18 #ifndef GZ_TRANSPORT_HANDLERSTORAGE_HH_
19 #define GZ_TRANSPORT_HANDLERSTORAGE_HH_
26 #include "gz/transport/config.hh"
32 inline namespace GZ_TRANSPORT_VERSION_NAMESPACE {
68 if (this->data.find(_topic) == this->data.end())
71 _handlers = this->data.at(_topic);
87 if (this->data.find(_topic) == this->data.end())
90 const auto &m = this->data.at(_topic);
91 for (
const auto &node : m)
93 for (
const auto &handler : node.second)
95 if (_reqTypeName == handler.second->ReqTypeName() &&
96 _repTypeName == handler.second->RepTypeName())
98 _handler = handler.second;
116 if (this->data.find(_topic) == this->data.end())
119 const auto &m = this->data.at(_topic);
120 for (
const auto &node : m)
122 for (
const auto &handler : node.second)
124 if (_msgTypeName == handler.second->TypeName() ||
127 _handler = handler.second;
146 if (this->data.find(_topic) == this->data.end())
149 auto const &m = this->data.at(_topic);
150 if (m.find(_nUuid) == m.end())
153 if (m.at(_nUuid).find(_hUuid) == m.at(_nUuid).end())
156 _handler = m.at(_nUuid).at(_hUuid);
177 if (this->data.find(_topic) == this->data.end())
181 if (this->data[_topic].find(_nUuid) == this->data[_topic].end())
185 this->data[_topic][_nUuid].insert(
195 if (this->data.find(_topic) == this->data.end())
198 return !this->data.at(_topic).empty();
208 if (this->data.find(_topic) == this->data.end())
211 return this->data.at(_topic).find(_nUuid) !=
212 this->data.at(_topic).end();
226 if (this->data.find(_topic) != this->data.end())
228 if (this->data[_topic].find(_nUuid) != this->data[_topic].end())
230 counter = this->data[_topic][_nUuid].erase(_reqUuid);
231 if (this->data[_topic][_nUuid].empty())
232 this->data[_topic].erase(_nUuid);
233 if (this->data[_topic].empty())
234 this->data.erase(_topic);
249 if (this->data.find(_topic) != this->data.end())
251 counter = this->data[_topic].erase(_nUuid);
252 if (this->data[_topic].empty())
253 this->data.erase(_topic);
262 private: TopicServiceCalls_M data;