Go to the documentation of this file.
26 #ifndef __XRD_CL_OPERATION_HANDLERS_HH__
27 #define __XRD_CL_OPERATION_HANDLERS_HH__
39 template<
typename Hdlr>
46 static constexpr
bool value = std::is_base_of<XrdCl::ResponseHandler, Hdlr>::value;
55 template<
typename Hdlr>
62 static constexpr
bool value = std::is_base_of<XrdCl::ResponseHandler, Hdlr>::value;
106 template<
typename ResponseType>
117 std::function<
void(
XRootDStatus&, ResponseType& )> handleFunction ) :
118 fun( handleFunction )
127 ResponseType *res =
nullptr;
129 response->
Get( res );
132 fun( *status, *res );
153 template<
typename ResponseType>
163 template<
typename Response,
typename Return>
183 Response *resp =
nullptr;
185 response->
Get( resp );
188 task( *status, *resp );
210 template<
typename Response,
typename Return>
220 template<
typename Return>
269 f(
f ),
fun( handleFunction )
283 fun( *status, *info );
284 if( info != &
nullref )
delete info;
343 const char*
what() const noexcept
369 template<
typename Response>
382 ftr =
prms.get_future();
406 prms.set_exception( ex );
426 template<
typename Response>
451 response->
Get( resp );
452 this->
prms.set_value( std::move( *resp ) );
509 template<
typename Response>
552 template<
typename Response>
573 template<
typename Return>
611 template<
typename Return>
624 #endif // __XRD_CL_OPERATIONS_HANDLERS_HH__
Definition: XrdClOperationHandlers.hh:510
static ResponseHandler * Create(ResponseHandler &hdlr)
Definition: XrdClOperationHandlers.hh:529
Definition: XrdClOperationHandlers.hh:553
Handle an async response.
Definition: XrdClXRootDResponses.hh:854
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:238
const XRootDStatus & GetError() const
Definition: XrdClOperationHandlers.hh:351
bool called
true if the handler has been called, false otherwise
Definition: XrdClOperationHandlers.hh:417
static ResponseHandler * Create(std::future< Response > &ftr)
Definition: XrdClOperationHandlers.hh:540
static ResponseHandler * Create(std::packaged_task< Return(XRootDStatus &)> &task)
Definition: XrdClOperationHandlers.hh:612
std::packaged_task< Return(XRootDStatus &, Response &)> task
user defined task
Definition: XrdClOperationHandlers.hh:199
static ResponseType nullref
Null reference to the response (not really but acts as one)
Definition: XrdClOperationHandlers.hh:147
std::promise< Response > prms
promise that corresponds to the future
Definition: XrdClOperationHandlers.hh:412
void SetException(const XRootDStatus &err)
Definition: XrdClOperationHandlers.hh:403
std::string ToString() const
Create a string representation.
Definition: XrdClOperationHandlers.hh:370
void Get(Type &object)
Retrieve the object being held.
Definition: XrdClAnyObject.hh:78
~FutureWrapperBase()
Definition: XrdClOperationHandlers.hh:390
TaskWrapper(std::packaged_task< Return(XRootDStatus &, Response &)> &&task)
Constructor.
Definition: XrdClOperationHandlers.hh:173
PipelineException & operator=(const PipelineException &ex)
Assigment operator.
Definition: XrdClOperationHandlers.hh:334
A file.
Definition: XrdClFile.hh:44
Pipeline exception, wrapps an XRootDStatus.
Definition: XrdClOperationHandlers.hh:311
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:125
ExOpenFuncWrapper(File &f, std::function< void(XRootDStatus &, StatInfo &)> handleFunction)
Constructor.
Definition: XrdClOperationHandlers.hh:267
std::function< void(XRootDStatus &)> fun
user defined function, functor or lambda
Definition: XrdClOperationHandlers.hh:98
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:484
static Response nullref
Null reference to the response (not really but acts as one)
Definition: XrdClOperationHandlers.hh:204
XRootDStatus error
the XRootDStatus associated with this exception
Definition: XrdClOperationHandlers.hh:361
static StatInfo nullref
Null reference to the response (not really but acts as one)
Definition: XrdClOperationHandlers.hh:300
Lambda wrapper.
Definition: XrdClOperationHandlers.hh:68
Request status.
Definition: XrdClXRootDResponses.hh:212
TaskWrapper(std::packaged_task< Return(XRootDStatus &)> &&task)
Constructor.
Definition: XrdClOperationHandlers.hh:230
Definition: XrdClOperationHandlers.hh:164
Definition: XrdClOperationHandlers.hh:107
static ResponseHandler * Create(std::packaged_task< Return(XRootDStatus &, Response &)> &task)
Definition: XrdClOperationHandlers.hh:574
std::function< void(XRootDStatus &, StatInfo &)> fun
user defined function, functor or lambda
Definition: XrdClOperationHandlers.hh:295
FutureWrapper(std::future< Response > &ftr)
Definition: XrdClOperationHandlers.hh:436
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:86
static ResponseHandler * Create(std::function< void(XRootDStatus &)> func)
Definition: XrdClOperationHandlers.hh:600
static ResponseHandler * Create(ResponseHandler *hdlr)
Definition: XrdClOperationHandlers.hh:518
PipelineException(const PipelineException &ex)
Copy constructor.
Definition: XrdClOperationHandlers.hh:326
static ResponseHandler * Create(std::function< void(XRootDStatus &, Response &)> func)
Definition: XrdClOperationHandlers.hh:561
bool IsOK() const
We're fine.
Definition: XrdClStatus.hh:119
std::packaged_task< Return(XRootDStatus &)> task
user defined task
Definition: XrdClOperationHandlers.hh:251
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:444
Lambda wrapper.
Definition: XrdClOperationHandlers.hh:258
Definition: XrdClAnyObject.hh:25
File & f
Definition: XrdClOperationHandlers.hh:291
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:276
XRootDStatus Stat(bool force, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
FutureWrapperBase(std::future< Response > &ftr)
Definition: XrdClOperationHandlers.hh:380
FutureWrapper(std::future< void > &ftr)
Definition: XrdClOperationHandlers.hh:476
const uint16_t stError
An error occurred that could potentially be retried.
Definition: XrdClStatus.hh:32
Object stat info.
Definition: XrdClXRootDResponses.hh:332
SimpleFunctionWrapper(std::function< void(XRootDStatus &)> handleFunction)
Constructor.
Definition: XrdClOperationHandlers.hh:77
PipelineException(const XRootDStatus &error)
Constructor from XRootDStatus.
Definition: XrdClOperationHandlers.hh:318
static constexpr bool value
Definition: XrdClOperationHandlers.hh:46
Definition: XrdClOperationHandlers.hh:221
Definition: XrdClAnyObject.hh:32
const uint16_t errPipelineFailed
Pipeline failed and operation couldn't be executed.
Definition: XrdClStatus.hh:65
std::function< void(XRootDStatus &, ResponseType &)> fun
user defined function, functor or lambda
Definition: XrdClOperationHandlers.hh:142
Definition: XrdClOperationHandlers.hh:427
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:181
Definition: XrdClOperationHandlers.hh:40
const char * what() const noexcept
inherited from std::exception
Definition: XrdClOperationHandlers.hh:343
FunctionWrapper(std::function< void(XRootDStatus &, ResponseType &)> handleFunction)
Constructor.
Definition: XrdClOperationHandlers.hh:116