ReqHandler.hh
Go to the documentation of this file.
bool Requested() const
Returns if this service call request has already been requested.
Definition: ReqHandler.hh:97
virtual std::string ReqTypeName() const
Get the message type name used in the service request.
Definition: ReqHandler.hh:284
void NotifyResult(const std::string &_rep, const bool _result)
Executes the callback registered for this handler and notify a potential requester waiting on a block...
Definition: ReqHandler.hh:370
virtual std::string RepTypeName() const
Get the message type name used in the service response.
Definition: ReqHandler.hh:290
std::string NodeUuid() const
Get the node UUID.
Definition: ReqHandler.hh:76
It creates a reply handler for the specific protobuf messages used. 'Req' is a protobuf message type ...
Definition: ReqHandler.hh:188
T endl(T... args)
void SetCallback(const std::function< void(const Rep &_rep, const bool _result)> &_cb)
Set the callback for this handler.
Definition: ReqHandler.hh:220
std::string Response() const
Get the service response as raw bytes.
Definition: ReqHandler.hh:83
ReqHandler(const std::string &_nUuid)
Definition: ReqHandler.hh:314
STL class.
void SetMessage(const google::protobuf::Message *_reqMsg)
Set the REQ protobuf message for this handler.
Definition: ReqHandler.hh:322
A portable class for representing a Universally Unique Identifier.
Definition: Uuid.hh:45
Interface class used to manage a request handler.
Definition: ReqHandler.hh:48
std::shared_ptr< Rep > CreateMsg(const std::string &_data) const
Create a specific protobuf message given its serialized data.
Definition: ReqHandler.hh:200
std::string HandlerUuid() const
Returns the unique handler UUID.
Definition: ReqHandler.hh:116
bool result
Stores the result of the service call.
Definition: ReqHandler.hh:171
bool Serialize(std::string &_buffer) const
Serialize the Req protobuf message stored.
Definition: ReqHandler.hh:250
ignition::transport::ReqHandler< google::protobuf::Message, google::protobuf::Message >::RepTypeName
virtual std::string RepTypeName() const
Get the message type name used in the service response.
Definition: ReqHandler.hh:393
void Requested(const bool _value)
Mark the service call as requested (or not).
Definition: ReqHandler.hh:104
bool WaitUntil(Lock &_lock, const unsigned int _timeout)
Block the current thread until the response to the service request is available or until the timeout ...
Definition: ReqHandler.hh:128
ignition::transport::ReqHandler< google::protobuf::Message, google::protobuf::Message >::ReqTypeName
virtual std::string ReqTypeName() const
Get the message type name used in the service request.
Definition: ReqHandler.hh:380
T now(T... args)
bool repAvailable
When there is a blocking service call request, the call can be unlocked when a service call REP is av...
Definition: ReqHandler.hh:180
void SetResponse(const Rep *)
This function is only used for compatibility with SetResponse() when [REP = google::protobuf::Message...
Definition: ReqHandler.hh:245
void NotifyResult(const std::string &_rep, const bool _result)
Executes the callback registered for this handler and notify a potential requester waiting on a block...
Definition: ReqHandler.hh:263
std::string hUuid
Unique handler's UUID.
Definition: ReqHandler.hh:162
ignition::transport::ReqHandler< google::protobuf::Message, google::protobuf::Message >::SetResponse
void SetResponse(const google::protobuf::Message *_repMsg)
Set the REP protobuf message for this handler.
Definition: ReqHandler.hh:338
IReqHandler(const std::string &_nUuid)
Constructor.
Definition: ReqHandler.hh:52
ReqHandler(const std::string &_nUuid)
Definition: ReqHandler.hh:192
Definition: AdvertiseOptions.hh:28
std::string rep
Stores the service response as raw bytes.
Definition: ReqHandler.hh:159
void SetMessage(const Req *_reqMsg)
Set the REQ protobuf message for this handler.
Definition: ReqHandler.hh:229
bool Result() const
Get the result of the service response.
Definition: ReqHandler.hh:90
bool Serialize(std::string &_buffer) const
Serialize the Req protobuf message stored.
Definition: ReqHandler.hh:351