Callback helper Template. More...
#include <transport/transport.hh>
Inherits CallbackHelper.
Public Member Functions | |
CallbackHelperT (const boost::function< void(const boost::shared_ptr< M const > &)> &_cb, bool _latching=false) | |
Constructor. | |
unsigned int | GetId () const |
Get the unique ID of this callback. | |
bool | GetLatching () const |
Is the callback latching? | |
std::string | GetMsgType () const |
Get the typename of the message that is handled. | |
virtual bool | HandleData (const std::string &_newdata, boost::function< void(uint32_t)> _cb, uint32_t _id) |
Process new incoming data. | |
virtual bool | HandleMessage (MessagePtr _newMsg) |
Process new incoming message. | |
virtual bool | IsLocal () const |
Is the callback local? | |
void | SetLatching (bool _latch) |
Set whether this callback is latching. | |
Protected Attributes | |
bool | latching |
True means that the callback helper will get the last published message on the topic. | |
std::mutex | latchingMutex |
Mutex to protect the latching variable. | |
Callback helper Template.
|
inline |
Constructor.
[in] | _cb | boost function to call on incoming messages |
[in] | _latching | Set to true to make the callback helper latching. |
|
inherited |
Get the unique ID of this callback.
|
inherited |
Is the callback latching?
|
inlinevirtual |
Get the typename of the message that is handled.
Reimplemented from CallbackHelper.
|
inlinevirtual |
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. |
Implements CallbackHelper.
References CallbackHelper::SetLatching().
|
inlinevirtual |
Process new incoming message.
[in] | _newMsg | Incoming message to be processed |
Implements CallbackHelper.
References CallbackHelper::SetLatching().
|
inlinevirtual |
Is the callback local?
Implements CallbackHelper.
|
inherited |
Set whether this callback is latching.
This function should only be used by the Transport library.
[in] | _latch | False to turn off latching. |
Referenced by CallbackHelperT< M >::HandleData(), RawCallbackHelper::HandleData(), CallbackHelperT< M >::HandleMessage(), and RawCallbackHelper::HandleMessage().
|
protectedinherited |
True means that the callback helper will get the last published message on the topic.
|
mutableprotectedinherited |
Mutex to protect the latching variable.