XRootD
XrdCl::FunctionWrapper< void > Class Reference

#include <XrdClOperationHandlers.hh>

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

Public Member Functions

 FunctionWrapper (std::function< void(XRootDStatus &)> handleFunction)
 Constructor. More...
 
 FunctionWrapper (std::function< void(XRootDStatus &, HostList &)> handleFunction)
 Constructor. More...
 
void HandleResponseWithHosts (XRootDStatus *status, AnyObject *response, HostList *hostList)
 Callback method. More...
 
- Public Member Functions inherited from XrdCl::ResponseHandler
virtual ~ResponseHandler ()
 
virtual void HandleResponse (XRootDStatus *status, AnyObject *response)
 

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

Lambda wrapper

Template specialization for responses that return no value (void)

Definition at line 207 of file XrdClOperationHandlers.hh.

Constructor & Destructor Documentation

◆ FunctionWrapper() [1/2]

XrdCl::FunctionWrapper< void >::FunctionWrapper ( std::function< void(XRootDStatus &)>  handleFunction)
inline

Constructor.

Parameters
func: function, functor or lambda (1 argument)

Definition at line 216 of file XrdClOperationHandlers.hh.

217  :
218  fun( [handleFunction]( XRootDStatus& s, HostList& ){ handleFunction( s ); } )
219  {
220  }
std::vector< HostInfo > HostList

◆ FunctionWrapper() [2/2]

XrdCl::FunctionWrapper< void >::FunctionWrapper ( std::function< void(XRootDStatus &, HostList &)>  handleFunction)
inline

Constructor.

Parameters
func: function, functor or lambda (2 arguments)

Definition at line 227 of file XrdClOperationHandlers.hh.

228  :
229  fun( handleFunction )
230  {
231  }

Member Function Documentation

◆ HandleResponseWithHosts()

void XrdCl::FunctionWrapper< void >::HandleResponseWithHosts ( XRootDStatus status,
AnyObject response,
HostList hostList 
)
inlinevirtual

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 236 of file XrdClOperationHandlers.hh.

237  {
238  std::unique_ptr<XRootDStatus> delst( status );
239  std::unique_ptr<AnyObject> delrsp( response );
240  std::unique_ptr<HostList> delhl( hostList );
241  fun( *status, *hostList );
242  }

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