ros::SubscribeOptions Struct Reference

Encapsulates all options available for creating a Subscriber. More...

#include <subscribe_options.h>

List of all members.

Public Member Functions

template<class M >
void init (const std::string &_topic, uint32_t _queue_size, const boost::function< void(const boost::shared_ptr< M const > &)> &_callback, const boost::function< boost::shared_ptr< M >(void)> &factory_fn=DefaultMessageCreator< M >())
 Templated initialization, templated on message type. Only supports "const boost::shared_ptr<M const>&" callback types.
template<class P >
void initByFullCallbackType (const std::string &_topic, uint32_t _queue_size, const boost::function< void(P)> &_callback, const boost::function< boost::shared_ptr< typename ParameterAdapter< P >::Message >(void)> &factory_fn=DefaultMessageCreator< typename ParameterAdapter< P >::Message >())
 Templated initialization, templated on callback parameter type. Supports any callback parameters supported by the SubscriptionCallbackAdapter.
 SubscribeOptions (const std::string &_topic, uint32_t _queue_size, const std::string &_md5sum, const std::string &_datatype)
 Constructor.
 SubscribeOptions ()

Static Public Member Functions

template<class M >
static SubscribeOptions create (const std::string &topic, uint32_t queue_size, const boost::function< void(const boost::shared_ptr< M const > &)> &callback, const VoidConstPtr &tracked_object, CallbackQueueInterface *queue)
 Templated helper function for creating an AdvertiseServiceOptions with most of its options.

Public Attributes

bool allow_concurrent_callbacks
CallbackQueueInterfacecallback_queue
 Queue to add callbacks to. If NULL, the global callback queue will be used.
std::string datatype
 Datatype of the message we'd like to subscribe as.
SubscriptionCallbackHelperPtr helper
 Helper object used to get create messages and call callbacks.
std::string md5sum
 MD5 of the message datatype.
uint32_t queue_size
 Number of incoming messages to queue up for processing (messages in excess of this queue capacity will be discarded).
std::string topic
 Topic to subscribe to.
VoidConstPtr tracked_object
 An object whose destruction will prevent the callback associated with this subscription.
TransportHints transport_hints
 Hints for transport type and options.

Detailed Description

Encapsulates all options available for creating a Subscriber.

Definition at line 42 of file subscribe_options.h.


Constructor & Destructor Documentation

ros::SubscribeOptions::SubscribeOptions (  )  [inline]

Definition at line 47 of file subscribe_options.h.

ros::SubscribeOptions::SubscribeOptions ( const std::string &  _topic,
uint32_t  _queue_size,
const std::string &  _md5sum,
const std::string &  _datatype 
) [inline]

Constructor.

Parameters:
_topic Topic to subscribe on
_queue_size Number of incoming messages to queue up for processing (messages in excess of this queue capacity will be discarded).
_md5sum 
_datatype 

Definition at line 63 of file subscribe_options.h.


Member Function Documentation

template<class M >
static SubscribeOptions ros::SubscribeOptions::create ( const std::string &  topic,
uint32_t  queue_size,
const boost::function< void(const boost::shared_ptr< M const > &)> &  callback,
const VoidConstPtr tracked_object,
CallbackQueueInterface queue 
) [inline, static]

Templated helper function for creating an AdvertiseServiceOptions with most of its options.

Parameters:
topic Topic name to subscribe to
queue_size Number of incoming messages to queue up for processing (messages in excess of this queue capacity will be discarded).
callback The callback to invoke when a message is received on this topic
tracked_object The tracked object to use (see SubscribeOptions::tracked_object)
queue The callback queue to use (see SubscribeOptions::callback_queue)

Definition at line 153 of file subscribe_options.h.

template<class M >
void ros::SubscribeOptions::init ( const std::string &  _topic,
uint32_t  _queue_size,
const boost::function< void(const boost::shared_ptr< M const > &)> &  _callback,
const boost::function< boost::shared_ptr< M >(void)> &  factory_fn = DefaultMessageCreator<M>() 
) [inline]

Templated initialization, templated on message type. Only supports "const boost::shared_ptr<M const>&" callback types.

Parameters:
_topic Topic to subscribe on
_queue_size Number of incoming messages to queue up for processing (messages in excess of this queue capacity will be discarded).
_callback Callback to call when a message arrives on this topic

Definition at line 102 of file subscribe_options.h.

template<class P >
void ros::SubscribeOptions::initByFullCallbackType ( const std::string &  _topic,
uint32_t  _queue_size,
const boost::function< void(P)> &  _callback,
const boost::function< boost::shared_ptr< typename ParameterAdapter< P >::Message >(void)> &  factory_fn = DefaultMessageCreator<typename ParameterAdapter<P>::Message>() 
) [inline]

Templated initialization, templated on callback parameter type. Supports any callback parameters supported by the SubscriptionCallbackAdapter.

Parameters:
_topic Topic to subscribe on
_queue_size Number of incoming messages to queue up for processing (messages in excess of this queue capacity will be discarded).
_callback Callback to call when a message arrives on this topic

Definition at line 81 of file subscribe_options.h.


Member Data Documentation

By default subscription callbacks are guaranteed to arrive in-order, with only one callback happening for this subscription at any given time. Setting this to true allows you to receive multiple messages on the same topic from multiple threads at the same time

Definition at line 126 of file subscribe_options.h.

Queue to add callbacks to. If NULL, the global callback queue will be used.

Definition at line 122 of file subscribe_options.h.

Datatype of the message we'd like to subscribe as.

Definition at line 118 of file subscribe_options.h.

Helper object used to get create messages and call callbacks.

Definition at line 120 of file subscribe_options.h.

MD5 of the message datatype.

Definition at line 117 of file subscribe_options.h.

Number of incoming messages to queue up for processing (messages in excess of this queue capacity will be discarded).

Definition at line 115 of file subscribe_options.h.

Topic to subscribe to.

Definition at line 114 of file subscribe_options.h.

An object whose destruction will prevent the callback associated with this subscription.

A shared pointer to an object to track for these callbacks. If set, the a weak_ptr will be created to this object, and if the reference count goes to 0 the subscriber callbacks will not get called.

Note:
Note that setting this will cause a new reference to be added to the object before the callback, and for it to go out of scope (and potentially be deleted) in the code path (and therefore thread) that the callback is invoked from.

Definition at line 138 of file subscribe_options.h.

Hints for transport type and options.

Definition at line 140 of file subscribe_options.h.


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


roscpp
Author(s): Morgan Quigley mquigley@cs.stanford.edu, Josh Faust jfaust@willowgarage.com, Brian Gerkey gerkey@willowgarage.com
autogenerated on Fri Jan 11 10:08:41 2013