A class to read the parameters and store them in the correct place.
More...
#include <keyvalueparser.h>
|
template<typename T > |
void | registerVariable (const QString &key, T &value, Variable::VariableMode mode=0) |
| Register an allowed variable with the parser. More...
|
|
A class to read the parameters and store them in the correct place.
The location of the SimulationParameters object for the entire simulation is a private variable of this class.
To add new variables, follow these steps:
LangmuirCore::KeyValueParser::KeyValueParser |
( |
World & |
world, |
|
|
QObject * |
parent = 0 |
|
) |
| |
LangmuirCore::KeyValueParser::~KeyValueParser |
( |
| ) |
|
const QStringList& LangmuirCore::KeyValueParser::getOrderedNames |
( |
| ) |
const |
Variable& LangmuirCore::KeyValueParser::getVariable |
( |
const QString & |
key | ) |
|
Get a reference to a variable by name.
- Parameters
-
key | the name of the variable |
const QMap<QString,Variable*>& LangmuirCore::KeyValueParser::getVariableMap |
( |
| ) |
const |
void LangmuirCore::KeyValueParser::parse |
( |
const QString & |
line | ) |
|
Parse a string and assign a value to the correct parameter.
template<typename T >
void LangmuirCore::KeyValueParser::registerVariable |
( |
const QString & |
key, |
|
|
T & |
value, |
|
|
Variable::VariableMode |
mode = 0 |
|
) |
| |
|
private |
Register an allowed variable with the parser.
void LangmuirCore::KeyValueParser::save |
( |
const QString & |
fileName = "%stub.parm" | ) |
|
Write the parameters to a file in a "key=value" fashion.
QString LangmuirCore::KeyValueParser::toQString |
( |
| ) |
|
convert parameters to a QString
std::ostream& operator<< |
( |
std::ostream & |
stream, |
|
|
const KeyValueParser & |
keyValueParser |
|
) |
| |
|
friend |
Write the parameters to a std::ostream in a "key=value" fashion.
Write the parameters to QDebug in a "key=value" fashion.
QStringList LangmuirCore::KeyValueParser::m_orderedNames |
|
private |
A list of variable names in a specific order.
The simulation parameters.
QMap<QString,Variable*> LangmuirCore::KeyValueParser::m_variableMap |
|
private |
A map between variable names and variables.
World& LangmuirCore::KeyValueParser::m_world |
|
private |
Reference to World object.
The documentation for this class was generated from the following file: