Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
roswrap::Publication Class Reference

A Publication manages an advertised topic. More...

#include <publication.h>

Public Member Functions

void addCallbacks (const SubscriberCallbacksPtr &callbacks)
 
void addSubscriberLink (const SubscriberLinkPtr &sub_link)
 Adds a publisher to our list. More...
 
void drop ()
 Drop this publication. Disconnects all publishers. More...
 
bool enqueueMessage (const SerializedMessage &m)
 queues an outgoing message into each of the publishers, so that it gets sent to every subscriber More...
 
const std::string & getDataType () const
 Returns the data type of the message published by this publication. More...
 
void getInfo (XmlRpc::XmlRpcValue &info)
 Get the accumulated info for this publication. More...
 
size_t getMaxQueue ()
 returns the max queue size of this publication More...
 
const std::string & getMD5Sum () const
 Returns the md5sum of the message published by this publication. More...
 
const std::string & getMessageDefinition () const
 Returns the full definition of the message published by this publication. More...
 
const std::string & getName () const
 Returns the name of the topic this publication broadcasts to. More...
 
size_t getNumCallbacks ()
 
uint32_t getNumSubscribers ()
 Returns the number of subscribers this publication has. More...
 
void getPublishTypes (bool &serialize, bool &nocopy, const std::type_info &ti)
 
uint32_t getSequence ()
 Returns the sequence number. More...
 
XmlRpc::XmlRpcValue getStats ()
 Get the accumulated stats for this publication. More...
 
bool hasSubscribers ()
 Returns whether or not this publication has any subscribers. More...
 
uint32_t incrementSequence ()
 
bool isDropped ()
 Returns if this publication is valid or not. More...
 
bool isLatched ()
 
bool isLatching ()
 
void processPublishQueue ()
 
 Publication (const std::string &name, const std::string &datatype, const std::string &_md5sum, const std::string &message_definition, size_t max_queue, bool latch, bool has_header)
 
void publish (SerializedMessage &m)
 
void removeCallbacks (const SubscriberCallbacksPtr &callbacks)
 
