XRootD
Loading...
Searching...
No Matches
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)
 
 FutureWrapper (std::future< void > &ftr)
 
void HandleResponse (XRootDStatus *status, AnyObject *response)
 Callback method.
 
void HandleResponse (XRootDStatus *status, AnyObject *response)
 Callback method.
 
- Public Member Functions inherited from XrdCl::FutureWrapperBase< void >
 FutureWrapperBase (std::future< void > &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< 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
 

Detailed Description

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

Definition at line 543 of file XrdClOperationHandlers.hh.

Constructor & Destructor Documentation

◆ FutureWrapper() [1/2]

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 552 of file XrdClOperationHandlers.hh.

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

+ Here is the call graph for this function:

◆ FutureWrapper() [2/2]

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 512 of file XrdClOperationHandlers.hh.

513 {
514 }
FutureWrapperBase(std::future< void > &ftr)

Member Function Documentation

◆ HandleResponse() [1/2]

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

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 519 of file XrdClOperationHandlers.hh.

520 {
523 if( status->IsOK() )
524 {
528 else
529 {
530 this->prms.set_value( std::move( *resp ) );
531 this->fulfilled = true;
532 }
533 }
534 else
535 this->SetException( *status );
536 }
void SetException(const XRootDStatus &err)
Response * GetResponse(AnyObject *rsp)

◆ HandleResponse() [2/2]

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

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 559 of file XrdClOperationHandlers.hh.

560 {
563 if( status->IsOK() )
564 {
565 prms.set_value();
566 fulfilled = true;
567 }
568 else
570 }

References XrdCl::FutureWrapperBase< void >::fulfilled, XrdCl::Status::IsOK(), XrdCl::FutureWrapperBase< void >::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: