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

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

354  :
355  f( f ), fun( handleFunction )
356  {
357  }

Member Function Documentation

◆ HandleResponseWithHosts()

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

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 362 of file XrdClOperationHandlers.hh.

363  {
364  std::unique_ptr<XRootDStatus> delst( status );
365  std::unique_ptr<AnyObject> delrsp( response );
366  std::unique_ptr<HostList> delhl( hostList );
367 
368  if( !status->IsOK() ) {
369  StatInfo dummy{};
370  fun( *status, dummy, *hostList );
371  return;
372  }
373 
374  StatInfo *info = nullptr;
375  XRootDStatus st = f->Stat( false, info );
376  fun( *status, *info, *hostList );
377  delete info;
378  }

References XrdCl::Status::IsOK().

+ Here is the call graph for this function:

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