XRootD
Loading...
Searching...
No Matches
XrdCl::FutureWrapperBase< Response > Class Template Reference

#include <XrdClOperationHandlers.hh>

Inheritance diagram for XrdCl::FutureWrapperBase< Response >:
Collaboration diagram for XrdCl::FutureWrapperBase< Response >:

Public Member Functions

 FutureWrapperBase (std::future< Response > &ftr)
virtual ~FutureWrapperBase ()
 Destructor.
Public Member Functions inherited from XrdCl::ResponseHandler
virtual ~ResponseHandler ()
virtual void HandleResponse (XRootDStatus *status, AnyObject *response)
virtual void HandleResponseWithHosts (XRootDStatus *status, AnyObject *response, HostList *hostList)

Protected Member Functions

void SetException (const XRootDStatus &err)

Protected Attributes

bool fulfilled
std::promise< Response > prms
 promise that corresponds to the future

Additional Inherited Members

Static Public Member Functions inherited from XrdCl::ResponseHandler
static ResponseHandlerWrap (std::function< void(XRootDStatus &, AnyObject &)> func)
static ResponseHandlerWrap (std::function< void(XRootDStatus *, AnyObject *)> func)

Detailed Description

template<typename Response>
class XrdCl::FutureWrapperBase< Response >

A wrapper handler for a std::promise / std::future.

  • Response : response type

Definition at line 461 of file XrdClOperationHandlers.hh.

Constructor & Destructor Documentation

◆ FutureWrapperBase()

template<typename Response>
XrdCl::FutureWrapperBase< Response >::FutureWrapperBase ( std::future< Response > & ftr)
inline

Constructor, initializes the std::future argument from its own std::promise

Parameters
ftr: the future to be linked with this handler

Definition at line 471 of file XrdClOperationHandlers.hh.

471 : fulfilled( false )
472 {
473 ftr = prms.get_future();
474 }
std::promise< Response > prms
promise that corresponds to the future

References fulfilled, and prms.

Referenced by XrdCl::FutureWrapper< Response >::FutureWrapper().

Here is the caller graph for this function:

◆ ~FutureWrapperBase()

template<typename Response>
virtual XrdCl::FutureWrapperBase< Response >::~FutureWrapperBase ( )
inlinevirtual

Destructor.

Definition at line 479 of file XrdClOperationHandlers.hh.

480 {
482 }
void SetException(const XRootDStatus &err)

References XrdCl::errPipelineFailed, fulfilled, SetException(), and XrdCl::stError.

Here is the call graph for this function:

Member Function Documentation

◆ SetException()

template<typename Response>
void XrdCl::FutureWrapperBase< Response >::SetException ( const XRootDStatus & err)
inlineprotected

Set exception in the std::promise / std::future

Parameters
err: the error

Definition at line 491 of file XrdClOperationHandlers.hh.

492 {
494 prms.set_exception( ex );
495 fulfilled = true;
496 }

References fulfilled, and prms.

Referenced by ~FutureWrapperBase(), XrdCl::FutureWrapper< Response >::HandleResponse(), and XrdCl::FutureWrapper< void >::HandleResponse().

Here is the caller graph for this function:

Member Data Documentation

◆ fulfilled

template<typename Response>
bool XrdCl::FutureWrapperBase< Response >::fulfilled
protected

◆ prms

template<typename Response>
std::promise<Response> XrdCl::FutureWrapperBase< Response >::prms
protected

promise that corresponds to the future

Definition at line 501 of file XrdClOperationHandlers.hh.

Referenced by FutureWrapperBase(), XrdCl::FutureWrapper< Response >::HandleResponse(), and SetException().


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