#include <tlbtree.h>
Collaboration diagram for TLBTree< T, _OP >::Node:
Public Member Functions | |
T & | elem (int idx, TLBTree *bt) |
Use this to access the elements:. | |
T * | elemP (int idx, TLBTree *bt) |
Pointer version of elem():. | |
template<typename K> bool | _LBI (const K &e, int *idx, TLBTree *bt) |
Implements binary search for child branch. | |
void | _INSLeafNS (int idx, const T &e, TLBTree *bt) |
Insert element before the passed index. | |
void | _INS_NS (int idx, const T &e, Node *chld, TLBTree *bt) |
Insert element and associated branch pointer before the passed index. | |
void | _DELLeaf (int idx, TLBTree *bt) |
void | _DEL_L (int idx, TLBTree *bt) |
Remove entry with passed index and its _left_ down pointer from non-leaf node. | |
void | _DEL_R (int idx, TLBTree *bt) |
Remove entry with passed index and its _right_ down pointer from non-leaf node. | |
Node () | |
~Node () | |
Public Attributes | |
int | nelem |
Number of elements stored. | |
Node ** | down |
Children nodes [2*m+1] or NULL if leaf. | |
char | _elem [] |
Array of 2*m elements. |
For internal use only.
Definition at line 82 of file tlbtree.h.
|
Definition at line 204 of file tlbtree.h. References TLBTree< T, _OP >::Node::down, and TLBTree< T, _OP >::Node::nelem. |
|
|
|
Remove entry with passed index and its _left_ down pointer from non-leaf node.
For internal use only.
Definition at line 181 of file tlbtree.h. References TLBTree< T, _OP >::Node::down, TLBTree< T, _OP >::Node::elem(), TLBTree< T, _OP >::Node::elemP(), TLBTree< T, _OP >::Node::nelem, and TLBTree< T, _OP >::OP. |
|
Remove entry with passed index and its _right_ down pointer from non-leaf node.
For internal use only.
Definition at line 193 of file tlbtree.h. References TLBTree< T, _OP >::Node::down, TLBTree< T, _OP >::Node::elem(), TLBTree< T, _OP >::Node::elemP(), TLBTree< T, _OP >::Node::nelem, and TLBTree< T, _OP >::OP. |
|
For internal use only. Remove entry with passed index from leaf node. Definition at line 171 of file tlbtree.h. References TLBTree< T, _OP >::Node::elem(), TLBTree< T, _OP >::Node::elemP(), TLBTree< T, _OP >::Node::nelem, and TLBTree< T, _OP >::OP. |
|
Insert element and associated branch pointer before the passed index.
For internal use only. Must NOT be a leaf node, i.e. down!=NULL. Relies on nelem>=1. idx=0 -> insert as first element; idx=nelem<2*m -> insert as last element; May NOT be called if splitting the node will be necessary, i.e. do not call if nelem==2*m. Definition at line 158 of file tlbtree.h. References TLBTree< T, _OP >::Node::down, TLBTree< T, _OP >::Node::elem(), TLBTree< T, _OP >::Node::elemP(), TLBTree< T, _OP >::Node::nelem, and TLBTree< T, _OP >::OP. |
|
Insert element before the passed index.
For internal use only. Must be a leaf node, i.e. down=NULL. Relies on nelem>=1. idx=0 -> insert as first element; idx=nelem<2*m -> insert as last element; May NOT be called if splitting the node will be necessary, i.e. do not call if nelem==2*m. Definition at line 140 of file tlbtree.h. References TLBTree< T, _OP >::Node::elem(), TLBTree< T, _OP >::Node::elemP(), TLBTree< T, _OP >::Node::nelem, and TLBTree< T, _OP >::OP. |
|
Implements binary search for child branch.
For internal use only. Lookup (branch) index in this node: range 0..nelem (inclusive). Does binary search O(log(m)). If the node is found (exact match), return value is 1 (match), otherwise it is 0. The index in question is stored in *idx. Definition at line 104 of file tlbtree.h. References TLBTree< T, _OP >::Node::elem(), TLBTree< T, _OP >::Node::nelem, and TLBTree< T, _OP >::OP. |
|
Use this to access the elements:.
Definition at line 90 of file tlbtree.h. References TLBTree< T, _OP >::Node::_elem, and TLBTree< T, _OP >::OP. Referenced by TLBTree< T, _OP >::Node::_DEL_L(), TLBTree< T, _OP >::Node::_DEL_R(), TLBTree< T, _OP >::Node::_DELLeaf(), TLBTree< NamespaceInfo *, PtrListOperators< NamespaceInfo > >::_FindSmallest(), TLBTree< T, _OP >::Node::_INS_NS(), TLBTree< T, _OP >::Node::_INSLeafNS(), TLBTree< T, _OP >::Node::_LBI(), and TLBTree< NamespaceInfo *, PtrListOperators< NamespaceInfo > >::store(). |
|
Pointer version of elem():.
Definition at line 93 of file tlbtree.h. References TLBTree< T, _OP >::Node::_elem, and TLBTree< T, _OP >::OP. Referenced by TLBTree< T, _OP >::Node::_DEL_L(), TLBTree< T, _OP >::Node::_DEL_R(), TLBTree< T, _OP >::Node::_DELLeaf(), TLBTree< T, _OP >::Node::_INS_NS(), and TLBTree< T, _OP >::Node::_INSLeafNS(). |
|
Array of 2*m elements.
Definition at line 86 of file tlbtree.h. Referenced by TLBTree< T, _OP >::Node::elem(), and TLBTree< T, _OP >::Node::elemP(). |
|
Children nodes [2*m+1] or NULL if leaf.
Definition at line 85 of file tlbtree.h. Referenced by TLBTree< T, _OP >::Node::_DEL_L(), TLBTree< T, _OP >::Node::_DEL_R(), TLBTree< NamespaceInfo *, PtrListOperators< NamespaceInfo > >::_FindLargestLeaf(), TLBTree< NamespaceInfo *, PtrListOperators< NamespaceInfo > >::_FindSmallestLeaf(), TLBTree< NamespaceInfo *, PtrListOperators< NamespaceInfo > >::_HandleRootUnderflow(), TLBTree< T, _OP >::Node::_INS_NS(), and TLBTree< T, _OP >::Node::Node(). |
|