Go to the documentation of this file.
26 #ifndef __XRD_CL_OPERATION_HANDLERS_HH__
27 #define __XRD_CL_OPERATION_HANDLERS_HH__
61 std::vector<XAttrStatus> *bulk =
nullptr;
62 response->
Get( bulk );
63 *status = bulk->front().
status;
91 std::vector<XAttr> *bulk =
nullptr;
92 response->
Get( bulk );
93 *status = bulk->front().
status;
94 std::string *rsp =
new std::string( std::move( bulk->front().value ) );
110 template<
typename Response>
119 template<
typename Response>
128 template<
typename Response>
131 Response *ret =
nullptr;
143 template<
typename Response>
147 return GetResponse<Response>( rsp );
155 template<
typename Response>
166 std::function<
void(
XRootDStatus&, Response& )> handleFunction ) :
167 fun( handleFunction )
176 std::unique_ptr<XRootDStatus> delst( status );
177 std::unique_ptr<AnyObject> delrsp( response );
178 Response *res = GetResponse<Response>( status, response );
179 fun( *status, *res );
206 fun( handleFunction )
215 std::unique_ptr<XRootDStatus> delst( status );
216 std::unique_ptr<AnyObject> delrsp( response );
233 template<
typename Response,
typename Return>
253 std::unique_ptr<XRootDStatus> delst( status );
254 std::unique_ptr<AnyObject> delrsp( response );
255 Response *resp = GetResponse<Response>( status, response );
256 task( *status, *resp );
274 template<
typename Return>
294 std::unique_ptr<XRootDStatus> delst( status );
295 std::unique_ptr<AnyObject> delrsp( response );
322 f(
f ),
fun( handleFunction )
332 std::unique_ptr<XRootDStatus> delst( status );
333 std::unique_ptr<StatInfo> delrsp;
338 delrsp.reset( info );
342 fun( *status, *info );
388 const char*
what() const noexcept
414 template<
typename Response>
427 ftr =
prms.get_future();
448 prms.set_exception( ex );
464 template<
typename Response>
483 std::unique_ptr<XRootDStatus> delst( status );
484 std::unique_ptr<AnyObject> delrsp( response );
487 Response *resp = GetResponse<Response>( response );
492 this->
prms.set_value( std::move( *resp ) );
523 std::unique_ptr<XRootDStatus> delst( status );
524 std::unique_ptr<AnyObject> delrsp( response );
579 template<
typename Response>
622 template<
typename Response>
643 template<
typename Return>
681 template<
typename Return>
694 #endif // __XRD_CL_OPERATIONS_HANDLERS_HH__
Definition: XrdClOperationHandlers.hh:581
static ResponseHandler * Create(ResponseHandler &hdlr)
Definition: XrdClOperationHandlers.hh:599
static Response value
Definition: XrdClOperationHandlers.hh:113
Definition: XrdClOperationHandlers.hh:624
Handle an async response.
Definition: XrdClXRootDResponses.hh:1051
Definition: XrdClOperationHandlers.hh:112
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:292
const XRootDStatus & GetError() const
Definition: XrdClOperationHandlers.hh:396
ExOpenFuncWrapper(const Ctx< File > &f, std::function< void(XRootDStatus &, StatInfo &)> handleFunction)
Constructor.
Definition: XrdClOperationHandlers.hh:320
static ResponseHandler * Create(std::future< Response > &ftr)
Definition: XrdClOperationHandlers.hh:610
static ResponseHandler * Create(std::packaged_task< Return(XRootDStatus &)> &task)
Definition: XrdClOperationHandlers.hh:682
ResponseHandler * handler
Definition: XrdClOperationHandlers.hh:70
std::packaged_task< Return(XRootDStatus &, Response &)> task
user defined task
Definition: XrdClOperationHandlers.hh:264
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClXRootDResponses.hh:1064
std::promise< Response > prms
promise that corresponds to the future
Definition: XrdClOperationHandlers.hh:455
void SetException(const XRootDStatus &err)
Definition: XrdClOperationHandlers.hh:445
std::string ToString() const
Create a string representation.
UnpackXAttr(ResponseHandler *handler)
Definition: XrdClOperationHandlers.hh:80
std::function< void(XRootDStatus &)> fun
user defined function, functor or lambda
Definition: XrdClOperationHandlers.hh:224
Utility class for storing a pointer to operation context.
Definition: XrdClCtx.hh:38
FunctionWrapper(std::function< void(XRootDStatus &, Response &)> handleFunction)
Constructor.
Definition: XrdClOperationHandlers.hh:165
bool fulfilled
Definition: XrdClOperationHandlers.hh:456
Definition: XrdClOperationHandlers.hh:416
void Get(Type &object)
Retrieve the object being held.
Definition: XrdClAnyObject.hh:78
UnpackXAttrStatus(ResponseHandler *handler)
Definition: XrdClOperationHandlers.hh:45
void Set(Type object, bool own=true)
Definition: XrdClAnyObject.hh:59
TaskWrapper(std::packaged_task< Return(XRootDStatus &, Response &)> &&task)
Constructor.
Definition: XrdClOperationHandlers.hh:243
PipelineException & operator=(const PipelineException &ex)
Assigment operator.
Definition: XrdClOperationHandlers.hh:379
Pipeline exception, wrapps an XRootDStatus.
Definition: XrdClOperationHandlers.hh:357
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)
Definition: XrdClXRootDResponses.hh:1080
const uint16_t errInternal
Internal error.
Definition: XrdClStatus.hh:56
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:521
XRootDStatus error
the XRootDStatus associated with this exception
Definition: XrdClOperationHandlers.hh:406
virtual ~FutureWrapperBase()
Destructor.
Definition: XrdClOperationHandlers.hh:433
FunctionWrapper(std::function< void(XRootDStatus &)> handleFunction)
Constructor.
Definition: XrdClOperationHandlers.hh:204
uint16_t status
Status of the execution.
Definition: XrdClStatus.hh:144
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:52
Request status.
Definition: XrdClXRootDResponses.hh:219
ResponseHandler * handler
The actual operation handler (we don't own the pointer)
Definition: XrdClOperationHandlers.hh:569
TaskWrapper(std::packaged_task< Return(XRootDStatus &)> &&task)
Constructor.
Definition: XrdClOperationHandlers.hh:284
Definition: XrdClOperationHandlers.hh:235
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClOperationHandlers.hh:558
Definition: XrdClOperationHandlers.hh:157
static ResponseHandler * Create(std::packaged_task< Return(XRootDStatus &, Response &)> &task)
Definition: XrdClOperationHandlers.hh:644
std::function< void(XRootDStatus &, StatInfo &)> fun
user defined function, functor or lambda
Definition: XrdClOperationHandlers.hh:350
FutureWrapper(std::future< Response > &ftr)
Definition: XrdClOperationHandlers.hh:474
static ResponseHandler * Create(std::function< void(XRootDStatus &)> func)
Definition: XrdClOperationHandlers.hh:670
static ResponseHandler * Create(ResponseHandler *hdlr)
Definition: XrdClOperationHandlers.hh:588
Helper class for unpacking single XAttr from bulk response.
Definition: XrdClOperationHandlers.hh:77
PipelineException(const PipelineException &ex)
Copy constructor.
Definition: XrdClOperationHandlers.hh:371
Ctx< File > f
Definition: XrdClOperationHandlers.hh:346
static ResponseHandler * Create(std::function< void(XRootDStatus &, Response &)> func)
Definition: XrdClOperationHandlers.hh:631
bool IsOK() const
We're fine.
Definition: XrdClStatus.hh:122
std::packaged_task< Return(XRootDStatus &)> task
user defined task
Definition: XrdClOperationHandlers.hh:304
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:481
Lambda wrapper.
Definition: XrdClOperationHandlers.hh:312
Response * GetResponse(AnyObject *rsp)
Definition: XrdClOperationHandlers.hh:129
Definition: XrdClAnyObject.hh:26
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:174
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:1045
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:213
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:329
FutureWrapperBase(std::future< Response > &ftr)
Definition: XrdClOperationHandlers.hh:425
FutureWrapper(std::future< void > &ftr)
Definition: XrdClOperationHandlers.hh:514
const uint16_t stError
An error occurred that could potentially be retried.
Definition: XrdClStatus.hh:32
Object stat info.
Definition: XrdClXRootDResponses.hh:400
ResponseHandler * handler
Definition: XrdClOperationHandlers.hh:102
std::function< void(XRootDStatus &, Response &)> fun
user defined function, functor or lambda
Definition: XrdClOperationHandlers.hh:186
Definition: XrdClOperationHandlers.hh:196
PipelineException(const XRootDStatus &error)
Constructor from XRootDStatus.
Definition: XrdClOperationHandlers.hh:363
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:87
Definition: XrdClOperationHandlers.hh:276
Wrapper class for raw response handler (ResponseHandler).
Definition: XrdClOperationHandlers.hh:540
Helper class for unpacking single XAttrStatus from bulk response.
Definition: XrdClOperationHandlers.hh:42
Definition: XrdClAnyObject.hh:33
const uint16_t errPipelineFailed
Pipeline failed and operation couldn't be executed.
Definition: XrdClStatus.hh:66
Definition: XrdClOperationHandlers.hh:466
void HandleResponse(XRootDStatus *status, AnyObject *response)
Callback method.
Definition: XrdClOperationHandlers.hh:251
const char * what() const noexcept
inherited from std::exception
Definition: XrdClOperationHandlers.hh:388
RawWrapper(ResponseHandler *handler)
Definition: XrdClOperationHandlers.hh:548