![]() |
• Utility Library | ||||||||||||||||||||||||||||||
|
API Links
Developer Links
|
class TreeDefined in:
Objects inherit from the C4Tree.hTree class so that they can be stored in a hierarchical tree.
Definition
Member Functions
Template Parameters
Constructor
Tree class can only exist as a base class for another class.
Description
The Tree class should be declared as a base class for objects that need to be stored in a hierarchical tree. The type template parameter should match the class type of such objects.When a Tree object is initially created, its super node is nullptr and it has no subnodes. An object having no super node is the root of a tree. (A newly created Tree object can be thought of as the root of a tree containing a single object.) In a normal tree structure, one object is created to serve as the root node. Objects are added to the tree by calling the Tree::AddSubnode function to designate them as subnodes of other objects in the tree.A tree is traversed in depth-first order using the Tree::GetNextNode function. The root node of a tree is considered to be the first node visited in a traversal. Iterative calls to the Tree::GetNextNode function visit every non-root node in a tree.When a Tree object is destroyed, all of its subnodes (and all of their subnodes, etc.) are also destroyed.
Base Classes
|