Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
roswrap::AdvertiseOptions Struct Reference

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

#include <advertise_options.h>

Public Member Functions

 AdvertiseOptions ()
 
 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())
 
template<class M >
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 More...
 

Static Public Member Functions

template<class M >
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. More...
 

Public Attributes

CallbackQueueInterfacecallback_queue
 Queue to add callbacks to. If NULL, the global callback queue will be used. More...
 
SubscriberStatusCallback connect_cb
 The function to call when a subscriber connects to this topic. More...
 
std::string datatype
 The datatype of the message published on this topic (eg. "std_msgs/String") More...
 
SubscriberStatusCallback disconnect_cb
 The function to call when a subscriber disconnects from this topic. More...
 
bool has_header
 Tells whether or not the message has a header. If it does, the sequence number will be written directly into the serialized bytes after the message has been serialized. More...
 
bool latch
 Whether or not this publication should "latch". A latching publication will automatically send out the last published message to any new subscribers. More...
 
std::string md5sum
 The md5sum of the message datatype published on this topic. More...
 
std::string message_definition
 The full definition of the message published on this topic. More...
 
uint32_t queue_size
 The maximum number of outgoing messages to be queued for delivery to subscribers. More...
 
std::string topic
 The topic to publish on. More...
 
VoidConstPtr tracked_object
 An object whose destruction will prevent the callbacks associated with this advertisement from being called. More...
 

Detailed Description

Encapsulates all options available for creating a Publisher.

Definition at line 42 of file advertise_options.h.

Constructor & Destructor Documentation

◆ AdvertiseOptions() [1/2]

roswrap::AdvertiseOptions::AdvertiseOptions ( )
inline

Definition at line 44 of file advertise_options.h.

◆ AdvertiseOptions() [2/2]

roswrap::AdvertiseOptions::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() 
)
inline

Definition at line 59 of file advertise_options.h.

Member Function Documentation

◆ create()

template<class M >
static AdvertiseOptions roswrap::AdvertiseOptions::create ( const std::string &  topic,
uint32_t  queue_size,
const SubscriberStatusCallback connect_cb,
const SubscriberStatusCallback disconnect_cb,
const VoidConstPtr tracked_object,
CallbackQueueInterface queue 
)
inlinestatic

Templated helper function for creating an AdvertiseOptions for a message type with most options.

Parameters
M[template] Message type
topicTopic to publish on
queue_sizeMaximum number of outgoing messages to be queued for delivery to subscribers
connect_cbFunction to call when a subscriber connects to this topic
disconnect_cbFunction to call when a subscriber disconnects from this topic
tracked_objecttracked object to use (see AdvertiseOptions::tracked_object)
queueThe callback queue to use (see AdvertiseOptions::callback_queue)
Returns
an AdvertiseOptions which embodies the parameters

Definition at line 149 of file advertise_options.h.

◆ init()

template<class M >
void roswrap::AdvertiseOptions::init ( const std::string &  _topic,
uint32_t  _queue_size,
const SubscriberStatusCallback _connect_cb = SubscriberStatusCallback(),
const SubscriberStatusCallback _disconnect_cb = SubscriberStatusCallback() 
)
inline

templated helper function for automatically filling out md5sum, datatype and message definition

Parameters
M[template] Message type
_topicTopic to publish on
_queue_sizeMaximum number of outgoing messages to be queued for delivery to subscribers
_connect_cbFunction to call when a subscriber connects to this topic
_disconnect_cbFunction to call when a subscriber disconnects from this topic

Definition at line 85 of file advertise_options.h.

Member Data Documentation

◆ callback_queue

CallbackQueueInterface* roswrap::AdvertiseOptions::callback_queue

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

Definition at line 109 of file advertise_options.h.

◆ connect_cb

SubscriberStatusCallback roswrap::AdvertiseOptions::connect_cb

The function to call when a subscriber connects to this topic.

Definition at line 106 of file advertise_options.h.

◆ datatype

std::string roswrap::AdvertiseOptions::datatype

The datatype of the message published on this topic (eg. "std_msgs/String")

Definition at line 103 of file advertise_options.h.

◆ disconnect_cb

SubscriberStatusCallback roswrap::AdvertiseOptions::disconnect_cb

The function to call when a subscriber disconnects from this topic.

Definition at line 107 of file advertise_options.h.

◆ has_header

bool roswrap::AdvertiseOptions::has_header

Tells whether or not the message has a header. If it does, the sequence number will be written directly into the serialized bytes after the message has been serialized.

Definition at line 132 of file advertise_options.h.

◆ latch

bool roswrap::AdvertiseOptions::latch

Whether or not this publication should "latch". A latching publication will automatically send out the last published message to any new subscribers.

Definition at line 127 of file advertise_options.h.

◆ md5sum

std::string roswrap::AdvertiseOptions::md5sum

The md5sum of the message datatype published on this topic.

Definition at line 102 of file advertise_options.h.

◆ message_definition

std::string roswrap::AdvertiseOptions::message_definition

The full definition of the message published on this topic.

Definition at line 104 of file advertise_options.h.

◆ queue_size

uint32_t roswrap::AdvertiseOptions::queue_size

The maximum number of outgoing messages to be queued for delivery to subscribers.

Definition at line 100 of file advertise_options.h.

◆ topic

std::string roswrap::AdvertiseOptions::topic

The topic to publish on.

Definition at line 99 of file advertise_options.h.

◆ tracked_object

VoidConstPtr roswrap::AdvertiseOptions::tracked_object

An object whose destruction will prevent the callbacks associated with this advertisement from being called.

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 121 of file advertise_options.h.


The documentation for this struct was generated from the following file:


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:15