| 4199 | } |
| 4200 | |
| 4201 | void routing_manager_impl::unregister_event(client_t _client, service_t _service, instance_t _instance, event_t _event, bool _is_provided) { |
| 4202 | (void)_client; |
| 4203 | std::shared_ptr<event> its_unrefed_event; |
| 4204 | { |
| 4205 | std::scoped_lock its_lock(events_mutex_); |
| 4206 | const auto search = events_.find(service_instance_t{_service, _instance}); |
| 4207 | if (search != events_.end()) { |
| 4208 | const auto found_event = search->second.find(_event); |
| 4209 | if (found_event != search->second.end()) { |
| 4210 | auto its_event = found_event->second; |
| 4211 | its_event->remove_ref(_client, _is_provided); |
| 4212 | if (!its_event->has_ref()) { |
| 4213 | its_unrefed_event = its_event; |
| 4214 | search->second.erase(found_event); |
| 4215 | } else if (_is_provided) { |
| 4216 | its_event->set_provided(false); |
| 4217 | } |
| 4218 | } |
| 4219 | } |
| 4220 | } |
| 4221 | if (its_unrefed_event) { |
| 4222 | auto its_eventgroups = its_unrefed_event->get_eventgroups(); |
| 4223 | for (auto eg : its_eventgroups) { |
| 4224 | std::shared_ptr<eventgroupinfo> its_eventgroup_info = find_eventgroup(_service, _instance, eg); |
| 4225 | if (its_eventgroup_info) { |
| 4226 | its_eventgroup_info->remove_event(its_unrefed_event); |
| 4227 | if (0 == its_eventgroup_info->get_events().size()) { |
| 4228 | remove_eventgroup_info(_service, _instance, eg); |
| 4229 | } |
| 4230 | } |
| 4231 | } |
| 4232 | } |
| 4233 | } |
| 4234 | |
| 4235 | std::set<std::shared_ptr<eventgroupinfo>> routing_manager_impl::find_eventgroups(service_t _service, instance_t _instance) const { |
| 4236 |
no test coverage detected