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

345  :
346  f( f ), fun( [handleFunction]( XRootDStatus &s, StatInfo &i, HostList& ){ handleFunction( s, i ); } )
347  {
348  }
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 355 of file XrdClOperationHandlers.hh.

356  :
357  f( f ), fun( handleFunction )
358  {
359  }

Member Function Documentation

◆ HandleResponseWithHosts()

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

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 364 of file XrdClOperationHandlers.hh.

365  {
366  delete response;
367  std::unique_ptr<XRootDStatus> delst( status );
368  std::unique_ptr<StatInfo> delrsp;
369  std::unique_ptr<HostList> delhl;
370  StatInfo *info = nullptr;
371  if( status->IsOK() )
372  {
373  XRootDStatus st = f->Stat( false, info );
374  delrsp.reset( info );
375  }
376  else
377  info = &NullRef<StatInfo>::value;
378  fun( *status, *info, *hostList );
379  }

References XrdCl::Status::IsOK().

+ Here is the call graph for this function:

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