ParVarMap Class Reference

Represents mapping of variables to their parent variable (ParVar) and path. More...

#include <parvarmap.h>

Collaboration diagram for ParVarMap:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~ParVarMap ()
void insertParVar (unsigned var, unsigned parvar, PathExpression *path, bool _direct_output)
 Inserts a new variable with its parent variable (ParVar) and path.
void print (OutputStream &dos)
 Prints all variables with their parent variable (ParVar) and path.
unsigned getParVar (unsigned var)
 Returns the parent variable (ParVar) for the entered variable.
PathExpressiongetPath (unsigned var)
 Returns the path for the entered variable.
vector< unsigned > * getVarsq ()
 Returns all occurring variables (set VARSQ) of the corresponding query.
vector< bool > * getDirectOutputInfo ()
 Returns all direct output information for all occurring variables of the corresponding query.

Static Public Member Functions

static ParVarMapgetInstance ()
 Returns instance of ParVarMap.

Private Member Functions

 ParVarMap ()
 Constructor.

Private Attributes

VarVarPathMap parvarmap
 The underlying map of this object.
vector< unsigned > varsq
vector< bool > direct_output

Static Private Attributes

static ParVarMapinstance = NULL
 Instance of ParVarMap.


Detailed Description

Represents mapping of variables to their parent variable (ParVar) and path.

Represents mapping of variables to their parent variable (ParVar) and path, which takes therefore two variables, e.g. ParVar($x) = $y, and a PathExpression, e.g. /bib//book or /bib/book/title, as arguments.

Note:
Variables are internally represented by numbers!

SINGLETON PATTERN!

Author:
Michael Schmidt

Gunnar Jehl

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

Definition at line 60 of file parvarmap.h.


Constructor & Destructor Documentation

ParVarMap::~ParVarMap (  )  [virtual]

Destructor.

Definition at line 55 of file parvarmap.cpp.

ParVarMap::ParVarMap (  )  [private]

Constructor.

Constructor - creating object.

Definition at line 47 of file parvarmap.cpp.

References direct_output, parvarmap, TAGID_ROOT, and varsq.

Referenced by getInstance().


Member Function Documentation

vector< bool > * ParVarMap::getDirectOutputInfo (  )  [inline]

Returns all direct output information for all occurring variables of the corresponding query.

Returns all direct output information for all occurring variables of the corresponding query.

Return values:
vector<bool>* Pointer to a vector object containing all direct output information for all occurring variables of the corresponding query.

Definition at line 126 of file parvarmap.h.

Referenced by VariableTree::VariableTree().

static ParVarMap * ParVarMap::getInstance (  )  [static]

Returns instance of ParVarMap.

Returns instance of ParVarMap, i.e. of this object.

Return values:
ParVarMap* Pointer to a ParVarMap object.

Definition at line 39 of file parvarmap.cpp.

References instance, and ParVarMap().

Referenced by Executor::collectQueryInformation(), ProjectionTree::createProjectionTree(), PathEnvironment::PathEnvironment(), print(), VariableTree::VariableTree(), and Executor::~Executor().

unsigned ParVarMap::getParVar ( unsigned  var  ) 

Returns the parent variable (ParVar) for the entered variable.

Returns the parent variable (ParVar) for the entered variable.

Parameters:
[in] var Variable for which parent variable (ParVar) should be obtained.
Return values:
unsigned Parent variable (ParVar) for the entered variable.

Definition at line 88 of file parvarmap.cpp.

References parvarmap.

Referenced by ProjectionTree::createProjectionTree(), PathEnvironment::PathEnvironment(), and VariableTree::VariableTree().

PathExpression * ParVarMap::getPath ( unsigned  var  ) 

Returns the path for the entered variable.

Returns the path for the entered variable.

Parameters:
[in] var Variable for which path should be obtained.
Return values:
PathExpression* Pointer to a PathExpression object.

Definition at line 95 of file parvarmap.cpp.

References parvarmap.

Referenced by ProjectionTree::createProjectionTree(), and PathEnvironment::PathEnvironment().

vector< unsigned > * ParVarMap::getVarsq (  )  [inline]

Returns all occurring variables (set VARSQ) of the corresponding query.

Returns all occurring variables (set VARSQ) of the corresponding query.

Return values:
vector<unsigned>* Pointer to a vector object containing all occurring variables (set VARSQ) of the corresponding query.

Definition at line 118 of file parvarmap.h.

References varsq.

Referenced by Executor::buildDependencies(), PathEnvironment::PathEnvironment(), and VariableTree::VariableTree().

void ParVarMap::insertParVar ( unsigned  var,
unsigned  parvar,
PathExpression path,
bool  _direct_output 
)

Inserts a new variable with its parent variable (ParVar) and path.

Inserts a new variable with its parent variable (ParVar) and path.

Parameters:
[in] var Variable for which parent variable (ParVar) and path holds.
[in] parvar Parent variable (ParVar).
[in] path Pointer to a PathExpression object.
[in] _direct_output true if the associated for-loop contains direct output, e.g. in form of a NodeConstructExpression or ConstExpression, false otherwise.
Return values:
void 

Definition at line 58 of file parvarmap.cpp.

References direct_output, parvarmap, and varsq.

Referenced by ForExpression::extractParVarMap().

void ParVarMap::print ( OutputStream dos  ) 

Prints all variables with their parent variable (ParVar) and path.

Prints all variables with their parent variable (ParVar) and path.

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

Definition at line 67 of file parvarmap.cpp.

References getInstance(), NEWLINE, parvarmap, and TAGID_ROOT.

Referenced by Executor::collectQueryInformation().


Member Data Documentation

vector< bool > ParVarMap::direct_output [private]

Stores direct output information for all occurring variables of the corresponding query.

Definition at line 160 of file parvarmap.h.

Referenced by insertParVar(), and ParVarMap().

static ParVarMap * ParVarMap::instance = NULL [static, private]

Instance of ParVarMap.

Instance of ParVarMap to avoid duplicate existence of this object.

Definition at line 135 of file parvarmap.h.

Referenced by getInstance().

The underlying map of this object.

The underlying map of this object, which maps variables to their parent variable (ParVar) and path.

Definition at line 146 of file parvarmap.h.

Referenced by getParVar(), getPath(), insertParVar(), ParVarMap(), and print().

vector< unsigned > ParVarMap::varsq [private]

All occurring variables (set VARSQ) of the corresponding query.

Definition at line 152 of file parvarmap.h.

Referenced by getVarsq(), insertParVar(), and ParVarMap().


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