21 #ifndef _PUBLISHER_HH_
22 #define _PUBLISHER_HH_
24 #include <google/protobuf/message.h>
25 #include <boost/thread.hpp>
43 public:
Publisher(
const std::string &_topic,
const std::string &_msgType,
52 public:
Publisher(
const std::string &_topic,
const std::string &_msgType,
53 unsigned int _limit,
double _hzRate);
86 public:
void Publish(
const google::protobuf::Message &_message,
88 { this->PublishImpl(_message, _block); }
94 public:
template<
typename M>
95 void Publish(M _message,
bool _block =
false)
96 { this->PublishImpl(_message, _block); }
102 private:
void PublishImpl(
const google::protobuf::Message &_message,
107 public: std::string
GetTopic()
const;
122 public:
bool GetLatching() const GAZEBO_DEPRECATED(1.5);
134 private:
void OnPublishComplete(uint32_t _id);
137 private: std::
string topic;
140 private: std::
string msgType;
144 private:
unsigned int queueLimit;
148 private:
double updatePeriod;
152 private:
bool queueLimitWarned;
158 private: mutable boost::mutex mutex;
170 private: common::Time currentTime;
171 private: common::Time prevPublishTime;
174 private:
bool waiting;
177 private: uint32_t pubId;
178 private: std::list<uint32_t> pubIds;