XRootD
XrdCl::FutureWrapper< void > Class Reference

A wrapper handler for a std::promise / std::future, overload for void type. More...

#include <XrdClOperationHandlers.hh>

+ Inheritance diagram for XrdCl::FutureWrapper< void >:
+ Collaboration diagram for XrdCl::FutureWrapper< void >:

Public Member Functions

 FutureWrapper (std::future< void > &ftr)
 
void HandleResponse (XRootDStatus *status, AnyObject *response)
 Callback method. More...
 
- Public Member Functions inherited from XrdCl::FutureWrapperBase< void >
 FutureWrapperBase (std::future< void > &ftr)
 
virtual ~FutureWrapperBase ()
 Destructor. More...
 
- 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< void >
void SetException (const XRootDStatus &err)
 
- Protected Attributes inherited from XrdCl::FutureWrapperBase< void >
bool fulfilled
 
std::promise< void > prms
 promise that corresponds to the future More...
 

Detailed Description

A wrapper handler for a std::promise / std::future, overload for void type.

Definition at line 551 of file XrdClOperationHandlers.hh.

Constructor & Destructor Documentation

◆ FutureWrapper()

XrdCl::FutureWrapper< void >::FutureWrapper ( std::future< void > &  ftr)
inline

Constructor,

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

Definition at line 560 of file XrdClOperationHandlers.hh.

560  : FutureWrapperBase<void>( ftr )
561  {
562  }

Member Function Documentation

◆ HandleResponse()

void XrdCl::FutureWrapper< void >::HandleResponse ( XRootDStatus status,
AnyObject response 
)
inlinevirtual

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 567 of file XrdClOperationHandlers.hh.

568  {
569  std::unique_ptr<XRootDStatus> delst( status );
570  std::unique_ptr<AnyObject> delrsp( response );
571  if( status->IsOK() )
572  {
573  prms.set_value();
574  fulfilled = true;
575  }
576  else
577  SetException( *status );
578  }
void SetException(const XRootDStatus &err)
std::promise< void > prms
promise that corresponds to the future

References XrdCl::FutureWrapperBase< Response >::fulfilled, XrdCl::Status::IsOK(), XrdCl::FutureWrapperBase< Response >::prms, and XrdCl::FutureWrapperBase< Response >::SetException().

+ Here is the call graph for this function:

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