diff options
author | Arthur Guyader <arthur.guyader@iot.bzh> | 2019-08-28 10:36:40 +0200 |
---|---|---|
committer | Arthur Guyader <arthur.guyader@iot.bzh> | 2019-08-30 15:08:52 +0200 |
commit | d4899192ccda96a8ee328bad3e16efdc98c2a856 (patch) | |
tree | 91d0723c2600db860f8af779edde50e022e75546 /low-can-binding/utils/signals.hpp | |
parent | b9b4580d5d55f81ce2cdc47d652b1aa3304ad772 (diff) |
Change vector to list to allow to remove signal.
This commit allows to remove signals. We need that because
subscription to an iso tp message needs to be individual.
Bug-AGL : SPEC-2779
Change-Id: I1d6410ebfc8ea82d33addf1bb828d9cd810b006a
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Diffstat (limited to 'low-can-binding/utils/signals.hpp')
-rw-r--r-- | low-can-binding/utils/signals.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/low-can-binding/utils/signals.hpp b/low-can-binding/utils/signals.hpp index 84e81d03..b28942e7 100644 --- a/low-can-binding/utils/signals.hpp +++ b/low-can-binding/utils/signals.hpp @@ -17,6 +17,7 @@ #pragma once +#include <list> #include <vector> #include <string> #include <fnmatch.h> @@ -32,8 +33,8 @@ namespace utils { struct signals_found { - std::vector<std::shared_ptr<signal_t> > signals; - std::vector<std::shared_ptr<diagnostic_message_t> > diagnostic_messages; + std::list<std::shared_ptr<signal_t> > signals; + std::list<std::shared_ptr<diagnostic_message_t> > diagnostic_messages; }; /// @brief Signal manager singleton hold subscription object with attached afb_event_t and its mutex @@ -59,7 +60,7 @@ namespace utils void find_signals(const openxc_DynamicField &key, std::vector<std::shared_ptr<signal_t> >& found_signals); template <typename T> - void lookup_signals_by_name(const std::string& key, std::vector<std::shared_ptr<T> > signals, std::vector<std::shared_ptr<T> >& found_signals) + void lookup_signals_by_name(const std::string& key, std::vector<std::shared_ptr<T> > signals, std::list<std::shared_ptr<T> >& found_signals) { for(std::shared_ptr<T> s : signals) { @@ -71,7 +72,7 @@ namespace utils } template <typename T> - void lookup_signals_by_id(const double key, std::vector<std::shared_ptr<T> > signals, std::vector<std::shared_ptr<T> >& found_signals) + void lookup_signals_by_id(const double key, std::vector<std::shared_ptr<T> > signals, std::list<std::shared_ptr<T> >& found_signals) { for(std::shared_ptr<T> s : signals) { |