summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-10 15:14:56 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:10:41 +0100
commit7b131462d3b84f9fd5e87938c5f26d951d39a6cb (patch)
tree1e5ac1db9bb31f33707701f94ba3b418a777fc98 /src/utils
parent390edc67f93cb9447fb4585a12f58a63754c56d5 (diff)
Instead of a global pointer, config is now a Singleton.
Change-Id: I0cfc34f330c531ba5f070542a1cb723be4bcc70a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/signals.cpp8
-rw-r--r--src/utils/signals.hpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/signals.cpp b/src/utils/signals.cpp
index 7393409..9e71929 100644
--- a/src/utils/signals.cpp
+++ b/src/utils/signals.cpp
@@ -60,12 +60,12 @@ std::vector<std::string> find_signals(const openxc_DynamicField &key)
switch(key.type)
{
case openxc_DynamicField_Type::openxc_DynamicField_Type_STRING:
- lookup_signals_by_name(key.string_value, config->get_can_signals(), found_signals_name);
- lookup_signals_by_name(key.string_value, config->get_obd2_signals(), found_signals_name);
+ lookup_signals_by_name(key.string_value, configuration_t::instance().get_can_signals(), found_signals_name);
+ lookup_signals_by_name(key.string_value, configuration_t::instance().get_obd2_signals(), found_signals_name);
break;
case openxc_DynamicField_Type::openxc_DynamicField_Type_NUM:
- lookup_signals_by_id(key.numeric_value, config->get_can_signals(), found_signals_name);
- lookup_signals_by_id(key.numeric_value, config->get_obd2_signals(), found_signals_name);
+ lookup_signals_by_id(key.numeric_value, configuration_t::instance().get_can_signals(), found_signals_name);
+ lookup_signals_by_id(key.numeric_value, configuration_t::instance().get_obd2_signals(), found_signals_name);
break;
default:
ERROR(binder_interface, "find_signals: wrong openxc_DynamicField specified. Use openxc_DynamicField_Type_NUM or openxc_DynamicField_Type_STRING type only.");
diff --git a/src/utils/signals.hpp b/src/utils/signals.hpp
index fe86953..4380045 100644
--- a/src/utils/signals.hpp
+++ b/src/utils/signals.hpp
@@ -64,7 +64,7 @@ void lookup_signals_by_id(const double key, std::vector<T>& signals, std::vector
{
for(T& s : signals)
{
- if(config->get_signal_id(s) == key)
+ if(configuration_t::instance().get_signal_id(s) == key)
{
found_signals.push_back(&s);
}
@@ -76,7 +76,7 @@ void lookup_signals_by_id(const double key, std::vector<T>& signals, std::vector
{
for(T& s : signals)
{
- if(config->get_signal_id(s) == key)
+ if(configuration_t::instance().get_signal_id(s) == key)
{
found_signals_name.push_back(s.get_generic_name());
}