HierarchyTree< NodeClass >::NodeNavigator Class Reference

provides easy access to the tree hierarchy More...

#include <hierarchy_tree.h>

Collaboration diagram for HierarchyTree< NodeClass >::NodeNavigator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NodeNavigator (void)
 constructs empty navigator
 NodeNavigator (const NodeNavigator &navig)
 copy ctor
NodeClass & operator * () const
 reference access operator for node-data access
NodeClass * operator-> () const
 member access operator for node-data access
NodeNavigatorgetChild (const int child_id, NodeNavigator &child) const
 children access
bool isValid (void) const
 checks for validity of encapsulated node

Private Member Functions

HierarchyTreegetTree () const
 access the tree referenced by this navigator
 NodeNavigator (HierarchyTree *t, int level, int index)
 creates a navigator with explicit tree and node position

Private Attributes

HierarchyTreemTree
 pointer to tree
int mNodeLevel
 position of node in tree (depth)
int mNodeIndex
 position of node in tree (left offset)

Friends

class HierarchyTree< NodeClass >

Detailed Description

template<class NodeClass>
class HierarchyTree< NodeClass >::NodeNavigator

provides easy access to the tree hierarchy

Definition at line 136 of file hierarchy_tree.h.


Constructor & Destructor Documentation

template<class NodeClass>
HierarchyTree< NodeClass >::NodeNavigator::NodeNavigator void   )  [inline]
 

constructs empty navigator

Definition at line 144 of file hierarchy_tree.h.

Referenced by HierarchyTree< NodeClass >::getRoot().

template<class NodeClass>
HierarchyTree< NodeClass >::NodeNavigator::NodeNavigator const NodeNavigator navig  )  [inline]
 

copy ctor

Definition at line 151 of file hierarchy_tree.h.

template<class NodeClass>
HierarchyTree< NodeClass >::NodeNavigator::NodeNavigator HierarchyTree t,
int  level,
int  index
[inline, private]
 

creates a navigator with explicit tree and node position

Parameters:
t tree pointer
level node's level, zero based (root is on level 0)
index node's index (root has index 0, its left child 0, its right child 1 )

Definition at line 211 of file hierarchy_tree.h.


Member Function Documentation

template<class NodeClass>
NodeNavigator& HierarchyTree< NodeClass >::NodeNavigator::getChild const int  child_id,
NodeNavigator child
const [inline]
 

children access

Parameters:
child_id number of the child, zero based
child node navigator that will be filled with data
Returns:
reference to child that was provided as argument

Definition at line 178 of file hierarchy_tree.h.

References assertL, HierarchyTree< NodeClass >::NodeNavigator::getTree(), HierarchyTree< NodeClass >::NodeNavigator::isValid(), HierarchyTree< NodeClass >::NodeNavigator::mNodeIndex, HierarchyTree< NodeClass >::NodeNavigator::mNodeLevel, and HierarchyTree< NodeClass >::NodeNavigator::mTree.

Here is the call graph for this function:

template<class NodeClass>
HierarchyTree* HierarchyTree< NodeClass >::NodeNavigator::getTree  )  const [inline, private]
 

access the tree referenced by this navigator

Returns:
tree pointer

Definition at line 200 of file hierarchy_tree.h.

References assertL, and HierarchyTree< NodeClass >::NodeNavigator::mTree.

Referenced by HierarchyTree< NodeClass >::NodeNavigator::getChild(), HierarchyTree< NodeClass >::NodeNavigator::isValid(), and HierarchyTree< NodeClass >::NodeNavigator::operator *().

template<class NodeClass>
bool HierarchyTree< NodeClass >::NodeNavigator::isValid void   )  const [inline]
 

checks for validity of encapsulated node

Returns:
true, if node exists in the tree, false otherwise
Note:
checks only if there is memory allocated in the tree for this node

Definition at line 192 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::NodeNavigator::getTree(), HierarchyTree< NodeClass >::isNodeValid(), HierarchyTree< NodeClass >::NodeNavigator::mNodeIndex, and HierarchyTree< NodeClass >::NodeNavigator::mNodeLevel.

Referenced by HierarchyTree< NodeClass >::NodeNavigator::getChild().

Here is the call graph for this function:

template<class NodeClass>
NodeClass& HierarchyTree< NodeClass >::NodeNavigator::operator *  )  const [inline]
 

reference access operator for node-data access

Definition at line 158 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::getNode(), HierarchyTree< NodeClass >::NodeNavigator::getTree(), HierarchyTree< NodeClass >::NodeNavigator::mNodeIndex, and HierarchyTree< NodeClass >::NodeNavigator::mNodeLevel.

Referenced by HierarchyTree< NodeClass >::NodeNavigator::operator->().

Here is the call graph for this function:

template<class NodeClass>
NodeClass* HierarchyTree< NodeClass >::NodeNavigator::operator->  )  const [inline]
 

member access operator for node-data access

Definition at line 166 of file hierarchy_tree.h.

References HierarchyTree< NodeClass >::NodeNavigator::operator *().

Here is the call graph for this function:


Friends And Related Function Documentation

template<class NodeClass>
friend class HierarchyTree< NodeClass > [friend]
 

Definition at line 138 of file hierarchy_tree.h.


Member Data Documentation

template<class NodeClass>
int HierarchyTree< NodeClass >::NodeNavigator::mNodeIndex [private]
 

position of node in tree (left offset)

Definition at line 217 of file hierarchy_tree.h.

Referenced by HierarchyTree< NodeClass >::NodeNavigator::getChild(), HierarchyTree< NodeClass >::NodeNavigator::isValid(), and HierarchyTree< NodeClass >::NodeNavigator::operator *().

template<class NodeClass>
int HierarchyTree< NodeClass >::NodeNavigator::mNodeLevel [private]
 

position of node in tree (depth)

Definition at line 217 of file hierarchy_tree.h.

Referenced by HierarchyTree< NodeClass >::NodeNavigator::getChild(), HierarchyTree< NodeClass >::NodeNavigator::isValid(), and HierarchyTree< NodeClass >::NodeNavigator::operator *().

template<class NodeClass>
HierarchyTree* HierarchyTree< NodeClass >::NodeNavigator::mTree [private]
 

pointer to tree

Definition at line 215 of file hierarchy_tree.h.

Referenced by HierarchyTree< NodeClass >::NodeNavigator::getChild(), and HierarchyTree< NodeClass >::NodeNavigator::getTree().


The documentation for this class was generated from the following file:
Generated on Wed Apr 12 14:17:15 2006 for bjs by  doxygen 1.4.5