signOff(variable/path, role)
.
More...
#include <signoffexpression.h>
Public Member Functions | |
SignOffExpression (VarExpression *_var, Role *_role) | |
Constructor. | |
SignOffExpression (VarStepExpression *_varstep, Role *_role) | |
Constructor. | |
virtual | ~SignOffExpression () |
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 | print (OutputStream &dos) const |
void | init (BufferNode *root) |
virtual void | eval (OutputStream &eos, Environment *env, unsigned modus) |
virtual unsigned | getVar () |
Returns the (numeric value of the) variable from the underlying VarExpression or VarStepExpression respectively. | |
Private Attributes | |
VarExpression * | var |
The entered VarExpression. | |
VarStepExpression * | varstep |
The entered VarStepExpression. | |
VarExpression * | exec_var |
The cloned VarExpression of the original VarExpression. | |
VarStepExpression * | exec_varstep |
The cloned VarStepExpression of the original VarStepExpression. | |
Role * | role |
The entered Role. | |
BufferIterator * | bit |
The initialized BufferIterator for the entered/cloned VarExpression or VarStepExpression. |
signOff(variable/path, role)
.
Represents a single (signOff-) expression of the form signOff(variable/path, role)
, which takes therefore either a VarExpression, e.g. signOff($x, ri)
, or a VarStepExpression, e.g. signOff($x/bib/book/dos
:
:
node
(), ri)
or signOff(/bib//book[position
()=1], ri)
respectively, and a Role as arguments and removes this certain role from all affected buffer nodes, i.e. removes role ri
from all BufferNode that are located through the entered VarExpression or the entered VarStepExpression respectively.
Definition at line 56 of file signoffexpression.h.
SignOffExpression::SignOffExpression | ( | VarExpression * | _var, | |
Role * | _role | |||
) |
Constructor.
Constructor - creating object for a VarExpression and a Role.
[in] | _var | Pointer to a VarExpression object. |
[in] | _role | Pointer to a Role object. |
Definition at line 37 of file signoffexpression.cpp.
SignOffExpression::SignOffExpression | ( | VarStepExpression * | _varstep, | |
Role * | _role | |||
) |
Constructor.
Constructor - creating object for a VarStepExpression and a Role.
[in] | _varstep | Pointer to a VarStepExpression object. |
[in] | _role | Pointer to a Role object. |
Definition at line 42 of file signoffexpression.cpp.
References exec_var, exec_varstep, VarExpression::getId(), VarStepExpression::getPath(), PathExpression::isEmptyPath(), and VarExpression::setId().
SignOffExpression::~SignOffExpression | ( | ) | [virtual] |
Destructor.
Definition at line 56 of file signoffexpression.cpp.
References bit, exec_var, exec_varstep, var, and varstep.
void SignOffExpression::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 117 of file signoffexpression.cpp.
References bit, BufferIterator::clear(), exec_var, exec_varstep, VarExpression::getId(), BufferIterator::getNext(), Environment::getNodeBinding(), BufferIterator::init(), LOCK_CONTEXT_ALWAYS_CLEAR, READ_UP_TO_CLOSE_NONE, and role.
unsigned SignOffExpression::getVar | ( | ) | [virtual] |
Returns the (numeric value of the) variable from the underlying VarExpression or VarStepExpression respectively.
Returns the (numeric value of the) variable from the underlying VarExpression or VarStepExpression respectively.
unsigned | Numeric value of the variable from the underlying VarExpression or VarStepExpression respectively. |
Definition at line 135 of file signoffexpression.cpp.
References VarExpression::getId(), var, and varstep.
void SignOffExpression::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 104 of file signoffexpression.cpp.
References bit, exec_var, and exec_varstep.
void SignOffExpression::print | ( | OutputStream & | dos | ) | const [virtual] |
Prints the expression.
Prints the expression.
[in] | dos | Pointer to a OutputStream object. |
void |
Implements Expression.
Definition at line 90 of file signoffexpression.cpp.
void SignOffExpression::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 76 of file signoffexpression.cpp.
References exec_var, exec_varstep, VarExpression::replaceVarId(), var, and varstep.
void SignOffExpression::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 66 of file signoffexpression.cpp.
References VarExpression::scopeCheck(), var, and varstep.
BufferIterator * SignOffExpression::bit [private] |
The initialized BufferIterator for the entered/cloned VarExpression or VarStepExpression.
The initialized BufferIterator for the entered/cloned VarExpression or VarStepExpression 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.
Definition at line 162 of file signoffexpression.h.
Referenced by eval(), init(), and ~SignOffExpression().
VarExpression * SignOffExpression::exec_var [private] |
The cloned VarExpression of the original VarExpression.
The cloned VarExpression of the original VarExpression. This member variable is NULL
if the constructor was called with a VarStepExpression.
signOff($x/dos
:
:
node
(), ri)
. Definition at line 135 of file signoffexpression.h.
Referenced by eval(), init(), print(), replaceVarId(), SignOffExpression(), and ~SignOffExpression().
VarStepExpression * SignOffExpression::exec_varstep [private] |
The cloned VarStepExpression of the original VarStepExpression.
The cloned VarStepExpression of the original VarStepExpression without the tail PathStepExpression /dos
:
:
node
()
if present. This member variable is NULL
if the constructor was called with a VarExpression.
signOff($x/dos
:
:
node
(), ri)
. Definition at line 146 of file signoffexpression.h.
Referenced by eval(), init(), replaceVarId(), SignOffExpression(), and ~SignOffExpression().
Role * SignOffExpression::role [private] |
The entered Role.
The entered Role, which is the second argument of the constructor and defines the Role which should be be removed from all through VarExpression or VarStepExpression respectively located BufferNode.
Definition at line 154 of file signoffexpression.h.
Referenced by eval().
VarExpression * SignOffExpression::var [private] |
The entered VarExpression.
The entered VarExpression, which is the first argument of the constructor. This member variable is NULL
if the constructor was called with a VarStepExpression.
Definition at line 118 of file signoffexpression.h.
Referenced by getVar(), print(), replaceVarId(), scopeCheck(), and ~SignOffExpression().
VarStepExpression * SignOffExpression::varstep [private] |
The entered VarStepExpression.
The entered VarStepExpression, which is the first argument of the constructor. This member variable is NULL
if the constructor was called with a VarExpression.
Definition at line 125 of file signoffexpression.h.
Referenced by getVar(), replaceVarId(), scopeCheck(), and ~SignOffExpression().