VarStepExpression Class Reference

Represents an XQuery variable with following path (or a path without a preceding variable). More...

#include <varstepexpression.h>

Inheritance diagram for VarStepExpression:

Inheritance graph
[legend]
Collaboration diagram for VarStepExpression:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 VarStepExpression (unsigned _id, PathExpression *_path)
 Constructor.
virtual ~VarStepExpression ()
void extractDependencies (vector< DependencySet * > *depset)
void print (OutputStream &dos) const
void init (BufferNode *root)
void eval (OutputStream &eos, Environment *env, unsigned modus)
PathExpressiongetPath ()
 Returns the PathExpression (path of this object).
VarStepExpressionclone ()
 Returns a new, independent copy of this object.
VarStepExpressioncloneWithoutFinalDosNodeAndAttributes ()
 Returns a new, independent copy of this object.
bool isSingleValued ()
void prepareOperand (OutputStream &eos, Environment *env, unsigned modus)
void unprepareOperand ()
virtual ValuegetNextValue ()

Private Attributes

PathExpressionpath
 The entered PathExpression.
BufferIteratorbit
 The initialized BufferIterator for this path.


Detailed Description

Represents an XQuery variable with following path (or a path without a preceding variable).

Represents an XQuery variable with following path (or a path without a preceding variable), which takes therefore a (numeric value of a) variable, e.g. $x, $z or $root, and a PathExpression, e.g. /bib//book or //node()/text(), as arguments and returns the sequence of BufferNode located through the entered PathExpression.

Note:
ALL PathExpression without a preceeding variable are initialized with variable $root!
Author:
Michael Schmidt

Gunnar Jehl

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

Definition at line 53 of file varstepexpression.h.


Constructor & Destructor Documentation

VarStepExpression::VarStepExpression ( unsigned  _id,
PathExpression _path 
)

Constructor.

Constructor - creating object for a variable and a PathExpression.

Parameters:
[in] _id Preceeding variable of the entered PathExpression (second argument).
[in] _path Pointer to a PathExpression object.

Definition at line 37 of file varstepexpression.cpp.

Referenced by clone(), and cloneWithoutFinalDosNodeAndAttributes().

VarStepExpression::~VarStepExpression (  )  [virtual]

Destructor.

Definition at line 44 of file varstepexpression.cpp.

References bit, and path.


Member Function Documentation

VarStepExpression * VarStepExpression::clone (  ) 

Returns a new, independent copy of this object.

Returns a new, independent copy of this object.

Return values:
VarStepExpression* Copy of this object.

Reimplemented from VarExpression.

Definition at line 94 of file varstepexpression.cpp.

References PathExpression::clone(), path, and VarStepExpression().

Referenced by AggregateFunctExpression::rewriteAggregateFuncts().

VarStepExpression * VarStepExpression::cloneWithoutFinalDosNodeAndAttributes (  ) 

Returns a new, independent copy of this object.

Returns a new, independent copy of this object without the tail PathStepExpression /dos::node() and without any PathStepAttribute if present.

Return values:
VarStepExpression* Copy of this object without the tail path step /dos::node() and attributes.

Definition at line 98 of file varstepexpression.cpp.

References PathExpression::cloneWithoutFinalDosNodeAndAttributes(), path, and VarStepExpression().

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

Reimplemented from VarExpression.

Definition at line 68 of file varstepexpression.cpp.

References bit, BufferIterator::clear(), EVAL_QUERY, EVAL_SIGNOFF, BufferIterator::getNext(), Environment::getNodeBinding(), BufferIterator::init(), and READ_UP_TO_CLOSE_CONTEXT.

void VarStepExpression::extractDependencies ( vector< DependencySet * > *  depset  )  [virtual]

Extracts the needed dependencies of a query.

Extracts the needed dependencies of a query, which are needed for constructing the ProjectionTree.

Parameters:
[in,out] depset Pointer to a vector containing Pointer to DependencySet objects.
Return values:
void 

Reimplemented from VarExpression.

Definition at line 49 of file varstepexpression.cpp.

References VarExpression::id, and path.

Value * VarStepExpression::getNextValue (  )  [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.

Reimplemented from VarExpression.

Definition at line 112 of file varstepexpression.cpp.

References bit, OperandExpression::cur_val, BufferIterator::getNext(), BufferNode::getPCDataRepresentation(), READ_UP_TO_CLOSE_CONTEXT, and Value::setStrVal().

PathExpression * VarStepExpression::getPath (  )  [inline]

Returns the PathExpression (path of this object).

Returns the PathExpression (path of this object), i.e. returns the member variable.

Return values:
PathExpression* Pointer to a PathExpression object.

Definition at line 93 of file varstepexpression.h.

References path.

Referenced by ExistsCondExpression::extractDependencies(), ForExpression::extractParVarMap(), and SignOffExpression::SignOffExpression().

void VarStepExpression::init ( BufferNode root  )  [virtual]

Initializes the query for evaluation.

Initializes the query for evaluation. Up to now only all required BufferIterator objects are created to speed up query evaluation.

Parameters:
[in] root Pointer to a BufferNode object.
Return values:
void 

Reimplemented from VarExpression.

Definition at line 62 of file varstepexpression.cpp.

References bit, and path.

bool VarStepExpression::isSingleValued (  )  [inline, 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.

Reimplemented from VarExpression.

Definition at line 115 of file varstepexpression.h.

void VarStepExpression::prepareOperand ( OutputStream eos,
Environment env,
unsigned  modus 
) [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 

Reimplemented from VarExpression.

Definition at line 103 of file varstepexpression.cpp.

References bit, Environment::getNodeBinding(), and BufferIterator::init().

void VarStepExpression::print ( OutputStream dos  )  const [virtual]

Prints the expression.

Prints the expression.

Parameters:
[in] dos Pointer to a OutputStream object.
Return values:
void 

Reimplemented from VarExpression.

Definition at line 58 of file varstepexpression.cpp.

References VarName::getInstance(), and VarName::getVarname().

void VarStepExpression::unprepareOperand (  )  [virtual]

Resets the operand if necessary.

Resets the operand if necessary.

Return values:
void 

Reimplemented from VarExpression.

Definition at line 108 of file varstepexpression.cpp.

References bit, and BufferIterator::reset().


Member Data Documentation

The initialized BufferIterator for this path.

The initialized BufferIterator for this path after calling method init(). This member variable is NULL on creation of object but should not be NULL anymore after method init() has been executed.

Reimplemented from VarExpression.

Definition at line 147 of file varstepexpression.h.

Referenced by eval(), getNextValue(), init(), prepareOperand(), unprepareOperand(), and ~VarStepExpression().

The entered PathExpression.

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

Definition at line 139 of file varstepexpression.h.

Referenced by clone(), cloneWithoutFinalDosNodeAndAttributes(), extractDependencies(), getPath(), init(), and ~VarStepExpression().


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