This is the documentation for Enlighten.
class Geo TreeNode
template<typename>
class Geo::TreeNode
A generic tree structure, where each node contains an item by value.
Nodes are not copied after construction, but the SetValue function requires that the item type (_Ty) is assignable.
Functions
Name | Description |
|---|---|
Destructor. | |
Add a child node with the given value 'val'. | |
Delete the child with index 'idx', children of the node is assigned to this node at the end of the child array. | |
Delete the child with index 'idx' and all nodes below this child. | |
Get child with index 'idx', NULL if 'idx' is out of range. | |
Get child with index 'idx', NULL if 'idx' is out of range. | |
Get the depth of the node. | |
Fills in an array of all the leaf nodes underneath this node. Returns the total number of leaves in the resulting array. | |
GetLevelFromRoot(Geo::GeoArray< TreeNode< _Ty > * > &, Geo::s32) | Return an array of nodes at the given depth ordered from left to right in the tree. |
GetLevelFromRoot(Geo::GeoArray< const TreeNode< _Ty > * > &, Geo::s32) | Return an array of nodes at the given depth ordered from left to right in the tree. |
Number of immediate children nodes. | |
Total number of internal nodes in the tree (i.e. not leaves) | |
Get the number of levels in the tree. | |
Total number of nodes in a given level. | |
Total number of nodes in the tree. | |
Get the parent node, NULL if this is the root. | |
Get the parent node, NULL if this is the root. | |
Get the root of the tree. | |
Get the root of the tree. | |
Get the value stored in the node. | |
Get the value stored in the node. | |
Returns whether this is a leaf node, i.e. has no children. | |
Returns whether this is a root node, i.e. has no parent. | |
Load tree from disk. | |
Remove and return the child with index 'idx' from the tree. | |
Save tree to disk. | |
Set the value stored in the node. | |
Constructor. |
Geo::TreeNode< _Ty >::~TreeNode
public: ~TreeNode()
Destructor.