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

Constructor & Destructor Documentation

◆ Pipeline() [1/8]

XrdCl::Pipeline::Pipeline ( )
inline

Default constructor.

Definition at line 301 of file XrdClOperations.hh.

302  {
303  }

◆ Pipeline() [2/8]

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

Constructor.

Definition at line 308 of file XrdClOperations.hh.

308  :
309  operation( op->Move() )
310  {
311  }

◆ Pipeline() [3/8]

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

Constructor.

Definition at line 316 of file XrdClOperations.hh.

316  :
317  operation( op.Move() )
318  {
319  }

◆ Pipeline() [4/8]

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

Constructor.

Definition at line 324 of file XrdClOperations.hh.

324  :
325  operation( op.Move() )
326  {
327  }

◆ Pipeline() [5/8]

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

Definition at line 329 of file XrdClOperations.hh.

329  :
330  operation( op->ToHandled() )
331  {
332  }

◆ Pipeline() [6/8]

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

Constructor.

Definition at line 337 of file XrdClOperations.hh.

337  :
338  operation( op.ToHandled() )
339  {
340  }

◆ Pipeline() [7/8]

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

Constructor.

Definition at line 345 of file XrdClOperations.hh.

345  :
346  operation( op.ToHandled() )
347  {
348  }

◆ Pipeline() [8/8]

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

Definition at line 350 of file XrdClOperations.hh.

350  :
351  operation( std::move( pipe.operation ) )
352  {
353  }

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

399  {
400  return bool( operation );
401  }

◆ operator Operation< true > &()

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

Conversion to Operation<true>

Exceptions
std::logic_error if pipeline is invalid

Definition at line 387 of file XrdClOperations.hh.

388  {
389  if( !bool( operation ) ) throw std::logic_error( "Invalid pipeline." );
390  return *operation.get();
391  }

◆ operator=()

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

Constructor.

Definition at line 358 of file XrdClOperations.hh.

359  {
360  operation = std::move( pipe.operation );
361  return *this;
362  }

◆ operator|=() [1/2]

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

Extend pipeline.

Definition at line 376 of file XrdClOperations.hh.

377  {
378  operation->AddOperation( op.ToHandled() );
379  return *this;
380  }

◆ operator|=() [2/2]

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

Extend pipeline.

Definition at line 367 of file XrdClOperations.hh.

368  {
369  operation->AddOperation( op.Move() );
370  return *this;
371  }

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

489  {
490  pipeline.Run( timeout );
491  return std::move( pipeline.ftr );
492  }

◆ ParallelOperation

template<bool >
friend class ParallelOperation
friend

Definition at line 292 of file XrdClOperations.hh.

◆ PipelineHandler

friend class PipelineHandler
friend

Definition at line 294 of file XrdClOperations.hh.


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