class Geo TreeNode

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

Name

Description

~TreeNode()

Destructor.

AddChild(const _Ty &)

Add a child node with the given value 'val'.

DeleteChild(Geo::s32)

Delete the child with index 'idx', children of the node is assigned to this node at the end of the child array.

DeleteSubTree(Geo::s32)

Delete the child with index 'idx' and all nodes below this child.

GetChild(Geo::s32)

Get child with index 'idx', NULL if 'idx' is out of range.

GetChild(Geo::s32)

Get child with index 'idx', NULL if 'idx' is out of range.

GetDepth()

Get the depth of the node.

GetLeaves(Geo::GeoArray< const TreeNode< _Ty > * > &)

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.

GetNumChildren()

Number of immediate children nodes.

GetNumInternalNodes()

Total number of internal nodes in the tree (i.e. not leaves)

GetNumLevels()

Get the number of levels in the tree.

GetNumNodes(Geo::s32)

Total number of nodes in a given level.

GetNumNodes()

Total number of nodes in the tree.

GetParent()

Get the parent node, NULL if this is the root.

GetParent()

Get the parent node, NULL if this is the root.

GetRoot()

Get the root of the tree.

GetRoot()

Get the root of the tree.

GetValue()

Get the value stored in the node.

GetValue()

Get the value stored in the node.

IsLeaf()

Returns whether this is a leaf node, i.e. has no children.

IsRoot()

Returns whether this is a root node, i.e. has no parent.

Load(Geo::IGeoInputStream &)

Load tree from disk.

RemoveChild(Geo::s32)

Remove and return the child with index 'idx' from the tree.

Save(Geo::IGeoStream &)

Save tree to disk.

SetValue(const _Ty &)

Set the value stored in the node.

TreeNode()

Constructor.



Geo::TreeNode< _Ty >::~TreeNode


public: ~TreeNode()


Destructor.