Manages an advertisement on a specific topic. More...
#include <publisher.h>
Classes | |
class | Impl |
Public Member Functions | |
boost::function< void(const SubscriberLinkPtr &)> | getLastMessageCallback () |
uint32_t | getNumSubscribers () const |
Returns the number of subscribers that are currently connected to this Publisher. More... | |
std::string | getTopic () const |
Returns the topic that this Publisher will publish on. More... | |
bool | isLatched () const |
Returns whether or not this topic is latched. More... | |
operator void * () const | |
bool | operator!= (const Publisher &rhs) const |
bool | operator< (const Publisher &rhs) const |
Publisher & | operator= (const Publisher &other)=default |
bool | operator== (const Publisher &rhs) const |
template<typename M > | |
void | publish (const boost::shared_ptr< M > &message) const |
Publish a message on the topic associated with this Publisher. More... | |
template<typename M > | |
void | publish (const M &message) const |
Publish a message on the topic associated with this Publisher. More... | |
Publisher () | |
Publisher (const Publisher &rhs) | |
void | shutdown () |
Shutdown the advertisement associated with this Publisher. More... | |
~Publisher () | |
Private Types | |
typedef boost::shared_ptr< Impl > | ImplPtr |
typedef boost::weak_ptr< Impl > | ImplWPtr |
Private Member Functions | |
void | incrementSequence () const |
void | publish (const boost::function< SerializedMessage(void)> &serfunc, SerializedMessage &m) const |
Publisher (const std::string &topic, const std::string &md5sum, const std::string &datatype, bool latch, const NodeHandle &node_handle, const SubscriberCallbacksPtr &callbacks) | |
Private Attributes | |
ImplPtr | impl_ |
Friends | |
class | NodeHandle |
class | NodeHandleBackingCollection |
Manages an advertisement on a specific topic.
A Publisher should always be created through a call to NodeHandle::advertise(), or copied from one that was. Once all copies of a specific Publisher go out of scope, any subscriber status callbacks associated with that handle will stop being called. Once all Publishers for a given topic go out of scope the topic will be unadvertised.
Definition at line 51 of file publisher.h.
|
private |
Definition at line 209 of file publisher.h.
|
private |
Definition at line 210 of file publisher.h.
|
inline |
Definition at line 54 of file publisher.h.
ros::Publisher::Publisher | ( | const Publisher & | rhs | ) |
Definition at line 78 of file publisher.cpp.
ros::Publisher::~Publisher | ( | ) |
Definition at line 83 of file publisher.cpp.
|
private |
Definition at line 67 of file publisher.cpp.
|
inline |
Definition at line 176 of file publisher.h.
uint32_t ros::Publisher::getNumSubscribers | ( | ) | const |
Returns the number of subscribers that are currently connected to this Publisher.
Definition at line 136 of file publisher.cpp.
std::string ros::Publisher::getTopic | ( | ) | const |
Returns the topic that this Publisher will publish on.
Definition at line 126 of file publisher.cpp.
|
private |
Definition at line 109 of file publisher.cpp.
bool ros::Publisher::isLatched | ( | ) | const |
Returns whether or not this topic is latched.
Definition at line 146 of file publisher.cpp.
|
inline |
Definition at line 159 of file publisher.h.
|
inline |
Definition at line 171 of file publisher.h.
|
inline |
Definition at line 161 of file publisher.h.
|
inline |
Definition at line 166 of file publisher.h.
|
private |
Definition at line 87 of file publisher.cpp.
|
inline |
Publish a message on the topic associated with this Publisher.
This version of publish will allow fast intra-process message-passing in the future, so you may not mutate the message after it has been passed in here (since it will be passed directly into a callback function)
Definition at line 68 of file publisher.h.
|
inline |
Publish a message on the topic associated with this Publisher.
Definition at line 103 of file publisher.h.
void ros::Publisher::shutdown | ( | ) |
Shutdown the advertisement associated with this Publisher.
This method usually does not need to be explicitly called, as automatic shutdown happens when all copies of this Publisher go out of scope
This method overrides the automatic reference counted unadvertise, and does so immediately.
Definition at line 117 of file publisher.cpp.
|
friend |
Definition at line 214 of file publisher.h.
|
friend |
Definition at line 215 of file publisher.h.
|
private |
Definition at line 212 of file publisher.h.