VariableTreeNode Class Reference

Represents a single node of the constructed variable tree. More...

#include <variabletreenode.h>

Collaboration diagram for VariableTreeNode:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 VariableTreeNode ()
 Constructor.
 VariableTreeNode (VariableTreeNode *_parent, unsigned _var, bool _direct_output)
 Constructor.
virtual ~VariableTreeNode ()
bool insertNode (unsigned parent_var, unsigned introduced_var, bool direct_output)
 Inserts a new node for a variable.
void print (OutputStream &dos)
 Prints this single VariableTreeNode.
unsigned getVar ()
 Returns the (numeric value of a) variable of a VariableTreeNode.
vector< VariableTreeNode * > * getChildren ()
 Returns all children of a VariableTreeNode.
bool isDirectOutput ()
 Returns if the for-loop introducing the variable generates direct output.

Private Member Functions

void print (OutputStream &dos, unsigned indents)
 Prints this single VariableTreeNode with whitespace indenting.

Private Attributes

VariableTreeNodeparent
 The entered VariableTreeNode (parent node).
unsigned var
 The entered variable.
vector< VariableTreeNode * > children
bool direct_output


Detailed Description

Represents a single node of the constructed variable tree.

Represents a single node of the constructed variable tree, i.e. of the constructed VariableTree, which takes a VariableTreeNode as parent node and a variable as child node of this parent node as arguments.

Note:
Variables are internally represented by numbers!
Author:
Michael Schmidt

Gunnar Jehl

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

Definition at line 56 of file variabletreenode.h.


Constructor & Destructor Documentation

VariableTreeNode::VariableTreeNode (  ) 

Constructor.

Constructor - creating object for variable $root.

Definition at line 37 of file variabletreenode.cpp.

Referenced by insertNode().

VariableTreeNode::VariableTreeNode ( VariableTreeNode _parent,
unsigned  _var,
bool  _direct_output 
)

Constructor.

Constructor - creating object for a VariableTreeNode and a variable.

Parameters:
[in] _parent Pointer to a VariableTreeNode object (parent node).
[in] _var Variable to be inserted as child node (of the entered parent node).
[in] _direct_output true if the associated for-loop directly produces output, false otherwise.

Definition at line 41 of file variabletreenode.cpp.

VariableTreeNode::~VariableTreeNode (  )  [virtual]

Destructor.

Definition at line 47 of file variabletreenode.cpp.

References children.


Member Function Documentation

vector< VariableTreeNode * > * VariableTreeNode::getChildren (  )  [inline]

Returns all children of a VariableTreeNode.

Returns all children of a VariableTreeNode, i.e. returns the member variable.

Return values:
vector<VariableTreeNode*>* Pointer to a vector object containing a pointer to VariableTreeNode objects.

Definition at line 111 of file variabletreenode.h.

Referenced by ProjectionTree::createProjectionTree().

unsigned VariableTreeNode::getVar (  )  [inline]

Returns the (numeric value of a) variable of a VariableTreeNode.

Returns the (numeric value of a) variable of a VariableTreeNode, i.e. returns the member variable.

Return values:
unsigned Numeric value of a variable.

Definition at line 104 of file variabletreenode.h.

References var.

Referenced by ProjectionTree::createProjectionTree().

bool VariableTreeNode::insertNode ( unsigned  parent_var,
unsigned  introduced_var,
bool  direct_output 
)

Inserts a new node for a variable.

Inserts a new node for a variable, which is appended as child of the first argument of this method.

Parameters:
[in] parent_var Parent node of a new node.
[in] introduced_var New node or variable respectively to be inserted.
[in] direct_output true if the associated for-loop directly produces output, false otherwise.
Return values:
bool true if the new node was successfully inserted, false otherwise.

Definition at line 53 of file variabletreenode.cpp.

References children, var, and VariableTreeNode().

Referenced by VariableTree::insertNode().

bool VariableTreeNode::isDirectOutput (  )  [inline]

Returns if the for-loop introducing the variable generates direct output.

Returns if the for-loop introducing the variable generates direct output.

Return values:
bool true if the for-loop introducing the variable generates direct output, false otherwise.

Definition at line 121 of file variabletreenode.h.

void VariableTreeNode::print ( OutputStream dos,
unsigned  indents 
) [private]

Prints this single VariableTreeNode with whitespace indenting.

Prints this single VariableTreeNode with whitespace indenting.

Parameters:
[in] dos Pointer to a OutputStream object.
[in] indents Number of whitespaces to put before output or of a VariableTreeNode respectively.
Return values:
void 

Definition at line 79 of file variabletreenode.cpp.

References children, direct_output, VarName::getInstance(), VarName::getVarname(), incrementIndents(), NEWLINE, resetIndents(), var, and writeIndents().

void VariableTreeNode::print ( OutputStream dos  ) 

Prints this single VariableTreeNode.

Prints this single VariableTreeNode.

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

Definition at line 74 of file variabletreenode.cpp.

References resetIndents().

Referenced by VariableTree::print().


Member Data Documentation

All child nodes of a VariableTreeNode.

Definition at line 151 of file variabletreenode.h.

Referenced by insertNode(), print(), and ~VariableTreeNode().

Indicator if the for-loop introducing the variable generates direct output.

Definition at line 157 of file variabletreenode.h.

Referenced by print().

The entered VariableTreeNode (parent node).

The entered VariableTreeNode (parent node), which is the first argument of the constructor.

Definition at line 139 of file variabletreenode.h.

unsigned VariableTreeNode::var [private]

The entered variable.

The entered variable, which is the second argument of the constructor and internally represented by a number.

Definition at line 145 of file variabletreenode.h.

Referenced by getVar(), insertNode(), and print().


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