gz/transport/ReqHandler.hh
ReqHandler(const std::string &_nUuid)
Definition: gz/transport/ReqHandler.hh:315
Definition: gz/transport/AdvertiseOptions.hh:28
STL class.
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: gz/transport/ReqHandler.hh:264
std::string rep
Stores the service response as raw bytes.
Definition: gz/transport/ReqHandler.hh:159
bool Result() const
Get the result of the service response.
Definition: gz/transport/ReqHandler.hh:90
It creates a reply handler for the specific protobuf messages used. 'Req' is a protobuf message type ...
Definition: gz/transport/ReqHandler.hh:188
std::condition_variable_any condition
Condition variable used to wait until a service call REP is available.
Definition: gz/transport/ReqHandler.hh:156
IReqHandler(const std::string &_nUuid)
Constructor.
Definition: gz/transport/ReqHandler.hh:52
virtual std::string RepTypeName() const
Get the message type name used in the service response.
Definition: gz/transport/ReqHandler.hh:291
std::string NodeUuid() const
Get the node UUID.
Definition: gz/transport/ReqHandler.hh:76
std::string hUuid
Unique handler's UUID.
Definition: gz/transport/ReqHandler.hh:162
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: gz/transport/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: gz/transport/ReqHandler.hh:381
bool Requested() const
Returns if this service call request has already been requested.
Definition: gz/transport/ReqHandler.hh:97
void SetResponse(const Rep *_repMsg)
This function is only used for compatibility with SetResponse() when [REP = google::protobuf::Message...
Definition: gz/transport/ReqHandler.hh:245
void Requested(const bool _value)
Mark the service call as requested (or not).
Definition: gz/transport/ReqHandler.hh:104
ReqHandler(const std::string &_nUuid)
Definition: gz/transport/ReqHandler.hh:192
bool result
Stores the result of the service call.
Definition: gz/transport/ReqHandler.hh:171
void SetMessage(const google::protobuf::Message *_reqMsg)
Set the REQ protobuf message for this handler.
Definition: gz/transport/ReqHandler.hh:323
virtual bool Serialize(std::string &_buffer) const =0
Serialize the Req protobuf message stored.
A portable class for representing a Universally Unique Identifier.
Definition: gz/transport/Uuid.hh:45
Interface class used to manage a request handler.
Definition: gz/transport/ReqHandler.hh:48
virtual std::string ReqTypeName() const =0
Get the message type name used in the service request.
void SetMessage(const Req *_reqMsg)
Set the REQ protobuf message for this handler.
Definition: gz/transport/ReqHandler.hh:229
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: gz/transport/ReqHandler.hh:371
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: gz/transport/ReqHandler.hh:394
void SetCallback(const std::function< void(const Rep &_rep, const bool _result)> &_cb)
Set the callback for this handler.
Definition: gz/transport/ReqHandler.hh:220
bool Serialize(std::string &_buffer) const
Serialize the Req protobuf message stored.
Definition: gz/transport/ReqHandler.hh:251
virtual std::string RepTypeName() const =0
Get the message type name used in the service response.
T notify_one(T... args)
std::string HandlerUuid() const
Returns the unique handler UUID.
Definition: gz/transport/ReqHandler.hh:116
T endl(T... args)
T wait_until(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: gz/transport/ReqHandler.hh:180
bool Serialize(std::string &_buffer) const
Serialize the Req protobuf message stored.
Definition: gz/transport/ReqHandler.hh:352
std::string Response() const
Get the service response as raw bytes.
Definition: gz/transport/ReqHandler.hh:83
virtual void NotifyResult(const std::string &_rep, const bool _result)=0
Executes the callback registered for this handler and notify a potential requester waiting on a block...
std::shared_ptr< Rep > CreateMsg(const std::string &_data) const
Create a specific protobuf message given its serialized data.
Definition: gz/transport/ReqHandler.hh:200
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: gz/transport/ReqHandler.hh:339
virtual std::string ReqTypeName() const
Get the message type name used in the service request.
Definition: gz/transport/ReqHandler.hh:285
T now(T... args)