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

Constructor & Destructor Documentation

◆ Pipeline() [1/8]

XrdCl::Pipeline::Pipeline ( )
inline

Default constructor.

Definition at line 300 of file XrdClOperations.hh.

301  {
302  }

◆ Pipeline() [2/8]

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

Constructor.

Definition at line 307 of file XrdClOperations.hh.

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

◆ Pipeline() [3/8]

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

Constructor.

Definition at line 315 of file XrdClOperations.hh.

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

◆ Pipeline() [4/8]

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

Constructor.

Definition at line 323 of file XrdClOperations.hh.

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

◆ Pipeline() [5/8]

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

Definition at line 328 of file XrdClOperations.hh.

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

◆ Pipeline() [6/8]

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

Constructor.

Definition at line 336 of file XrdClOperations.hh.

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

◆ Pipeline() [7/8]

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

Constructor.

Definition at line 344 of file XrdClOperations.hh.

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

◆ Pipeline() [8/8]

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

Definition at line 349 of file XrdClOperations.hh.

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

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

398  {
399  return bool( operation );
400  }

◆ operator Operation< true > &()

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

Conversion to Operation<true>

Exceptions
std::logic_error if pipeline is invalid

Definition at line 386 of file XrdClOperations.hh.

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

◆ operator=()

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

Constructor.

Definition at line 357 of file XrdClOperations.hh.

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

◆ operator|=() [1/2]

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

Extend pipeline.

Definition at line 375 of file XrdClOperations.hh.

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

◆ operator|=() [2/2]

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

Extend pipeline.

Definition at line 366 of file XrdClOperations.hh.

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

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

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

◆ ParallelOperation

template<bool >
friend class ParallelOperation
friend

Definition at line 291 of file XrdClOperations.hh.

◆ PipelineHandler

friend class PipelineHandler
friend

Definition at line 293 of file XrdClOperations.hh.


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