#include <cmconfig.h>
Public Member Functions | |
virtual | ~Config () |
virtual void | load_entry (const string &)=0 |
Initially load the relevant entry (if needed for the subclass). | |
Protected Member Functions | |
Config (const string &) | |
Protected Attributes | |
string | filename |
The filename of the configuration file. | |
Static Protected Attributes | |
static const std::vector < std::string > | config_keys |
The list of keys that should be loaded from the configuration file(s). | |
Static Private Attributes | |
static const char * | keytexts [] |
This array is only used to load the std::vector, below. |
Defining this symbol will causes informational and progress messages to be printed by the code that loads the configuration from the files.
Implement a generic interface to configuration. Because this is a sub-class of a specific instantiation of std::map<>, all values are mapped to strings, rather than numbers or booleans where appropriate. This is an arguable shortcoming.
Most accesses to the information loaded by load_entry() is via std::map::operator[]
Definition at line 83 of file cmconfig.h.
Config::Config | ( | const string & | filename | ) | [protected] |
Definition at line 137 of file cmconfig.cc.
Config::~Config | ( | ) | [virtual] |
Definition at line 141 of file cmconfig.cc.
virtual void Config::load_entry | ( | const string & | ) | [pure virtual] |
string Config::filename [protected] |
The filename of the configuration file.
Definition at line 99 of file cmconfig.h.
Referenced by Getcap::load_entry().
const char * Config::keytexts [static, private] |
Initial value:
{ "host", "port", "local_socket", "logfile", "device", }
Definition at line 102 of file cmconfig.h.
const std::vector< std::string > Config::config_keys [static, protected] |
The list of keys that should be loaded from the configuration file(s).
This vector contains the list of all valid configuration parameters that should be loaded from any configuration file(s).
At the moment it's not an error of any form to have others in the config file, but that may be at some point, and/or they may be ignored, or the like. We may also want to implement a notion of parameters that are required or optional, but we have no functionality like that at the moment.
Definition at line 105 of file cmconfig.h.
Referenced by YAML::load_entry(), and LibConfig::load_entry().