diff options
author | Jürgen Gehring <Juergen.Gehring@bmw.de> | 2016-09-20 03:59:53 -0700 |
---|---|---|
committer | Jürgen Gehring <Juergen.Gehring@bmw.de> | 2016-09-20 03:59:53 -0700 |
commit | 273814c76be4a8f906dc053492529b8d53b9e807 (patch) | |
tree | e7160dc68fe3f478a0c5c86aaccaeb620d528b63 /implementation/routing/include/eventgroupinfo.hpp | |
parent | 4c5d160362d8693aed8abd642212e68c9778bbda (diff) | |
download | vSomeIP-273814c76be4a8f906dc053492529b8d53b9e807.tar.gz |
vSomeIP 2.2.42.2.4
Diffstat (limited to 'implementation/routing/include/eventgroupinfo.hpp')
-rw-r--r-- | implementation/routing/include/eventgroupinfo.hpp | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/implementation/routing/include/eventgroupinfo.hpp b/implementation/routing/include/eventgroupinfo.hpp index 08536e0..7e832a1 100644 --- a/implementation/routing/include/eventgroupinfo.hpp +++ b/implementation/routing/include/eventgroupinfo.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// Copyright (C) 2014-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,6 +6,8 @@ #ifndef VSOMEIP_EVENTGROUPINFO_HPP #define VSOMEIP_EVENTGROUPINFO_HPP +#include <chrono> +#include <list> #include <memory> #include <set> @@ -21,6 +23,15 @@ class event; class eventgroupinfo { public: + struct target_t { + std::shared_ptr<endpoint_definition> endpoint_; + std::chrono::high_resolution_clock::time_point expiration_; + + bool operator==(const target_t &_other) const { + return (endpoint_ == _other.endpoint_); + } + }; + VSOMEIP_EXPORT eventgroupinfo(); VSOMEIP_EXPORT eventgroupinfo(major_version_t _major, ttl_t _ttl); VSOMEIP_EXPORT ~eventgroupinfo(); @@ -41,22 +52,32 @@ public: VSOMEIP_EXPORT void add_event(std::shared_ptr<event> _event); VSOMEIP_EXPORT void remove_event(std::shared_ptr<event> _event); - VSOMEIP_EXPORT const std::set< - std::shared_ptr<endpoint_definition> > get_targets() const; - VSOMEIP_EXPORT bool add_target(std::shared_ptr<endpoint_definition> _target); - VSOMEIP_EXPORT bool remove_target(std::shared_ptr<endpoint_definition> _target); + VSOMEIP_EXPORT const std::list<target_t> get_targets() const; + VSOMEIP_EXPORT uint32_t get_unreliable_target_count(); + + VSOMEIP_EXPORT bool add_target(const target_t &_target); + VSOMEIP_EXPORT bool add_target(const target_t &_target, const target_t &_subscriber); + VSOMEIP_EXPORT bool update_target( + const std::shared_ptr<endpoint_definition> &_target, + const std::chrono::high_resolution_clock::time_point &_expiration); + VSOMEIP_EXPORT bool remove_target( + const std::shared_ptr<endpoint_definition> &_target); VSOMEIP_EXPORT void clear_targets(); + VSOMEIP_EXPORT void add_multicast_target(const target_t &_multicast_target); + VSOMEIP_EXPORT void clear_multicast_targets(); + VSOMEIP_EXPORT const std::list<target_t> get_multicast_targets() const; + private: major_version_t major_; ttl_t ttl_; - bool is_multicast_; boost::asio::ip::address address_; uint16_t port_; std::set<std::shared_ptr<event> > events_; - std::set<std::shared_ptr<endpoint_definition> > targets_; + std::list<target_t> targets_; + std::list<target_t> multicast_targets_; }; } // namespace vsomeip |