or
of two conditions.
More...
#include <orcondexpression.h>
Public Member Functions | |
OrCondExpression (CondExpression *_left, CondExpression *_right) | |
Constructor. | |
virtual | ~OrCondExpression () |
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) |
virtual void | rewriteEmptyFuncts () |
virtual void | rewriteVarstepCondExps () |
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 | |
CondExpression * | left |
The entered CondExpression on the left hand side of disjunction or . | |
CondExpression * | right |
The entered CondExpression on the right hand side of disjunction or . |
or
of two conditions.
Represents XQuery disjunction or
of two conditions, which takes therefore two CondExpression, e.g. fn:false() or fn:true()
or $x/bib/book != /bib//book or fn:count($x) < 3
, as arguments and returns the or
disjunction of both conditions, i.e. returns true
if at least one CondExpression is true
, false
otherwise.
Definition at line 52 of file orcondexpression.h.
OrCondExpression::OrCondExpression | ( | CondExpression * | _left, | |
CondExpression * | _right | |||
) |
Constructor.
Constructor - creating object for two CondExpression.
[in] | _left | Pointer to a CondExpression object. |
[in] | _right | Pointer to a CondExpression object. |
Definition at line 37 of file orcondexpression.cpp.
OrCondExpression::~OrCondExpression | ( | ) | [virtual] |
void OrCondExpression::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 123 of file orcondexpression.cpp.
References Expression::eval(), EVAL_SIGNOFF, left, and right.
bool OrCondExpression::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 140 of file orcondexpression.cpp.
References EVAL_SIGNOFF, CondExpression::evalCond(), left, and right.
void OrCondExpression::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 68 of file orcondexpression.cpp.
References Expression::extractDependencies(), left, and right.
void OrCondExpression::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 58 of file orcondexpression.cpp.
References Expression::extractFSAMap(), left, and right.
void OrCondExpression::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 63 of file orcondexpression.cpp.
References Expression::extractParVarMap(), left, and right.
void OrCondExpression::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 118 of file orcondexpression.cpp.
References Expression::init(), left, and right.
Expression * OrCondExpression::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 73 of file orcondexpression.cpp.
References left, Expression::placeSignOffs(), and right.
void OrCondExpression::print | ( | OutputStream & | dos | ) | const [virtual] |
Prints the expression.
Prints the expression.
[in] | dos | Pointer to a OutputStream object. |
void |
Implements Expression.
Definition at line 96 of file orcondexpression.cpp.
References Expression::getType(), left, and right.
void OrCondExpression::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 53 of file orcondexpression.cpp.
References left, Expression::replaceVarId(), and right.
void OrCondExpression::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 91 of file orcondexpression.cpp.
References left, Expression::rewriteAggregateFuncts(), and right.
void OrCondExpression::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 81 of file orcondexpression.cpp.
References left, Expression::rewriteEmptyFuncts(), and right.
void OrCondExpression::rewriteVarstepCondExps | ( | ) | [virtual] |
Rewrites all if($x)
if-conditions into equivalent if(fn:not(fn:empty($x)))
XQuery expressions.
Rewrites all if($x)
if-conditions into equivalent if(fn:not(fn:empty($x)))
XQuery expressions.
void |
Reimplemented from Expression.
Definition at line 86 of file orcondexpression.cpp.
References left, Expression::rewriteVarstepCondExps(), and right.
void OrCondExpression::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 46 of file orcondexpression.cpp.
References left, right, and Expression::scopeCheck().
CondExpression * OrCondExpression::left [private] |
The entered CondExpression on the left hand side of disjunction or
.
The entered CondExpression on the left hand side of disjunction or
, which is the first argument of the constructor.
Definition at line 141 of file orcondexpression.h.
Referenced by eval(), evalCond(), extractDependencies(), extractFSAMap(), extractParVarMap(), init(), placeSignOffs(), print(), replaceVarId(), rewriteAggregateFuncts(), rewriteEmptyFuncts(), rewriteVarstepCondExps(), scopeCheck(), and ~OrCondExpression().
CondExpression * OrCondExpression::right [private] |
The entered CondExpression on the right hand side of disjunction or
.
The entered CondExpression on the right hand side of disjunction or
, which is the second argument of the constructor.
Definition at line 148 of file orcondexpression.h.
Referenced by eval(), evalCond(), extractDependencies(), extractFSAMap(), extractParVarMap(), init(), placeSignOffs(), print(), replaceVarId(), rewriteAggregateFuncts(), rewriteEmptyFuncts(), rewriteVarstepCondExps(), scopeCheck(), and ~OrCondExpression().