23 #include "softwarecontainer-common.h" 24 #include "configloader.h" 25 #include "configsource.h" 26 #include "configdefinition.h" 70 LOG_DECLARE_CLASS_CONTEXT(
"CFG",
"Config");
90 Config(std::vector<std::unique_ptr<ConfigSource>> sources,
91 MandatoryConfigs mandatory,
92 ConfigDependencies dependencies);
107 std::string
getStringValue(
const std::string &group,
const std::string &key)
const;
120 int getIntValue(
const std::string &group,
const std::string &key)
const;
133 bool getBoolValue(
const std::string &group,
const std::string &key)
const;
140 void assertDependencies();
146 void assertAllMandatoryPresent();
152 void readConfigsFromSources();
158 T getConfig(
const std::string &group,
159 const std::string &key,
160 const std::vector<T> &configs)
const;
166 T prioritizedConfig(
const std::vector<T> &configs)
const;
171 bool allDepsSatisfied(
const std::vector<UniqueKey> &dependencies)
const;
173 std::vector<std::unique_ptr<ConfigSource>> m_sources;
174 MandatoryConfigs m_mandatory;
175 ConfigDependencies m_dependencies;
176 std::vector<StringConfig> m_stringConfigs;
177 std::vector<IntConfig> m_intConfigs;
178 std::vector<BoolConfig> m_boolConfigs;
179 std::vector<UniqueKey> m_allConfigs;
bool getBoolValue(const std::string &group, const std::string &key) const
getBoolValue Get a config value of type bool
std::string getStringValue(const std::string &group, const std::string &key) const
getStringValue Get a config value of type string
int getIntValue(const std::string &group, const std::string &key) const
getIntValue Get a config value of type int
Developers guide to adding a config item:
Represents the configuration of SoftwareContainer (the component)
Config(std::vector< std::unique_ptr< ConfigSource >> sources, MandatoryConfigs mandatory, ConfigDependencies dependencies)
Constructor - retrieves all configs from the available sources.