All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
gazebo::transport::CallbackHelper Class Reference

A helper class to handle callbacks when messages arrive. More...

#include <transport/transport.hh>

Inheritance diagram for gazebo::transport::CallbackHelper:
Inheritance graph
[legend]

Public Member Functions

 CallbackHelper (bool _latching=false)
 Constructor.
virtual ~CallbackHelper ()
 Destructor.
unsigned int GetId () const
 Get the unique ID of this callback.
bool GetLatching () const
 Is the callback latching?
virtual 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)=0
 Process new incoming data.
virtual bool HandleMessage (MessagePtr _newMsg)=0
 Process new incoming message.
virtual bool IsLocal () const =0
 Is the callback local?

Protected Attributes

bool latching
 True means that the callback helper will get the last published message on the topic.

Detailed Description

A helper class to handle callbacks when messages arrive.

Constructor & Destructor Documentation

gazebo::transport::CallbackHelper::CallbackHelper ( bool  _latching = false)

Constructor.

Parameters
[in]_latchingSet to true to make the callback helper latching.
virtual gazebo::transport::CallbackHelper::~CallbackHelper ( )
virtual

Destructor.

Member Function Documentation

unsigned int gazebo::transport::CallbackHelper::GetId ( ) const

Get the unique ID of this callback.

Returns
The unique ID of this callback.
bool gazebo::transport::CallbackHelper::GetLatching ( ) const

Is the callback latching?

Returns
true if the callback is latching, false otherwise
virtual std::string gazebo::transport::CallbackHelper::GetMsgType ( ) const
virtual

Get the typename of the message that is handled.

Returns
String representation of the message type

Reimplemented in gazebo::transport::RawCallbackHelper, and gazebo::transport::CallbackHelperT< M >.

virtual bool gazebo::transport::CallbackHelper::HandleData ( const std::string &  _newdata,
boost::function< void(uint32_t)>  _cb,
uint32_t  _id 
)
pure virtual

Process new incoming data.

Parameters
[in]_newdataIncoming data to be processed
Returns
true if successfully processed; false otherwise
Parameters
[in]_cbIf non-null, callback to be invoked which signals that transmission is complete.
[in]_idID associated with the message data.

Implemented in gazebo::transport::RawCallbackHelper, gazebo::transport::CallbackHelperT< M >, and gazebo::transport::SubscriptionTransport.

virtual bool gazebo::transport::CallbackHelper::HandleMessage ( MessagePtr  _newMsg)
pure virtual

Process new incoming message.

Parameters
[in]_newMsgIncoming message to be processed
Returns
true if successfully processed; false otherwise

Implemented in gazebo::transport::RawCallbackHelper, gazebo::transport::CallbackHelperT< M >, and gazebo::transport::SubscriptionTransport.

virtual bool gazebo::transport::CallbackHelper::IsLocal ( ) const
pure virtual

Is the callback local?

Returns
true if the callback is local, false if the callback is tied to a remote connection

Implemented in gazebo::transport::RawCallbackHelper, gazebo::transport::CallbackHelperT< M >, and gazebo::transport::SubscriptionTransport.

Member Data Documentation

bool gazebo::transport::CallbackHelper::latching
protected

True means that the callback helper will get the last published message on the topic.


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