28 #ifndef ROSCPP_ADVERTISE_OPTIONS_H 29 #define ROSCPP_ADVERTISE_OPTIONS_H 58 AdvertiseOptions(
const std::string& _topic, uint32_t _queue_size,
const std::string& _md5sum,
59 const std::string& _datatype,
const std::string& _message_definition,
63 , queue_size(_queue_size)
66 , message_definition(_message_definition)
67 , connect_cb(_connect_cb)
68 , disconnect_cb(_disconnect_cb)
84 void init(
const std::string& _topic, uint32_t _queue_size,
89 queue_size = _queue_size;
90 connect_cb = _connect_cb;
91 disconnect_cb = _disconnect_cb;
92 md5sum = message_traits::md5sum<M>();
93 datatype = message_traits::datatype<M>();
94 message_definition = message_traits::definition<M>();
95 has_header = message_traits::hasHeader<M>();
155 ops.
init<M>(topic, queue_size, connect_cb, disconnect_cb);
SubscriberStatusCallback connect_cb
The function to call when a subscriber connects to this topic.
boost::function< void(const SingleSubscriberPublisher &)> SubscriberStatusCallback
std::string message_definition
The full definition of the message published on this topic.
bool has_header
Tells whether or not the message has a header. If it does, the sequence number will be written direct...
SubscriberStatusCallback disconnect_cb
The function to call when a subscriber disconnects from this topic.
void init(const std::string &_topic, uint32_t _queue_size, const SubscriberStatusCallback &_connect_cb=SubscriberStatusCallback(), const SubscriberStatusCallback &_disconnect_cb=SubscriberStatusCallback())
templated helper function for automatically filling out md5sum, datatype and message definition ...
bool latch
Whether or not this publication should "latch". A latching publication will automatically send out th...
Abstract interface for a queue used to handle all callbacks within roscpp.
Encapsulates all options available for creating a Publisher.
static AdvertiseOptions create(const std::string &topic, uint32_t queue_size, const SubscriberStatusCallback &connect_cb, const SubscriberStatusCallback &disconnect_cb, const VoidConstPtr &tracked_object, CallbackQueueInterface *queue)
Templated helper function for creating an AdvertiseOptions for a message type with most options...
VoidConstPtr tracked_object
An object whose destruction will prevent the callbacks associated with this advertisement from being ...
AdvertiseOptions(const std::string &_topic, uint32_t _queue_size, const std::string &_md5sum, const std::string &_datatype, const std::string &_message_definition, const SubscriberStatusCallback &_connect_cb=SubscriberStatusCallback(), const SubscriberStatusCallback &_disconnect_cb=SubscriberStatusCallback())
std::string datatype
The datatype of the message published on this topic (eg. "std_msgs/String")
std::string md5sum
The md5sum of the message datatype published on this topic.
std::string topic
The topic to publish on.
CallbackQueueInterface * callback_queue
Queue to add callbacks to. If NULL, the global callback queue will be used.
uint32_t queue_size
The maximum number of outgoing messages to be queued for delivery to subscribers. ...