XRootD
XrdCl::FunctionWrapper< Response > Class Template Reference

#include <XrdClOperationHandlers.hh>

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

Public Member Functions

 FunctionWrapper (std::function< void(XRootDStatus &, Response &)> handleFunction)
 Constructor. More...
 
 FunctionWrapper (std::function< void(XRootDStatus &, Response &, 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

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

Lambda wrapper

  • ResponseType : type of response returned by the server

Definition at line 164 of file XrdClOperationHandlers.hh.

Constructor & Destructor Documentation

◆ FunctionWrapper() [1/2]

template<typename Response >
XrdCl::FunctionWrapper< Response >::FunctionWrapper ( std::function< void(XRootDStatus &, Response &)>  handleFunction)
inline

Constructor.

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

Definition at line 173 of file XrdClOperationHandlers.hh.

174  :
175  fun( [handleFunction]( XRootDStatus &s, Response &r, HostList& ){ handleFunction( s, r ); } )
176  {
177  }
std::vector< HostInfo > HostList

◆ FunctionWrapper() [2/2]

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

Constructor.

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

Definition at line 184 of file XrdClOperationHandlers.hh.

185  :
186  fun( handleFunction )
187  {
188  }

Member Function Documentation

◆ HandleResponseWithHosts()

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

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 193 of file XrdClOperationHandlers.hh.

194  {
195  std::unique_ptr<XRootDStatus> delst( status );
196  std::unique_ptr<AnyObject> delrsp( response );
197  std::unique_ptr<HostList> delhl( hostList );
198  Response *res = GetResponse<Response>( status, response );
199  fun( *status, *res, *hostList );
200  }

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