All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ignition::transport::RepHandler< Req, Rep > Class Template Reference

with the service response. More...

#include <RepHandler.hh>

Inheritance diagram for ignition::transport::RepHandler< Req, Rep >:
Inheritance graph
[legend]

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...
 
void RunCallback (const std::string &_req, std::string &_rep, bool &_result)
 Executes the callback registered for this handler. More...
 
void RunLocalCallback (const transport::ProtoMsg &_msgReq, transport::ProtoMsg &_msgRep, bool &_result)
 Executes the local callback registered for this handler. More...
 
void SetCallback (const std::function< void(const Req &, Rep &, bool &)> &_cb)
 Set the callback for this handler. More...
 
- Public Member Functions inherited from ignition::transport::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 ignition::transport::IRepHandler
std::string hUuid
 Unique handler's UUID. More...
 

Detailed Description

template<typename Req, typename Rep>
class ignition::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

template<typename Req , typename Rep >
ignition::transport::RepHandler< Req, Rep >::RepHandler ( )
default

Member Function Documentation

template<typename Req , typename Rep >
virtual std::string ignition::transport::RepHandler< Req, Rep >::RepTypeName ( ) const
inlinevirtual

Get the message type name used in the service response.

Returns
Message type name.

Implements ignition::transport::IRepHandler.

template<typename Req , typename Rep >
virtual std::string ignition::transport::RepHandler< Req, Rep >::ReqTypeName ( ) const
inlinevirtual

Get the message type name used in the service request.

Returns
Message type name.

Implements ignition::transport::IRepHandler.

template<typename Req , typename Rep >
void ignition::transport::RepHandler< Req, Rep >::RunCallback ( const std::string &  _req,
std::string &  _rep,
bool &  _result 
)
inlinevirtual

Executes the callback registered for this handler.

Parameters
[in]_reqSerialized data received. The data will be used to compose a specific protobuf message and will be passed to the callback function.
[out]_repOut parameter with the data serialized.
[out]_resultService call result.

Implements ignition::transport::IRepHandler.

template<typename Req , typename Rep >
void ignition::transport::RepHandler< Req, Rep >::RunLocalCallback ( const transport::ProtoMsg _msgReq,
transport::ProtoMsg _msgRep,
bool &  _result 
)
inlinevirtual

Executes the local callback registered for this handler.

Parameters
[in]_msgReqInput parameter (Protobuf message).
[out]_msgRepOutput parameter (Protobuf message).
[out]_resultService call result.

Implements ignition::transport::IRepHandler.

template<typename Req , typename Rep >
void ignition::transport::RepHandler< Req, Rep >::SetCallback ( const std::function< void(const Req &, Rep &, bool &)> &  _cb)
inline

Set the callback for this handler.

Parameters
[in]_cbThe callback with the following parameters:
[in]_reqProtobuf message containing the service request params
[out]_repProtobuf message containing the service response.
[out]_resultTrue when the service response is considered successful or false otherwise.

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