Intrusive Containers
|
Intrusive Binary Tree, Root. More...
#include <BalTreeIn.h>
Public Member Functions | |
BalTreeInRoot () | |
Constructor. | |
virtual | ~BalTreeInRoot () |
Destructor. | |
N * | base () const |
bool | check () const override |
int | compare (N const &node1, N const &node2) const |
int | compareKey (N const &node, K key) const |
N * | first () const |
N * | last () const |
unsigned | readLock (bool upgrade) const |
void | readUnlock (unsigned save) const |
unsigned | writeLock (bool upgrade) const |
void | writeUnlock (unsigned save) const |
Protected Member Functions | |
virtual void | add (N &node) |
Add node to our tree, note trees are sorted by the compare member function which needs to be implemented by the user. | |
void | add (N *node) |
Add node to our tree. | |
N * | find (K key) const |
find a node | |
N * | findMinus (K key) const |
find a node, or the node that would be just lower than this node | |
N * | findPlus (K key) const |
find a node, r the node that would be just above this node. | |
void | remove (N &node) |
Remove Node from List. | |
void | remove (N *node) |
Remove Node from List. | |
Private Types | |
typedef class TreeInRoot< R, N, K, s, n > | Base |
typedef class BalTreeInNode< R, N, K, s, n > | Node |
Type of DListIInNode. | |
typedef class BalTreeInRoot< R, N, K, s, n > | Root |
Type of TreeInRoot. | |
Private Attributes | |
N * | m_base |
Pointer to root node on tree. | |
Friends | |
class | BalTreeInNode< R, N, K, s, n > |
Intrusive Binary Tree, Root.
R | The class that will be the owner of the Tree. Must derive from TreeInRoot<R, N, K, n> |
N | The class that will be the nodes of the Tree. Must derive from TreeInNode<R, N, K, n> |
K | The class defining the Key used to lookup Nodes in the tree. |
s | The ContainerThreadSafety value to define the thread safety model of the Container |
n | A numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided. |
Note, because base class is a template, we have many forwarding functions to that base to avoid errors and warnings about thing missing.
|
private |
|
private |
Type of DListIInNode.
|
private |
Type of TreeInRoot.
BalTreeInRoot< R, N, K, s, n >::BalTreeInRoot | ( | ) |
Constructor.
Starts us as an empty list.
|
virtual |
Destructor.
|
inlineprotectedvirtualinherited |
Add node to our tree, note trees are sorted by the compare member function which needs to be implemented by the user.
node | The node to add to the list If node is currently on a different list it is removed before being added to the list. |
If node is on the requested list, do nothing. If trying to change value and position, use resort
|
inlineprotectedinherited |
Add node to our tree.
node | The node to add to the list If node is null, Nothing is done. If node is currently on a list (even us) it is removed before being added to the list |
|
inline |
|
inlineoverridevirtual |
Implements Container< s >.
|
inline |
|
inline |
|
protectedinherited |
find a node
|
protectedinherited |
find a node, or the node that would be just lower than this node
|
protectedinherited |
find a node, r the node that would be just above this node.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotectedinherited |
Remove Node from List.
node | node to be removed. If node is not on this list, nothing will be done. |
|
inlineprotectedinherited |
Remove Node from List.
node | Pointer to node to be removed. If node is null, operation will be ignored. If node is not on this list, nothing will be done. |
|
inline |
|
inline |
|
friend |
|
privateinherited |
Pointer to root node on tree.
Referenced by TreeInRoot< R, N, K, s, n >::base().