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

529  : args( std::tuple<Args...>( std::move( args )... ) ),
530  timeout( 0 )
531  {
532  static_assert( !HasHndl, "It is only possible to construct operation without handler" );
533  }
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 543 of file XrdClOperations.hh.

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

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

696  {
697  me.handler.reset( new PipelineHandler() );
698  }
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 686 of file XrdClOperations.hh.

687  {
688  // nothing to do
689  }

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

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

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

559  {
560  return this->StreamImpl( HdlrFactory::Create( hdlr ) );
561  }
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 614 of file XrdClOperations.hh.

615  {
616  AllocHandler( *this );
617  this->handler->Assign( fo.final );
618  return this->template Transform<true>();
619  }
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 606 of file XrdClOperations.hh.

607  {
608  return PipeImpl( *this, op );
609  }
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 594 of file XrdClOperations.hh.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 520 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 737 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 742 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: