#include <value.h>
Public Member Functions | |
Value () | |
Constructor. | |
Value (const char *_str_val) | |
Constructor. | |
Value (long double _num_val) | |
Constructor. | |
virtual | ~Value () |
const char * | getStrVal () |
Returns the string representation of this value. | |
long double | getNumVal () |
Returns the numeric representation of this value. | |
VALUE_TYPE | getType () |
Returns the type of the Value object. | |
void | setStrVal (const char *_str_val) |
Initializes the str_val member variable. | |
void | setNumVal (long double _num_val) |
Initializes the num_val member variable. | |
void | reset () |
Resets the data structure. | |
Public Attributes | |
const char * | str_val |
Field to store the string value. | |
long double | num_val |
Field to store the numeric value. | |
VALUE_TYPE | type |
Specifies the type of instantiated objects. |
GCX currently supports to basic types, namely xsd::string and xsd::numeric. This struct provides fields for both string and numeric content and automatically casts values if requested.
Definition at line 54 of file value.h.
Value::Value | ( | ) |
Value::Value | ( | const char * | _str_val | ) |
Value::Value | ( | long double | _num_val | ) |
Value::~Value | ( | ) | [virtual] |
long double Value::getNumVal | ( | ) | [inline] |
Returns the numeric representation of this value.
If the field xsd_numeric is not initialized, a cast will be triggered, trying to convert xsd_string into a numeric value.
long | double The numeric representations of this value, if any. |
Throws | an error (InvalidCastException) if the string cannot be converted. |
Definition at line 92 of file value.h.
Referenced by FunctTruncateExpression::calculateValue(), FunctRoundHalfToEvenExpression::calculateValue(), FunctRoundExpression::calculateValue(), FunctFloorExpression::calculateValue(), FunctCoverExpression::calculateValue(), FunctCeilingExpression::calculateValue(), FunctAbsExpression::calculateValue(), and CondOperandExpression::evalRelOp().
const char * Value::getStrVal | ( | ) | [inline] |
Returns the string representation of this value.
Straightforwardly returns the corresponding field of the struct.
const | char* Pointer to the string representation of this value. |
Definition at line 83 of file value.h.
References str_val.
Referenced by CondOperandExpression::evalRelOp().
VALUE_TYPE Value::getType | ( | ) | [inline] |
Returns the type of the Value object.
Due to the minimalistic type system, this will either be either xsd_string, xsd_numeric.
VALUE_TYPE | The type of the Value object. |
Definition at line 109 of file value.h.
References type.
Referenced by FunctTruncateExpression::calculateValue(), FunctRoundHalfToEvenExpression::calculateValue(), FunctRoundExpression::calculateValue(), FunctFloorExpression::calculateValue(), FunctCoverExpression::calculateValue(), FunctCeilingExpression::calculateValue(), and FunctAbsExpression::calculateValue().
void Value::reset | ( | ) |
void Value::setNumVal | ( | long double | _num_val | ) |
Initializes the num_val member variable.
Initializes the num_val member variable to the passed numeric value.
[in] | _num_val | The numeric value to be set. |
void |
Definition at line 61 of file value.cpp.
References num_val, str_val, and type.
Referenced by FunctTruncateExpression::eval(), FunctRoundHalfToEvenExpression::eval(), FunctRoundExpression::eval(), FunctFloorExpression::eval(), FunctCoverExpression::eval(), FunctCeilingExpression::eval(), FunctAbsExpression::eval(), AggregateFunctVarSampExpression::eval(), AggregateFunctVarPopExpression::eval(), AggregateFunctSumExpression::eval(), AggregateFunctStdDevSampExpression::eval(), AggregateFunctStdDevPopExpression::eval(), AggregateFunctMinExpression::eval(), AggregateFunctMedianExpression::eval(), AggregateFunctMaxExpression::eval(), AggregateFunctCountExpression::eval(), AggregateFunctAvgExpression::eval(), and NumericConstExpression::getNextValue().
void Value::setStrVal | ( | const char * | _str_val | ) |
Initializes the str_val member variable.
Initializes the str_val member variable, by setting its pointer to the passes const char*.
[in] | _str_val | The string the pointer should be set to. |
void |
Definition at line 54 of file value.cpp.
References num_val, str_val, and type.
Referenced by FunctTruncateExpression::eval(), FunctRoundHalfToEvenExpression::eval(), FunctRoundExpression::eval(), FunctFloorExpression::eval(), FunctCoverExpression::eval(), FunctCeilingExpression::eval(), FunctAbsExpression::eval(), AggregateFunctVarSampExpression::eval(), AggregateFunctVarPopExpression::eval(), AggregateFunctStdDevSampExpression::eval(), AggregateFunctStdDevPopExpression::eval(), AggregateFunctMinExpression::eval(), AggregateFunctMedianExpression::eval(), AggregateFunctMaxExpression::eval(), AggregateFunctAvgExpression::eval(), VarStepExpression::getNextValue(), VarExpression::getNextValue(), and StringConstExpression::getNextValue().
long double Value::num_val |
Field to store the numeric value.
Field to store the numeric value, if any.
Definition at line 148 of file value.h.
Referenced by reset(), setNumVal(), and setStrVal().
const char * Value::str_val |
Field to store the string value.
This field may be empty, i.e. point to NULL.
Definition at line 142 of file value.h.
Referenced by getStrVal(), reset(), setNumVal(), and setStrVal().
Specifies the type of instantiated objects.
Set either to xsd_numeric or xsd_string.
Definition at line 154 of file value.h.
Referenced by CondOperandExpression::evalRelOp(), getType(), reset(), setNumVal(), and setStrVal().