softwarecontainer  0.18.0-739e8d7 2017-05-04
softwarecontainer::MainConfigSource Class Reference
Inheritance diagram for softwarecontainer::MainConfigSource:
[legend]
Collaboration diagram for softwarecontainer::MainConfigSource:
[legend]

Public Member Functions

 MainConfigSource (std::unique_ptr< ConfigLoader > loader, TypeMap typeMapping)
 
std::vector< StringConfigstringConfigs () override
 
std::vector< IntConfigintConfigs () override
 
std::vector< BoolConfigboolConfigs () override
 
template<>
std::string getGlibValue (const std::string &group, const std::string &key) const
 
template<>
int getGlibValue (const std::string &group, const std::string &key) const
 
template<>
bool getGlibValue (const std::string &group, const std::string &key) const
 

Detailed Description

Definition at line 31 of file mainconfigsource.h.

Constructor & Destructor Documentation

softwarecontainer::MainConfigSource::MainConfigSource ( std::unique_ptr< ConfigLoader loader,
TypeMap  typeMapping 
)
Exceptions
ConfigUnknownErrorIf any config item found in the loaded config does not match what is defined in ConfigDefinition
ConfigFileErrorIf a known config item could not be parsed

Definition at line 27 of file mainconfigsource.cpp.

27  :
28  m_loader(std::move(loader)),
29  m_typeMapping(std::move(typeMapping)),
30  m_configsByGroup(std::map<std::string, std::vector<std::string>>()),
31  m_stringConfigs(std::vector<StringConfig>()),
32  m_intConfigs(std::vector<IntConfig>()),
33  m_boolConfigs(std::vector<BoolConfig>())
34 {
35  log_debug() << "Initializing main config source";
36 
37  /*
38  * The order of the calls below is important as some calls modify members
39  * that subsequent calls uses. In general, all errors that can occur are turned
40  * into ConfigError of various kinds and thrown where the error happened.
41  * These exceptions are not caught and handled anywhere, they are propagated to
42  * the creator of MainConfigSource.
43  */
44 
45  loadConfig();
46  readLoadedConfig();
47  createConfigItems();
48 }

The documentation for this class was generated from the following files: