|
DisCostiC v2.0.0
Distributed Cost in Cluster: a cross-architecture simulator for massively parallel MPI programs
|
a wrapper class which contains functions for parsing the configuration file end class configParser More...
#include <ConfigParser.hpp>
Public Member Functions | |
| ConfigParser (const std::string &fileName) | |
| a class to set the name of the configuration file and extracts and parses the data | |
| bool | getKey (const std::string &key) const |
| a function for finding the key | |
| template<typename scalarT > | |
| scalarT | getValue (const std::string &key, scalarT const &defaultValue=scalarT()) const |
| a function that retrieves the value of a specific key | |
Private Member Functions | |
| void | removeComment (std::string &line) const |
| a function that removes everything from the semicolon (including it) to the end of the line. | |
| bool | whitespace (const std::string &line) const |
| a function that returns false if a non-space character was found, true otherwise. The function is "const" because it does not alter any class member variables. | |
| void | extractKey (std::string &key, size_t const &sepPos, const std::string &line) const |
| a function that extracts the key from the pair of key = value | |
| void | extractValue (std::string &value, size_t const &sepPos, const std::string &line) const |
| a function that extracts the value from the pair of key = value | |
| void | parseLine (const std::string &line, size_t const lineNum) |
| a function that parse the line by calling above mentioed functions | |
Private Attributes | |
| std::map< std::string, std::string > | data |
| which will hold pairs of key-value | |
| std::string | fileName |
| As member variables, we will only have a std::string, which will hold the name of the configuration file. | |
a wrapper class which contains functions for parsing the configuration file end class configParser
Definition at line 58 of file ConfigParser.hpp.
|
inline |
a class to set the name of the configuration file and extracts and parses the data
Definition at line 121 of file ConfigParser.hpp.
References fileclose, fileName, fileopen, parseLine(), removeComment(), and whitespace().
Here is the call graph for this function:
|
inlineprivate |
a function that extracts the key from the pair of key = value
Definition at line 83 of file ConfigParser.hpp.
Referenced by parseLine().
Here is the caller graph for this function:
|
inlineprivate |
a function that extracts the value from the pair of key = value
Definition at line 92 of file ConfigParser.hpp.
Referenced by parseLine().
Here is the caller graph for this function:
|
inline |
a function for finding the key
Definition at line 148 of file ConfigParser.hpp.
References data.
Referenced by getValue(), and parseLine().
Here is the caller graph for this function:
|
inline |
a function that retrieves the value of a specific key
Definition at line 156 of file ConfigParser.hpp.
References data, getKey(), and UserInterface::Conversion::stringTOScalarT().
Referenced by AST::AST(), DisCosTiC::Benchmark::Benchmark(), UserInterface::ChromeTraceViz::ChromeTraceViz(), DisCosTiC::CompModel::CompModel(), AST::Exec(), AST::execNodeLVL(), UserInterface::ItacVtf::ItacVtf(), main(), NodeModel::NodeModel(), NodeModel::NodeModel(), DisCosTiC::Benchmark::Oneway_PositiveDisplacement(), and UserInterface::TimeRankOP::TimeRankOP().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
a function that parse the line by calling above mentioed functions
Definition at line 102 of file ConfigParser.hpp.
References data, extractKey(), extractValue(), and getKey().
Referenced by ConfigParser().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
a function that removes everything from the semicolon (including it) to the end of the line.
Definition at line 67 of file ConfigParser.hpp.
Referenced by ConfigParser().
Here is the caller graph for this function:
|
inlineprivate |
a function that returns false if a non-space character was found, true otherwise. The function is "const" because it does not alter any class member variables.
Definition at line 75 of file ConfigParser.hpp.
Referenced by ConfigParser().
Here is the caller graph for this function:
|
private |
which will hold pairs of key-value
Definition at line 61 of file ConfigParser.hpp.
Referenced by getKey(), getValue(), and parseLine().
|
private |
As member variables, we will only have a std::string, which will hold the name of the configuration file.
Definition at line 62 of file ConfigParser.hpp.
Referenced by ConfigParser().