OMNeT++ Simulation Library
5.6.1
|
#include <cdynamicexpression.h>
One element in a (reverse Polish) expression.
Public Member Functions | |
void | operator= (const Elem &other) |
void | operator= (bool b) |
void | operator= (intpar_t i) |
void | operator= (double d) |
void | setUnit (const char *s) |
void | operator= (const char *s) |
void | operator= (cXMLElement *x) |
void | operator= (cNedMathFunction *f) |
void | set (cNedFunction *f, int argc) |
void | operator= (Functor *f) |
void | operator= (OpType op) |
void | operator= (cExpression *expr) |
Type | getType () const |
bool | isNumericConstant () const |
void | negate () |
bool | getBoolConstant () const |
intpar_t | getIntConstant () const |
double | getDoubleConstant () const |
const char * | getUnit () const |
const char * | getStringConstant () const |
cXMLElement * | getXMLElement () const |
cNedMathFunction * | getMathFunction () const |
cNedFunction * | getNedFunction () const |
int | getNedFunctionNumArgs () const |
Functor * | getFunctor () const |
OpType | getOperation () const |
cExpression * | getConstSubexpression () const |
int | compare (const Elem &other) const |
std::string | str () const |
Static Public Member Functions | |
static const char * | getOpName (OpType op) |
void operator= | ( | bool | b | ) |
Effect during evaluation of the expression: pushes the given boolean constant to the evaluation stack.
void operator= | ( | intpar_t | i | ) |
Effect during evaluation of the expression: pushes the given number (which is converted to double) to the evaluation stack.
void operator= | ( | double | d | ) |
Effect during evaluation of the expression: pushes the given number to the evaluation stack.
void setUnit | ( | const char * | s | ) |
Sets the unit of an Elem previously set to a double or integer value. The type must already be DBL or INT, or an error gets thrown.
void operator= | ( | const char * | s | ) |
Effect during evaluation of the expression: pushes the given string to the evaluation stack.
void operator= | ( | cXMLElement * | x | ) |
Effect during evaluation of the expression: pushes the given cXMLElement pointer to the evaluation stack.
void operator= | ( | cNedMathFunction * | f | ) |
Effect during evaluation of the expression: Call a function taking 0..4 doubles and returning a double.
void set | ( | cNedFunction * | f, |
int | argc | ||
) |
Effect during evaluation of the expression: call a function that function takes an array of cNedValues and returns a cNedValue.
void operator= | ( | Functor * | f | ) |
Function object, with an interface not unlike cNedFunction. This object will be deleted by expression's destructor.
void operator= | ( | OpType | op | ) |
Unary, binary or tertiary (?:) operations.
void operator= | ( | cExpression * | expr | ) |
Constant subexpression.
|
inline |
Returns the element type
|
inline |
Returns true if the element is a numeric constant (type INT or DBL).
void negate | ( | ) |
Negates the element. It must be a numeric constant (type INT or DBL).
|
inline |
Returns the value if the element is a boolean constant (type BOOL).
|
inline |
Returns the value if the element is an integer constant (type INT).
|
inline |
Returns the value if the element is a double constant (type DBL).
|
inline |
Returns the unit if the element is a numeric constant (type INT or DBL).
|
inline |
Returns the value if the element is a string constant (type STR).
|
inline |
Returns the value if the element is an XML element (type XML).
|
inline |
Returns the function pointer if the element is a math function (type MATHFUNC).
|
inline |
Returns the function pointer if the element is a NED function (type NEDFUNC).
|
inline |
Returns the argument count if the element is a NED function (type NEDFUNC).
|
inline |
Returns the functor pointer if the element is a functor (type FUNCTOR).
|
inline |
Returns the operation if the element is an operation (type OP).
|
inline |
Returns the subexpression if the element is a NED function (type CONSTSUBEXPR).
int compare | ( | const Elem & | other | ) | const |
|
static |
Returns the string representation of the given operator.
std::string str | ( | ) | const |
Returns the string representation of this element.