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 551 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 563 of file XrdClOperations.hh.

563  : args( std::tuple<Args...>( std::move( args )... ) ),
564  timeout( 0 )
565  {
566  static_assert( !HasHndl, "It is only possible to construct operation without handler" );
567  }
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 577 of file XrdClOperations.hh.

577  :
578  Operation<HasHndl>( std::move( op ) ), args( std::move( op.args ) ), timeout( 0 )
579  {
580  }

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 729 of file XrdClOperations.hh.

730  {
731  me.handler.reset( new PipelineHandler() );
732  }
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 720 of file XrdClOperations.hh.

721  {
722  // nothing to do
723  }

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 660 of file XrdClOperations.hh.

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

◆ 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 592 of file XrdClOperations.hh.

593  {
594  return this->StreamImpl( HdlrFactory::Create( hdlr ) );
595  }
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 648 of file XrdClOperations.hh.

649  {
650  AllocHandler( *this );
651  this->handler->Assign( fo.final );
652  return this->template Transform<true>();
653  }
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 640 of file XrdClOperations.hh.

641  {
642  return PipeImpl( *this, op );
643  }
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 628 of file XrdClOperations.hh.

629  {
630  return PipeImpl( *this, op );
631  }

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 616 of file XrdClOperations.hh.

617  {
618  return PipeImpl( *this, op );
619  }

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 604 of file XrdClOperations.hh.

605  {
606  return PipeImpl( *this, op );
607  }

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 760 of file XrdClOperations.hh.

762  {
763  AllocHandler( me ); // if HasHndl is false allocate handler
764  me.AddOperation( op.ToHandled() );
765  return me.template Transform<true>();
766  }

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 743 of file XrdClOperations.hh.

745  {
746  AllocHandler( me ); // if HasHndl is false allocate handler
747  me.AddOperation( op.Move() );
748  return me.template Transform<true>();
749  }

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 709 of file XrdClOperations.hh.

710  {
711  static_assert( !HasHndl, "Operator >> is available only for operation without handler" );
712  this->handler.reset( new PipelineHandler( handler ) );
713  return Transform<true>();
714  }

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 681 of file XrdClOperations.hh.

682  {
683  this->timeout = timeout;
684  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
685  return std::move( *me );
686  }

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 671 of file XrdClOperations.hh.

672  {
673  this->handler.reset( new PipelineHandler() );
674  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
675  return new Derived<true>( std::move( *me ) );
676  }

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 696 of file XrdClOperations.hh.

697  {
698  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
699  return Derived<to>( std::move( *me ) );
700  }

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 554 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 771 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 776 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: