17 #ifndef _CONNECTION_MANAGER_HH_
18 #define _CONNECTION_MANAGER_HH_
21 #include <boost/shared_ptr.hpp>
53 public:
bool Init(
const std::string &_masterHost,
54 unsigned int _masterPort);
75 public:
void Subscribe(
const std::string &_topic,
76 const std::string &_msgType,
81 public:
void Unsubscribe(
const msgs::Subscribe &_sub);
87 const std::string &_msgType);
92 public:
void Advertise(
const std::string &_topic,
93 const std::string &_msgType);
97 public:
void Unadvertise(
const std::string &_topic);
119 private:
ConnectionPtr FindConnection(
const std::string &_host,
132 private:
void OnMasterRead(
const std::string &_data);
142 const std::string &_data);
146 private:
void ProcessMessage(
const std::string &_packet);
154 private: std::list<ConnectionPtr> connections;
157 private:
bool initialized;
158 private:
bool stop, stopped;
159 private: boost::thread *thread;
161 private:
unsigned int tmpIndex;
162 private: boost::recursive_mutex *listMutex;
163 private: boost::recursive_mutex *masterMessagesMutex;
164 private: boost::recursive_mutex *connectionMutex;
166 private: std::list<msgs::Publish> publishers;
167 private: std::list<std::string> namespaces;
168 private: std::list<std::string> masterMessages;