Go to the documentation of this file.
29 #ifndef ROSCPP_PUBLISHER_HANDLE_H
30 #define ROSCPP_PUBLISHER_HANDLE_H
32 #include "ros/forwards.h"
33 #include "ros/common.h"
34 #include "ros/message.h"
35 #include "ros/serialization.h"
64 void publish(
const std::shared_ptr<M>& message)
const
66 using namespace serialization;
70 ROS_ASSERT_MSG(
false,
"Call to publish() on an invalid Publisher");
74 if (!impl_->isValid())
76 ROS_ASSERT_MSG(
false,
"Call to publish() on an invalid Publisher (topic [%s])", impl_->topic_.c_str());
81 "Trying to publish message of type [%s/%s] on a publisher with type [%s/%s]",
83 impl_->datatype_.c_str(), impl_->md5sum_.c_str());
89 publish(std::bind(serializeMessage<M>, std::ref(*
message)), m);
101 using namespace serialization;
106 ROS_ASSERT_MSG(
false,
"Call to publish() on an invalid Publisher");
110 if (!impl_->isValid())
112 ROS_ASSERT_MSG(
false,
"Call to publish() on an invalid Publisher (topic [%s])", impl_->topic_.c_str());
117 "Trying to publish message of type [%s/%s] on a publisher with type [%s/%s]",
119 impl_->datatype_.c_str(), impl_->md5sum_.c_str());
122 publish(std::bind(serializeMessage<M>, std::ref(
message)), m);
140 std::string getTopic()
const;
145 uint32_t getNumSubscribers()
const;
150 bool isLatched()
const;
152 operator void*()
const {
return (impl_ && impl_->isValid()) ? (
void*)1 : (
void*)0; }
156 return impl_ < rhs.
impl_;
161 return impl_ == rhs.
impl_;
166 return impl_ != rhs.
impl_;
176 void incrementSequence()
const;
185 bool isValid()
const;
200 friend class NodeHandleBackingCollection;
206 #endif // ROSCPP_PUBLISHER_HANDLE_H
const char * md5sum()
returns MD5Sum<M>::value();
void publish(const M &message) const
Publish a message on the topic associated with this Publisher.
bool operator!=(const Publisher &rhs) const
std::shared_ptr< Impl > ImplPtr
Manages an advertisement on a specific topic.
bool operator==(const Publisher &rhs) const
std::shared_ptr< NodeHandle > NodeHandlePtr
const char * datatype()
returns DataType<M>::value();
ROSCPP_DECL void shutdown()
Disconnects everything and unregisters from the master. It is generally not necessary to call this fu...
const std::type_info * type_info
def message(msg, *args, **kwargs)
bool operator<(const Publisher &rhs) const
void publish(const std::shared_ptr< M > &message) const
Publish a message on the topic associated with this Publisher.
std::vector< Publisher > V_Publisher
#define ROS_ASSERT_MSG(cond,...)
Asserts that the provided condition evaluates to true.
std::shared_ptr< void const > message
roscpp's interface for creating subscribers, publishers, etc.
std::weak_ptr< Impl > ImplWPtr
SubscriberCallbacksPtr callbacks_
NodeHandlePtr node_handle_
std::shared_ptr< SubscriberCallbacks > SubscriberCallbacksPtr
sick_scan_xd
Author(s): Michael Lehning
, Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:10