MCPcopy Create free account
hub / github.com/COVESA/vsomeip / on_unsubscribe_ack

Method on_unsubscribe_ack

implementation/routing/src/routing_manager_impl.cpp:3393–3429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3391}
3392
3393void routing_manager_impl::on_unsubscribe_ack(client_t _client, service_t _service, instance_t _instance, eventgroup_t _eventgroup,
3394 remote_subscription_id_t _id) {
3395 std::shared_ptr<eventgroupinfo> its_info = find_eventgroup(_service, _instance, _eventgroup);
3396 if (its_info) {
3397 std::unique_lock its_update_lock{update_remote_subscription_mutex_};
3398 const auto its_subscription = its_info->get_remote_subscription(_id);
3399 if (its_subscription) {
3400 its_info->remove_remote_subscription(_id);
3401
3402 if (its_info->get_remote_subscriptions().size() == 0) {
3403 for (const auto& its_event : its_info->get_events()) {
3404 bool has_remote_subscriber(false);
3405 for (const auto& its_eventgroup : its_event->get_eventgroups()) {
3406 const auto its_eventgroup_info = find_eventgroup(_service, _instance, its_eventgroup);
3407 if (its_eventgroup_info && its_eventgroup_info->get_remote_subscriptions().size() > 0) {
3408 has_remote_subscriber = true;
3409 }
3410 }
3411
3412 if (!has_remote_subscriber && its_event->is_shadow()) {
3413 if (its_event->is_set()) {
3414 VSOMEIP_INFO_P << "Unsetting payload for [" << hex4(_service) << "." << hex4(_instance) << "."
3415 << hex4(its_event->get_event()) << "]";
3416 }
3417 its_event->unset_payload();
3418 }
3419 }
3420 }
3421 } else {
3422 VSOMEIP_ERROR_P << "Unknown StopSubscribe for eventgroup [" << hex4(_service) << "." << hex4(_instance) << "."
3423 << hex4(_eventgroup) << "] id=" << hex4(_id);
3424 }
3425 } else {
3426 VSOMEIP_ERROR_P << "Received StopSubscribe for unknown eventgroup: (" << hex4(_client) << "): [" << hex4(_service) << "."
3427 << hex4(_instance) << "." << hex4(_eventgroup) << "] id=" << hex4(_id);
3428 }
3429}
3430
3431void routing_manager_impl::send_subscription(const client_t _offering_client, const service_t _service, const instance_t _instance,
3432 const eventgroup_t _eventgroup, const major_version_t _major,

Callers 1

on_messageMethod · 0.80

Calls 11

hex4Function · 0.85
get_eventsMethod · 0.80
is_shadowMethod · 0.80
is_setMethod · 0.80
unset_payloadMethod · 0.80
sizeMethod · 0.45
get_eventgroupsMethod · 0.45
get_eventMethod · 0.45

Tested by

no test coverage detected