OperandExpression Class Reference

Represents base clase of all XQuery operands of a condition. More...

#include <operandexpression.h>

Inheritance diagram for OperandExpression:

Inheritance graph
[legend]
Collaboration diagram for OperandExpression:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 OperandExpression (EXP_TYPE _type, EXP_TYPE _op_type)
 Constructor.
virtual ~OperandExpression ()
virtual bool isSingleValued ()=0
 Returns if the result/iteration of the operand is a single value.
virtual void prepareOperand (OutputStream &eos, Environment *env, unsigned modus)=0
 Initializes the operand if necessary.
virtual void unprepareOperand ()=0
 Resets the operand if necessary.
virtual ValuegetNextValue ()=0
 Returns the next value of the operand.
const EXP_TYPE getOperandType ()
 Returns the type of the operand.

Protected Attributes

EXP_TYPE op_type
 The entered EXP_TYPE.
bool initial
Value cur_val


Detailed Description

Represents base clase of all XQuery operands of a condition.

Represents base clase of all XQuery operands of a condition, i.e. represents a operand of a CondOperandExpression, which takes either a VarExpression, e.g. $x, $z or $root, a VarStepExpression, e.g. $x/bib//book or //node()/text(), a AggregateFunctExpression, e.g. fn:count($x) or fn:sum(/bib//book), a RoundingExpression, e.g. fn:avg(fn:sum(/bib//book)) or fn:round(fn:avg(/bib//book)), or a ConstExpression, e.g. "foo" or 8, as argument and returns the evaluated value of the corresponding Expression.

Author:
Michael Schmidt

Gunnar Jehl

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

Definition at line 54 of file operandexpression.h.


Constructor & Destructor Documentation

OperandExpression::OperandExpression ( EXP_TYPE  _type,
EXP_TYPE  _op_type 
)

Constructor.

Constructor - creating object for two EXP_TYPE.

Parameters:
[in] _type EXP_TYPE.
[in] _op_type EXP_TYPE.

Definition at line 37 of file operandexpression.cpp.

OperandExpression::~OperandExpression (  )  [virtual]

Destructor.

Definition at line 43 of file operandexpression.cpp.


Member Function Documentation

Value * OperandExpression::getNextValue (  )  [pure virtual]

Returns the next value of the operand.

Returns the next value of the operand for iteration.

Return values:
Value* Pointer to a Value object.

Implemented in AggregateFunctExpression, ConstExpression, NumericConstExpression, RoundingExpression, StringConstExpression, VarExpression, and VarStepExpression.

Referenced by CondOperandExpression::evalCond().

const EXP_TYPE OperandExpression::getOperandType (  )  [inline]

Returns the type of the operand.

Returns the type of the operand.

Return values:
const EXP_TYPE EXP_TYPE.

Definition at line 108 of file operandexpression.h.

References op_type.

bool OperandExpression::isSingleValued (  )  [pure virtual]

Returns if the result/iteration of the operand is a single value.

Returns if the result/iteration of the operand is a single value, e.g a AggregateFunctExpression returns a single value whereas a VarStepExpression may return more than one value.

Return values:
bool  if the result/iteration is a single value, false otherwise.

Implemented in AggregateFunctExpression, ConstExpression, RoundingExpression, VarExpression, and VarStepExpression.

Referenced by CondOperandExpression::evalCond().

void OperandExpression::prepareOperand ( OutputStream eos,
Environment env,
unsigned  modus 
) [pure virtual]

Initializes the operand if necessary.

Initializes the operand if necessary.

Parameters:
[in] eos Pointer to a OutputStream object.
[in] env Pointer to a Environment object.
[in] modus Evaluation modus.
Return values:
void 

Implemented in AggregateFunctExpression, ConstExpression, RoundingExpression, VarExpression, and VarStepExpression.

Referenced by CondOperandExpression::evalCond().

void OperandExpression::unprepareOperand (  )  [pure virtual]

Resets the operand if necessary.

Resets the operand if necessary.

Return values:
void 

Implemented in AggregateFunctExpression, ConstExpression, RoundingExpression, VarExpression, and VarStepExpression.

Referenced by CondOperandExpression::evalCond().


Member Data Documentation

bool OperandExpression::initial [protected]

The entered EXP_TYPE.

The entered EXP_TYPE, which is the second argument of the constructor.

Definition at line 115 of file operandexpression.h.

Referenced by getOperandType().


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