Deepsolver
|
Central configuration processing class. More...
Public Member Functions | |
void | commit () |
Verifies read configuration data. | |
ConfigCenter () | |
The default constructor. | |
void | loadFromFile (const std::string &fileName) |
reads one configuration file | |
const ConfRoot & | root () const |
Returns the reference to parsed configuration data. | |
virtual | ~ConfigCenter () |
The destructor. |
This class designed as central place to store all configuration information necessary for all operations except repository index building. Every client application should create the instance of this class, process with it configuration files it need and provide the reference to OperationCore or InfoCore classes depending on required task.
Configuration center class strongly associated with ConfigFile class since it is used for configuration file syntax processing. During configuration file reading two types of exceptions can be thrown: ConfigFileException and ConfigException. The first type is used for syntax error indication only, the second one is designed for general configuration data validation problems.
Do not forget to call commit() method after configuration files reading. Some data may be left unprepared without commit() method invocation. After configuration files processing configuration data is placed in various structures gathered in ConfRoot type and can be accessed directly.
void ConfigCenter::commit | ( | ) |
This method makes final configuration data preparing and performs various checks to be sure the data is valid. In case of errors ConfigException or ConfigFileException can be thrown. This method call is strongly required for proper further execution.
void ConfigCenter::loadFromFile | ( | const std::string & | fileName | ) |
This method reads one configuration file parses it and saves processed values into internal structures for further access. You can call it multiple times for different files but do not forget make final invocation of commit() method to validate received data.
This method throws two types of exceptions: ConfigFileException to indicate syntax problems and ConfigException for general errors.
[in] | fileName | Name of the file to read configuration data from |