Loading...
Searching...
No Matches
XrdCl::PipelineHandler Class Reference

`#include <XrdClOperations.hh>`

Inheritance diagram for XrdCl::PipelineHandler:
Collaboration diagram for XrdCl::PipelineHandler:

## Public Member Functions

| PipelineHandler ()
| Default Constructor.
| PipelineHandler (ResponseHandler *handler)
| ~PipelineHandler ()
| Destructor.
void | AddOperation (Operation< true > *operation)
void | Assign (const Timeout &timeout, std::promise< XRootDStatus > prms, std::function< void(const XRootDStatus &)> final, Operation< true > *opr)
void | Assign (std::function< void(const XRootDStatus &)> final)
| Assign the finalization routine.
void | HandleResponse (XRootDStatus *status, AnyObject *response)
| Callback function.
void | HandleResponseWithHosts (XRootDStatus *status, AnyObject *response, HostList *hostList)
| Callback function.
void | PreparePipelineStart ()
| Called by a pipeline on the handler of its first operation before Run.
Public Member Functions inherited from XrdCl::ResponseHandler
virtual | ~ResponseHandler ()

## Friends

template<bool>
class | Operation

## Additional Inherited Members

Static Public Member Functions inherited from XrdCl::ResponseHandler
static ResponseHandler * | Wrap (std::function< void(XRootDStatus &, AnyObject &)> func)
static ResponseHandler * | Wrap (std::function< void(XRootDStatus *, AnyObject *)> func)

## Detailed Description

Wrapper for ResponseHandler, used only internally to run next operation after previous one is finished

Definition at line 167 of file XrdClOperations.hh.

## Constructor & Destructor Documentation

## PipelineHandler() [1/2]

XrdCl::PipelineHandler::PipelineHandler | ( | ResponseHandler * | handler | ) |

Constructor.

Parameters

  handler | : the handler of our operation

Definition at line 85 of file XrdClOperations.cc.

:
responseHandler( handler )
{
}

Referenced by PreparePipelineStart().

Here is the caller graph for this function:

## PipelineHandler() [2/2]

XrdCl::PipelineHandler::PipelineHandler | ( |  | ) |

inline

Default Constructor.

Definition at line 183 of file XrdClOperations.hh.

{
}

## ~PipelineHandler()

XrdCl::PipelineHandler::~PipelineHandler | ( |  | ) |

inline

Destructor.

Definition at line 201 of file XrdClOperations.hh.

{
}

## Member Function Documentation

## AddOperation()

void XrdCl::PipelineHandler::AddOperation | ( | Operation< true > * | operation | ) |

Add new operation to the pipeline

Parameters

  operation | : operation to add

Definition at line 93 of file XrdClOperations.cc.

{
if( nextOperation )
{
nextOperation->AddOperation( operation );
}
else
{
nextOperation.reset( operation );
}
}

References Operation.

Here is the call graph for this function:

## Assign() [1/2]

void XrdCl::PipelineHandler::Assign | ( | const Timeout & | timeout,
|  | std::promise< XRootDStatus > | prms,
|  | std::function< void(const XRootDStatus &)> | final,
|  | Operation< true > * | opr )

Set workflow to this and all next handlers. In the last handler it is used to finish workflow execution

Parameters

  prms | : a promis that the pipeline will have a result
  final | : a callable that should be called at the end of pipeline

Definition at line 189 of file XrdClOperations.cc.

{
timeout = t;
prms = std::move( p );
if( !final ) final = std::move( f );
else if( f )
{
auto f1 = std::move( final );
final = [f1, f]( const XRootDStatus &st ){ f1( st ); f( st ); };
}
currentOperation.reset( opr );
}

References Operation.

Referenced by PreparePipelineStart().

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

## Assign() [2/2]

void XrdCl::PipelineHandler::Assign | ( | std::function< void(const XRootDStatus &)> | final | ) |

Assign the finalization routine.

Definition at line 208 of file XrdClOperations.cc.

{
final = std::move( f );
}

## HandleResponse()

void XrdCl::PipelineHandler::HandleResponse | ( | XRootDStatus * | status,
|  | AnyObject * | response )

virtual

Callback function.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 180 of file XrdClOperations.cc.

{
HandleResponseImpl( status, response );
}

## HandleResponseWithHosts()

void XrdCl::PipelineHandler::HandleResponseWithHosts | ( | XRootDStatus * | status,
|  | AnyObject * | response,
|  | HostList * | hostList )

virtual

Callback function.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 171 of file XrdClOperations.cc.

{
HandleResponseImpl( status, response, hostList );
}

## PreparePipelineStart()

void XrdCl::PipelineHandler::PreparePipelineStart | ( |  | ) |

Called by a pipeline on the handler of its first operation before Run.

Definition at line 216 of file XrdClOperations.cc.

{
// Move any final-function from the handler of the last operaiton to the
// first. It will be moved along the pipeline of handlers while the
// pipeline is run.
if( final || !nextOperation ) return;
PipelineHandler *last = nextOperation->handler.get();
while( last )
{
Operation<true> *nextop = last->nextOperation.get();
if( !nextop ) break;
last = nextop->handler.get();
}
if( last )
{
// swap-then-move rather than only move as we need to guarantee that
// last->final is left without target.
std::function<void(const XRootDStatus&)> f;
f.swap( last->final );
Assign( std::move( f ) );
}
}
XrdCl::PipelineHandler::Assign
void Assign(const Timeout &timeout, std::promise< XRootDStatus > prms, std::function< void(const XRootDStatus &)> final, Operation< true > *opr)
Definition XrdClOperations.cc:189
XrdCl::PipelineHandler::PipelineHandler
PipelineHandler(ResponseHandler *handler)
Definition XrdClOperations.cc:85
XrdCl::PipelineHandler::Operation
friend class Operation
Definition XrdClOperations.hh:169

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

Here is the call graph for this function:

## Friends And Related Symbol Documentation

## Operation

template<bool>

friend class Operation

friend

Definition at line 169 of file XrdClOperations.hh.

References Operation.

Referenced by AddOperation(), Assign(), Operation, and PreparePipelineStart().

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

- XrdClOperations.hh
- XrdClOperations.cc