XRootD
Loading...
Searching...
No Matches
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.
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.
Operation< true > * ToHandled ()
Public Member Functions inherited from XrdCl::Operation< HasHndl >
 Operation ()
 Constructor.
template<bool from>
 Operation (Operation< from > &&op)
 Move constructor between template instances.
virtual ~Operation ()
 Destructor.
virtual std::string ToString ()=0
 Name of the operation.

Protected Member Functions

Derived< true > StreamImpl (ResponseHandler *handler)
template<bool to>
Derived< toTransform ()
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.
uint16_t timeout
 Operation timeout.
Protected Attributes inherited from XrdCl::Operation< HasHndl >
std::unique_ptr< PipelineHandlerhandler
 Operation handler.
bool valid
 Flag indicating if it is a valid object.

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.

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.

References args, and 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 :
545 {
546 }
friend class Operation

References ConcreteOperation, XrdCl::Operation< HasHndl >::Operation, args, and timeout.

Here is the call graph for this function:

Member Function Documentation

◆ AllocHandler() [1/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory, typename ... Args>
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
std::unique_ptr< PipelineHandler > handler
Operation handler.

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

Here is the call graph for this function:

◆ AllocHandler() [2/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory, typename ... Args>
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 }

References ConcreteOperation.

Referenced by operator|(), PipeImpl(), and PipeImpl().

Here is the call graph for this function:
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 }

References XrdCl::Operation< HasHndl >::Operation.

Here is the call graph for this function:

◆ 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 }
Derived< true > StreamImpl(ResponseHandler *handler)

References 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)

References AllocHandler(), XrdCl::Operation< HasHndl >::handler, and Transform().

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::Operation< HasHndl >::Operation, and 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::Operation< HasHndl >::Operation, and 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::Operation< HasHndl >::Operation, and 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::Operation< HasHndl >::Operation, and PipeImpl().

Here is the call graph for this function:

◆ PipeImpl() [1/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory, typename ... Args>
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
731 return me.template Transform<true>();
732 }
Operation< true > * ToHandled()
void AddOperation(Operation< true > *op)

References ConcreteOperation, XrdCl::Operation< HasHndl >::Operation, AllocHandler(), XrdCl::Operation< HasHndl >::ToHandled(), and Transform().

Here is the call graph for this function:

◆ PipeImpl() [2/2]

template<template< bool > class Derived, bool HasHndl, typename HdlrFactory, typename ... Args>
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 }
Operation< HasHndl > * Move()

References ConcreteOperation, XrdCl::Operation< HasHndl >::Operation, AllocHandler(), XrdCl::Operation< HasHndl >::Move(), and Transform().

Referenced by operator|(), operator|(), operator|(), and 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, XrdCl::Operation< HasHndl >::PipelineHandler, and Transform().

Referenced by operator>>().

Here is the call graph for this function:
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 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::PgWrite(), XrdCl::Read(), XrdCl::Read(), XrdCl::ReadFrom(), XrdCl::Stat(), XrdCl::Sync(), XrdCl::Truncate(), XrdCl::VectorRead(), XrdCl::VectorRead(), XrdCl::VectorWrite(), XrdCl::Write(), 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 >::Operation, XrdCl::Operation< HasHndl >::handler, and XrdCl::Operation< HasHndl >::PipelineHandler.

Here is the call graph for this function:

◆ 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 }

Referenced by operator|(), PipeImpl(), PipeImpl(), and StreamImpl().

Here is the caller graph for this function:

◆ ConcreteOperation

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

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 ConcreteOperation(), and ConcreteOperation().

◆ 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 ConcreteOperation(), ConcreteOperation(), and Timeout().


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