fn:round-half-to-even
.
More...
#include <functroundhalftoevenexpression.h>
Public Member Functions | |
FunctRoundHalfToEvenExpression (AggregateFunctExpression *_aggfunct) | |
Constructor. | |
virtual | ~FunctRoundHalfToEvenExpression () |
virtual void | eval (OutputStream &eos, Environment *env, unsigned modus) |
Private Member Functions | |
virtual long double | calculateValue (OutputStream &eos, Environment *env, unsigned modus, bool &non_value) |
fn:round-half-to-even
.
Represents XQuery standard function fn:round-half-to-even
, which takes a AggregateFunctExpression, e.g. fn:round-half-to-even(fn:count($x/bib/book))
or fn:round-half-to-even(fn:sum(/bib//book))
, as argument and returns the round half to even result of the entered AggregateFunctExpression.
Definition at line 61 of file functroundhalftoevenexpression.h.
FunctRoundHalfToEvenExpression::FunctRoundHalfToEvenExpression | ( | AggregateFunctExpression * | _aggfunct | ) |
Constructor.
Constructor - creating object for a AggregateFunctExpression.
[in] | _aggfunct | Pointer to a AggregateFunctExpression object. |
Definition at line 37 of file functroundhalftoevenexpression.cpp.
FunctRoundHalfToEvenExpression::~FunctRoundHalfToEvenExpression | ( | ) | [virtual] |
Destructor.
Definition at line 41 of file functroundhalftoevenexpression.cpp.
long double FunctRoundHalfToEvenExpression::calculateValue | ( | OutputStream & | eos, | |
Environment * | env, | |||
unsigned | modus, | |||
bool & | non_value | |||
) | [private, virtual] |
Result calculation of the corresponding rounding function.
Result calculation of the corresponding rounding function.
[in] | eos | Pointer to a OutputStream object. |
[in] | env | Pointer to a Environment object. |
[in] | modus | Evaluation modus. |
[in] | non_value | Indicator if rounding function is called on an non value, i.e. is called on an empty sequence of the corresponding aggregate function. |
long | double Result of the corresponding rounding function. |
Implements RoundingExpression.
Definition at line 95 of file functroundhalftoevenexpression.cpp.
References RoundingExpression::aggfunct, AggregateFunctExpression::getNextValue(), Value::getNumVal(), MiscFunctions::getRoundFrom(), Value::getType(), AggregateFunctExpression::prepareOperand(), and AggregateFunctExpression::unprepareOperand().
Referenced by eval().
void FunctRoundHalfToEvenExpression::eval | ( | OutputStream & | eos, | |
Environment * | env, | |||
unsigned | modus | |||
) | [virtual] |
Evaluates the expression in the given environment.
Evaluates the expression in the given environment. The evaluation takes place in the environment that is passed to this method. In addition, the parameter modus is one of the following: EVAL_QUERY, EVAL_QUERY_SILENT or EVAL_SIGNOFF (see also the corresponding defines for more information). This method implements the XQuery semantics for the standard expression types, but also the GCX specific extensions like signOff-statements.
[in] | eos | Pointer to a OutputStream object. |
[in] | env | Pointer to an Environment object. |
[in] | modus | The query evaluation mode. |
RuntimeException | If illegal evaluation mode. |
Implements RoundingExpression.
Definition at line 44 of file functroundhalftoevenexpression.cpp.
References calculateValue(), OperandExpression::cur_val, EVAL_QUERY, EVAL_QUERY_SILENT, EVAL_SIGNOFF, MiscFunctions::getStringFromNumerical(), OUTPUT_ROUNDHALFTOEVEN_ON_NON_VALUE, Value::setNumVal(), and Value::setStrVal().