XRootD
Loading...
Searching...
No Matches
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.
 
 FunctionWrapper (std::function< void(XRootDStatus &, Response &, HostList &)> handleFunction)
 Constructor.
 
void HandleResponseWithHosts (XRootDStatus *status, AnyObject *response, HostList *hostList)
 Callback method.
 
- Public Member Functions inherited from XrdCl::ResponseHandler
virtual ~ResponseHandler ()
 
virtual void HandleResponse (XRootDStatus *status, AnyObject *response)
 
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)
 

Detailed Description

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

Lambda wrapper

  • ResponseType : type of response returned by the server

Definition at line 156 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 165 of file XrdClOperationHandlers.hh.

166 :
167 fun( [handleFunction]( XRootDStatus &s, Response &r, HostList& ){ handleFunction( s, r ); } )
168 {
169 }
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 176 of file XrdClOperationHandlers.hh.

177 :
178 fun( handleFunction )
179 {
180 }

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

186 {
187 std::unique_ptr<XRootDStatus> delst( status );
188 std::unique_ptr<AnyObject> delrsp( response );
189 std::unique_ptr<HostList> delhl( hostList );
190 Response *res = GetResponse<Response>( status, response );
191 fun( *status, *res, *hostList );
192 }

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