Config management for the Project.
More...
Go to the source code of this file.
|
void | NAV::ConfigManager::CheckOptions (const int argc, const char *argv[]) |
| Writes all command line options into the log.
|
|
void | NAV::ConfigManager::deinitialize () |
| Deinitializes the config manager. Call this if you want to Fetch config again.
|
|
std::vector< std::string > | NAV::ConfigManager::FetchConfigs (const int argc, const char *argv[]) |
| Fetches the configs from the command line parameters.
|
|
template<typename T > |
const T & | NAV::ConfigManager::Get (const std::string &key) |
| Retrieves the value of a corresponding key from the configuration, if it does not exists, throws an exception.
|
|
template<typename T > |
const T & | NAV::ConfigManager::Get (const std::string &key, const T &defaultValue) |
| Retrieves the value of a corresponding key from the configuration, if one exists.
|
|
std::vector< std::string > | NAV::ConfigManager::GetKeys () |
| Returns all keys in the configuration, as a vector.
|
|
const boost::program_options::options_description & | NAV::ConfigManager::GetProgramOptions () |
| Get the Program Options object.
|
|
bool | NAV::ConfigManager::HasKey (const std::string &key) |
| Checks if a corresponding key exists in the configuration.
|
|
void | NAV::ConfigManager::initialize () |
| Initializes the config manager. Call this function before using other functions.
|
|
void | NAV::ConfigManager::LoadGlobalSettings () |
| Loads the global settings.
|
|
void | NAV::ConfigManager::SaveGlobalSettings () |
| Saves the global settings.
|
|
|
boost::program_options::variables_map | NAV::ConfigManager::vm |
| Map which stores all options.
|
|
Config management for the Project.
- Author
- T. Topp (topp@.nosp@m.ins..nosp@m.uni-s.nosp@m.tutt.nosp@m.gart..nosp@m.de)
- Date
- 2020-03-11
◆ CheckOptions()
void NAV::ConfigManager::CheckOptions |
( |
const int | argc, |
|
|
const char * | argv[] ) |
Writes all command line options into the log.
- Parameters
-
[in] | argc | Number of command line parameters |
[in] | argv | Array of the command line parameters |
◆ FetchConfigs()
std::vector< std::string > NAV::ConfigManager::FetchConfigs |
( |
const int | argc, |
|
|
const char * | argv[] ) |
Fetches the configs from the command line parameters.
- Parameters
-
[in] | argc | Number of command line parameters |
[in] | argv | Array of the command line parameters |
- Returns
- List of config files which failed to be read (for error reporting)
◆ Get() [1/2]
template<typename T >
const T & NAV::ConfigManager::Get |
( |
const std::string & | key | ) |
|
Retrieves the value of a corresponding key from the configuration, if it does not exists, throws an exception.
- Template Parameters
-
- Parameters
-
- Returns
- The value found with the key
◆ Get() [2/2]
template<typename T >
const T & NAV::ConfigManager::Get |
( |
const std::string & | key, |
|
|
const T & | defaultValue ) |
Retrieves the value of a corresponding key from the configuration, if one exists.
- Template Parameters
-
- Parameters
-
[in] | key | Key to search for |
[in] | defaultValue | If key is not found, the default value is returned |
- Returns
- The value found with the key or the default value
◆ GetProgramOptions()
const boost::program_options::options_description & NAV::ConfigManager::GetProgramOptions |
( |
| ) |
|
Get the Program Options object.
- Returns
- The object