28 #ifndef ROSCPP_PUBLICATION_H 29 #define ROSCPP_PUBLICATION_H 36 #include <boost/thread/mutex.hpp> 38 #include <boost/shared_ptr.hpp> 39 #include <boost/shared_array.hpp> 58 const std::string& _md5sum,
59 const std::string& message_definition,
89 bool hasSubscribers();
93 uint32_t getNumSubscribers();
95 void getPublishTypes(
bool&
serialize,
bool& nocopy,
const std::type_info& ti);
100 const std::string&
getName()
const {
return name_; }
108 const std::string&
getMD5Sum()
const {
return md5sum_; }
123 void addSubscriberLink(
const SubscriberLinkPtr& sub_link);
127 void removeSubscriberLink(
const SubscriberLinkPtr& sub_link);
138 uint32_t incrementSequence();
140 size_t getNumCallbacks();
145 void processPublishQueue();
147 bool validateHeader(
const Header& h, std::string& error_msg);
150 void dropAllConnections();
155 void peerConnect(
const SubscriberLinkPtr& sub_link);
159 void peerDisconnect(
const SubscriberLinkPtr& sub_link);
192 #endif // ROSCPP_PUBLICATION_H
SerializedMessage last_message_
std::string message_definition_
const std::string & getDataType() const
Returns the data type of the message published by this publication.
boost::mutex callbacks_mutex_
std::vector< SubscriberCallbacksPtr > V_Callback
V_SerializedMessage publish_queue_
size_t getMaxQueue()
returns the max queue size of this publication
V_SubscriberLink subscriber_links_
uint32_t intraprocess_subscriber_count_
void serialize(Stream &stream, const T &t)
boost::shared_ptr< SubscriberLink > SubscriberLinkPtr
bool isDropped()
Returns if this publication is valid or not.
const std::string & getMessageDefinition() const
Returns the full definition of the message published by this publication.
boost::mutex publish_queue_mutex_
A Publication manages an advertised topic.
const std::string & getName() const
Returns the name of the topic this publication broadcasts to.
std::vector< SerializedMessage > V_SerializedMessage
boost::mutex subscriber_links_mutex_
std::vector< SubscriberLinkPtr > V_SubscriberLink
const std::string & getMD5Sum() const
Returns the md5sum of the message published by this publication.
uint32_t getSequence()
Returns the sequence number.