![]() |
Humble Framework for SkyOS |
#include <HTree.h>
Inheritance diagram for HTreeNode< T >:

Definition at line 31 of file HTree.h.
Public Member Functions | |
| const T & | GetData () const |
| ErrCode | SetData (const T &data) |
| Updates the data embedded in the node. | |
| uint32 | GetDepth (void) const |
| Returns the depth beneath the current node. | |
| uint32 | GetCount (void) const |
| Returns the count of nodes beneath the current node. | |
| HTreeNodePtr | GetFirst (void) |
| HTreeNodePtr | GetLast (void) |
| HTreeNodePtr | GetNext (void) |
| HTreeNodePtr | GetPrev (void) |
| HTreeNodePtr | GetRoot (void) |
| HTreeNodePtr | Search (T const &data) |
| HTreeNode (const T &data, HTreeNodePtr pn=NULL) | |
Static Public Member Functions | |
| static int | Compare (const T &t1, const T &t2) |
Protected Types | |
| enum | Balance { BAL_LEFT, BAL_EVEN, BAL_RIGHT } |
Protected Member Functions | |
| void | afterDelete (void) |
| void | afterInsert (void) |
| HTreeNodePtr | getInsertPos (const T &data, HTreeNodePtr &pnFound) |
| void | rotateLeft (void) |
| void | rotateRight () |
| void | rotateLeftLeft (void) |
| void | rotateRightRight (void) |
| bool | hasParent (void) const |
| bool | hasLeftSibling () const |
| bool | hasRightSibling () const |
| bool | isLeftSibling () const |
| bool | isRightSibling () const |
| HTreeNode & | operator= (HTreeNode< T > const &) |
Protected Attributes | |
| T | m_data |
| The user-defined data type. | |
| Balance | m_balance |
| The "balance factor" of this node. | |
| HTreeNodePtr | m_pnLeft |
| Ptr to the node's left child. | |
| HTreeNodePtr | m_pnRight |
| Ptr to the node's right child. | |
| HTreeNodePtr | m_pnParent |
| Ptr to the node's parent. | |
Friends | |
| class | HTree< T > |
|
||||||||||
|
Rebalances the sub-tree after a node is deleted |
|
||||||||||
|
Rebalances sub-tree after node insertion |
|
||||||||||||||||
|
Finds the insertion point in tree
|
|
||||||||||
|
Performs a "rotate left" action on the current sub-tree. |
|
|||||||||
|
Performs a "rotate right" action on the current sub-tree. |
|
||||||||||
|
Performs a "double rotate left" action on the current sub-tree. |
|
||||||||||
|
Performs a "double rotate right" action on the current sub-tree. |
|
||||||||||
|
Evaluates to true if the node has a valid parent (all except root node)
|
|
|||||||||
|
Evaluates to true if the node has a valid left child.
|
|
|||||||||
|
Evaluates to true if the node has a valid right child.
|
|
|||||||||
|
Evaluates to true if the node is the left child of it's parent.
|
|
|||||||||
|
Evaluates to true if the node is the right child of it's parent
|
|
|||||||||
|
Returns the data embedded in the node
|
|
||||||||||
|
This method changes the data for this node, after verifying that it is equal to the existing node. Keep in mind that the Compare() function typically only compares whatever 'key' fields are contained inside the data structure. The key fields must remain the same—or the tree will be manually thrown out of balance—but any other fields can be freely changed.
|
|
||||||||||
|
Traverses the tree to compute the depth of the sub-tree from this node downwards. Minimum value will always be 1 (for this node).
|
|
||||||||||
|
Traverses the tree to count the number of nodes from the current node down.
|
|
||||||||||
|
Returns the first (minimum value) node in this sub-tree.
|
|
||||||||||
|
Returns the last (maximum value) node in this sub-tree.
|
|
||||||||||
|
Returns the next node in ordered sequence
|
|
||||||||||
|
Returns the previous node in ordered sequence
|
|
||||||||||
|
Returns the root node of the tree
|
|
||||||||||
|
Search the tree for a given node
|
|
||||||||||||||||
|
Helper function to compare two nodes in the tree.
|
2006.01.09-16:37