RISA
risa::ConfigReader Class Reference

Reads the configuration values from the input file. More...

#include <ConfigReader.h>

Public Member Functions

 ConfigReader (const char *configFile)
 Create the configuration reader from the given input file. More...
 
 ConfigReader (const ConfigReader &configReader)
 
template<typename T >
bool lookupValue (const std::string &identifier, T &value)
 Reads the configuration value identified by the identifier-string. More...
 
template<typename T >
bool lookupValue (const std::string &identifier, int index, T &value)
 Reads the configuration value list identified by the identifier-string and returns the value stored at position index. More...
 

Private Attributes

libconfig::Config cfg
 

Detailed Description

Reads the configuration values from the input file.

This class takes the file path to a configuration file as input and reads it using the libconfig++-Library

Definition at line 41 of file ConfigReader.h.

Constructor & Destructor Documentation

risa::ConfigReader::ConfigReader ( const char *  configFile)

Create the configuration reader from the given input file.

Parameters
[in]configFilepath to configuration file

Definition at line 32 of file ConfigReader.cpp.

risa::ConfigReader::ConfigReader ( const ConfigReader configReader)
inline

Definition at line 53 of file ConfigReader.h.

Member Function Documentation

template<typename T >
bool risa::ConfigReader::lookupValue ( const std::string &  identifier,
T &  value 
)
inline

Reads the configuration value identified by the identifier-string.

Parameters
[in]identifierthe string used to identify the desired parameter in the configuration file
[out]valuethe value, that was passed in the configuration file
Return values
truethe parameter could be read successfully
falsethe parameter could not be read successfully

Definition at line 63 of file ConfigReader.h.

template<typename T >
bool risa::ConfigReader::lookupValue ( const std::string &  identifier,
int  index,
T &  value 
)
inline

Reads the configuration value list identified by the identifier-string and returns the value stored at position index.

Parameters
[in]identifierthe string used to identify the desired parameter in the configuration file
[in]indexthe position at which the desired value shall be read
[out]valuethe value, that was passed in the configuration file
Return values
truethe parameter could be read successfully
falsethe parameter could not be read successfully

Definition at line 78 of file ConfigReader.h.

Member Data Documentation

libconfig::Config risa::ConfigReader::cfg
private

Definition at line 89 of file ConfigReader.h.


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