message_transport::SimpleSubscriberPlugin< Base, M > Class Template Reference

Base class to simplify implementing most plugins to Subscriber. More...

#include <simple_subscriber_plugin.h>

Inheritance diagram for message_transport::SimpleSubscriberPlugin< Base, M >:
Inheritance graph
[legend]

List of all members.

Classes

struct  SimpleSubscriberPluginImpl

Public Member Functions

virtual uint32_t getNumPublishers () const
 Returns the number of publishers this subscriber is connected to.
virtual std::string getTopic () const
 Get the transport-specific communication topic.
virtual void shutdown ()
 Unsubscribe the callback associated with this SubscriberPlugin.
virtual ~SimpleSubscriberPlugin ()

Protected Member Functions

virtual std::string getTopicToSubscribe (const std::string &base_topic) const
 Return the communication topic name for a given base topic.
virtual void internalCallback (const typename M::ConstPtr &message, const typename SubscriberPlugin< Base >::Callback &user_cb)=0
 Process a message. Must be implemented by the subclass.
ros::NodeHandle & nh ()
 Returns the ros::NodeHandle to be used for parameter lookup.
virtual void subscribeImpl (ros::NodeHandle &nh, const std::string &base_topic, uint32_t queue_size, const typename SubscriberPlugin< Base >::Callback &callback, const ros::VoidPtr &tracked_object, const TransportHints &transport_hints)

Private Attributes

boost::scoped_ptr
< SimpleSubscriberPluginImpl
simple_impl_

Detailed Description

template<class Base, class M>
class message_transport::SimpleSubscriberPlugin< Base, M >

Base class to simplify implementing most plugins to Subscriber.

The base class simplifies implementing a SubscriberPlugin in the common case that all communication with the matching PublisherPlugin happens over a single ROS topic using a transport-specific message type. SimpleSubscriberPlugin is templated on the transport-specific message type.

A subclass need implement only two methods:

For access to the parameter server and name remappings, use nh().

getTopicToSubscribe() controls the name of the internal communication topic. It defaults to <base topic>/<transport name>.

Definition at line 28 of file simple_subscriber_plugin.h.


Constructor & Destructor Documentation

template<class Base, class M>
virtual message_transport::SimpleSubscriberPlugin< Base, M >::~SimpleSubscriberPlugin (  )  [inline, virtual]

Definition at line 31 of file simple_subscriber_plugin.h.


Member Function Documentation

template<class Base, class M>
virtual uint32_t message_transport::SimpleSubscriberPlugin< Base, M >::getNumPublishers (  )  const [inline, virtual]

Returns the number of publishers this subscriber is connected to.

Implements message_transport::SubscriberPluginGen.

Definition at line 39 of file simple_subscriber_plugin.h.

template<class Base, class M>
virtual std::string message_transport::SimpleSubscriberPlugin< Base, M >::getTopic (  )  const [inline, virtual]

Get the transport-specific communication topic.

Implements message_transport::SubscriberPluginGen.

Definition at line 33 of file simple_subscriber_plugin.h.

template<class Base, class M>
virtual std::string message_transport::SimpleSubscriberPlugin< Base, M >::getTopicToSubscribe ( const std::string &  base_topic  )  const [inline, protected, virtual]

Return the communication topic name for a given base topic.

Defaults to <base topic>/<transport name>.

Reimplemented in message_transport::RawSubscriber< M >.

Definition at line 65 of file simple_subscriber_plugin.h.

template<class Base, class M>
virtual void message_transport::SimpleSubscriberPlugin< Base, M >::internalCallback ( const typename M::ConstPtr &  message,
const typename SubscriberPlugin< Base >::Callback user_cb 
) [protected, pure virtual]

Process a message. Must be implemented by the subclass.

Parameters:
message A message from the PublisherPlugin.
user_cb The user Message callback to invoke, if appropriate.
template<class Base, class M>
ros::NodeHandle& message_transport::SimpleSubscriberPlugin< Base, M >::nh (  )  [inline, protected]

Returns the ros::NodeHandle to be used for parameter lookup.

Definition at line 84 of file simple_subscriber_plugin.h.

template<class Base, class M>
virtual void message_transport::SimpleSubscriberPlugin< Base, M >::shutdown (  )  [inline, virtual]

Unsubscribe the callback associated with this SubscriberPlugin.

Implements message_transport::SubscriberPluginGen.

Definition at line 45 of file simple_subscriber_plugin.h.

template<class Base, class M>
virtual void message_transport::SimpleSubscriberPlugin< Base, M >::subscribeImpl ( ros::NodeHandle &  nh,
const std::string &  base_topic,
uint32_t  queue_size,
const typename SubscriberPlugin< Base >::Callback callback,
const ros::VoidPtr &  tracked_object,
const TransportHints transport_hints 
) [inline, protected, virtual]

Definition at line 70 of file simple_subscriber_plugin.h.


Member Data Documentation

template<class Base, class M>
boost::scoped_ptr<SimpleSubscriberPluginImpl> message_transport::SimpleSubscriberPlugin< Base, M >::simple_impl_ [private]

Definition at line 101 of file simple_subscriber_plugin.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


message_transport_common
Author(s): Cedric Pradalier
autogenerated on Fri Jan 11 09:52:59 2013