void removeSubscriberLink (const SubscriberLinkPtr &sub_link)
 Removes a publisher from our list (deleting it if it's the last reference) More...
 
bool validateHeader (const Header &h, std::string &error_msg)
 
 ~Publication ()
 

Private Types

typedef std::vector< SubscriberCallbacksPtrV_Callback
 
typedef std::vector< SerializedMessageV_SerializedMessage
 

Private Member Functions

void dropAllConnections ()
 
void peerConnect (const SubscriberLinkPtr &sub_link)
 Called when a new peer has connected. Calls the connection callback. More...
 
void peerDisconnect (const SubscriberLinkPtr &sub_link)
 Called when a peer has disconnected. Calls the disconnection callback. More...
 

Private Attributes

V_Callback callbacks_
 
std::mutex callbacks_mutex_
 
std::string datatype_
 
bool dropped_
 
bool has_header_
 
uint32_t intraprocess_subscriber_count_
 
SerializedMessage last_message_
 
bool latch_
 
size_t max_queue_
 
std::string md5sum_
 
std::string message_definition_
 
std::string name_
 
V_SerializedMessage publish_queue_
 
std::mutex publish_queue_mutex_
 
uint32_t seq_
 
std::mutex seq_mutex_
 
V_SubscriberLink subscriber_links_
 
std::mutex subscriber_links_mutex_
 

Detailed Description

A Publication manages an advertised topic.

Definition at line 54 of file publication.h.

Member Typedef Documentation

◆ V_Callback

Definition at line 170 of file publication.h.

◆ V_SerializedMessage

Definition at line 186 of file publication.h.

Constructor & Destructor Documentation

◆ Publication()

roswrap::Publication::Publication ( const std::string &  name,
const std::string &  datatype,
const std::string &  _md5sum,
const std::string &  message_definition,
size_t  max_queue,
bool  latch,
bool  has_header 
)

◆ ~Publication()

roswrap::Publication::~Publication ( )

Member Function Documentation

◆ addCallbacks()

void roswrap::Publication::addCallbacks ( const SubscriberCallbacksPtr callbacks)

◆ addSubscriberLink()

void roswrap::Publication::addSubscriberLink ( const SubscriberLinkPtr sub_link)

Adds a publisher to our list.

◆ drop()

void roswrap::Publication::drop ( )

Drop this publication. Disconnects all publishers.

◆ dropAllConnections()

void roswrap::Publication::dropAllConnections ( )
private

◆ enqueueMessage()

bool roswrap::Publication::enqueueMessage ( const SerializedMessage m)

queues an outgoing message into each of the publishers, so that it gets sent to every subscriber

◆ getDataType()

const std::string& roswrap::Publication::getDataType ( ) const
inline

Returns the data type of the message published by this publication.

Definition at line 105 of file publication.h.

◆ getInfo()

void roswrap::Publication::getInfo ( XmlRpc::XmlRpcValue info)

Get the accumulated info for this publication.

◆ getMaxQueue()

size_t roswrap::Publication::getMaxQueue ( )
inline

returns the max queue size of this publication

Definition at line 77 of file publication.h.

◆ getMD5Sum()

const std::string& roswrap::Publication::getMD5Sum ( ) const
inline

Returns the md5sum of the message published by this publication.

Definition at line 109 of file publication.h.

◆ getMessageDefinition()

const std::string& roswrap::Publication::getMessageDefinition ( ) const
inline

Returns the full definition of the message published by this publication.

Definition at line 113 of file publication.h.

◆ getName()

const std::string& roswrap::Publication::getName ( ) const
inline

Returns the name of the topic this publication broadcasts to.

Definition at line 101 of file publication.h.

◆ getNumCallbacks()

size_t roswrap::Publication::getNumCallbacks ( )

◆ getNumSubscribers()

uint32_t roswrap::Publication::getNumSubscribers ( )

Returns the number of subscribers this publication has.

◆ getPublishTypes()

void roswrap::Publication::getPublishTypes ( bool &  serialize,
bool &  nocopy,
const std::type_info &  ti 
)

◆ getSequence()

uint32_t roswrap::Publication::getSequence ( )
inline

Returns the sequence number.

Definition at line 117 of file publication.h.

◆ getStats()

XmlRpc::XmlRpcValue roswrap::Publication::getStats ( )

Get the accumulated stats for this publication.

◆ hasSubscribers()

bool roswrap::Publication::hasSubscribers ( )

Returns whether or not this publication has any subscribers.

◆ incrementSequence()

uint32_t roswrap::Publication::incrementSequence ( )

◆ isDropped()

bool roswrap::Publication::isDropped ( )
inline

Returns if this publication is valid or not.

Definition at line 137 of file publication.h.

◆ isLatched()

bool roswrap::Publication::isLatched ( )
inline

Definition at line 119 of file publication.h.

◆ isLatching()

bool roswrap::Publication::isLatching ( )
inline

Definition at line 143 of file publication.h.

◆ peerConnect()

void roswrap::Publication::peerConnect ( const SubscriberLinkPtr sub_link)
private

Called when a new peer has connected. Calls the connection callback.

◆ peerDisconnect()

void roswrap::Publication::peerDisconnect ( const SubscriberLinkPtr sub_link)
private

Called when a peer has disconnected. Calls the disconnection callback.

◆ processPublishQueue()

void roswrap::Publication::processPublishQueue ( )

◆ publish()

void roswrap::Publication::publish ( SerializedMessage m)

◆ removeCallbacks()

void roswrap::Publication::removeCallbacks ( const SubscriberCallbacksPtr callbacks)

◆ removeSubscriberLink()

void roswrap::Publication::removeSubscriberLink ( const SubscriberLinkPtr sub_link)

Removes a publisher from our list (deleting it if it's the last reference)

◆ validateHeader()

bool roswrap::Publication::validateHeader ( const Header h,
std::string &  error_msg 
)

Member Data Documentation

◆ callbacks_

V_Callback roswrap::Publication::callbacks_
private

Definition at line 171 of file publication.h.

◆ callbacks_mutex_

std::mutex roswrap::Publication::callbacks_mutex_
private

Definition at line 172 of file publication.h.

◆ datatype_

std::string roswrap::Publication::datatype_
private

Definition at line 163 of file publication.h.

◆ dropped_

bool roswrap::Publication::dropped_
private

Definition at line 178 of file publication.h.

◆ has_header_

bool roswrap::Publication::has_header_
private

Definition at line 181 of file publication.h.

◆ intraprocess_subscriber_count_

uint32_t roswrap::Publication::intraprocess_subscriber_count_
private

Definition at line 184 of file publication.h.

◆ last_message_

SerializedMessage roswrap::Publication::last_message_
private

Definition at line 182 of file publication.h.

◆ latch_

bool roswrap::Publication::latch_
private

Definition at line 180 of file publication.h.

◆ max_queue_

size_t roswrap::Publication::max_queue_
private

Definition at line 166 of file publication.h.

◆ md5sum_

std::string roswrap::Publication::md5sum_
private

Definition at line 164 of file publication.h.

◆ message_definition_

std::string roswrap::Publication::message_definition_
private

Definition at line 165 of file publication.h.

◆ name_

std::string roswrap::Publication::name_
private

Definition at line 162 of file publication.h.

◆ publish_queue_

V_SerializedMessage roswrap::Publication::publish_queue_
private

Definition at line 187 of file publication.h.

◆ publish_queue_mutex_

std::mutex roswrap::Publication::publish_queue_mutex_
private

Definition at line 188 of file publication.h.

◆ seq_

uint32_t roswrap::Publication::seq_
private

Definition at line 167 of file publication.h.

◆ seq_mutex_

std::mutex roswrap::Publication::seq_mutex_
private

Definition at line 168 of file publication.h.

◆ subscriber_links_

V_SubscriberLink roswrap::Publication::subscriber_links_
private

Definition at line 174 of file publication.h.

◆ subscriber_links_mutex_

std::mutex roswrap::Publication::subscriber_links_mutex_
private

Definition at line 176 of file publication.h.


The documentation for this class 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