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.cpp | |
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.cpp')
-rw-r--r-- | src/configuration.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp index cfa728e7..123f8a1c 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -51,6 +51,12 @@ std::vector<std::vector<can_message_definition_t>> CAN_MESSAGES_DEFINTION; std::vector<std::vector<can_signal_t>> SIGNALS; +configuration_t& configuration_t::instance() +{ + static configuration_t config; + return config; +} + configuration_t::configuration_t() : can_message_set_{CAN_MESSAGE_SET}, can_signals_{SIGNALS}, obd2_signals_{OBD2_PIDS}, can_message_definition_{CAN_MESSAGES_DEFINTION} {} |