xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdClOperations.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2011-2017 by European Organization for Nuclear Research (CERN)
3 // Author: Krzysztof Jamrog <krzysztof.piotr.jamrog@cern.ch>,
4 // Michal Simon <michal.simon@cern.ch>
5 //------------------------------------------------------------------------------
6 // This file is part of the XRootD software suite.
7 //
8 // XRootD is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Lesser General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // XRootD is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public License
19 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
20 //
21 // In applying this licence, CERN does not waive the privileges and immunities
22 // granted to it by virtue of its status as an Intergovernmental Organization
23 // or submit itself to any jurisdiction.
24 //------------------------------------------------------------------------------
25 
26 #ifndef __XRD_CL_OPERATIONS_HH__
27 #define __XRD_CL_OPERATIONS_HH__
28 
29 #include <memory>
30 #include <stdexcept>
31 #include <sstream>
32 #include <tuple>
33 #include <future>
36 #include "XrdCl/XrdClArg.hh"
39 #include "XrdSys/XrdSysPthread.hh"
40 
42 #include "XrdCl/XrdClJobManager.hh"
43 #include "XrdCl/XrdClPostMaster.hh"
44 #include "XrdCl/XrdClDefaultEnv.hh"
45 
46 namespace XrdCl
47 {
48 
49  template<bool HasHndl> class Operation;
50 
51  class Pipeline;
52 
53 
54  //----------------------------------------------------------------------------
56  //----------------------------------------------------------------------------
57  typedef std::function<Operation<true>*(const XRootDStatus&)> rcvry_func;
58 
59  //----------------------------------------------------------------------------
62  //----------------------------------------------------------------------------
64  {
65  template<bool> friend class Operation;
66 
67  public:
68 
69  //------------------------------------------------------------------------
73  //------------------------------------------------------------------------
74  PipelineHandler( ResponseHandler *handler );
75 
76  //------------------------------------------------------------------------
78  //------------------------------------------------------------------------
80  {
81  }
82 
83  //------------------------------------------------------------------------
85  //------------------------------------------------------------------------
86  void HandleResponseWithHosts( XRootDStatus *status, AnyObject *response,
87  HostList *hostList );
88 
89  //------------------------------------------------------------------------
91  //------------------------------------------------------------------------
92  void HandleResponse( XRootDStatus *status, AnyObject *response );
93 
94  //------------------------------------------------------------------------
96  //------------------------------------------------------------------------
98  {
99  }
100 
101  //------------------------------------------------------------------------
105  //------------------------------------------------------------------------
106  void AddOperation( Operation<true> *operation );
107 
108  //------------------------------------------------------------------------
115  //------------------------------------------------------------------------
116  void Assign( const Timeout &timeout,
117  std::promise<XRootDStatus> prms,
118  std::function<void(const XRootDStatus&)> final,
119  Operation<true> *opr );
120 
121  //------------------------------------------------------------------------
123  //------------------------------------------------------------------------
124  void Assign( std::function<void(const XRootDStatus&)> final );
125 
126  private:
127 
128  //------------------------------------------------------------------------
130  //------------------------------------------------------------------------
131  void HandleResponseImpl( XRootDStatus *status, AnyObject *response,
132  HostList *hostList = nullptr );
133 
134  inline void dealloc( XRootDStatus *status, AnyObject *response,
135  HostList *hostList )
136  {
137  delete status;
138  delete response;
139  delete hostList;
140  }
141 
142  //------------------------------------------------------------------------
144  //------------------------------------------------------------------------
145  std::unique_ptr<ResponseHandler> responseHandler;
146 
147  //------------------------------------------------------------------------
149  //------------------------------------------------------------------------
150  std::unique_ptr<Operation<true>> currentOperation;
151 
152  //------------------------------------------------------------------------
154  //------------------------------------------------------------------------
155  std::unique_ptr<Operation<true>> nextOperation;
156 
157  //------------------------------------------------------------------------
159  //------------------------------------------------------------------------
161 
162  //------------------------------------------------------------------------
164  //------------------------------------------------------------------------
165  std::promise<XRootDStatus> prms;
166 
167  //------------------------------------------------------------------------
170  //------------------------------------------------------------------------
171  std::function<void(const XRootDStatus&)> final;
172  };
173 
174  //----------------------------------------------------------------------------
180  //----------------------------------------------------------------------------
181  template<bool HasHndl>
182  class Operation
183  {
184  // Declare friendship between templates
185  template<bool>
186  friend class Operation;
187 
188  friend std::future<XRootDStatus> Async( Pipeline, uint16_t );
189 
190  friend class Pipeline;
191  friend class PipelineHandler;
192 
193  public:
194 
195  //------------------------------------------------------------------------
197  //------------------------------------------------------------------------
198  Operation() : valid( true )
199  {
200  }
201 
202  //------------------------------------------------------------------------
204  //------------------------------------------------------------------------
205  template<bool from>
207  handler( std::move( op.handler ) ), valid( true )
208  {
209  if( !op.valid ) throw std::invalid_argument( "Cannot construct "
210  "Operation from an invalid Operation!" );
211  op.valid = false;
212  }
213 
214  //------------------------------------------------------------------------
216  //------------------------------------------------------------------------
217  virtual ~Operation()
218  {
219  }
220 
221  //------------------------------------------------------------------------
223  //------------------------------------------------------------------------
224  virtual std::string ToString() = 0;
225 
226  //------------------------------------------------------------------------
230  //------------------------------------------------------------------------
231  virtual Operation<HasHndl>* Move() = 0;
232 
233  //------------------------------------------------------------------------
238  //------------------------------------------------------------------------
239  virtual Operation<true>* ToHandled() = 0;
240 
241  protected:
242 
243  //------------------------------------------------------------------------
248  //------------------------------------------------------------------------
249  void Run( Timeout timeout,
250  std::promise<XRootDStatus> prms,
251  std::function<void(const XRootDStatus&)> final )
252  {
253  static_assert(HasHndl, "Only an operation that has a handler can be assigned to workflow");
254  handler->Assign( timeout, std::move( prms ), std::move( final ), this );
255 
256  PipelineHandler *h = handler.release();
257  XRootDStatus st;
258  try
259  {
260  st = RunImpl( h, timeout );
261  }
262  catch( const operation_expired& ex )
263  {
265  }
266  catch( const PipelineException& ex ) // probably not needed
267  {
268  st = ex.GetError();
269  }
270  catch( const std::exception& ex )
271  {
272  st = XRootDStatus( stError, errInternal, 0, ex.what() );
273  }
274 
275  if( !st.IsOK() ){
276  ResponseJob *job = new ResponseJob(h, new XRootDStatus(st), 0, nullptr);
278  }
279  }
280 
281  //------------------------------------------------------------------------
287  //------------------------------------------------------------------------
288  virtual XRootDStatus RunImpl( PipelineHandler *handler, uint16_t timeout ) = 0;
289 
290  //------------------------------------------------------------------------
294  //------------------------------------------------------------------------
296  {
297  if( handler )
298  handler->AddOperation( op );
299  }
300 
301  //------------------------------------------------------------------------
303  //------------------------------------------------------------------------
304  std::unique_ptr<PipelineHandler> handler;
305 
306  //------------------------------------------------------------------------
308  //------------------------------------------------------------------------
309  bool valid;
310  };
311 
312  //----------------------------------------------------------------------------
318  //----------------------------------------------------------------------------
319  class Pipeline
320  {
321  template<bool> friend class ParallelOperation;
322  friend std::future<XRootDStatus> Async( Pipeline, uint16_t );
323  friend class PipelineHandler;
324 
325  public:
326 
327  //------------------------------------------------------------------------
329  //------------------------------------------------------------------------
331  {
332  }
333 
334  //------------------------------------------------------------------------
336  //------------------------------------------------------------------------
338  operation( op->Move() )
339  {
340  }
341 
342  //------------------------------------------------------------------------
344  //------------------------------------------------------------------------
346  operation( op.Move() )
347  {
348  }
349 
350  //------------------------------------------------------------------------
352  //------------------------------------------------------------------------
354  operation( op.Move() )
355  {
356  }
357 
359  operation( op->ToHandled() )
360  {
361  }
362 
363  //------------------------------------------------------------------------
365  //------------------------------------------------------------------------
367  operation( op.ToHandled() )
368  {
369  }
370 
371  //------------------------------------------------------------------------
373  //------------------------------------------------------------------------
375  operation( op.ToHandled() )
376  {
377  }
378 
379  Pipeline( Pipeline &&pipe ) :
380  operation( std::move( pipe.operation ) )
381  {
382  }
383 
384  //------------------------------------------------------------------------
386  //------------------------------------------------------------------------
388  {
389  operation = std::move( pipe.operation );
390  return *this;
391  }
392 
393  //------------------------------------------------------------------------
395  //------------------------------------------------------------------------
397  {
398  operation->AddOperation( op.Move() );
399  return *this;
400  }
401 
402  //------------------------------------------------------------------------
404  //------------------------------------------------------------------------
406  {
407  operation->AddOperation( op.ToHandled() );
408  return *this;
409  }
410 
411  //------------------------------------------------------------------------
415  //------------------------------------------------------------------------
416  operator Operation<true>&()
417  {
418  if( !bool( operation ) ) throw std::logic_error( "Invalid pipeline." );
419  return *operation.get();
420  }
421 
422  //------------------------------------------------------------------------
426  //------------------------------------------------------------------------
427  operator bool()
428  {
429  return bool( operation );
430  }
431 
432  //------------------------------------------------------------------------
436  //------------------------------------------------------------------------
437  static void Stop( const XRootDStatus &status = XrdCl::XRootDStatus() );
438 
439  //------------------------------------------------------------------------
441  //------------------------------------------------------------------------
442  static void Repeat();
443 
444  //------------------------------------------------------------------------
446  //------------------------------------------------------------------------
447  static void Replace( Operation<false> &&opr );
448 
449  //------------------------------------------------------------------------
451  //------------------------------------------------------------------------
452  static void Replace( Pipeline p );
453 
454  //------------------------------------------------------------------------
456  //------------------------------------------------------------------------
457  static void Ignore();
458 
459  private:
460 
461  //------------------------------------------------------------------------
466  //------------------------------------------------------------------------
468  {
469  return operation.get();
470  }
471 
472  //------------------------------------------------------------------------
477  //------------------------------------------------------------------------
478  void Run( Timeout timeout, std::function<void(const XRootDStatus&)> final = nullptr )
479  {
480  if( ftr.valid() )
481  throw std::logic_error( "Pipeline is already running!" );
482 
483  // a promise that the pipe will have a result
484  std::promise<XRootDStatus> prms;
485  ftr = prms.get_future();
486 
487  if( !operation ) std::logic_error( "Empty pipeline!" );
488 
489  Operation<true> *opr = operation.release();
490  opr->Run( timeout, std::move( prms ), std::move( final ) );
491  }
492 
493  //------------------------------------------------------------------------
495  //------------------------------------------------------------------------
496  std::unique_ptr<Operation<true>> operation;
497 
498  //------------------------------------------------------------------------
500  //------------------------------------------------------------------------
501  std::future<XRootDStatus> ftr;
502 
503  };
504 
505  //----------------------------------------------------------------------------
512  //----------------------------------------------------------------------------
513  inline std::future<XRootDStatus> Async( Pipeline pipeline, uint16_t timeout = 0 )
514  {
515  pipeline.Run( timeout );
516  return std::move( pipeline.ftr );
517  }
518 
519  //----------------------------------------------------------------------------
527  //----------------------------------------------------------------------------
528  inline XRootDStatus WaitFor( Pipeline pipeline, uint16_t timeout = 0 )
529  {
530  return Async( std::move( pipeline ), timeout ).get();
531  }
532 
533  //----------------------------------------------------------------------------
540  //----------------------------------------------------------------------------
541  template<template<bool> class Derived, bool HasHndl, typename HdlrFactory, typename ... Args>
542  class ConcreteOperation: public Operation<HasHndl>
543  {
544  template<template<bool> class, bool, typename, typename ...>
545  friend class ConcreteOperation;
546 
547  public:
548 
549  //------------------------------------------------------------------------
553  //------------------------------------------------------------------------
554  ConcreteOperation( Args&&... args ) : args( std::tuple<Args...>( std::move( args )... ) ),
555  timeout( 0 )
556  {
557  static_assert( !HasHndl, "It is only possible to construct operation without handler" );
558  }
559 
560  //------------------------------------------------------------------------
566  //------------------------------------------------------------------------
567  template<bool from>
569  Operation<HasHndl>( std::move( op ) ), args( std::move( op.args ) ), timeout( 0 )
570  {
571  }
572 
573  //------------------------------------------------------------------------
581  //------------------------------------------------------------------------
582  template<typename Hdlr>
583  Derived<true> operator>>( Hdlr &&hdlr )
584  {
585  return this->StreamImpl( HdlrFactory::Create( hdlr ) );
586  }
587 
588  //------------------------------------------------------------------------
594  //------------------------------------------------------------------------
595  Derived<true> operator|( Operation<true> &op )
596  {
597  return PipeImpl( *this, op );
598  }
599 
600  //------------------------------------------------------------------------
606  //------------------------------------------------------------------------
607  Derived<true> operator|( Operation<true> &&op )
608  {
609  return PipeImpl( *this, op );
610  }
611 
612  //------------------------------------------------------------------------
618  //------------------------------------------------------------------------
619  Derived<true> operator|( Operation<false> &op )
620  {
621  return PipeImpl( *this, op );
622  }
623 
624  //------------------------------------------------------------------------
630  //------------------------------------------------------------------------
631  Derived<true> operator|( Operation<false> &&op )
632  {
633  return PipeImpl( *this, op );
634  }
635 
636  //------------------------------------------------------------------------
638  //------------------------------------------------------------------------
639  Derived<true> operator|( FinalOperation &&fo )
640  {
641  AllocHandler( *this );
642  this->handler->Assign( fo.final );
643  return this->template Transform<true>();
644  }
645 
646  //------------------------------------------------------------------------
650  //------------------------------------------------------------------------
652  {
653  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
654  return new Derived<HasHndl>( std::move( *me ) );
655  }
656 
657  //------------------------------------------------------------------------
661  //------------------------------------------------------------------------
663  {
664  this->handler.reset( new PipelineHandler() );
665  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
666  return new Derived<true>( std::move( *me ) );
667  }
668 
669  //------------------------------------------------------------------------
671  //------------------------------------------------------------------------
672  Derived<HasHndl> Timeout( uint16_t timeout )
673  {
674  this->timeout = timeout;
675  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
676  return std::move( *me );
677  }
678 
679  protected:
680 
681  //------------------------------------------------------------------------
685  //------------------------------------------------------------------------
686  template<bool to>
687  inline Derived<to> Transform()
688  {
689  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
690  return Derived<to>( std::move( *me ) );
691  }
692 
693  //------------------------------------------------------------------------
699  //------------------------------------------------------------------------
700  inline Derived<true> StreamImpl( ResponseHandler *handler )
701  {
702  static_assert( !HasHndl, "Operator >> is available only for operation without handler" );
703  this->handler.reset( new PipelineHandler( handler ) );
704  return Transform<true>();
705  }
706 
707  //------------------------------------------------------------------------
708  // Allocate handler if necessary
709  //------------------------------------------------------------------------
710  inline static
712  {
713  // nothing to do
714  }
715 
716  //------------------------------------------------------------------------
717  // Allocate handler if necessary
718  //------------------------------------------------------------------------
719  inline static
721  {
722  me.handler.reset( new PipelineHandler() );
723  }
724 
725  //------------------------------------------------------------------------
732  //------------------------------------------------------------------------
733  inline static
734  Derived<true> PipeImpl( ConcreteOperation<Derived, HasHndl, HdlrFactory,
735  Args...> &me, Operation<true> &op )
736  {
737  AllocHandler( me ); // if HasHndl is false allocate handler
738  me.AddOperation( op.Move() );
739  return me.template Transform<true>();
740  }
741 
742  //------------------------------------------------------------------------
749  //------------------------------------------------------------------------
750  inline static
751  Derived<true> PipeImpl( ConcreteOperation<Derived, HasHndl, HdlrFactory,
752  Args...> &me, Operation<false> &op )
753  {
754  AllocHandler( me ); // if HasHndl is false allocate handler
755  me.AddOperation( op.ToHandled() );
756  return me.template Transform<true>();
757  }
758 
759  //------------------------------------------------------------------------
761  //------------------------------------------------------------------------
762  std::tuple<Args...> args;
763 
764  //------------------------------------------------------------------------
766  //------------------------------------------------------------------------
767  uint16_t timeout;
768  };
769 }
770 
771 #endif // __XRD_CL_OPERATIONS_HH__
std::unique_ptr< Operation< true > > operation
First operation in the pipeline.
Definition: XrdClOperations.hh:496
Definition: XrdClAnyObject.hh:32
Operation(Operation< from > &&op)
Move constructor between template instances.
Definition: XrdClOperations.hh:206
bool valid
Flag indicating if it is a valid object.
Definition: XrdClOperations.hh:309
Pipeline & operator|=(Operation< false > &&op)
Extend pipeline.
Definition: XrdClOperations.hh:405
friend std::future< XRootDStatus > Async(Pipeline, uint16_t)
Definition: XrdClOperations.hh:513
std::future< XRootDStatus > ftr
The future result of the pipeline.
Definition: XrdClOperations.hh:501
Pipeline(Operation< false > &&op)
Constructor.
Definition: XrdClOperations.hh:374
Definition: XrdClOperationTimeout.hh:19
ssize_t Move(KernelBuffer &kbuff, char *&ubuff)
Definition: XrdSysKernelBuffer.hh:452
Call the user callback.
Definition: XrdClResponseJob.hh:30
Derived< true > operator|(Operation< true > &&op)
Definition: XrdClOperations.hh:607
Pipeline & operator=(Pipeline &&pipe)
Constructor.
Definition: XrdClOperations.hh:387
static void Repeat()
Repeat current operation.
Derived< true > operator|(Operation< true > &op)
Definition: XrdClOperations.hh:595
Derived< true > operator>>(Hdlr &&hdlr)
Definition: XrdClOperations.hh:583
uint16_t timeout
Operation timeout.
Definition: XrdClOperations.hh:767
Pipeline & operator|=(Operation< true > &&op)
Extend pipeline.
Definition: XrdClOperations.hh:396
Pipeline()
Default constructor.
Definition: XrdClOperations.hh:330
void HandleResponseImpl(XRootDStatus *status, AnyObject *response, HostList *hostList=nullptr)
Callback function implementation;.
void dealloc(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClOperations.hh:134
Derived< true > operator|(FinalOperation &&fo)
Adds a final operation to the pipeline.
Definition: XrdClOperations.hh:639
void AddOperation(Operation< true > *op)
Definition: XrdClOperations.hh:295
ConcreteOperation(ConcreteOperation< Derived, from, HdlrFactory, Args...> &&op)
Definition: XrdClOperations.hh:568
Derived< true > StreamImpl(ResponseHandler *handler)
Definition: XrdClOperations.hh:700
const XRootDStatus & GetError() const
Definition: XrdClOperationHandlers.hh:433
void QueueJob(Job *job, void *arg=0)
Add a job to be run.
Definition: XrdClJobManager.hh:92
Definition: XrdClFinalOperation.hh:39
Derived< HasHndl > Timeout(uint16_t timeout)
Set operation timeout.
Definition: XrdClOperations.hh:672
friend std::future< XRootDStatus > Async(Pipeline, uint16_t)
Definition: XrdClOperations.hh:513
~PipelineHandler()
Destructor.
Definition: XrdClOperations.hh:97
Definition: XrdClOperationTimeout.hh:17
std::future< XRootDStatus > Async(Pipeline pipeline, uint16_t timeout=0)
Definition: XrdClOperations.hh:513
Derived< true > operator|(Operation< false > &op)
Definition: XrdClOperations.hh:619
static void Replace(Operation< false > &&opr)
Replace current operation.
virtual ~Operation()
Destructor.
Definition: XrdClOperations.hh:217
Pipeline exception, wrapps an XRootDStatus.
Definition: XrdClOperationHandlers.hh:392
Pipeline(Operation< true > &&op)
Constructor.
Definition: XrdClOperations.hh:353
std::function< Operation< true > *(const XRootDStatus &)> rcvry_func
Type of the recovery function to be provided by the user.
Definition: XrdClOperations.hh:51
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:1120
void Run(Timeout timeout, std::function< void(const XRootDStatus &)> final=nullptr)
Definition: XrdClOperations.hh:478
Timeout timeout
Pipeline timeout.
Definition: XrdClOperations.hh:160
void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Callback function.
static void Ignore()
Ignore error and proceed with the pipeline.
friend class ConcreteOperation
Definition: XrdClOperations.hh:545
std::tuple< Args...> args
Operation arguments.
Definition: XrdClOperations.hh:762
Pipeline(Pipeline &&pipe)
Definition: XrdClOperations.hh:379
PipelineHandler()
Default Constructor.
Definition: XrdClOperations.hh:79
virtual std::string ToString()=0
Name of the operation.
std::unique_ptr< Operation< true > > nextOperation
Next operation in the pipeline.
Definition: XrdClOperations.hh:155
Pipeline(Operation< false > &op)
Constructor.
Definition: XrdClOperations.hh:366
const uint16_t stError
An error occurred that could potentially be retried.
Definition: XrdClStatus.hh:32
Request status.
Definition: XrdClXRootDResponses.hh:218
XRootDStatus WaitFor(Pipeline pipeline, uint16_t timeout=0)
Definition: XrdClOperations.hh:528
Definition: XrdClOperations.hh:49
const uint16_t errOperationExpired
Definition: XrdClStatus.hh:90
Operation()
Constructor.
Definition: XrdClOperations.hh:198
static Derived< true > PipeImpl(ConcreteOperation< Derived, HasHndl, HdlrFactory, Args...> &me, Operation< false > &op)
Definition: XrdClOperations.hh:751
static void AllocHandler(ConcreteOperation< Derived, true, HdlrFactory, Args...> &me)
Definition: XrdClOperations.hh:711
Definition: XrdClOperations.hh:63
static void AllocHandler(ConcreteOperation< Derived, false, HdlrFactory, Args...> &me)
Definition: XrdClOperations.hh:720
Operation< HasHndl > * Move()
Definition: XrdClOperations.hh:651
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback function.
Pipeline(Operation< true > &op)
Constructor.
Definition: XrdClOperations.hh:345
std::promise< XRootDStatus > prms
The promise that there will be a result (traveling along the pipeline)
Definition: XrdClOperations.hh:165
Handle an async response.
Definition: XrdClXRootDResponses.hh:1125
Operation< true > * operator->()
Definition: XrdClOperations.hh:467
std::unique_ptr< Operation< true > > currentOperation
The operation the handler is assigned to.
Definition: XrdClOperations.hh:150
Derived< to > Transform()
Definition: XrdClOperations.hh:687
void AddOperation(Operation< true > *operation)
JobManager * GetJobManager()
Get the job manager object user by the post master.
Pipeline(Operation< false > *op)
Definition: XrdClOperations.hh:358
const uint16_t errInternal
Internal error.
Definition: XrdClStatus.hh:56
static Derived< true > PipeImpl(ConcreteOperation< Derived, HasHndl, HdlrFactory, Args...> &me, Operation< true > &op)
Definition: XrdClOperations.hh:734
virtual Operation< true > * ToHandled()=0
friend class PipelineHandler
Definition: XrdClOperations.hh:191
void Run(Timeout timeout, std::promise< XRootDStatus > prms, std::function< void(const XRootDStatus &)> final)
Definition: XrdClOperations.hh:249
virtual XRootDStatus RunImpl(PipelineHandler *handler, uint16_t timeout)=0
Operation< true > * ToHandled()
Definition: XrdClOperations.hh:662
static void Stop(const XRootDStatus &status=XrdCl::XRootDStatus())
ConcreteOperation(Args &&...args)
Definition: XrdClOperations.hh:554
Pipeline(Operation< true > *op)
Constructor.
Definition: XrdClOperations.hh:337
std::unique_ptr< ResponseHandler > responseHandler
The handler of our operation.
Definition: XrdClOperations.hh:145
static PostMaster * GetPostMaster()
Get default post master.
bool IsOK() const
We&#39;re fine.
Definition: XrdClStatus.hh:124
Derived< true > operator|(Operation< false > &&op)
Definition: XrdClOperations.hh:631
Definition: XrdClOperations.hh:319
Definition: XrdClParallelOperation.hh:79
void Assign(const Timeout &timeout, std::promise< XRootDStatus > prms, std::function< void(const XRootDStatus &)> final, Operation< true > *opr)
virtual Operation< HasHndl > * Move()=0
std::unique_ptr< PipelineHandler > handler
Operation handler.
Definition: XrdClOperations.hh:304
Definition: XrdClOperations.hh:542