XRootD
XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args > Class Template Reference

#include <XrdClOperations.hh>

+ Inheritance diagram for XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >:
+ Collaboration diagram for XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >:

Public Member Functions

 ConcreteOperation (Args &&... args)
 
template<bool from>
 ConcreteOperation (ConcreteOperation< Derived, from, HdlrFactory, Args... > &&op)
 
Operation< HasHndl > * Move ()
 
template<typename Hdlr >
Derived< true > operator>> (Hdlr &&hdlr)
 
Derived< true > operator| (FinalOperation &&fo)
 Adds a final operation to the pipeline. More...
 
Derived< true > operator| (Operation< false > &&op)
 
Derived< true > operator| (Operation< false > &op)
 
Derived< true > operator| (Operation< true > &&op)
 
Derived< true > operator| (Operation< true > &op)
 
Derived< HasHndl > Timeout (uint16_t timeout)
 Set operation timeout. More...
 
Operation< true > * ToHandled ()
 
- Public Member Functions inherited from XrdCl::Operation< HasHndl >
 Operation ()
 Constructor. More...
 
template<bool from>
 Operation (Operation< from > &&op)
 Move constructor between template instances. More...
 
virtual ~Operation ()
 Destructor. More...
 
virtual std::string ToString ()=0
 Name of the operation. More...
 

Protected Member Functions

Derived< true > StreamImpl (ResponseHandler *handler)
 
template<bool to>
Derived< to > Transform ()
 
- Protected Member Functions inherited from XrdCl::Operation< HasHndl >
void AddOperation (Operation< true > *op)
 
void Run (Timeout timeout, std::promise< XRootDStatus > prms, std::function< void(const XRootDStatus &)> final)
 
virtual XRootDStatus RunImpl (PipelineHandler *handler, uint16_t timeout)=0
 

Static Protected Member Functions

static void AllocHandler (ConcreteOperation< Derived, false, HdlrFactory, Args... > &me)
 
static void AllocHandler (ConcreteOperation< Derived, true, HdlrFactory, Args... > &me)
 
static Derived< true > PipeImpl (ConcreteOperation< Derived, HasHndl, HdlrFactory, Args... > &me, Operation< false > &op)
 
static Derived< true > PipeImpl (ConcreteOperation< Derived, HasHndl, HdlrFactory, Args... > &me, Operation< true > &op)
 

Protected Attributes

std::tuple< Args... > args
 Operation arguments. More...
 
uint16_t timeout
 Operation timeout. More...
 
- Protected Attributes inherited from XrdCl::Operation< HasHndl >
std::unique_ptr< PipelineHandlerhandler
 Operation handler. More...
 
bool valid
 Flag indicating if it is a valid object. More...
 

Friends

template<template< bool > class, bool , typename , typename ... >
class ConcreteOperation
 

Detailed Description

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory, typename ... Args>
class XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >

Concrete Operation template Defines | and >> operator as well as operation arguments.

  • Derived : the class that derives from this template (CRTP)
  • HasHndl : true if operation has a handler, false otherwise
  • Args : operation arguments

Definition at line 516 of file XrdClOperations.hh.

Constructor & Destructor Documentation

