19 #ifndef NAF_TOOLS_SETTINGSMANAGER
20 #define NAF_TOOLS_SETTINGSMANAGER
29 #include "tools/dvalue.h"
30 #include "yaml-cpp/node/detail/iterator_fwd.h"
31 #include "yaml-cpp/node/node.h"
32 #include "yaml-cpp/yaml.h"
33 #include "Poco/Exception.h"
35 #include "tools/dvalue.h"
41 class SettingsManager;
61 Tools::DValue::Type type;
67 static std::vector<Setting>& get_settings()
69 auto& var = settings_;
72 static std::string get_config_path() {
return config_path_; }
74 static void set_config_path(std::string config_path) { config_path_ = config_path; }
76 static std::vector<Setting>::iterator GetSetting_(std::string setting_name);
77 static std::string GetSetting_(std::string setting_name,
const char* another_value);
78 static std::string GetSetting_(std::string setting_name, std::string another_value);
79 static int GetSetting_(std::string setting_name,
int another_value);
80 static float GetSetting_(std::string setting_name,
float another_value);
81 static bool GetSetting_(std::string setting_name,
bool another_value);
82 static void AddSetting_(std::string name, Tools::DValue::Type type, Tools::DValue value);
83 static void AddBasicSettings_();
84 static void ReadSettings_();
87 static bool VerifyYAMLScalarNode_(YAML::Node& node);
88 static bool VerifyYAMLMapNode_(YAML::Node& node);
89 static void PrintError_(std::string
function, std::string variable);
92 static std::mutex mutex_;
93 static std::vector<Setting> settings_;
94 static std::string config_path_;