aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/utils
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-11-26 16:19:43 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-11-28 16:11:47 +0100
commita16b570f1e8607f1c984cef4c281df9d5b7b129e (patch)
tree16a0dca0e37c74eb2323926c8013dd4f9c88da33 /low-can-binding/utils
parentb5401df91ef1ded2430b8337294f9a1d7a5cb77f (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 Bug-AGL: SPEC-2976 Change-Id: I1d6410ebfc8ea82d33addf1bb828d9cd810b006a Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/utils')
-rw-r--r--low-can-binding/utils/signals.hpp9
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)
{