◆ ConcreteOperation() [1/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::ConcreteOperation ( Args &&...  args)
inline

Constructor

Parameters
args: operation arguments

Definition at line 528 of file XrdClOperations.hh.

528  : args( std::tuple<Args...>( std::move( args )... ) ),
529  timeout( 0 )
530  {
531  static_assert( !HasHndl, "It is only possible to construct operation without handler" );
532  }
std::tuple< Args... > args
Operation arguments.
uint16_t timeout
Operation timeout.

◆ ConcreteOperation() [2/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
template<bool from>
XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::ConcreteOperation ( ConcreteOperation< Derived, from, HdlrFactory, Args... > &&  op)
inline

Move constructor from other states

  • from : state from which the object is being converted
Parameters
op: the object that is being converted

Definition at line 542 of file XrdClOperations.hh.

542  :
543  Operation<HasHndl>( std::move( op ) ), args( std::move( op.args ) ), timeout( 0 )
544  {
545  }

Member Function Documentation

◆ AllocHandler() [1/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
static void XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::AllocHandler ( ConcreteOperation< Derived, false, HdlrFactory, Args... > &  me)
inlinestaticprotected

Definition at line 694 of file XrdClOperations.hh.

695  {
696  me.handler.reset( new PipelineHandler() );
697  }
friend class PipelineHandler

References XrdCl::Operation< HasHndl >::handler, and XrdCl::Operation< HasHndl >::PipelineHandler.

◆ AllocHandler() [2/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
static void XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::AllocHandler ( ConcreteOperation< Derived, true, HdlrFactory, Args... > &  me)
inlinestaticprotected

Definition at line 685 of file XrdClOperations.hh.

686  {
687  // nothing to do
688  }

Referenced by XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::operator|(), and XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::PipeImpl().

+ Here is the caller graph for this function:

◆ Move()

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
Operation<HasHndl>* XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::Move ( )
inlinevirtual

Move current object into newly allocated instance

Returns
: the new instance

Implements XrdCl::Operation< HasHndl >.

Definition at line 625 of file XrdClOperations.hh.

626  {
627  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
628  return new Derived<HasHndl>( std::move( *me ) );
629  }

◆ operator>>()

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
template<typename Hdlr >
Derived<true> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::operator>> ( Hdlr &&  hdlr)
inline

Adds ResponseHandler/function/functor/lambda/future handler for the operation.

Note: due to reference collapsing this covers both l-value and r-value references.

Parameters
hdlr: function/functor/lambda

Definition at line 557 of file XrdClOperations.hh.

558  {
559  return this->StreamImpl( HdlrFactory::Create( hdlr ) );
560  }
bool Create
Derived< true > StreamImpl(ResponseHandler *handler)

References Create, and XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::StreamImpl().

+ Here is the call graph for this function:

◆ operator|() [1/5]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
Derived<true> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::operator| ( FinalOperation &&  fo)
inline

Adds a final operation to the pipeline.

Definition at line 613 of file XrdClOperations.hh.

614  {
615  AllocHandler( *this );
616  this->handler->Assign( fo.final );
617  return this->template Transform<true>();
618  }
static void AllocHandler(ConcreteOperation< Derived, true, HdlrFactory, Args... > &me)
std::unique_ptr< PipelineHandler > handler
Operation handler.

References XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::AllocHandler(), and XrdCl::Operation< HasHndl >::handler.

+ Here is the call graph for this function:

◆ operator|() [2/5]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
Derived<true> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::operator| ( Operation< false > &&  op)
inline

Creates a pipeline of 2 or more operations

Parameters
op: operation to add
Returns
: handled operation

Definition at line 605 of file XrdClOperations.hh.

606  {
607  return PipeImpl( *this, op );
608  }
static Derived< true > PipeImpl(ConcreteOperation< Derived, HasHndl, HdlrFactory, Args... > &me, Operation< true > &op)

References XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::PipeImpl().

+ Here is the call graph for this function:

◆ operator|() [3/5]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
Derived<true> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::operator| ( Operation< false > &  op)
inline

Creates a pipeline of 2 or more operations

Parameters
opoperation to add
Returns
handled operation

Definition at line 593 of file XrdClOperations.hh.

594  {
595  return PipeImpl( *this, op );
596  }

References XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::PipeImpl().

+ Here is the call graph for this function:

◆ operator|() [4/5]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
Derived<true> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::operator| ( Operation< true > &&  op)
inline

Creates a pipeline of 2 or more operations

Parameters
op: operation to add
Returns
: handled operation

Definition at line 581 of file XrdClOperations.hh.

582  {
583  return PipeImpl( *this, op );
584  }

References XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::PipeImpl().

+ Here is the call graph for this function:

◆ operator|() [5/5]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
Derived<true> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::operator| ( Operation< true > &  op)
inline

Creates a pipeline of 2 or more operations

Parameters
op: operation to add
Returns
: handled operation

Definition at line 569 of file XrdClOperations.hh.

570  {
571  return PipeImpl( *this, op );
572  }

References XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::PipeImpl().

+ Here is the call graph for this function:

◆ PipeImpl() [1/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
static Derived<true> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::PipeImpl ( ConcreteOperation< Derived, HasHndl, HdlrFactory, Args... > &  me,
Operation< false > &  op 
)
inlinestaticprotected

Implements operator| functionality

Parameters
me: reference to myself (*this)
op: reference to the other operation
Returns
: move-copy of myself

Definition at line 725 of file XrdClOperations.hh.

727  {
728  AllocHandler( me ); // if HasHndl is false allocate handler
729  me.AddOperation( op.ToHandled() );
730  return me.template Transform<true>();
731  }

References XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::AllocHandler(), and XrdCl::Operation< HasHndl >::ToHandled().

+ Here is the call graph for this function:

◆ PipeImpl() [2/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
static Derived<true> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::PipeImpl ( ConcreteOperation< Derived, HasHndl, HdlrFactory, Args... > &  me,
Operation< true > &  op 
)
inlinestaticprotected

Implements operator| functionality

Parameters
me: reference to myself (*this)
op: reference to the other operation
Returns
: move-copy of myself

Definition at line 708 of file XrdClOperations.hh.

710  {
711  AllocHandler( me ); // if HasHndl is false allocate handler
712  me.AddOperation( op.Move() );
713  return me.template Transform<true>();
714  }

References XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::AllocHandler(), and XrdCl::Operation< HasHndl >::Move().

Referenced by XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::operator|().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StreamImpl()

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
Derived<true> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::StreamImpl ( ResponseHandler handler)
inlineprotected

Implements operator>> functionality

Parameters
handler: handler to be added
Returns
: return an instance of Derived<true>

Definition at line 674 of file XrdClOperations.hh.

675  {
676  static_assert( !HasHndl, "Operator >> is available only for operation without handler" );
677  this->handler.reset( new PipelineHandler( handler ) );
678  return Transform<true>();
679  }

References XrdCl::Operation< HasHndl >::handler, and XrdCl::Operation< HasHndl >::PipelineHandler.

Referenced by XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::operator>>().

+ Here is the caller graph for this function:

◆ Timeout()

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
Derived<HasHndl> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::Timeout ( uint16_t  timeout)
inline

Set operation timeout.

Definition at line 646 of file XrdClOperations.hh.

647  {
648  this->timeout = timeout;
649  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
650  return std::move( *me );
651  }

References XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::timeout.

Referenced by XrdCl::AppendFile(), XrdCl::Checkpoint(), XrdCl::ChkptWrt(), XrdCl::ChkptWrtV(), XrdCl::Close(), XrdCl::CloseArchive(), XrdCl::Open(), XrdCl::OpenArchive(), XrdCl::OpenFile(), XrdEc::OpenOnly(), XrdCl::PgRead(), XrdCl::PgWrite(), XrdCl::Read(), XrdCl::ReadFrom(), XrdCl::Stat(), XrdCl::Sync(), XrdCl::Truncate(), XrdCl::VectorRead(), XrdCl::VectorWrite(), XrdCl::Write(), and XrdCl::WriteV().

+ Here is the caller graph for this function:

◆ ToHandled()

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
Operation<true>* XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::ToHandled ( )
inlinevirtual

Transform operation to handled

Returns
Operation<true>&

Implements XrdCl::Operation< HasHndl >.

Definition at line 636 of file XrdClOperations.hh.

637  {
638  this->handler.reset( new PipelineHandler() );
639  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
640  return new Derived<true>( std::move( *me ) );
641  }

References XrdCl::Operation< HasHndl >::handler, and XrdCl::Operation< HasHndl >::PipelineHandler.

◆ Transform()

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
template<bool to>
Derived<to> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::Transform ( )
inlineprotected

Transform into a new instance with desired state

Returns
: new instance in the desired state

Definition at line 661 of file XrdClOperations.hh.

662  {
663  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
664  return Derived<to>( std::move( *me ) );
665  }

Friends And Related Function Documentation

◆ ConcreteOperation

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
template<template< bool > class, bool , typename , typename ... >
friend class ConcreteOperation
friend

Definition at line 519 of file XrdClOperations.hh.

Member Data Documentation

◆ args

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
std::tuple<Args...> XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::args
protected

Operation arguments.

Definition at line 736 of file XrdClOperations.hh.

Referenced by XrdCl::CheckpointImpl< HasHndl >::RunImpl(), XrdCl::ChkptWrtImpl< HasHndl >::RunImpl(), XrdCl::ChkptWrtVImpl< HasHndl >::RunImpl(), XrdCl::ReadImpl< HasHndl >::RunImpl(), XrdCl::PgReadImpl< HasHndl >::RunImpl(), XrdCl::PgWriteImpl< HasHndl >::RunImpl(), XrdCl::StatImpl< HasHndl >::RunImpl(), XrdCl::WriteImpl< HasHndl >::RunImpl(), XrdCl::TruncateImpl< HasHndl >::RunImpl(), XrdCl::VectorReadImpl< HasHndl >::RunImpl(), XrdCl::VectorWriteImpl< HasHndl >::RunImpl(), XrdCl::WriteVImpl< HasHndl >::RunImpl(), XrdCl::FcntlImpl< HasHndl >::RunImpl(), XrdCl::SetXAttrImpl< HasHndl >::RunImpl(), XrdCl::SetXAttrBulkImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrBulkImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrBulkImpl< HasHndl >::RunImpl(), XrdCl::DeepLocateImpl< HasHndl >::RunImpl(), XrdCl::MvImpl< HasHndl >::RunImpl(), XrdCl::QueryImpl< HasHndl >::RunImpl(), XrdCl::TruncateFsImpl< HasHndl >::RunImpl(), XrdCl::RmImpl< HasHndl >::RunImpl(), XrdCl::MkDirImpl< HasHndl >::RunImpl(), XrdCl::RmDirImpl< HasHndl >::RunImpl(), XrdCl::ChModImpl< HasHndl >::RunImpl(), XrdCl::StatFsImpl< HasHndl >::RunImpl(), XrdCl::StatVFSImpl< HasHndl >::RunImpl(), XrdCl::DirListImpl< HasHndl >::RunImpl(), XrdCl::SendInfoImpl< HasHndl >::RunImpl(), XrdCl::PrepareImpl< HasHndl >::RunImpl(), XrdCl::SetXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::SetXAttrFsBulkImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrFsBulkImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrFsBulkImpl< HasHndl >::RunImpl(), XrdCl::ListXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::OpenFileImpl< HasHndl >::RunImpl(), XrdCl::ZipReadImpl< HasHndl >::RunImpl(), XrdCl::ZipReadFromImpl< HasHndl >::RunImpl(), XrdCl::ZipWriteImpl< HasHndl >::RunImpl(), XrdCl::AppendFileImpl< HasHndl >::RunImpl(), and XrdEc::OpenOnlyImpl< HasHndl >::RunImpl().

◆ timeout

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory , typename ... Args>
uint16_t XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::timeout
protected

Operation timeout.

Definition at line 741 of file XrdClOperations.hh.

Referenced by XrdCl::ZipArchive::PgRead(), XrdCl::ZipArchive::Read(), XrdCl::CheckpointImpl< HasHndl >::RunImpl(), XrdCl::ChkptWrtImpl< HasHndl >::RunImpl(), XrdCl::ChkptWrtVImpl< HasHndl >::RunImpl(), XrdCl::ReadImpl< HasHndl >::RunImpl(), XrdCl::PgReadImpl< HasHndl >::RunImpl(), XrdCl::PgWriteImpl< HasHndl >::RunImpl(), XrdCl::CloseImpl< HasHndl >::RunImpl(), XrdCl::StatImpl< HasHndl >::RunImpl(), XrdCl::WriteImpl< HasHndl >::RunImpl(), XrdCl::SyncImpl< HasHndl >::RunImpl(), XrdCl::TruncateImpl< HasHndl >::RunImpl(), XrdCl::VectorReadImpl< HasHndl >::RunImpl(), XrdCl::VectorWriteImpl< HasHndl >::RunImpl(), XrdCl::WriteVImpl< HasHndl >::RunImpl(), XrdCl::FcntlImpl< HasHndl >::RunImpl(), XrdCl::VisaImpl< HasHndl >::RunImpl(), XrdCl::SetXAttrImpl< HasHndl >::RunImpl(), XrdCl::SetXAttrBulkImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrBulkImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrBulkImpl< HasHndl >::RunImpl(), XrdCl::ListXAttrImpl< HasHndl >::RunImpl(), XrdCl::DeepLocateImpl< HasHndl >::RunImpl(), XrdCl::MvImpl< HasHndl >::RunImpl(), XrdCl::QueryImpl< HasHndl >::RunImpl(), XrdCl::TruncateFsImpl< HasHndl >::RunImpl(), XrdCl::RmImpl< HasHndl >::RunImpl(), XrdCl::MkDirImpl< HasHndl >::RunImpl(), XrdCl::RmDirImpl< HasHndl >::RunImpl(), XrdCl::ChModImpl< HasHndl >::RunImpl(), XrdCl::PingImpl< HasHndl >::RunImpl(), XrdCl::StatFsImpl< HasHndl >::RunImpl(), XrdCl::StatVFSImpl< HasHndl >::RunImpl(), XrdCl::ProtocolImpl< HasHndl >::RunImpl(), XrdCl::DirListImpl< HasHndl >::RunImpl(), XrdCl::SendInfoImpl< HasHndl >::RunImpl(), XrdCl::PrepareImpl< HasHndl >::RunImpl(), XrdCl::SetXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::SetXAttrFsBulkImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrFsBulkImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrFsBulkImpl< HasHndl >::RunImpl(), XrdCl::ListXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::ZipReadImpl< HasHndl >::RunImpl(), XrdCl::ZipReadFromImpl< HasHndl >::RunImpl(), XrdCl::ZipWriteImpl< HasHndl >::RunImpl(), XrdCl::AppendFileImpl< HasHndl >::RunImpl(), XrdCl::CloseArchiveImpl< HasHndl >::RunImpl(), XrdEc::OpenOnlyImpl< HasHndl >::RunImpl(), XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::Timeout(), and XrdCl::ZipArchive::Write().


The documentation for this class was generated from the following file: