treqs::TreqsConfig Class Reference

Parsing the configuration file and providing it to other classes. More...

#include <TreqsConfig.h>

Collaboration diagram for treqs::TreqsConfig:
Collaboration graph
[legend]

List of all members.

Public Member Functions

std::string getConfigpath ()
 Getter.
void setConfigpath (std::string) throw (FileNotFoundError)
 Setter.
std::string getValue (std::string sec, std::string key) throw (ConfigNotFoundError)
void dumpConfig ()
void reloadConfig ()

Static Public Member Functions

static TreqsConfiggetInstance ()
 Singleton access.

Protected Member Functions

 TreqsConfig ()
 Constructor.

Private Member Functions

void findConfigpath () throw (FileNotFoundError)
 Computes the configuration file.
void parse_config ()
 Using the Configpath, this function parses the file and loads the configuration.

Private Attributes

std::string Configpath
 Path to the configuration file.

Static Private Attributes

static TreqsConfig_singleton = 0
 pointer to the Singleton instance
static Destroyer< TreqsConfig_destroyer
 the destroyer is responsible for cleaning the singleton on destruction
static std::map< ConfigKey_t,
std::string > 
Configuration
 The map containing the configuration.
static log4cxx::LoggerPtr logger
 The logger.

Detailed Description

Parsing the configuration file and providing it to other classes.


Constructor & Destructor Documentation

treqs::TreqsConfig::TreqsConfig (  )  [protected]

Constructor.

Here is the caller graph for this function:


Member Function Documentation

void treqs::TreqsConfig::dumpConfig (  ) 

dump configuration in the logging device.

void treqs::TreqsConfig::findConfigpath (  )  throw (FileNotFoundError) [private]

Computes the configuration file.

Order is : 1. command line "--config" parameter 2. $HOME/.treqs.conf 3. $TREQSC_HOME/etc/treqs.conf 4. /etc/treqs.conf If found nowhere, don't try to continue, it's hopeless. Throw an exception

std::string treqs::TreqsConfig::getConfigpath (  ) 

Getter.

Here is the caller graph for this function:

TreqsConfig * treqs::TreqsConfig::getInstance (  )  [static]

Singleton access.

Here is the call graph for this function:

Here is the caller graph for this function:

string treqs::TreqsConfig::getValue ( std::string  sec,
std::string  key 
) throw (ConfigNotFoundError)

Find the value for a defined parameter. If not present, throws a ConfigNotFoundException

Parameters:
sec the section
key the key
Returns:
the value

Here is the call graph for this function:

Here is the caller graph for this function:

void treqs::TreqsConfig::parse_config (  )  [private]

Using the Configpath, this function parses the file and loads the configuration.

Here is the caller graph for this function:

void treqs::TreqsConfig::reloadConfig (  ) 

Reload the configuration parameters from config file

Here is the call graph for this function:

void treqs::TreqsConfig::setConfigpath ( std::string  cfgpath  )  throw (FileNotFoundError)

Setter.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

the destroyer is responsible for cleaning the singleton on destruction

pointer to the Singleton instance

std::string treqs::TreqsConfig::Configpath [private]

Path to the configuration file.

map< ConfigKey_t, string > treqs::TreqsConfig::Configuration [static, private]

The map containing the configuration.

LoggerPtr treqs::TreqsConfig::logger [static, private]

The logger.


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

Generated on 4 Mar 2010 for TReqS by  doxygen 1.6.1