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

#include <XrdClOperationHandlers.hh>

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

Public Member Functions

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

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)
Protected Member Functions inherited from XrdCl::FutureWrapperBase< Response >
void SetException (const XRootDStatus &err)
Protected Attributes inherited from XrdCl::FutureWrapperBase< Response >
bool fulfilled
std::promise< Response > prms
 promise that corresponds to the future

Detailed Description

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

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

  • Response : response type

Definition at line 511 of file XrdClOperationHandlers.hh.

Constructor & Destructor Documentation

◆ FutureWrapper()

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

Constructor,

See also
FutureWrapperBase
Parameters
ftr: the future to be linked with this handler

Definition at line 520 of file XrdClOperationHandlers.hh.

References XrdCl::FutureWrapperBase< Response >::FutureWrapperBase().

Here is the call graph for this function:

Member Function Documentation

◆ HandleResponse()

template<typename Response>
void XrdCl::FutureWrapper< Response >::HandleResponse ( XRootDStatus * status,
AnyObject * response )
inlinevirtual

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 527 of file XrdClOperationHandlers.hh.

528 {
531 if( status->IsOK() )
532 {
536 else
537 {
538 this->prms.set_value( std::move( *resp ) );
539 this->fulfilled = true;
540 }
541 }
542 else
543 this->SetException( *status );
544 }
void SetException(const XRootDStatus &err)
std::promise< Response > prms
promise that corresponds to the future
Response * GetResponse(AnyObject *rsp)

References XrdCl::errInternal, XrdCl::FutureWrapperBase< Response >::fulfilled, XrdCl::GetResponse(), XrdCl::Status::IsOK(), XrdCl::FutureWrapperBase< Response >::prms, XrdCl::FutureWrapperBase< Response >::SetException(), XrdCl::stError, and XrdCl::NullRef< Response >::value.

Here is the call graph for this function:

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