diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-10 15:14:56 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:10:41 +0100 |
commit | 7b131462d3b84f9fd5e87938c5f26d951d39a6cb (patch) | |
tree | 1e5ac1db9bb31f33707701f94ba3b418a777fc98 /src/configuration.hpp | |
parent | 390edc67f93cb9447fb4585a12f58a63754c56d5 (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/configuration.hpp')
-rw-r--r-- | src/configuration.hpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/configuration.hpp b/src/configuration.hpp index 981e69e4..9aaf41e5 100644 --- a/src/configuration.hpp +++ b/src/configuration.hpp @@ -45,9 +45,12 @@ class configuration_t diagnostic_manager_t diagnostic_manager_; uint8_t active_message_set_ = 0; - public: + /// Private constructor with implementation generated by the AGL generator. configuration_t(); + public: + static configuration_t& instance(); + std::vector<can_message_set_t> can_message_set_; std::vector<std::vector<can_signal_t>> can_signals_; std::vector<std::vector<obd2_signal_t>> obd2_signals_; @@ -105,7 +108,3 @@ class configuration_t bool isBusActive(can_bus_dev_t* bus); */ }; - -// Make a global variable pointer -extern configuration_t *config; - |