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 ResponseHandler * | Wrap (std::function< void(XRootDStatus &, AnyObject &)> func)
static ResponseHandler * | Wrap (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.

: fulfilled( false )
{
ftr = prms.get_future();
}
XrdCl::FutureWrapperBase
Definition XrdClOperationHandlers.hh:462
XrdCl::FutureWrapperBase::fulfilled
bool fulfilled
Definition XrdClOperationHandlers.hh:502
XrdCl::FutureWrapperBase::prms
std::promise< Response > prms
promise that corresponds to the future
Definition XrdClOperationHandlers.hh:501

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 | ( |  | ) |

inline virtual

Destructor.

Definition at line 479 of file XrdClOperationHandlers.hh.

{
if( !fulfilled ) SetException( XRootDStatus( stError, errPipelineFailed ) );
}
XrdCl::FutureWrapperBase::SetException
void SetException(const XRootDStatus &err)
Definition XrdClOperationHandlers.hh:491

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 | ) |

inline protected

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

Parameters

  err | : the error

Definition at line 491 of file XrdClOperationHandlers.hh.

{
std::exception_ptr ex = std::make_exception_ptr( PipelineException( err ) );
prms.set_exception( ex );
fulfilled = true;
}

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

Definition at line 502 of file XrdClOperationHandlers.hh.

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

## 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:

- XrdClOperationHandlers.hh