SignOffExpression Class Reference

Represents a single (signOff-) expression of the form signOff(variable/path, role). More...

#include <signoffexpression.h>

Inheritance diagram for SignOffExpression:

Inheritance graph
[legend]
Collaboration diagram for SignOffExpression:

Collaboration graph
[legend]

List of all members.

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

VarExpressionvar
 The entered VarExpression.
VarStepExpressionvarstep
 The entered VarStepExpression.
VarExpressionexec_var
 The cloned VarExpression of the original VarExpression.
VarStepExpressionexec_varstep
 The cloned VarStepExpression of the original VarStepExpression.
Rolerole
 The entered Role.
BufferIteratorbit
 The initialized BufferIterator for the entered/cloned VarExpression or VarStepExpression.


Detailed Description

Represents a single (signOff-) expression of the form 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.

Author:
Michael Schmidt

Gunnar Jehl

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

Definition at line 56 of file signoffexpression.h.


Constructor & Destructor Documentation

SignOffExpression::SignOffExpression ( VarExpression _var,
Role _role 
)

Constructor.

Constructor - creating object for a VarExpression and a Role.

Parameters:
[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.

Parameters:
[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.


Member Function Documentation

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.

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 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.

Return values:
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.

Parameters:
[in] root Pointer to a BufferNode object.
Return values:
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.

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

Implements Expression.

Definition at line 90 of file signoffexpression.cpp.

References exec_var, and var.

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().

Parameters:
[in] old_id Old variable ID.
[in] new_id New variable ID, which should be introduced instead.
Return values:
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.

Parameters:
[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.
Return values:
void 

Reimplemented from Expression.

Definition at line 66 of file signoffexpression.cpp.

References VarExpression::scopeCheck(), var, and varstep.


Member Data Documentation

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().

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.

Note:
Because of strict separation of VarExpression and VarStepExpression it is possible that a cloned VarStepExpression results in a VarExpression. This, for example, will be the case for signOff($x/dos::node(), ri).

Definition at line 135 of file signoffexpression.h.

Referenced by eval(), init(), print(), replaceVarId(), SignOffExpression(), and ~SignOffExpression().

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.

Note:
Because of strict separation of VarExpression and VarStepExpression it is possible that a cloned VarStepExpression results in a VarExpression. This, for example, will be the case for signOff($x/dos::node(), ri).

Definition at line 146 of file signoffexpression.h.

Referenced by eval(), init(), replaceVarId(), SignOffExpression(), and ~SignOffExpression().

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().

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().

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().


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