Config Class Reference
[Configuration-related objects]

Print debugging for configuration file parsing. More...

#include <cmconfig.h>

Inheritance diagram for Config:

Inheritance graph
[legend]
Collaboration diagram for Config:

Collaboration graph
[legend]

List of all members.

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.


Detailed Description

Print debugging for configuration file parsing.

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

virtual void Config::load_entry ( const string &   )  [pure virtual]

Initially load the relevant entry (if needed for the subclass).

Implemented in Getcap, LibConfig, and YAML.

Referenced by main().

Here is the caller graph for this function:


Member Data Documentation

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",
}
This array is only used to load the std::vector, below.

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().


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

Generated on Tue May 13 11:32:43 2008 for consmgr by  doxygen 1.5.5