XRootD
XrdCl::SyncResponseHandler Class Reference

Synchronize the response. More...

#include <XrdClMessageUtils.hh>

+ Inheritance diagram for XrdCl::SyncResponseHandler:
+ Collaboration diagram for XrdCl::SyncResponseHandler:

Public Member Functions

 SyncResponseHandler ()
 Constructor. More...
 
virtual ~SyncResponseHandler ()
 Destructor. More...
 
AnyObjectGetResponse ()
 Get the response. More...
 
XRootDStatusGetStatus ()
 Get the status. More...
 
virtual void HandleResponse (XRootDStatus *status, AnyObject *response)
 Handle the response. More...
 
void WaitForResponse ()
 Wait for the arrival of the response. More...
 
- 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

Synchronize the response.

Definition at line 43 of file XrdClMessageUtils.hh.

Constructor & Destructor Documentation

◆ SyncResponseHandler()

XrdCl::SyncResponseHandler::SyncResponseHandler ( )
inline

Constructor.

Definition at line 49 of file XrdClMessageUtils.hh.

49  :
50  pStatus(0),
51  pResponse(0),
52  pCondVar(0) {}

◆ ~SyncResponseHandler()

virtual XrdCl::SyncResponseHandler::~SyncResponseHandler ( )
inlinevirtual

Destructor.

Definition at line 57 of file XrdClMessageUtils.hh.

58  {
59  }

Member Function Documentation

◆ GetResponse()

AnyObject* XrdCl::SyncResponseHandler::GetResponse ( )
inline

Get the response.

Definition at line 85 of file XrdClMessageUtils.hh.

86  {
87  return pResponse;
88  }

Referenced by XrdCl::MessageUtils::WaitForResponse().

+ Here is the caller graph for this function:

◆ GetStatus()

XRootDStatus* XrdCl::SyncResponseHandler::GetStatus ( )
inline

Get the status.

Definition at line 77 of file XrdClMessageUtils.hh.

78  {
79  return pStatus;
80  }

Referenced by XrdCl::MessageUtils::WaitForResponse(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the caller graph for this function:

◆ HandleResponse()

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

Handle the response.

Reimplemented from XrdCl::ResponseHandler.

Definition at line 65 of file XrdClMessageUtils.hh.

67  {
68  XrdSysCondVarHelper scopedLock(pCondVar);
69  pStatus = status;
70  pResponse = response;
71  pCondVar.Broadcast();
72  }

References XrdSysCondVar::Broadcast().

Referenced by XrdCl::LocalFileHandler::QueueTask().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WaitForResponse()

void XrdCl::SyncResponseHandler::WaitForResponse ( )
inline

Wait for the arrival of the response.

Definition at line 93 of file XrdClMessageUtils.hh.

94  {
95  XrdSysCondVarHelper scopedLock(pCondVar);
96  while (pStatus == 0) {
97  pCondVar.Wait();
98  }
99  }

References XrdSysCondVar::Wait().

Referenced by XrdCl::MessageUtils::WaitForResponse(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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