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  //------------------------------------------------------------------------
74  //------------------------------------------------------------------------
75  PipelineHandler( ResponseHandler *handler );
76 
77  //------------------------------------------------------------------------
79  //------------------------------------------------------------------------
81  {
82  }
83 
84  //------------------------------------------------------------------------
86  //------------------------------------------------------------------------
87  void HandleResponseWithHosts( XRootDStatus *status, AnyObject *response,
88  HostList *hostList );
89 
90  //------------------------------------------------------------------------
92  //------------------------------------------------------------------------
93  void HandleResponse( XRootDStatus *status, AnyObject *response );
94 
95  //------------------------------------------------------------------------
97  //------------------------------------------------------------------------
99  {
100  }
101 
102  //------------------------------------------------------------------------
106  //------------------------------------------------------------------------
107  void AddOperation( Operation<true> *operation );
108 
109  //------------------------------------------------------------------------
116  //------------------------------------------------------------------------
117  void Assign( const Timeout &timeout,
118  std::promise<XRootDStatus> prms,
119  std::function<void(const XRootDStatus&)> final,
120  Operation<true> *opr );
121 
122  //------------------------------------------------------------------------
124  //------------------------------------------------------------------------
125  void Assign( std::function<void(const XRootDStatus&)> final );
126 
127  private:
128 
129  //------------------------------------------------------------------------
131  //------------------------------------------------------------------------
132  void HandleResponseImpl( XRootDStatus *status, AnyObject *response,
133  HostList *hostList = nullptr );
134 
135  inline void dealloc( XRootDStatus *status, AnyObject *response,
136  HostList *hostList )
137  {
138  delete status;
139  delete response;
140  delete hostList;
141  }
142 
143  //------------------------------------------------------------------------
145  //------------------------------------------------------------------------
146  std::unique_ptr<ResponseHandler> responseHandler;
147 
148  //------------------------------------------------------------------------
150  //------------------------------------------------------------------------
151  std::unique_ptr<Operation<true>> currentOperation;
152 
153  //------------------------------------------------------------------------
155  //------------------------------------------------------------------------
156  std::unique_ptr<Operation<true>> nextOperation;
157 
158  //------------------------------------------------------------------------
160  //------------------------------------------------------------------------
162 
163  //------------------------------------------------------------------------
165  //------------------------------------------------------------------------
166  std::promise<XRootDStatus> prms;
167 
168  //------------------------------------------------------------------------
171  //------------------------------------------------------------------------
172  std::function<void(const XRootDStatus&)> final;
173  };
174 
175  //----------------------------------------------------------------------------
181  //----------------------------------------------------------------------------
182  template<bool HasHndl>
183  class Operation
184  {
185  // Declare friendship between templates
186  template<bool>
187  friend class Operation;
188 
189  friend std::future<XRootDStatus> Async( Pipeline, uint16_t );
190 
191  friend class Pipeline;
192  friend class PipelineHandler;
193 
194  public:
195 
196  //------------------------------------------------------------------------
198  //------------------------------------------------------------------------
199  Operation() : valid( true )
200  {
201  }
202 
203  //------------------------------------------------------------------------
205  //------------------------------------------------------------------------
206  template<bool from>
208  handler( std::move( op.handler ) ), valid( true )
209  {
210  if( !op.valid ) throw std::invalid_argument( "Cannot construct "
211  "Operation from an invalid Operation!" );
212  op.valid = false;
213  }
214 
215  //------------------------------------------------------------------------
217  //------------------------------------------------------------------------
218  virtual ~Operation()
219  {
220  }
221 
222  //------------------------------------------------------------------------
224  //------------------------------------------------------------------------
225  virtual std::string ToString() = 0;
226 
227  //------------------------------------------------------------------------
231  //------------------------------------------------------------------------
232  virtual Operation<HasHndl>* Move() = 0;
233 
234  //------------------------------------------------------------------------
239  //------------------------------------------------------------------------
240  virtual Operation<true>* ToHandled() = 0;
241 
242  protected:
243 
244  //------------------------------------------------------------------------
254  //------------------------------------------------------------------------
255  void Run( Timeout timeout,
256  std::promise<XRootDStatus> prms,
257  std::function<void(const XRootDStatus&)> final )
258  {
259  static_assert(HasHndl, "Only an operation that has a handler can be assigned to workflow");
260  handler->Assign( timeout, std::move( prms ), std::move( final ), this );
261 
262  PipelineHandler *h = handler.release();
263  XRootDStatus st;
264  try
265  {
266  st = RunImpl( h, timeout );
267  }
268  catch( const operation_expired& ex )
269  {
271  }
272  catch( const PipelineException& ex ) // probably not needed
273  {
274  st = ex.GetError();
275  }
276  catch( const std::exception& ex )
277  {
278  st = XRootDStatus( stError, errInternal, 0, ex.what() );
279  }
280 
281  if( !st.IsOK() ){
282  ResponseJob *job = new ResponseJob(h, new XRootDStatus(st), 0, nullptr);
284  }
285  }
286 
287  //------------------------------------------------------------------------
294  //------------------------------------------------------------------------
295  virtual XRootDStatus RunImpl( PipelineHandler *handler, uint16_t timeout ) = 0;
296 
297  //------------------------------------------------------------------------
301  //------------------------------------------------------------------------
303  {
304  if( handler )
305  handler->AddOperation( op );
306  }
307 
308  //------------------------------------------------------------------------
310  //------------------------------------------------------------------------
311  std::unique_ptr<PipelineHandler> handler;
312 
313  //------------------------------------------------------------------------
315  //------------------------------------------------------------------------
316  bool valid;
317  };
318 
319  //----------------------------------------------------------------------------
325  //----------------------------------------------------------------------------
326  class Pipeline
327  {
328  template<bool> friend class ParallelOperation;
329  friend std::future<XRootDStatus> Async( Pipeline, uint16_t );
330  friend class PipelineHandler;
331 
332  public:
333 
334  //------------------------------------------------------------------------
336  //------------------------------------------------------------------------
338  {
339  }
340 
341  //------------------------------------------------------------------------
343  //------------------------------------------------------------------------
345  operation( op->Move() )
346  {
347  }
348 
349  //------------------------------------------------------------------------
351  //------------------------------------------------------------------------
353  operation( op.Move() )
354  {
355  }
356 
357  //------------------------------------------------------------------------
359  //------------------------------------------------------------------------
361  operation( op.Move() )
362  {
363  }
364 
366  operation( op->ToHandled() )
367  {
368  }
369 
370  //------------------------------------------------------------------------
372  //------------------------------------------------------------------------
374  operation( op.ToHandled() )
375  {
376  }
377 
378  //------------------------------------------------------------------------
380  //------------------------------------------------------------------------
382  operation( op.ToHandled() )
383  {
384  }
385 
386  Pipeline( Pipeline &&pipe ) :
387  operation( std::move( pipe.operation ) )
388  {
389  }
390 
391  //------------------------------------------------------------------------
393  //------------------------------------------------------------------------
395  {
396  operation = std::move( pipe.operation );
397  return *this;
398  }
399 
400  //------------------------------------------------------------------------
402  //------------------------------------------------------------------------
404  {
405  operation->AddOperation( op.Move() );
406  return *this;
407  }
408 
409  //------------------------------------------------------------------------
411  //------------------------------------------------------------------------
413  {
414  operation->AddOperation( op.ToHandled() );
415  return *this;
416  }
417 
418  //------------------------------------------------------------------------
422  //------------------------------------------------------------------------
423  operator Operation<true>&()
424  {
425  if( !bool( operation ) ) throw std::logic_error( "Invalid pipeline." );
426  return *operation.get();
427  }
428 
429  //------------------------------------------------------------------------
433  //------------------------------------------------------------------------
434  operator bool()
435  {
436  return bool( operation );
437  }
438 
439  //------------------------------------------------------------------------
443  //------------------------------------------------------------------------
444  static void Stop( const XRootDStatus &status = XrdCl::XRootDStatus() );
445 
446  //------------------------------------------------------------------------
448  //------------------------------------------------------------------------
449  static void Repeat();
450 
451  //------------------------------------------------------------------------
453  //------------------------------------------------------------------------
454  static void Replace( Operation<false> &&opr );
455 
456  //------------------------------------------------------------------------
458  //------------------------------------------------------------------------
459  static void Replace( Pipeline p );
460 
461  //------------------------------------------------------------------------
463  //------------------------------------------------------------------------
464  static void Ignore();
465 
466  private:
467 
468  //------------------------------------------------------------------------
473  //------------------------------------------------------------------------
475  {
476  return operation.get();
477  }
478 
479  //------------------------------------------------------------------------
484  //------------------------------------------------------------------------
485  void Run( Timeout timeout, std::function<void(const XRootDStatus&)> final = nullptr )
486  {
487  if( ftr.valid() )
488  throw std::logic_error( "Pipeline is already running!" );
489 
490  // a promise that the pipe will have a result
491  std::promise<XRootDStatus> prms;
492  ftr = prms.get_future();
493 
494  if( !operation ) std::logic_error( "Empty pipeline!" );
495 
496  Operation<true> *opr = operation.release();
497  opr->Run( timeout, std::move( prms ), std::move( final ) );
498  }
499 
500  //------------------------------------------------------------------------
502  //------------------------------------------------------------------------
503  std::unique_ptr<Operation<true>> operation;
504 
505  //------------------------------------------------------------------------
507  //------------------------------------------------------------------------
508  std::future<XRootDStatus> ftr;
509 
510  };
511 
512  //----------------------------------------------------------------------------
519  //----------------------------------------------------------------------------
520  inline std::future<XRootDStatus> Async( Pipeline pipeline, uint16_t timeout = 0 )
521  {
522  pipeline.Run( timeout );
523  return std::move( pipeline.ftr );
524  }
525 
526  //----------------------------------------------------------------------------
533  //----------------------------------------------------------------------------
534  inline XRootDStatus WaitFor( Pipeline pipeline, uint16_t timeout = 0 )
535  {
536  return Async( std::move( pipeline ), timeout ).get();
537  }
538 
539  //----------------------------------------------------------------------------
546  //----------------------------------------------------------------------------
547  template<template<bool> class Derived, bool HasHndl, typename HdlrFactory, typename ... Args>
548  class ConcreteOperation: public Operation<HasHndl>
549  {
550  template<template<bool> class, bool, typename, typename ...>
551  friend class ConcreteOperation;
552 
553  public:
554 
555  //------------------------------------------------------------------------
559  //------------------------------------------------------------------------
560  ConcreteOperation( Args&&... args ) : args( std::tuple<Args...>( std::move( args )... ) ),
561  timeout( 0 )
562  {
563  static_assert( !HasHndl, "It is only possible to construct operation without handler" );
564  }
565 
566  //------------------------------------------------------------------------
572  //------------------------------------------------------------------------
573  template<bool from>
575  Operation<HasHndl>( std::move( op ) ), args( std::move( op.args ) ), timeout( 0 )
576  {
577  }
578 
579  //------------------------------------------------------------------------
587  //------------------------------------------------------------------------
588  template<typename Hdlr>
589  Derived<true> operator>>( Hdlr &&hdlr )
590  {
591  return this->StreamImpl( HdlrFactory::Create( hdlr ) );
592  }
593 
594  //------------------------------------------------------------------------
600  //------------------------------------------------------------------------
601  Derived<true> operator|( Operation<true> &op )
602  {
603  return PipeImpl( *this, op );
604  }
605 
606  //------------------------------------------------------------------------
612  //------------------------------------------------------------------------
613  Derived<true> operator|( Operation<true> &&op )
614  {
615  return PipeImpl( *this, op );
616  }
617 
618  //------------------------------------------------------------------------
624  //------------------------------------------------------------------------
625  Derived<true> operator|( Operation<false> &op )
626  {
627  return PipeImpl( *this, op );
628  }
629 
630  //------------------------------------------------------------------------
636  //------------------------------------------------------------------------
637  Derived<true> operator|( Operation<false> &&op )
638  {
639  return PipeImpl( *this, op );
640  }
641 
642  //------------------------------------------------------------------------
644  //------------------------------------------------------------------------
645  Derived<true> operator|( FinalOperation &&fo )
646  {
647  AllocHandler( *this );
648  this->handler->Assign( fo.final );
649  return this->template Transform<true>();
650  }
651 
652  //------------------------------------------------------------------------
656  //------------------------------------------------------------------------
658  {
659  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
660  return new Derived<HasHndl>( std::move( *me ) );
661  }
662 
663  //------------------------------------------------------------------------
667  //------------------------------------------------------------------------
669  {
670  this->handler.reset( new PipelineHandler() );
671  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
672  return new Derived<true>( std::move( *me ) );
673  }
674 
675  //------------------------------------------------------------------------
677  //------------------------------------------------------------------------
678  Derived<HasHndl> Timeout( uint16_t timeout )
679  {
680  this->timeout = timeout;
681  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
682  return std::move( *me );
683  }
684 
685  protected:
686 
687  //------------------------------------------------------------------------
691  //------------------------------------------------------------------------
692  template<bool to>
693  inline Derived<to> Transform()
694  {
695  Derived<HasHndl> *me = static_cast<Derived<HasHndl>*>( this );
696  return Derived<to>( std::move( *me ) );
697  }
698 
699  //------------------------------------------------------------------------
705  //------------------------------------------------------------------------
706  inline Derived<true> StreamImpl( ResponseHandler *handler )
707  {
708  static_assert( !HasHndl, "Operator >> is available only for operation without handler" );
709  this->handler.reset( new PipelineHandler( handler ) );
710  return Transform<true>();
711  }
712 
713  //------------------------------------------------------------------------
714  // Allocate handler if necessary
715  //------------------------------------------------------------------------
716  inline static
718  {
719  // nothing to do
720  }
721 
722  //------------------------------------------------------------------------
723  // Allocate handler if necessary
724  //------------------------------------------------------------------------
725  inline static
727  {
728  me.handler.reset( new PipelineHandler() );
729  }
730 
731  //------------------------------------------------------------------------
738  //------------------------------------------------------------------------
739  inline static
740  Derived<true> PipeImpl( ConcreteOperation<Derived, HasHndl, HdlrFactory,
741  Args...> &me, Operation<true> &op )
742  {
743  AllocHandler( me ); // if HasHndl is false allocate handler
744  me.AddOperation( op.Move() );
745  return me.template Transform<true>();
746  }
747 
748  //------------------------------------------------------------------------
755  //------------------------------------------------------------------------
756  inline static
757  Derived<true> PipeImpl( ConcreteOperation<Derived, HasHndl, HdlrFactory,
758  Args...> &me, Operation<false> &op )
759  {
760  AllocHandler( me ); // if HasHndl is false allocate handler
761  me.AddOperation( op.ToHandled() );
762  return me.template Transform<true>();
763  }
764 
765  //------------------------------------------------------------------------
767  //------------------------------------------------------------------------
768  std::tuple<Args...> args;
769 
770  //------------------------------------------------------------------------
772  //------------------------------------------------------------------------
773  uint16_t timeout;
774  };
775 }
776 
777 #endif // __XRD_CL_OPERATIONS_HH__
std::unique_ptr< Operation< true > > operation
First operation in the pipeline.
Definition: XrdClOperations.hh:503
Definition: XrdClAnyObject.hh:32
Operation(Operation< from > &&op)
Move constructor between template instances.
Definition: XrdClOperations.hh:207
bool valid
Flag indicating if it is a valid object.
Definition: XrdClOperations.hh:316
Pipeline & operator|=(Operation< false > &&op)
Extend pipeline.
Definition: XrdClOperations.hh:412
friend std::future< XRootDStatus > Async(Pipeline, uint16_t)
Definition: XrdClOperations.hh:520
std::future< XRootDStatus > ftr
The future result of the pipeline.
Definition: XrdClOperations.hh:508
Pipeline(Operation< false > &&op)
Constructor.
Definition: XrdClOperations.hh:381
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:613
Pipeline & operator=(Pipeline &&pipe)
Constructor.
Definition: XrdClOperations.hh:394
static void Repeat()
Repeat current operation.
Derived< true > operator|(Operation< true > &op)
Definition: XrdClOperations.hh:601
Derived< true > operator>>(Hdlr &&hdlr)
Definition: XrdClOperations.hh:589
uint16_t timeout
Operation timeout.
Definition: XrdClOperations.hh:773
Pipeline & operator|=(Operation< true > &&op)
Extend pipeline.
Definition: XrdClOperations.hh:403
Pipeline()
Default constructor.
Definition: XrdClOperations.hh:337
void HandleResponseImpl(XRootDStatus *status, AnyObject *response, HostList *hostList=nullptr)
Callback function implementation;.
void dealloc(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClOperations.hh:135
Derived< true > operator|(FinalOperation &&fo)
Adds a final operation to the pipeline.
Definition: XrdClOperations.hh:645
void AddOperation(Operation< true > *op)
Definition: XrdClOperations.hh:302
ConcreteOperation(ConcreteOperation< Derived, from, HdlrFactory, Args...> &&op)
Definition: XrdClOperations.hh:574
Derived< true > StreamImpl(ResponseHandler *handler)
Definition: XrdClOperations.hh:706
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:678
friend std::future< XRootDStatus > Async(Pipeline, uint16_t)
Definition: XrdClOperations.hh:520
~PipelineHandler()
Destructor.
Definition: XrdClOperations.hh:98
Definition: XrdClOperationTimeout.hh:17
std::future< XRootDStatus > Async(Pipeline pipeline, uint16_t timeout=0)
Definition: XrdClOperations.hh:520
Derived< true > operator|(Operation< false > &op)
Definition: XrdClOperations.hh:625
static void Replace(Operation< false > &&opr)
Replace current operation.
virtual ~Operation()
Destructor.
Definition: XrdClOperations.hh:218
Pipeline exception, wrapps an XRootDStatus.
Definition: XrdClOperationHandlers.hh:392
Pipeline(Operation< true > &&op)
Constructor.
Definition: XrdClOperations.hh:360
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:1111
void Run(Timeout timeout, std::function< void(const XRootDStatus &)> final=nullptr)
Definition: XrdClOperations.hh:485
Timeout timeout
Pipeline timeout.
Definition: XrdClOperations.hh:161
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:551
std::tuple< Args...> args
Operation arguments.
Definition: XrdClOperations.hh:768
Pipeline(Pipeline &&pipe)
Definition: XrdClOperations.hh:386
PipelineHandler()
Default Constructor.
Definition: XrdClOperations.hh:80
virtual std::string ToString()=0
Name of the operation.
std::unique_ptr< Operation< true > > nextOperation
Next operation in the pipeline.
Definition: XrdClOperations.hh:156
Pipeline(Operation< false > &op)
Constructor.
Definition: XrdClOperations.hh:373
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:534
Definition: XrdClOperations.hh:49
const uint16_t errOperationExpired
Definition: XrdClStatus.hh:90
Operation()
Constructor.
Definition: XrdClOperations.hh:199
static Derived< true > PipeImpl(ConcreteOperation< Derived, HasHndl, HdlrFactory, Args...> &me, Operation< false > &op)
Definition: XrdClOperations.hh:757
static void AllocHandler(ConcreteOperation< Derived, true, HdlrFactory, Args...> &me)
Definition: XrdClOperations.hh:717
Definition: XrdClOperations.hh:63
static void AllocHandler(ConcreteOperation< Derived, false, HdlrFactory, Args...> &me)
Definition: XrdClOperations.hh:726
Operation< HasHndl > * Move()
Definition: XrdClOperations.hh:657
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback function.
Pipeline(Operation< true > &op)
Constructor.
Definition: XrdClOperations.hh:352
std::promise< XRootDStatus > prms
The promise that there will be a result (traveling along the pipeline)
Definition: XrdClOperations.hh:166
Handle an async response.
Definition: XrdClXRootDResponses.hh:1116
Operation< true > * operator->()
Definition: XrdClOperations.hh:474
std::unique_ptr< Operation< true > > currentOperation
The operation the handler is assigned to.
Definition: XrdClOperations.hh:151
Derived< to > Transform()
Definition: XrdClOperations.hh:693
void AddOperation(Operation< true > *operation)
JobManager * GetJobManager()
Get the job manager object user by the post master.
Pipeline(Operation< false > *op)
Definition: XrdClOperations.hh:365
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:740
virtual Operation< true > * ToHandled()=0
friend class PipelineHandler
Definition: XrdClOperations.hh:192
void Run(Timeout timeout, std::promise< XRootDStatus > prms, std::function< void(const XRootDStatus &)> final)
Definition: XrdClOperations.hh:255
virtual XRootDStatus RunImpl(PipelineHandler *handler, uint16_t timeout)=0
Operation< true > * ToHandled()
Definition: XrdClOperations.hh:668
static void Stop(const XRootDStatus &status=XrdCl::XRootDStatus())
ConcreteOperation(Args &&...args)
Definition: XrdClOperations.hh:560
Pipeline(Operation< true > *op)
Constructor.
Definition: XrdClOperations.hh:344
std::unique_ptr< ResponseHandler > responseHandler
The handler of our operation.
Definition: XrdClOperations.hh:146
static PostMaster * GetPostMaster()
Get default post master.
bool IsOK() const
We&#39;re fine.
Definition: XrdClStatus.hh:123
Derived< true > operator|(Operation< false > &&op)
Definition: XrdClOperations.hh:637
Definition: XrdClOperations.hh:326
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:311
Definition: XrdClOperations.hh:548