| 1090 | } |
| 1091 | |
| 1092 | void application_impl::on_subscription_status(service_t _service, instance_t _instance, eventgroup_t _eventgroup, event_t _event, |
| 1093 | uint16_t _error) { |
| 1094 | |
| 1095 | bool entry_found(false); |
| 1096 | { |
| 1097 | std::scoped_lock its_lock{subscriptions_state_mutex_}; |
| 1098 | if (auto its_si = subscriptions_state_.find({_service, _instance}); its_si != subscriptions_state_.end() |
| 1099 | || (its_si = subscriptions_state_.find({ANY_SERVICE, _instance})) != subscriptions_state_.end()) { |
| 1100 | auto its_eventgroup = its_si->second.find(_eventgroup); |
| 1101 | if (its_eventgroup == its_si->second.end()) { |
| 1102 | its_eventgroup = its_si->second.find(ANY_EVENTGROUP); |
| 1103 | } |
| 1104 | if (its_eventgroup != its_si->second.end()) { |
| 1105 | auto its_event = its_eventgroup->second.find(_event); |
| 1106 | if (its_event == its_eventgroup->second.end()) { |
| 1107 | its_event = its_eventgroup->second.find(ANY_EVENT); |
| 1108 | } |
| 1109 | if (its_event != its_eventgroup->second.end()) { |
| 1110 | entry_found = true; |
| 1111 | its_event->second = (_error ? subscription_state_e::SUBSCRIPTION_NOT_ACKNOWLEDGED |
| 1112 | : subscription_state_e::SUBSCRIPTION_ACKNOWLEDGED); |
| 1113 | } |
| 1114 | auto its_any_event = its_eventgroup->second.find(ANY_EVENT); |
| 1115 | if (its_any_event != its_eventgroup->second.end()) { |
| 1116 | entry_found = true; |
| 1117 | its_any_event->second = (_error ? subscription_state_e::SUBSCRIPTION_NOT_ACKNOWLEDGED |
| 1118 | : subscription_state_e::SUBSCRIPTION_ACKNOWLEDGED); |
| 1119 | } |
| 1120 | } |
| 1121 | } |
| 1122 | } |
| 1123 | if (entry_found) { |
| 1124 | deliver_subscription_state(_service, _instance, _eventgroup, _event, _error); |
| 1125 | } |
| 1126 | } |
| 1127 | |
| 1128 | void application_impl::deliver_subscription_state(service_t _service, instance_t _instance, eventgroup_t _eventgroup, event_t _event, |
| 1129 | uint16_t _error) { |
no test coverage detected