XRootD
XrdCl::ExOpenFuncWrapper Class Reference

Lambda wrapper. More...

#include <XrdClOperationHandlers.hh>

+ Inheritance diagram for XrdCl::ExOpenFuncWrapper:
+ Collaboration diagram for XrdCl::ExOpenFuncWrapper:

Public Member Functions

 ExOpenFuncWrapper (const Ctx< File > &f, std::function< void(XRootDStatus &, StatInfo &)> handleFunction)
 Constructor. More...
 
 ExOpenFuncWrapper (const Ctx< File > &f, std::function< void(XRootDStatus &, StatInfo &, 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.

Definition at line 343 of file XrdClOperationHandlers.hh.

Constructor & Destructor Documentation

◆ ExOpenFuncWrapper() [1/2]

XrdCl::ExOpenFuncWrapper::ExOpenFuncWrapper ( const Ctx< File > &  f,
std::function< void(XRootDStatus &, StatInfo &)>  handleFunction 
)
inline

Constructor.

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

Definition at line 352 of file XrdClOperationHandlers.hh.

353  :
354  f( f ), fun( [handleFunction]( XRootDStatus &s, StatInfo &i, HostList& ){ handleFunction( s, i ); } )
355  {
356  }
std::vector< HostInfo > HostList

◆ ExOpenFuncWrapper() [2/2]

XrdCl::ExOpenFuncWrapper::ExOpenFuncWrapper ( const Ctx< File > &  f,
std::function< void(XRootDStatus &, StatInfo &, HostList &)>  handleFunction 
)
inline

Constructor.

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

Definition at line 363 of file XrdClOperationHandlers.hh.

364  :
365  f( f ), fun( handleFunction )
366  {
367  }

Member Function Documentation

◆ HandleResponseWithHosts()

void XrdCl::ExOpenFuncWrapper::HandleResponseWithHosts ( XRootDStatus status,
AnyObject response,
HostList hostList 
)
inlinevirtual

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 372 of file XrdClOperationHandlers.hh.

373  {
374  delete response;
375  std::unique_ptr<XRootDStatus> delst( status );
376  std::unique_ptr<StatInfo> delrsp;
377  std::unique_ptr<HostList> delhl;
378  StatInfo *info = nullptr;
379  if( status->IsOK() )
380  {
381  XRootDStatus st = f->Stat( false, info );
382  delrsp.reset( info );
383  }
384  else
385  info = &NullRef<StatInfo>::value;
386  fun( *status, *info, *hostList );
387  }

References XrdCl::Status::IsOK().

+ Here is the call graph for this function:

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