XRootD
XrdCl::Pipeline Class Reference

#include <XrdClOperations.hh>

+ Collaboration diagram for XrdCl::Pipeline:

Public Member Functions

 Pipeline ()
 Default constructor. More...
 
 Pipeline (Operation< false > &&op)
 Constructor. More...
 
 Pipeline (Operation< false > &op)
 Constructor. More...
 
 Pipeline (Operation< false > *op)
 
 Pipeline (Operation< true > &&op)
 Constructor. More...
 
 Pipeline (Operation< true > &op)
 Constructor. More...
 
 Pipeline (Operation< true > *op)
 Constructor. More...
 
 Pipeline (Pipeline &&pipe)
 
 operator bool ()
 
 operator Operation< true > & ()
 
Pipelineoperator= (Pipeline &&pipe)
 Constructor. More...
 
Pipelineoperator|= (Operation< false > &&op)
 Extend pipeline. More...
 
Pipelineoperator|= (Operation< true > &&op)
 Extend pipeline. More...
 

Static Public Member Functions

static void Ignore ()
 Ignore error and proceed with the pipeline. More...
 
static void Repeat ()
 Repeat current operation. More...
 
static void Replace (Operation< false > &&opr)
 Replace current operation. More...
 
static void Replace (Pipeline p)
 Replace with pipeline. More...
 
static void Stop (const XRootDStatus &status=XrdCl::XRootDStatus())
 

Friends

std::future< XRootDStatusAsync (Pipeline, uint16_t)
 
template<bool >
class ParallelOperation
 
class PipelineHandler
 

Detailed Description

A wrapper around operation pipeline. A Pipeline is a once-use-only object - once executed by a Workflow engine it is invalidated.

Takes ownership of given operation pipeline (which is in most would be a temporary object)

Definition at line 324 of file XrdClOperations.hh.

Constructor & Destructor Documentation

◆ Pipeline() [1/8]

XrdCl::Pipeline::Pipeline ( )
inline

Default constructor.

Definition at line 335 of file XrdClOperations.hh.

336  {
337  }

◆ Pipeline() [2/8]

XrdCl::Pipeline::Pipeline ( Operation< true > *  op)
inline

Constructor.

Definition at line 342 of file XrdClOperations.hh.

342  :
343  operation( op->Move() )
344  {
345  }

◆ Pipeline() [3/8]

XrdCl::Pipeline::Pipeline ( Operation< true > &  op)
inline

Constructor.

Definition at line 350 of file XrdClOperations.hh.

350  :
351  operation( op.Move() )
352  {
353  }

◆ Pipeline() [4/8]

XrdCl::Pipeline::Pipeline ( Operation< true > &&  op)
inline

Constructor.

Definition at line 358 of file XrdClOperations.hh.

358  :
359  operation( op.Move() )
360  {
361  }

◆ Pipeline() [5/8]

XrdCl::Pipeline::Pipeline ( Operation< false > *  op)
inline

Definition at line 363 of file XrdClOperations.hh.

363  :
364  operation( op->ToHandled() )
365  {
366  }

◆ Pipeline() [6/8]

XrdCl::Pipeline::Pipeline ( Operation< false > &  op)
inline

Constructor.

Definition at line 371 of file XrdClOperations.hh.

371  :
372  operation( op.ToHandled() )
373  {
374  }

◆ Pipeline() [7/8]

XrdCl::Pipeline::Pipeline ( Operation< false > &&  op)
inline

Constructor.

Definition at line 379 of file XrdClOperations.hh.

379  :
380  operation( op.ToHandled() )
381  {
382  }

◆ Pipeline() [8/8]

XrdCl::Pipeline::Pipeline ( Pipeline &&  pipe)
inline

Definition at line 384 of file XrdClOperations.hh.

384  :
385  operation( std::move( pipe.operation ) )
386  {
387  }

Member Function Documentation

◆ Ignore()

void XrdCl::Pipeline::Ignore ( )
static

Ignore error and proceed with the pipeline.

Definition at line 275 of file XrdClOperations.cc.

276  {
277  throw IgnoreError();
278  }

◆ operator bool()

XrdCl::Pipeline::operator bool ( )
inline

Conversion to boolean

Returns
: true if it's a valid pipeline, false otherwise

Definition at line 432 of file XrdClOperations.hh.

433  {
434  return bool( operation );
435  }

◆ operator Operation< true > &()

XrdCl::Pipeline::operator Operation< true > & ( )
inline

Conversion to Operation<true>

Exceptions
std::logic_error if pipeline is invalid

Definition at line 421 of file XrdClOperations.hh.

422  {
423  if( !bool( operation ) ) throw std::logic_error( "Invalid pipeline." );
424  return *operation.get();
425  }

◆ operator=()

Pipeline& XrdCl::Pipeline::operator= ( Pipeline &&  pipe)
inline

Constructor.

Definition at line 392 of file XrdClOperations.hh.

393  {
394  operation = std::move( pipe.operation );
395  return *this;
396  }

◆ operator|=() [1/2]

Pipeline& XrdCl::Pipeline::operator|= ( Operation< false > &&  op)
inline

Extend pipeline.

Definition at line 410 of file XrdClOperations.hh.

411  {
412  operation->AddOperation( op.ToHandled() );
413  return *this;
414  }

◆ operator|=() [2/2]

Pipeline& XrdCl::Pipeline::operator|= ( Operation< true > &&  op)
inline

Extend pipeline.

Definition at line 401 of file XrdClOperations.hh.

402  {
403  operation->AddOperation( op.Move() );
404  return *this;
405  }

◆ Repeat()

void XrdCl::Pipeline::Repeat ( )
static

Repeat current operation.

Definition at line 251 of file XrdClOperations.cc.

252  {
253  throw RepeatOpeation();
254  }

Referenced by XrdCl::ZipArchive::OpenArchive().

+ Here is the caller graph for this function:

◆ Replace() [1/2]

void XrdCl::Pipeline::Replace ( Operation< false > &&  opr)
static

Replace current operation.

Definition at line 259 of file XrdClOperations.cc.

260  {
261  throw ReplaceOperation( std::move( opr ) );
262  }

◆ Replace() [2/2]

void XrdCl::Pipeline::Replace ( Pipeline  p)
static

Replace with pipeline.

Definition at line 267 of file XrdClOperations.cc.

268  {
269  throw ReplacePipeline( std::move( p ) );
270  }

◆ Stop()

void XrdCl::Pipeline::Stop ( const XRootDStatus status = XrdCl::XRootDStatus())
static

Stop the current pipeline

Parameters
status: the final status for the pipeline

Definition at line 243 of file XrdClOperations.cc.

244  {
245  throw StopPipeline( status );
246  }

Referenced by XrdCl::ZipArchive::OpenArchive().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Async

std::future<XRootDStatus> Async ( Pipeline  pipeline,
uint16_t  timeout = 0 
)
friend

Helper function, schedules execution of given pipeline

Parameters
pipeline: the pipeline to be executed
timeout: the pipeline timeout
Returns
: future status of the operation

Definition at line 522 of file XrdClOperations.hh.

523  {
524  pipeline.Run( timeout );
525  return std::move( pipeline.ftr );
526  }

◆ ParallelOperation

template<bool >
friend class ParallelOperation
friend

Definition at line 326 of file XrdClOperations.hh.

◆ PipelineHandler

friend class PipelineHandler
friend

Definition at line 328 of file XrdClOperations.hh.


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