40 ROS_DEBUG(
"Publisher on '%s' deregistering callbacks.",
topic_.c_str());
62 impl_->topic_ = topic;
63 impl_->md5sum_ = md5sum;
64 impl_->datatype_ = datatype;
65 impl_->node_handle_ = boost::make_shared<NodeHandle>(node_handle);
66 impl_->callbacks_ = callbacks;
82 ROS_ASSERT_MSG(
false,
"Call to publish() on an invalid Publisher (topic [%s])",
impl_->topic_.c_str());
86 if (!
impl_->isValid())
88 ROS_ASSERT_MSG(
false,
"Call to publish() on an invalid Publisher (topic [%s])",
impl_->topic_.c_str());
107 impl_->unadvertise();
116 return impl_->topic_;
119 return std::string();
138 ROS_ASSERT_MSG(
false,
"Call to isLatched() on an invalid Publisher");
139 throw ros::Exception(
"Call to isLatched() on an invalid Publisher");
141 if (publication_ptr) {
142 return publication_ptr->isLatched();
144 ROS_ASSERT_MSG(
false,
"Call to isLatched() on an invalid Publisher");
145 throw ros::Exception(
"Call to isLatched() on an invalid Publisher");
bool isLatched() const
Returns whether or not this topic is latched.
NodeHandlePtr node_handle_
void publish(const boost::shared_ptr< M > &message) const
Publish a message on the topic associated with this Publisher.
#define ROS_ASSERT_MSG(cond,...)
roscpp's interface for creating subscribers, publishers, etc.
Manages an advertisement on a specific topic.
std::string getTopic() const
Returns the topic that this Publisher will publish on.
void incrementSequence() const
SubscriberCallbacksPtr callbacks_
void shutdown()
Shutdown the advertisement associated with this Publisher.
uint32_t getNumSubscribers() const
Returns the number of subscribers that are currently connected to this Publisher. ...
static const TopicManagerPtr & instance()