#include <ntree.h>
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_t & | get_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). | |
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.
| 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.
| index | Node index. | |
| parent | Index of parent node. |
| void ace::NTreeNode::add_child | ( | tree_size_t | child_index | ) | [inline] |
| size_t ace::NTreeNode::count_childs | ( | void | ) | const throw () [inline] |
| const childs_t& ace::NTreeNode::get_childs | ( | void | ) | const throw () [inline] |
| tree_size_t ace::NTreeNode::index | ( | void | ) | const throw () [inline] |
| bool ace::NTreeNode::is_abstract | ( | void | ) | const throw () [inline] |
Node is abstract, if its index is 0.
Only the root node should be abstract.
| bool ace::NTreeNode::is_leaf | ( | void | ) | const throw () [inline] |
| bool ace::NTreeNode::is_root | ( | void | ) | const throw () [inline] |
| tree_size_t ace::NTreeNode::parent | ( | void | ) | const throw () [inline] |
tree_size_t ace::NTreeNode::_index [private] |
Index of given node (0 for abstract node).
tree_size_t ace::NTreeNode::_parent [private] |
Index of parent node (0 for root node).
childs_t ace::NTreeNode::_childs [private] |
Indexes of childs of given node (order is significant).
1.5.6