17 #ifndef CONNECTION_MANAGER_HH
18 #define CONNECTION_MANAGER_HH
21 #include <boost/shared_ptr.hpp>
48 public:
bool Init(
const std::string &master_host,
49 unsigned int master_port);
63 public:
void Subscribe(
const std::string &_topic,
64 const std::string &_msgType,
67 public:
void Unsubscribe(
const msgs::Subscribe &_sub);
70 const std::string &_msgType);
72 public:
void Advertise(
const std::string &topic,
73 const std::string &msgType);
90 private:
ConnectionPtr FindConnection(
const std::string &host,
97 private:
void OnMasterRead(
const std::string &data);
102 const std::string &data);
104 private:
void ProcessMessage(
const std::string &_packet);
111 private: std::list<ConnectionPtr> connections;
114 private:
bool initialized;
115 private:
bool stop, stopped;
116 private: boost::thread *thread;
118 private:
unsigned int tmpIndex;
119 private: boost::recursive_mutex *listMutex;
120 private: boost::recursive_mutex *masterMessagesMutex;
121 private: boost::recursive_mutex *connectionMutex;
123 private: std::list<msgs::Publish> publishers;
124 private: std::list<std::string> namespaces;
125 private: std::list<std::string> masterMessages;