Skip to content

Commit

Permalink
Support handling multiple services with the same service and instance…
Browse files Browse the repository at this point in the history
… IDs but different major version.
  • Loading branch information
KareemLMR committed Dec 20, 2024
1 parent 6461369 commit 59c8bb5
Show file tree
Hide file tree
Showing 53 changed files with 2,182 additions and 2,037 deletions.
64 changes: 32 additions & 32 deletions implementation/compat/runtime/include/application_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,52 +33,52 @@ class application_impl
void start();
void stop();

void offer_service(service_t _service, instance_t _instance,
void offer_service(service_t _service, unique_version_t _unique,
major_version_t _major, minor_version_t _minor);
void stop_offer_service(service_t _service, instance_t _instance,
void stop_offer_service(service_t _service, unique_version_t _unique,
major_version_t _major, minor_version_t _minor);

void offer_event(service_t _service, instance_t _instance, event_t _event,
void offer_event(service_t _service, unique_version_t _unique, event_t _event,
const std::set<eventgroup_t> &_eventgroups, bool _is_field);
void stop_offer_event(service_t _service, instance_t _instance,
void stop_offer_event(service_t _service, unique_version_t _unique,
event_t _event);

void request_service(service_t _service, instance_t _instance,
void request_service(service_t _service, unique_version_t _unique,
major_version_t _major, minor_version_t _minor,
bool _use_exclusive_proxy);
void release_service(service_t _service, instance_t _instance);
void release_service(service_t _service, unique_version_t _unique);

void request_event(service_t _service, instance_t _instance,
void request_event(service_t _service, unique_version_t _unique,
event_t _event, const std::set<eventgroup_t> &_eventgroups,
bool _is_field);
void release_event(service_t _service, instance_t _instance,
void release_event(service_t _service, unique_version_t _unique,
event_t _event);

void subscribe(service_t _service, instance_t _instance,
void subscribe(service_t _service, unique_version_t _unique,
eventgroup_t _eventgroup, major_version_t _major,
subscription_type_e _subscription_type,
event_t _event);
void unsubscribe(service_t _service, instance_t _instance,
void unsubscribe(service_t _service, unique_version_t _unique,
eventgroup_t _eventgroup);

bool is_available(service_t _service, instance_t _instance,
bool is_available(service_t _service, unique_version_t _unique,
major_version_t _major, minor_version_t _minor) const;

void send(std::shared_ptr<message> _message, bool _flush);
void notify(service_t _service, instance_t _instance,
void notify(service_t _service, unique_version_t _unique,
event_t _event, std::shared_ptr<payload> _payload) const;
void notify_one(service_t _service, instance_t _instance,
void notify_one(service_t _service, unique_version_t _unique,
event_t _event, std::shared_ptr<payload> _payload,
client_t _client) const;

void register_state_handler(state_handler_t _handler);
void unregister_state_handler();

void register_message_handler(service_t _service,
instance_t _instance, method_t _method,
unique_version_t _unique, method_t _method,
message_handler_t _handler);
void unregister_message_handler(service_t _service,
instance_t _instance, method_t _method);
unique_version_t _unique, method_t _method);

void register_availability_handler(service_t _service,
instance_t _instance, availability_handler_t _handler,
Expand All @@ -88,60 +88,60 @@ class application_impl
major_version_t _major, minor_version_t _minor);

void register_subscription_handler(service_t _service,
instance_t _instance, eventgroup_t _eventgroup,
unique_version_t _unique, eventgroup_t _eventgroup,
subscription_handler_t _handler);
void unregister_subscription_handler(service_t _service,
instance_t _instance, eventgroup_t _eventgroup);
unique_version_t _unique, eventgroup_t _eventgroup);

void register_subscription_error_handler(service_t _service,
instance_t _instance, eventgroup_t _eventgroup,
unique_version_t _unique, eventgroup_t _eventgroup,
error_handler_t _handler);
void unregister_subscription_error_handler(service_t _service,
instance_t _instance, eventgroup_t _eventgroup);
unique_version_t _unique, eventgroup_t _eventgroup);

void clear_all_handler();

bool is_routing() const;

void offer_event(service_t _service,
instance_t _instance, event_t _event,
unique_version_t _unique, event_t _event,
const std::set<eventgroup_t> &_eventgroups,
bool _is_field,
std::chrono::milliseconds _cycle,
bool _change_resets_cycle,
const epsilon_change_func_t &_epsilon_change_func);

void notify(service_t _service, instance_t _instance,
void notify(service_t _service, unique_version_t _unique,
event_t _event, std::shared_ptr<payload> _payload,
bool _force) const;

void notify_one(service_t _service, instance_t _instance,
void notify_one(service_t _service, unique_version_t _unique,
event_t _event, std::shared_ptr<payload> _payload,
client_t _client, bool _force) const;

bool are_available(available_t &_available,
service_t _service, instance_t _instance,
service_t _service, unique_version_t _unique,
major_version_t _major, minor_version_t _minor) const;

void notify(service_t _service, instance_t _instance,
void notify(service_t _service, unique_version_t _unique,
event_t _event, std::shared_ptr<payload> _payload,
bool _force, bool _flush) const;

void notify_one(service_t _service, instance_t _instance,
void notify_one(service_t _service, unique_version_t _unique,
event_t _event, std::shared_ptr<payload> _payload,
client_t _client, bool _force, bool _flush) const;

void set_routing_state(routing_state_e _routing_state);

void unsubscribe(service_t _service, instance_t _instance,
void unsubscribe(service_t _service, unique_version_t _unique,
eventgroup_t _eventgroup, event_t _event);

void register_subscription_status_handler(service_t _service,
instance_t _instance, eventgroup_t _eventgroup, event_t _event,
unique_version_t _unique, eventgroup_t _eventgroup, event_t _event,
subscription_status_handler_t _handler);

void register_subscription_status_handler(service_t _service,
instance_t _instance, eventgroup_t _eventgroup, event_t _event,
unique_version_t _unique, eventgroup_t _eventgroup, event_t _event,
subscription_status_handler_t _handler, bool _is_selective);

void get_offered_services_async(
Expand All @@ -151,7 +151,7 @@ class application_impl
watchdog_handler_t _handler, std::chrono::seconds _interval);

virtual void register_async_subscription_handler(
service_t _service, instance_t _instance, eventgroup_t _eventgroup,
service_t _service, unique_version_t _unique, eventgroup_t _eventgroup,
async_subscription_handler_t _handler);

virtual void set_offer_acceptance_required(
Expand All @@ -172,7 +172,7 @@ class application_impl
routing_state_handler_t _handler);

virtual bool update_service_configuration(
service_t _service, instance_t _instance,
service_t _service, unique_version_t _unique,
std::uint16_t _port, bool _reliable,
bool _magic_cookies_enabled, bool _offer);

Expand All @@ -186,14 +186,14 @@ class application_impl

private:
bool is_selective_event(
vsomeip::service_t _service, vsomeip::instance_t _instance,
vsomeip::service_t _service, vsomeip::unique_version_t _unique,
const std::set<vsomeip::eventgroup_t> &_eventgroups);

private:
std::shared_ptr<vsomeip_v3::application> impl_;

std::map<service_t,
std::map<instance_t, std::set<eventgroup_t> > > eventgroups_;
std::map<unique_version_t, std::set<eventgroup_t> > > eventgroups_;
std::mutex eventgroups_mutex_;
};

Expand Down
Loading

0 comments on commit 59c8bb5

Please sign in to comment.