![]() |
Langmuir
Simulation
|
A class to map between variable names (keys) and locations (references) More...
#include <variable.h>
Public Types | |
| enum | VariableModeFlag { Constant = 1 } |
| A Flag to alter the behavoir of certain variable member functions. More... | |
Public Member Functions | |
| Variable (const QString &key, VariableMode mode=0, QObject *parent=0) | |
| Create a Variable, see Variable::Variable for description. More... | |
| virtual void | read (const QString &token)=0 |
| Cast the value stored in string to the correct type and store it in the correct location. More... | |
| virtual QString | key () const =0 |
| Get this variable's key (name) More... | |
| virtual QString | value () const =0 |
| Get this variable's value as a QString. More... | |
| virtual QString | keyValue () const =0 |
| Get this variable's key and value in the form 'key = value'. More... | |
| bool | isConstant () const |
| True if the Variable::Constant mode flag was set. More... | |
| const VariableMode & | mode () const |
| Get this variable's mode flags. More... | |
Protected Member Functions | |
| virtual void | write (QTextStream &stream) const =0 |
| Write 'key = value' to a stream. More... | |
Protected Attributes | |
| QString | m_key |
| The name of this variable. More... | |
| VariableMode | m_mode |
| The mode flags for this variable. More... | |
Friends | |
| QTextStream & | operator<< (QTextStream &stream, const Variable &variable) |
| Operator overload to output 'key = value' to QTextStream. More... | |
| QDebug | operator<< (QDebug dbg, const Variable &variable) |
| Operator overload to output 'key = value' to QDebug. More... | |
| std::ostream & | operator<< (std::ostream &stream, Variable &variable) |
| Operator overload to output to output 'key = value' to std::ofstream. More... | |
A class to map between variable names (keys) and locations (references)
|
inline |
Create a Variable, see Variable::Variable for description.
initialize a Variable with a key
|
inline |
True if the Variable::Constant mode flag was set.
see if the Variable is really a Constant
|
pure virtual |
Get this variable's key (name)
Implemented in LangmuirCore::TypedVariable< T >.
|
pure virtual |
Get this variable's key and value in the form 'key = value'.
Implemented in LangmuirCore::TypedVariable< T >, and LangmuirCore::TypedVariable< T >.
|
inline |
Get this variable's mode flags.
get the mode flags of this Variable
|
pure virtual |
Cast the value stored in string to the correct type and store it in the correct location.
This function assumes 'QTextStream& operator<<' has been implemented for that data type T. Keep this in mind if adding a new data type.
Implemented in LangmuirCore::TypedVariable< T >.
|
pure virtual |
Get this variable's value as a QString.
Implemented in LangmuirCore::TypedVariable< T >, LangmuirCore::TypedVariable< T >, LangmuirCore::TypedVariable< T >, and LangmuirCore::TypedVariable< T >.
|
protectedpure virtual |
Write 'key = value' to a stream.
Implemented in LangmuirCore::TypedVariable< T >.
|
friend |
Operator overload to output 'key = value' to QTextStream.
|
friend |
Operator overload to output 'key = value' to QDebug.
|
friend |
Operator overload to output to output 'key = value' to std::ofstream.
|
protected |
The name of this variable.
|
protected |
The mode flags for this variable.