#include <parvarmap.h>
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. | |
PathExpression * | getPath (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 ParVarMap * | getInstance () |
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 ParVarMap * | instance = NULL |
Instance of ParVarMap. |
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.
SINGLETON PATTERN!
Definition at line 60 of file parvarmap.h.
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().
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.
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.
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.
[in] | var | Variable for which parent variable (ParVar) should be obtained. |
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.
[in] | var | Variable for which path should be obtained. |
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.
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.
[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. |
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.
[in] | dos | Pointer to a OutputStream object. |
void |
Definition at line 67 of file parvarmap.cpp.
References getInstance(), NEWLINE, parvarmap, and TAGID_ROOT.
Referenced by Executor::collectQueryInformation().
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().
VarVarPathMap ParVarMap::parvarmap [private] |
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().