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);
79 public:
void Publish(
const google::protobuf::Message &_message,
81 { this->PublishImpl(_message, _block); }
87 public:
template<
typename M>
88 void Publish(M _message,
bool _block =
false)
89 { this->PublishImpl(_message, _block); }
95 private:
void PublishImpl(
const google::protobuf::Message &_message,
100 public: std::string
GetTopic()
const;
110 public:
bool GetLatching() const GAZEBO_DEPRECATED(1.5);
121 private:
void OnPublishComplete();
124 private: std::
string topic;
127 private: std::
string msgType;
131 private:
unsigned int queueLimit;
135 private:
double updatePeriod;
139 private:
bool queueLimitWarned;
145 private: mutable boost::recursive_mutex mutex;
154 private: common::Time currentTime;
155 private: common::Time prevPublishTime;