A typed expression class. More...
#include "Expression.hpp"
Classes | |
struct | ResultT |
A helper structure for returning both the type and the value of an expression. More... | |
struct | SymbolsT |
This structure contains the values for the "variables" of an expression. More... | |
Public Types | |
enum | TypeT { FloatNumber, IntNumber, SymbolTime, SymbolALRed, SymbolALGreen, SymbolALBlue, TableLookup, CastInt, Add, Sub, Mul, Div, GENERIC_FLOAT_START =0x10000, GENERIC_INT_START =0x20000 } |
The type of the expression. More... | |
Public Member Functions | |
ExpressionT (float FloatNumberValue_=0.0) | |
Constructor. More... | |
ExpressionT (int IntNumberValue_) | |
Constructor. More... | |
ExpressionT (TypeT Type_) | |
This constructor creates an ExpressionT of a given type. More... | |
ExpressionT (TextParserT &TP, const ArrayT< TableT * > &ListOfTables) | |
Constructor. More... | |
ExpressionT (const ExpressionT &Source) | |
Copy Constructor (Law of the Big Three). More... | |
~ExpressionT () | |
Destructor (Law of the Big Three). More... | |
ExpressionT & | operator= (const ExpressionT &Source) |
Assignment Operator (Law of the Big Three). More... | |
std::string | GetString () const |
Returns a string description of this ExpressionT. More... | |
ResultT | Evaluate (const SymbolsT &Symbols) const |
Evaluates this expression and returns the result. More... | |
A typed expression class.
enum ExpressionT::TypeT |
The type of the expression.
If bit 0x10000 is set, the type is the generic float variable whose index is obtained from the 16 lower (0x0FFFF) bits. If bit 0x20000 is set, the type is the generic int variable whose index is obtained from the 16 lower (0x0FFFF) bits.
ExpressionT::ExpressionT | ( | float | FloatNumberValue_ = 0.0 | ) |
Constructor.
ExpressionT::ExpressionT | ( | int | IntNumberValue_ | ) |
Constructor.
ExpressionT::ExpressionT | ( | TypeT | Type_ | ) |
This constructor creates an ExpressionT of a given type.
Note that only those types are meaningful for which no other parameter is required, such as SymbolTime
, SymbolALRed
, SymbolALGreen
and SymbolALBlue
.
ExpressionT::ExpressionT | ( | TextParserT & | TP, |
const ArrayT< TableT * > & | ListOfTables | ||
) |
Constructor.
ExpressionT::ExpressionT | ( | const ExpressionT & | Source | ) |
Copy Constructor (Law of the Big Three).
ExpressionT::~ExpressionT | ( | ) |
Destructor (Law of the Big Three).
ExpressionT::ResultT ExpressionT::Evaluate | ( | const SymbolsT & | Symbols | ) | const |
Evaluates this expression and returns the result.
std::string ExpressionT::GetString | ( | ) | const |
Returns a string description of this ExpressionT.
ExpressionT & ExpressionT::operator= | ( | const ExpressionT & | Source | ) |
Assignment Operator (Law of the Big Three).