#include <varstepexpression.h>
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) |
PathExpression * | getPath () |
Returns the PathExpression (path of this object). | |
VarStepExpression * | clone () |
Returns a new, independent copy of this object. | |
VarStepExpression * | cloneWithoutFinalDosNodeAndAttributes () |
Returns a new, independent copy of this object. | |
bool | isSingleValued () |
void | prepareOperand (OutputStream &eos, Environment *env, unsigned modus) |
void | unprepareOperand () |
virtual Value * | getNextValue () |
Private Attributes | |
PathExpression * | path |
The entered PathExpression. | |
BufferIterator * | bit |
The initialized BufferIterator for this path. |
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.
$root
! Definition at line 53 of file varstepexpression.h.
VarStepExpression::VarStepExpression | ( | unsigned | _id, | |
PathExpression * | _path | |||
) |
Constructor.
Constructor - creating object for a variable and a PathExpression.
[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] |
VarStepExpression * VarStepExpression::clone | ( | ) |
Returns a new, independent copy of this object.
Returns a new, independent copy of this object.
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.
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.
[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. |
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.
[in,out] | depset | Pointer to a vector containing Pointer to DependencySet objects. |
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.
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.
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.
[in] | root | Pointer to a BufferNode object. |
void |
Reimplemented from VarExpression.
Definition at line 62 of file varstepexpression.cpp.
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.
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.
[in] | eos | Pointer to a OutputStream object. |
[in] | env | Pointer to a Environment object. |
[in] | modus | Evaluation modus. |
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.
[in] | dos | Pointer to a OutputStream object. |
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.
void |
Reimplemented from VarExpression.
Definition at line 108 of file varstepexpression.cpp.
References bit, and BufferIterator::reset().
BufferIterator * VarStepExpression::bit [private] |
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().
PathExpression * VarStepExpression::path [private] |
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().