ace::NTreeNode Class Reference

Class holds information of single indexed-tree node. More...

#include <ntree.h>

List of all members.

Public Member Functions

 NTreeNode (void)
 Default constructor constructs abstract (root) node.
 NTreeNode (tree_size_t index, tree_size_t parent)
 It's required to know parent index when constructing node non-abstract node.
void add_child (tree_size_t child_index)
size_t count_childs (void) const throw ()
const childs_tget_childs (void) const throw ()
tree_size_t index (void) const throw ()
bool is_abstract (void) const throw ()
 Node is abstract, if its index is 0.
bool is_leaf (void) const throw ()
bool is_root (void) const throw ()
tree_size_t parent (void) const throw ()

Private Attributes

tree_size_t _index
 Index of given node (0 for abstract node).
tree_size_t _parent
 Index of parent node (0 for root node).
childs_t _childs
 Indexes of childs of given node (order is significant).


Detailed Description

Class holds information of single indexed-tree node.

For description of indexed-tree see file commentary. Note that the zero index is used for special purposes - it determines that given node is so called abstract root. Real tree roots (or root) are then childs of this abstract root node.


Constructor & Destructor Documentation

ace::NTreeNode::NTreeNode ( void   )  [inline]

Default constructor constructs abstract (root) node.

ace::NTreeNode::NTreeNode ( tree_size_t  index,
tree_size_t  parent 
) [inline]

It's required to know parent index when constructing node non-abstract node.

Parameters:
index Node index.
parent Index of parent node.


Member Function Documentation

void ace::NTreeNode::add_child ( tree_size_t  child_index  )  [inline]

size_t ace::NTreeNode::count_childs ( void   )  const throw () [inline]

Returns:
Number of node childs.

const childs_t& ace::NTreeNode::get_childs ( void   )  const throw () [inline]

Returns:
Reference to childs container.

tree_size_t ace::NTreeNode::index ( void   )  const throw () [inline]

Returns:
Node index.

bool ace::NTreeNode::is_abstract ( void   )  const throw () [inline]

Node is abstract, if its index is 0.

Only the root node should be abstract.

Returns:
True, if node is abstract.

bool ace::NTreeNode::is_leaf ( void   )  const throw () [inline]

Returns:
True, if node is leaf (has no childs).

bool ace::NTreeNode::is_root ( void   )  const throw () [inline]

Returns:
True, if node is root (has no parent node = parent node index is 0).

tree_size_t ace::NTreeNode::parent ( void   )  const throw () [inline]

Returns:
Index of parent node.


Member Data Documentation

Index of given node (0 for abstract node).

Index of parent node (0 for root node).

Indexes of childs of given node (order is significant).


The documentation for this class was generated from the following file:

Generated on Wed Aug 6 23:25:51 2008 for PACE by  doxygen 1.5.6