A helper class to handle callbacks when messages arrive. More...
#include <transport/transport.hh>
Public Member Functions | |
CallbackHelper (bool _latching=false) | |
Constructor. More... | |
virtual | ~CallbackHelper () |
Destructor. More... | |
unsigned int | GetId () const |
Get the unique ID of this callback. More... | |
bool | GetLatching () const |
Is the callback latching? More... | |
virtual std::string | GetMsgType () const |
Get the typename of the message that is handled. More... | |
virtual bool | HandleData (const std::string &_newdata, boost::function< void(uint32_t)> _cb, uint32_t _id)=0 |
Process new incoming data. More... | |
virtual bool | HandleMessage (MessagePtr _newMsg)=0 |
Process new incoming message. More... | |
virtual bool | IsLocal () const =0 |
Is the callback local? More... | |
void | SetLatching (bool _latch) |
Set whether this callback is latching. More... | |
Protected Attributes | |
bool | latching |
True means that the callback helper will get the last published message on the topic. More... | |
A helper class to handle callbacks when messages arrive.
gazebo::transport::CallbackHelper::CallbackHelper | ( | bool | _latching = false | ) |
Constructor.
[in] | _latching | Set to true to make the callback helper latching. |
|
virtual |
Destructor.
unsigned int gazebo::transport::CallbackHelper::GetId | ( | ) | const |
Get the unique ID of this callback.
bool gazebo::transport::CallbackHelper::GetLatching | ( | ) | const |
Is the callback latching?
|
virtual |
Get the typename of the message that is handled.
Reimplemented in gazebo::transport::RawCallbackHelper, and gazebo::transport::CallbackHelperT< M >.
|
pure virtual |
Process new incoming data.
[in] | _newdata | Incoming data to be processed |
[in] | _cb | If non-null, callback to be invoked which signals that transmission is complete. |
[in] | _id | ID associated with the message data. |
Implemented in gazebo::transport::RawCallbackHelper, gazebo::transport::CallbackHelperT< M >, and gazebo::transport::SubscriptionTransport.
|
pure virtual |
Process new incoming message.
[in] | _newMsg | Incoming message to be processed |
Implemented in gazebo::transport::RawCallbackHelper, gazebo::transport::CallbackHelperT< M >, and gazebo::transport::SubscriptionTransport.
|
pure virtual |
Is the callback local?
Implemented in gazebo::transport::RawCallbackHelper, gazebo::transport::CallbackHelperT< M >, and gazebo::transport::SubscriptionTransport.
void gazebo::transport::CallbackHelper::SetLatching | ( | bool | _latch | ) |
Set whether this callback is latching.
This function should only be used by the Transport library.
[in] | _latch | False to turn off latching. |
|
protected |
True means that the callback helper will get the last published message on the topic.