Public Member Functions | List of all members
ignition::transport::SubscriptionHandler< T > Class Template Reference

It creates a subscription handler for a specific protobuf message. More...

#include <SubscriptionHandler.hh>

Inheritance diagram for ignition::transport::SubscriptionHandler< T >:
Inheritance graph
[legend]

Public Member Functions

 SubscriptionHandler (const std::string &_nUuid)
 
const std::shared_ptr< transport::ProtoMsgCreateMsg (const std::string &_data) const
 Create a specific protobuf message given its serialized data. More...
 
bool RunLocalCallback (const transport::ProtoMsg &_msg) const
 Executes the local callback registered for this handler. More...
 
void SetCallback (const std::function< void(const T &_msg)> &_cb)
 Set the callback for this handler. More...
 
std::string TypeName ()
 Get the type of the messages from which this subscriber handler is subscribed. More...
 
- Public Member Functions inherited from ignition::transport::ISubscriptionHandler
 ISubscriptionHandler (const std::string &_nUuid)
 Constructor. More...
 
virtual ~ISubscriptionHandler ()
 Destructor. More...
 
std::string HandlerUuid () const
 Get the unique UUID of this handler. More...
 
std::string NodeUuid () const
 Get the node UUID. More...
 

Additional Inherited Members

- Protected Attributes inherited from ignition::transport::ISubscriptionHandler
std::string hUuid
 Unique handler's UUID. More...
 

Detailed Description

template<typename T>
class ignition::transport::SubscriptionHandler< T >

It creates a subscription handler for a specific protobuf message.

'T' is the Protobuf message type that will be used for this particular handler.

Constructor & Destructor Documentation

template<typename T >
ignition::transport::SubscriptionHandler< T >::SubscriptionHandler ( const std::string &  _nUuid)
inline

Member Function Documentation

template<typename T >
const std::shared_ptr<transport::ProtoMsg> ignition::transport::SubscriptionHandler< T >::CreateMsg ( const std::string &  _data) const
inlinevirtual

Create a specific protobuf message given its serialized data.

Parameters
[in]_dataThe serialized data.
Returns
Pointer to the specific protobuf message.

Implements ignition::transport::ISubscriptionHandler.

template<typename T >
bool ignition::transport::SubscriptionHandler< T >::RunLocalCallback ( const transport::ProtoMsg _msg) const
inlinevirtual

Executes the local callback registered for this handler.

Parameters
[in]_msgProtobuf message received.
Returns
True when success, false otherwise.

Implements ignition::transport::ISubscriptionHandler.

template<typename T >
void ignition::transport::SubscriptionHandler< T >::SetCallback ( const std::function< void(const T &_msg)> &  _cb)
inline

Set the callback for this handler.

Parameters
[in]_cbThe callback with the following parameters:
[in]_msgProtobuf message containing the topic update.
template<typename T >
std::string ignition::transport::SubscriptionHandler< T >::TypeName ( )
inlinevirtual

Get the type of the messages from which this subscriber handler is subscribed.

Returns
String representation of the message type.

Implements ignition::transport::ISubscriptionHandler.


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