FunctAbsExpression Class Reference

Represents XQuery non-standard function fn:abs. More...

#include <functabsexpression.h>

Inheritance diagram for FunctAbsExpression:

Inheritance graph
[legend]
Collaboration diagram for FunctAbsExpression:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FunctAbsExpression (AggregateFunctExpression *_aggfunct)
 Constructor.
virtual ~FunctAbsExpression ()
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)


Detailed Description

Represents XQuery non-standard function fn:abs.

Represents XQuery non-standard function fn:abs, which takes a AggregateFunctExpression, e.g. fn:abs(fn:count($x/bib/book)) or fn:abs(fn:sum(/bib//book)), as argument and returns the absolute result of the entered AggregateFunctExpression.

Author:
Michael Schmidt

Gunnar Jehl

Version:
2.1
License:
Software License Agreement (BSD License)

Definition at line 61 of file functabsexpression.h.


Constructor & Destructor Documentation

FunctAbsExpression::FunctAbsExpression ( AggregateFunctExpression _aggfunct  ) 

Constructor.

Constructor - creating object for a AggregateFunctExpression.

Parameters:
[in] _aggfunct Pointer to a AggregateFunctExpression object.

Definition at line 37 of file functabsexpression.cpp.

FunctAbsExpression::~FunctAbsExpression (  )  [virtual]

Destructor.

Definition at line 41 of file functabsexpression.cpp.


Member Function Documentation

long double FunctAbsExpression::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.

Parameters:
[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.
Return values:
long double Result of the corresponding rounding function.

Implements RoundingExpression.

Definition at line 92 of file functabsexpression.cpp.

References RoundingExpression::aggfunct, AggregateFunctExpression::getNextValue(), Value::getNumVal(), Value::getType(), AggregateFunctExpression::prepareOperand(), and AggregateFunctExpression::unprepareOperand().

Referenced by eval().

void FunctAbsExpression::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.

Parameters:
[in] eos Pointer to a OutputStream object.
[in] env Pointer to an Environment object.
[in] modus The query evaluation mode.
Exceptions:
RuntimeException If illegal evaluation mode.

Implements RoundingExpression.

Definition at line 44 of file functabsexpression.cpp.

References calculateValue(), OperandExpression::cur_val, EVAL_QUERY, EVAL_QUERY_SILENT, EVAL_SIGNOFF, MiscFunctions::getStringFromNumerical(), OUTPUT_ABS_ON_NON_VALUE, Value::setNumVal(), and Value::setStrVal().


Generated on Sun May 24 20:20:24 2009 for G(arbage) C(ollected) X(Query) Engine by  doxygen 1.5.9