17 #ifndef _TOPICMANAGER_HH_
18 #define _TOPICMANAGER_HH_
20 #include <boost/bind.hpp>
98 public:
template<
typename M>
100 unsigned int _queueLimit)
102 google::protobuf::Message *msg =
NULL;
104 msg =
dynamic_cast<google::protobuf::Message *
>(&msgtype);
106 gzthrow(
"Advertise requires a google protobuf type");
111 msg->GetTypeName(), _queueLimit));
113 std::string msgTypename;
117 for (
int i = 0; i < 2; i ++)
123 msgTypename = msg->GetTypeName();
127 t = _topic +
"/__dbg";
129 msgTypename = tmp.GetTypeName();
140 pub->SetPublication(publication, i);
142 SubNodeMap::iterator iter2;
143 SubNodeMap::iterator st_end2 = this->subscribedNodes.end();
144 for (iter2 = this->subscribedNodes.begin();
145 iter2 != st_end2; iter2++)
147 if (iter2->first == t)
149 std::list<NodePtr>::iterator liter;
150 std::list<NodePtr>::iterator l_end = iter2->second.end();
151 for (liter = iter2->second.begin();
152 liter != l_end; liter++)
165 public:
void Unadvertise(
const std::string &_topic);
172 public:
void Publish(
const std::string &_topic,
173 const google::protobuf::Message &_message,
174 const boost::function<
void()> &_cb =
NULL);
191 const std::string &_host,
199 const std::string &_host,
212 const std::string &_msgType);
226 public: std::map<std::string, std::list<std::string> >
239 private: typedef std::map<std::
string,
PublicationPtr> PublicationPtr_M;
240 private: PublicationPtr_M advertisedTopics;
241 private: PublicationPtr_M::iterator advertisedTopicsEnd;
242 private: SubNodeMap subscribedNodes;
243 private: std::vector<
NodePtr> nodes;
245 private: boost::recursive_mutex *nodeMutex;
247 private:
bool pauseIncoming;