Stores keyword-value pairs from a configuration file. More...

#include <Configuration.h>

Classes

class  Parameter
 A configurable parameter. More...
 

Public Member Functions

 Configuration (const char *filename=0)
 Construct from the specified file.
 
void load (const std::string &filename)
 Load the configuration from the specified file.
 
template<typename T >
get (const std::string &key, T default_value) const
 Get the value for the specified key.
 
template<typename T >
get (const std::string &key) const
 Get the value for the specified key (throw exception if not found. More...
 
Entry * find (const std::string &key) const
 Find the entry with the specified key.
 
const std::vector< std::string > & get_filenames () const
 Get the names of the configuration files in the order they were parsed.
 
unsigned get_find_count () const
 Get the number of times that the find method has been called.
 

Protected Member Functions

virtual void load ()
 Allow derived types to implement lazy evaluation of file loading.
 

Protected Attributes

std::vector< std::string > filenames
 
std::vector< Entry > entries
 

Detailed Description

Stores keyword-value pairs from a configuration file.

The Configuration class enables convenient, distributed access to configuration parameters stored in a simple text file

Member Function Documentation

◆ get()

template<typename T >
T Configuration::get ( const std::string &  key) const

Get the value for the specified key (throw exception if not found.

Get the value for the specified key.

References find().


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

Generated using doxygen 1.8.17