18 #ifndef _PUBLICATION_HH_
19 #define _PUBLICATION_HH_
22 #include <boost/shared_ptr.hpp>
23 #include <boost/thread/mutex.hpp>
48 const std::string &_msgType);
115 public:
void Publish(
const google::protobuf::Message &_msg,
116 const boost::function<
void()> &_cb =
NULL);
127 public:
bool HasTransport(
const std::string &_host,
unsigned int _port);
134 private:
void RemoveNodes();
137 private:
unsigned int id;
140 private:
static unsigned int idCounter;
143 private: std::string topic;
146 private: std::string msgType;
149 private: std::list<CallbackHelperPtr> callbacks;
152 private: std::list<NodePtr> nodes;
155 private: std::list<unsigned int> removeNodes;
158 private: std::list<std::pair<std::string, unsigned int> > removeCallbacks;
161 private: std::list<PublicationTransportPtr> transports;
164 private: std::vector<PublisherPtr> publishers;
167 private:
bool locallyAdvertised;
170 private:
mutable boost::mutex nodeMutex;
173 private:
mutable boost::mutex callbackMutex;
176 private:
mutable boost::mutex nodeRemoveMutex;