fn:empty
.
More...
#include <emptycondexpression.h>
Public Member Functions | |
EmptyCondExpression (VarExpression *_var) | |
Constructor. | |
EmptyCondExpression (VarStepExpression *_varstep) | |
Constructor. | |
virtual | ~EmptyCondExpression () |
virtual void | scopeCheck (vector< unsigned > &def_vars, vector< unsigned > &introduced_vars, vector< unsigned > &violating_vars) |
virtual void | replaceVarId (unsigned old_id, unsigned new_id) |
virtual void | extractFSAMap (FSAMap *fsamap, unsigned parent_var) |
virtual void | extractParVarMap (ParVarMap *parvarmap) |
virtual void | extractDependencies (vector< DependencySet * > *depset) |
virtual Expression * | placeSignOffs (vector< SignOffExpression * > &signoffs) |
void | rewriteEmptyFuncts () |
virtual void | rewriteAggregateFuncts () |
virtual void | print (OutputStream &dos) const |
virtual void | init (BufferNode *root) |
virtual void | eval (OutputStream &eos, Environment *env, unsigned modus) |
virtual bool | evalCond (OutputStream &eos, Environment *env, unsigned modus) |
Private Attributes | |
VarExpression * | var |
The entered VarExpression. | |
VarStepExpression * | varstep |
The entered VarStepExpression. | |
NotCondExpression * | ncond |
The rewritten NotCondExpression of this XQuery function fn:empty or of the entered VarExpression or VarStepExpression respectively. |
fn:empty
.
Represents XQuery standard function fn:empty
, which takes either a VarExpression, e.g. fn:empty($x)
, or a VarStepExpression, e.g. fn:empty($x/bib/book)
or fn:empty(/bib//book)
respectively, as argument and returns true
if the sequence located through the entered VarExpression or the entered VarStepExpression respectively contains no items, false
otherwise.
fn:not(fn:exists)
. Definition at line 57 of file emptycondexpression.h.
EmptyCondExpression::EmptyCondExpression | ( | VarExpression * | _var | ) |
Constructor.
Constructor - creating object for a VarExpression.
[in] | _var | Pointer to a VarExpression object. |
Definition at line 37 of file emptycondexpression.cpp.
EmptyCondExpression::EmptyCondExpression | ( | VarStepExpression * | _varstep | ) |
Constructor.
Constructor - creating object for a VarStepExpression.
[in] | _varstep | Pointer to a VarStepExpression object. |
Definition at line 41 of file emptycondexpression.cpp.
EmptyCondExpression::~EmptyCondExpression | ( | ) | [virtual] |
void EmptyCondExpression::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 Expression.
Definition at line 115 of file emptycondexpression.cpp.
References NotCondExpression::eval(), and ncond.
bool EmptyCondExpression::evalCond | ( | OutputStream & | eos, | |
Environment * | env, | |||
unsigned | modus | |||
) | [virtual] |
Evaluates the corresponding CondExpression.
Evaluates the corresponding CondExpression.
[in] | eos | Pointer to a OutputStream object. |
[in] | env | Pointer to a Environment object. |
[in] | modus | Evaluation modus. |
bool | true if the corresponding CondExpression is true , false otherwise. |
RuntimeException | If illegal evaluation mode (argument: unsigned modus). |
Implements CondExpression.
Definition at line 120 of file emptycondexpression.cpp.
References NotCondExpression::evalCond(), and ncond.
void EmptyCondExpression::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 Expression.
Definition at line 75 of file emptycondexpression.cpp.
References NotCondExpression::extractDependencies(), and ncond.
void EmptyCondExpression::extractFSAMap | ( | FSAMap * | fsamap, | |
unsigned | parent_var | |||
) | [virtual] |
Extracts the needed first straight ancestor (FSA) variables map.
Extracts the needed first straight ancestor (FSA) variables map, which is needed for correct insertion of SignOffExpression.
[in,out] | fsamap | Pointer to a FSAMap object. |
[in] | parent_var | Parent variable. |
void |
Reimplemented from Expression.
Definition at line 67 of file emptycondexpression.cpp.
References NotCondExpression::extractFSAMap(), and ncond.
void EmptyCondExpression::extractParVarMap | ( | ParVarMap * | parvarmap | ) | [virtual] |
Extracts the needed parent variable (ParVar) map.
Extracts the needed parent variable (ParVar) map, which is needed for constructing the VariableTree.
[in,out] | parvarmap | Pointer to a ParVarMap object. |
void |
Reimplemented from Expression.
Definition at line 71 of file emptycondexpression.cpp.
References NotCondExpression::extractParVarMap(), and ncond.
void EmptyCondExpression::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 Expression.
Definition at line 111 of file emptycondexpression.cpp.
References NotCondExpression::init(), and ncond.
Expression * EmptyCondExpression::placeSignOffs | ( | vector< SignOffExpression * > & | signoffs | ) | [virtual] |
Places all signOff-statements in the corresponding query.
Places all signOff-statements in the corresponding query, which are needed for active garbage collection by removing Role from the BufferNode.
[in] | signoffs | Pointer to a vector containing Pointer to SignOffExpression objects. |
Expression* | Pointer to a Expression object (following expression in the corresponding query). |
Reimplemented from Expression.
Definition at line 79 of file emptycondexpression.cpp.
References ncond, and NotCondExpression::placeSignOffs().
void EmptyCondExpression::print | ( | OutputStream & | dos | ) | const [virtual] |
Prints the expression.
Prints the expression.
[in] | dos | Pointer to a OutputStream object. |
void |
Implements Expression.
Definition at line 99 of file emptycondexpression.cpp.
void EmptyCondExpression::replaceVarId | ( | unsigned | old_id, | |
unsigned | new_id | |||
) | [virtual] |
Replaces all matching variable IDs by a new one.
Replaces all matching variable IDs by a new one, which is needed in case of calling method rewriteVarsteps().
[in] | old_id | Old variable ID. |
[in] | new_id | New variable ID, which should be introduced instead. |
void |
Reimplemented from Expression.
Definition at line 59 of file emptycondexpression.cpp.
References VarExpression::replaceVarId(), var, and varstep.
void EmptyCondExpression::rewriteAggregateFuncts | ( | ) | [virtual] |
Rewrites all arguments of all aggregate functions into an equivalent for-clause (with return-clause).
Rewrites all arguments of all aggregate functions into an equivalent for-clause (with return-clause).
void |
Reimplemented from Expression.
Definition at line 95 of file emptycondexpression.cpp.
References ncond, and NotCondExpression::rewriteAggregateFuncts().
void EmptyCondExpression::rewriteEmptyFuncts | ( | ) | [virtual] |
Rewrites all fn:empty
XQuery functions into equivalent fn:not(fn:exists)
XQuery functions.
Rewrites all fn:empty
XQuery functions into equivalent fn:not(fn:exists)
XQuery functions.
void |
Reimplemented from Expression.
Definition at line 86 of file emptycondexpression.cpp.
References ncond, Expression::setType(), var, and varstep.
void EmptyCondExpression::scopeCheck | ( | vector< unsigned > & | def_vars, | |
vector< unsigned > & | introduced_vars, | |||
vector< unsigned > & | violating_vars | |||
) | [virtual] |
Returns if all used variables were previously (through a for-clause) defined or if a variable leaves their defined scope.
Returns if all used variables were previously (through a for-clause) defined or if a variable leaves their defined scope.
[in] | def_vars | Vector containing all previously defined variables. |
[in] | introduced_vars | Vector containing all up to this expression defined variables. |
[in] | violating_vars | Vector containing all variables which violates the scope condition. |
void |
Reimplemented from Expression.
Definition at line 49 of file emptycondexpression.cpp.
References VarExpression::scopeCheck(), var, and varstep.
NotCondExpression * EmptyCondExpression::ncond [private] |
The rewritten NotCondExpression of this XQuery function fn:empty
or of the entered VarExpression or VarStepExpression respectively.
The rewritten NotCondExpression of this XQuery function fn:empty
or of the entered VarExpression or VarStepExpression respectively after calling method rewriteEmptyFuncts(). This member variable is NULL
on creation of object but should not be NULL
anymore after method rewriteEmptyFuncts() has been executed.
Definition at line 163 of file emptycondexpression.h.
Referenced by eval(), evalCond(), extractDependencies(), extractFSAMap(), extractParVarMap(), init(), placeSignOffs(), print(), rewriteAggregateFuncts(), rewriteEmptyFuncts(), and ~EmptyCondExpression().
VarExpression * EmptyCondExpression::var [private] |
The entered VarExpression.
The entered VarExpression, which is the argument of the constructor. This member variable is NULL
if the constructor was called with a VarStepExpression.
Definition at line 146 of file emptycondexpression.h.
Referenced by print(), replaceVarId(), rewriteEmptyFuncts(), and scopeCheck().
VarStepExpression * EmptyCondExpression::varstep [private] |
The entered VarStepExpression.
The entered VarStepExpression, which is the argument of the constructor. This member variable is NULL
if the constructor was called with a VarExpression.
Definition at line 153 of file emptycondexpression.h.
Referenced by replaceVarId(), rewriteEmptyFuncts(), and scopeCheck().