Go to the documentation of this file.
29 #ifndef ROSCPP_SUBSCRIBE_OPTIONS_H
30 #define ROSCPP_SUBSCRIBE_OPTIONS_H
32 #include "ros/forwards.h"
34 #include "ros/transport_hints.h"
35 #include "ros/message_traits.h"
52 , allow_concurrent_callbacks(false)
65 SubscribeOptions(
const std::string& _topic, uint32_t _queue_size,
const std::string& _md5sum,
const std::string& _datatype)
71 , allow_concurrent_callbacks(false)
84 const std::function<
void (P)>& _callback,
90 md5sum = message_traits::md5sum<MessageType>();
91 datatype = message_traits::datatype<MessageType>();
92 helper = std::make_shared<SubscriptionCallbackHelperT<P> >(_callback, factory_fn);
104 void init(
const std::string& _topic, uint32_t _queue_size,
105 const std::function<
void (
const std::shared_ptr<M const>&)>& _callback,
111 md5sum = message_traits::md5sum<MessageType>();
112 datatype = message_traits::datatype<MessageType>();
113 helper = std::make_shared<SubscriptionCallbackHelperT<const std::shared_ptr<MessageType const>&> >(_callback, factory_fn);
156 const std::function<
void (
const std::shared_ptr<M const>&)>&
callback,
const char * md5sum()
returns MD5Sum<M>::value();
std::string md5sum
MD5 of the message datatype.
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 supp...
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.
TransportHints transport_hints
Hints for transport type and options.
const char * datatype()
returns DataType<M>::value();
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.
bool allow_concurrent_callbacks
std::shared_ptr< SubscriptionCallbackHelper > SubscriptionCallbackHelperPtr
std::string topic
Topic to subscribe to.
Abstract interface for a queue used to handle all callbacks within roscpp.
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>&" ...
uint32_t queue_size
Number of incoming messages to queue up for processing (messages in excess of this queue capacity wil...
CallbackQueueInterface * callback_queue
Queue to add callbacks to. If NULL, the global callback queue will be used.
Provides a way of specifying network transport hints to ros::NodeHandle::subscribe() and someday ros:...
SubscribeOptions(const std::string &_topic, uint32_t _queue_size, const std::string &_md5sum, const std::string &_datatype)
Constructor.
Encapsulates all options available for creating a Subscriber.
VoidConstPtr tracked_object
An object whose destruction will prevent the callback associated with this subscription.
std::remove_reference< typename std::remove_const< M >::type >::type Message
std::shared_ptr< void const > VoidConstPtr
void callback(const sick_scan_xd::RadarScan::ConstPtr &oa)
sick_scan_xd
Author(s): Michael Lehning
, Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:12