18 #ifndef GZ_TRANSPORT_HANDLERSTORAGE_HH_
19 #define GZ_TRANSPORT_HANDLERSTORAGE_HH_
26 #include "gz/transport/config.hh"
34 inline namespace GZ_TRANSPORT_VERSION_NAMESPACE {
70 if (this->data.find(_topic) == this->data.end())
73 _handlers = this->data.at(_topic);
89 if (this->data.find(_topic) == this->data.end())
92 const auto &m = this->data.at(_topic);
93 for (
const auto &node : m)
95 for (
const auto &handler : node.second)
97 if (_reqTypeName == handler.second->ReqTypeName() &&
98 _repTypeName == handler.second->RepTypeName())
100 _handler = handler.second;
118 if (this->data.find(_topic) == this->data.end())
121 const auto &m = this->data.at(_topic);
122 for (
const auto &node : m)
124 for (
const auto &handler : node.second)
126 if (_msgTypeName == handler.second->TypeName() ||
129 _handler = handler.second;
148 if (this->data.find(_topic) == this->data.end())
151 auto const &m = this->data.at(_topic);
152 if (m.find(_nUuid) == m.end())
155 if (m.at(_nUuid).find(_hUuid) == m.at(_nUuid).end())
158 _handler = m.at(_nUuid).at(_hUuid);
172 if (this->data.find(_topic) == this->data.end())
176 if (this->data[_topic].find(_nUuid) == this->data[_topic].end())
180 this->data[_topic][_nUuid].insert(
190 if (this->data.find(_topic) == this->data.end())
193 return !this->data.at(_topic).empty();
203 if (this->data.find(_topic) == this->data.end())
206 return this->data.at(_topic).find(_nUuid) !=
207 this->data.at(_topic).end();
221 if (this->data.find(_topic) != this->data.end())
223 if (this->data[_topic].find(_nUuid) != this->data[_topic].end())
225 counter = this->data[_topic][_nUuid].erase(_reqUuid);
226 if (this->data[_topic][_nUuid].empty())
227 this->data[_topic].erase(_nUuid);
228 if (this->data[_topic].empty())
229 this->data.erase(_topic);
244 if (this->data.find(_topic) != this->data.end())
246 counter = this->data[_topic].erase(_nUuid);
247 if (this->data[_topic].empty())
248 this->data.erase(_topic);
257 private: TopicServiceCalls_M data;