Encapsulates all options available for creating a Subscriber. More...
#include <subscribe_options.h>
Public Member Functions | |
template<class M > | |
void | init (const std::string &_topic, uint32_t _queue_size, const std::function< void(const std::shared_ptr< M const > &)> &_callback, const std::function< std::shared_ptr< M >(void)> &factory_fn=DefaultMessageCreator< M >()) |
Templated initialization, templated on message type. Only supports "const std::shared_ptr<M const>&" callback types. More... | |
template<class P > | |
void | initByFullCallbackType (const std::string &_topic, uint32_t _queue_size, const std::function< void(P)> &_callback, const std::function< std::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. More... | |
SubscribeOptions () | |
SubscribeOptions (const std::string &_topic, uint32_t _queue_size, const std::string &_md5sum, const std::string &_datatype) | |
Constructor. More... | |
Static Public Member Functions | |
template<class M > | |
static SubscribeOptions | create (const std::string &topic, uint32_t queue_size, const std::function< void(const std::shared_ptr< M const > &)> &callback, const VoidConstPtr &tracked_object, CallbackQueueInterface *queue) |
Templated helper function for creating an AdvertiseServiceOptions with most of its options. More... | |
Public Attributes | |
bool | allow_concurrent_callbacks |
CallbackQueueInterface * | callback_queue |
Queue to add callbacks to. If NULL, the global callback queue will be used. More... | |
std::string | datatype |
Datatype of the message we'd like to subscribe as. More... | |
SubscriptionCallbackHelperPtr | helper |
Helper object used to get create messages and call callbacks. More... | |
std::string | md5sum |
MD5 of the message datatype. More... | |
uint32_t | queue_size |
Number of incoming messages to queue up for processing (messages in excess of this queue capacity will be discarded). More... | |
std::string | topic |
Topic to subscribe to. More... | |
VoidConstPtr | tracked_object |
An object whose destruction will prevent the callback associated with this subscription. More... | |
TransportHints | transport_hints |
Hints for transport type and options. More... | |
Encapsulates all options available for creating a Subscriber.
Definition at line 44 of file subscribe_options.h.
|
inline |
Definition at line 49 of file subscribe_options.h.
|
inline |
Constructor.
_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 65 of file subscribe_options.h.
|
inlinestatic |
Templated helper function for creating an AdvertiseServiceOptions with most of its options.
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 155 of file subscribe_options.h.
|
inline |
Templated initialization, templated on message type. Only supports "const std::shared_ptr<M const>&" callback types.
_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 104 of file subscribe_options.h.
|
inline |
Templated initialization, templated on callback parameter type. Supports any callback parameters supported by the SubscriptionCallbackAdapter.
_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 83 of file subscribe_options.h.
bool roswrap::SubscribeOptions::allow_concurrent_callbacks |
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 128 of file subscribe_options.h.
CallbackQueueInterface* roswrap::SubscribeOptions::callback_queue |
Queue to add callbacks to. If NULL, the global callback queue will be used.
Definition at line 124 of file subscribe_options.h.
std::string roswrap::SubscribeOptions::datatype |
Datatype of the message we'd like to subscribe as.
Definition at line 120 of file subscribe_options.h.
SubscriptionCallbackHelperPtr roswrap::SubscribeOptions::helper |
Helper object used to get create messages and call callbacks.
Definition at line 122 of file subscribe_options.h.
std::string roswrap::SubscribeOptions::md5sum |
MD5 of the message datatype.
Definition at line 119 of file subscribe_options.h.
uint32_t roswrap::SubscribeOptions::queue_size |
Number of incoming messages to queue up for processing (messages in excess of this queue capacity will be discarded).
Definition at line 117 of file subscribe_options.h.
std::string roswrap::SubscribeOptions::topic |
Topic to subscribe to.
Definition at line 116 of file subscribe_options.h.
VoidConstPtr roswrap::SubscribeOptions::tracked_object |
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.
Definition at line 140 of file subscribe_options.h.
TransportHints roswrap::SubscribeOptions::transport_hints |
Hints for transport type and options.
Definition at line 142 of file subscribe_options.h.