ConfigDataGroups class. stores an array of ConfigDataGroup created from the config file.
More...
#include <ConfigDataGroups.hpp>
ConfigDataGroups class. stores an array of ConfigDataGroup created from the config file.
◆ ConfigDataGroups()
ConfigDataGroups::ConfigDataGroups |
( |
| ) |
|
std::vector< std::shared_ptr< ConfigDataGroup > > groups_
Definition: ConfigDataGroups.hpp:59
◆ ~ConfigDataGroups()
ConfigDataGroups::~ConfigDataGroups |
( |
| ) |
|
|
override |
◆ addGroup()
void ConfigDataGroups::addGroup |
( |
std::shared_ptr< ConfigDataGroup > |
group | ) |
|
◆ configInit()
void ConfigDataGroups::configInit |
( |
const Json::Value & |
root | ) |
|
|
overridevirtual |
Must be called after instanciation to load the config file. Parses the json root and creates ConfigDataGroup objects.
- Parameters
-
Implements ConfigDataBase.
34 if (root.empty() || !root.isArray()) {
35 throw std::runtime_error(
"Invalid configuration file");
37 for (
auto &group : root) {
38 auto group_ = std::make_shared<ConfigDataGroup>();
39 group_->configInit(group);
@ L_INFO
Definition: Logger.hpp:49
virtual void Log(const std::string &message, LogLevel level) const
Log a message This method logs a message to the log file or stream. The message is only logged if the...
Definition: Logger.cpp:73
static Logger * GetInstance()
Get the Logger object.
Definition: Logger.cpp:41
References Logger::GetInstance(), groups_, L_INFO, and Logger::Log().
◆ configSave()
Json::Value ConfigDataGroups::configSave |
( |
| ) |
|
|
overridevirtual |
Build a Json::Value object with the configuration.
- Returns
- Json::Value Object with the current runtime configuration
Implements ConfigDataBase.
◆ getGroup()
◆ getGroups()
const std::vector< std::shared_ptr< ConfigDataGroup > > & ConfigDataGroups::getGroups |
( |
| ) |
const |
◆ removeGroup()
52 if (it->get() == group) {
References groups_.
◆ groups_
The documentation for this class was generated from the following files: