1 #ifndef KEYVALUEPARSER_H
2 #define KEYVALUEPARSER_H
53 void parse(
const QString& line);
58 void save(
const QString& fileName =
"%stub.parm");
118 Variable::VariableMode mode = 0);
124 Variable::VariableMode mode)
128 qFatal(
"langmuir: variable already registered; key %s",
137 #endif // KEYVALUEPARSER_H
KeyValueParser(World &world, QObject *parent=0)
Create a KeyValueParser.
QStringList m_orderedNames
A list of variable names in a specific order.
Definition: keyvalueparser.h:100
void parse(const QString &line)
Parse a string and assign a value to the correct parameter.
Variable & getVariable(const QString &key)
Get a reference to a variable by name.
World & m_world
Reference to World object.
Definition: keyvalueparser.h:110
A template class to map between variable names (keys) and locations (references)
Definition: variable.h:91
A class to map between variable names (keys) and locations (references)
Definition: variable.h:26
void registerVariable(const QString &key, T &value, Variable::VariableMode mode=0)
Register an allowed variable with the parser.
Definition: keyvalueparser.h:121
const QStringList & getOrderedNames() const
get list of ordered keys
A class to hold all objects in a simulation.
Definition: world.h:51
SimulationParameters & parameters()
Get the SimulationParameters.
const QMap< QString, Variable * > & getVariableMap() const
get the variable map
A struct to store all simulation options.
Definition: parameters.h:46
SimulationParameters m_parameters
The simulation parameters.
Definition: keyvalueparser.h:105
friend std::ostream & operator<<(std::ostream &stream, const KeyValueParser &keyValueParser)
Write the parameters to a std::ostream in a "key=value" fashion.
~KeyValueParser()
Destroy the KeyValueParser.
QString toQString()
convert parameters to a QString
QMap< QString, Variable * > m_variableMap
A map between variable names and variables.
Definition: keyvalueparser.h:95
A class to read the parameters and store them in the correct place.
Definition: keyvalueparser.h:27
void save(const QString &fileName="%stub.parm")
Write the parameters to a file in a "key=value" fashion.