RepHandler< Req, Rep > Class Template Reference
  with the service response. More...
#include <RepHandler.hh>
| Public Member Functions | |
| RepHandler ()=default | |
| virtual std::string | RepTypeName () const | 
| Get the message type name used in the service response.  More... | |
| virtual std::string | ReqTypeName () const | 
| Get the message type name used in the service request.  More... | |
| bool | RunCallback (const std::string &_req, std::string &_rep) | 
| Executes the callback registered for this handler.  More... | |
| bool | RunLocalCallback (const transport::ProtoMsg &_msgReq, transport::ProtoMsg &_msgRep) | 
| Executes the local callback registered for this handler.  More... | |
| void | SetCallback (const std::function< bool(const Req &, Rep &)> &_cb) | 
| Set the callback for this handler.  More... | |
|  Public Member Functions inherited from IRepHandler | |
| IRepHandler () | |
| Constructor.  More... | |
| virtual | ~IRepHandler ()=default | 
| Destructor.  More... | |
| std::string | HandlerUuid () const | 
| Get the unique UUID of this handler.  More... | |
| Additional Inherited Members | |
|  Protected Attributes inherited from IRepHandler | |
| std::string | hUuid | 
| Unique handler's UUID.  More... | |
Detailed Description
template<typename Req, typename Rep>
class gz::transport::RepHandler< Req, Rep >
with the service response.
It creates a service reply handler for a pair of protobuf messages containing the request parameters and the response. 'Req' is the protobuf message type containing the input parameters of.
Constructor & Destructor Documentation
◆ RepHandler()
| 
 | default | 
Member Function Documentation
◆ RepTypeName()
| 
 | inlinevirtual | 
Get the message type name used in the service response.
- Returns
- Message type name.
Implements IRepHandler.
◆ ReqTypeName()
| 
 | inlinevirtual | 
Get the message type name used in the service request.
- Returns
- Message type name.
Implements IRepHandler.
◆ RunCallback()
| 
 | inlinevirtual | 
Executes the callback registered for this handler.
- Parameters
- 
  [in] _req Serialized data received. The data will be used to compose a specific protobuf message and will be passed to the callback function. [out] _rep Out parameter with the data serialized. 
- Returns
- Service call result.
Implements IRepHandler.
References std::endl().
◆ RunLocalCallback()
| 
 | inlinevirtual | 
Executes the local callback registered for this handler.
- Parameters
- 
  [in] _msgReq Input parameter (Protobuf message). [out] _msgRep Output parameter (Protobuf message). 
- Returns
- Service call result.
Implements IRepHandler.
References std::endl().
◆ SetCallback()
| 
 | inline | 
Set the callback for this handler.
- Parameters
- 
  [in] _cb The callback with the following parameters: - _req Protobuf message containing the service request params
- _rep Protobuf message containing the service response.
- Returns true when the service response is considered successful or false otherwise.
 
The documentation for this class was generated from the following file: