113template <
class R,
class N,
class K, ContainerThreadSafety s=ContainerNoSafety,
int n = 0>
class TreeInNode;
114template <
class R,
class N,
class K, ContainerThreadSafety s=ContainerNoSafety,
int n = 0>
class TreeInRoot;
116template <
class R,
class N,
class K, ContainerThreadSafety s,
int n = 0>
class BalTreeInNode;
153template <
class R,
class N,
class K, ContainerThreadSafety s,
int n>
168 int compare(N
const& node1, N
const& node2)
const;
175 virtual void add(N& node);
179 N*
find(K key)
const;
187 bool check()
const override;
275template <
class R,
class N,
class K, ContainerThreadSafety s,
int n>
298 bool check()
const override;
Intrusive Container Documentation and Base Class.
Intrusive Binary Tree, Node.
Definition BalTreeIn.h:222
Base Container Class.
Definition Container.h:192
unsigned writeLock(bool upgrade) const
Obtain a write lock.
unsigned readLock(bool upgradable) const
Obtain a read lock.
void readUnlock(unsigned code) const
Release the read lock that was held.
void writeUnlock(unsigned code) const
Release write lock.
Base Container Node Class.
Definition Container.h:255
unsigned readLock(bool upgradable) const
void setRoot(C *root)
Set our Container.
Definition Container.h:272
void readUnlock(unsigned code) const
unsigned writeLock(bool upgrade) const
void writeUnlock(unsigned code) const
Intrusive Binary Tree, Node.
Definition TreeIn.h:276
N * right() const
Definition TreeIn.h:292
void readUnlock(unsigned save) const
Definition TreeIn.h:310
bool check() const override
Definition TreeIn.hpp:182
virtual ~TreeInNode()
Destructor.
Definition TreeIn.hpp:671
N * m_left
Pointer to left (lesser) child node on tree.
Definition TreeIn.h:315
void setRoot(R *root)
Definition TreeIn.h:296
N * prev() const
Return previous node in sort sequence.
Definition TreeIn.hpp:229
R * m_root
Pointer to tree we are on.
Definition TreeIn.h:313
unsigned writeLock(bool upgrade) const
Definition TreeIn.h:306
virtual void remove()
Remove node from whatever tree it is on, if it is on a tree.
Definition TreeIn.hpp:335
class TreeInNode< R, N, K, s, n > Node
Type of DListIInNode.
Definition TreeIn.h:280
N * m_right
Pointer to right (greater) child node on tree.
Definition TreeIn.h:316
N * parent() const
Definition TreeIn.h:290
unsigned readLock(bool upgrade) const
Definition TreeIn.h:309
N * m_parent
Pointer to parent node on tree.
Definition TreeIn.h:314
N * next() const
Return node next in sort sequence.
Definition TreeIn.hpp:194
void addTo(R &root)
Add ourself to a tree.
Definition TreeIn.hpp:513
class TreeInRoot< R, N, K, s, n > Root
Type of TreeInRoot.
Definition TreeIn.h:279
N * left() const
Definition TreeIn.h:291
R * root() const
Return pointer to tree we are on.
Definition TreeIn.h:289
TreeInNode()
Constructor.
Definition TreeIn.hpp:657
void writeUnlock(unsigned save) const
Definition TreeIn.h:307
virtual void rebalance()
Hook to allow Balanced trees to rebalance from current node, just changed.
Definition TreeIn.h:302
Intrusive Binary Tree, Root.
Definition TreeIn.h:154
int compare(N const &node1, N const &node2) const
Compare Nodes Should return >0 if node2 > node1, and <0 if node2 < node1, 0 if equal.
N * base() const
Definition TreeIn.h:183
class TreeInRoot< R, N, K, s, n > Root
Type of TreeInRoot.
Definition TreeIn.h:157
N * last() const
Definition TreeIn.hpp:276
void remove(N &node)
Remove Node from List.
Definition TreeIn.hpp:417
N * m_base
Pointer to root node on tree.
Definition TreeIn.h:197
virtual ~TreeInRoot()
Destructor.
Definition TreeIn.hpp:626
N * find(K key) const
find a node
Definition TreeIn.hpp:539
void readUnlock(unsigned save) const
Definition TreeIn.h:194
class TreeInNode< R, N, K, s, n > Node
Type of DListIInNode.
Definition TreeIn.h:158
unsigned writeLock(bool upgrade) const
Definition TreeIn.h:190
bool check() const override
Definition TreeIn.hpp:185
int compareKey(N const &node, K key) const
Compare Key to node Should return >0 if key > node, <0 if key < node, 0 if key == node.
unsigned readLock(bool upgrade) const
Definition TreeIn.h:193
TreeInRoot()
Constructor.
Definition TreeIn.hpp:613
N * findMinus(K key) const
find a node, or the node that would be just lower than this node
Definition TreeIn.hpp:559
N * first() const
Definition TreeIn.hpp:261
N * findPlus(K key) const
find a node, r the node that would be just above this node.
Definition TreeIn.hpp:585
virtual void add(N &node)
Add node to our tree, note trees are sorted by the compare member function which needs to be implemen...
Definition TreeIn.hpp:450
void writeUnlock(unsigned save) const
Definition TreeIn.h:191