XRootD
Loading...
Searching...
No Matches
XrdCl::UnpackXAttr Class Reference

Helper class for unpacking single XAttr from bulk response. More...

#include <XrdClOperationHandlers.hh>

+ Inheritance diagram for XrdCl::UnpackXAttr:
+ Collaboration diagram for XrdCl::UnpackXAttr:

Public Member Functions

 UnpackXAttr (ResponseHandler *handler)
 
void HandleResponse (XRootDStatus *status, AnyObject *response)
 Callback method.
 
- Public Member Functions inherited from XrdCl::ResponseHandler
virtual ~ResponseHandler ()
 
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

Helper class for unpacking single XAttr from bulk response.

Definition at line 76 of file XrdClOperationHandlers.hh.

Constructor & Destructor Documentation

◆ UnpackXAttr()

XrdCl::UnpackXAttr::UnpackXAttr ( ResponseHandler handler)
inline

Definition at line 80 of file XrdClOperationHandlers.hh.

80 : handler( handler )
81 {
82 }

Member Function Documentation

◆ HandleResponse()

void XrdCl::UnpackXAttr::HandleResponse ( XRootDStatus status,
AnyObject response 
)
inlinevirtual

Callback method.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 87 of file XrdClOperationHandlers.hh.

88 {
89 // status is always OK for bulk response
90
91 std::vector<XAttr> *bulk = nullptr;
92 response->Get( bulk );
93 *status = bulk->front().status;
94 std::string *rsp = new std::string( std::move( bulk->front().value ) );
95 delete bulk;
96 response->Set( rsp );
97 handler->HandleResponse( status, response );
98 }
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)

References XrdCl::AnyObject::Get(), XrdCl::ResponseHandler::HandleResponse(), XrdCl::AnyObject::Set(), and XrdCl::Status::status.

+ Here is the call graph for this function:

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