115template <
class R,
class N,
class K, ContainerThreadSafety s=ContainerNoSafety,
int n>
class BalTreeInNode;
116template <
class R,
class N,
class K, ContainerThreadSafety s=ContainerNoSafety,
int n = 0>
class BalTreeInRoot;
144template <
class R,
class N,
class K, ContainerThreadSafety s,
int n>
class BalTreeInRoot :
156 int compare(N
const& node1, N
const& node2)
const {
157 return Base::compare(node1, node2);
160 return Base::compareKey(node, key);
169 N*
base()
const {
return Base::base(); }
170 N*
first()
const {
return Base::first(); }
171 N*
last()
const {
return Base::last(); }
173 bool check()
const override;
221template <
class R,
class N,
class K, ContainerThreadSafety s,
int n>
class BalTreeInNode :
235 R*
root()
const {
return Base::root(); }
236 N*
parent()
const {
return Base::parent(); }
237 N*
left()
const {
return Base::left(); }
238 N*
right()
const {
return Base::right(); }
239 N*
next()
const {
return Base::next(); }
240 N*
prev()
const {
return Base::prev(); }
245 bool check()
const override;
Intrusive Binary Tree (unbalanced).
Intrusive Binary Tree, Node.
Definition BalTreeIn.h:222
BalTreeInNode()
Constructor.
Definition BalTreeIn.hpp:133
virtual ~BalTreeInNode()
Destructor.
Definition BalTreeIn.hpp:141
unsigned readLock(bool upgrade) const
Definition BalTreeIn.h:252
N * right() const
Definition BalTreeIn.h:238
R * root() const
Definition BalTreeIn.h:235
unsigned writeLock(bool upgrade) const
Definition BalTreeIn.h:249
N * next() const
Definition BalTreeIn.h:239
N * rotateLeft()
Balance tree with a Left Rotate.
Definition BalTreeIn.hpp:175
N * rotateRight()
Balance Tree with a Right Rotate.
Definition BalTreeIn.hpp:216
void rebalance() override=0
Hook to allow Balanced trees to rebalance from current node, just changed.
class BalTreeInNode< R, N, K, s, n > Node
Type of Node.
Definition BalTreeIn.h:226
class TreeInNode< R, N, K, s, n > Base
Definition BalTreeIn.h:224
class BalTreeInRoot< R, N, K, s, n > Root
Type of Root.
Definition BalTreeIn.h:225
N * left() const
Definition BalTreeIn.h:237
N * parent() const
Definition BalTreeIn.h:236
N * prev() const
Definition BalTreeIn.h:240
bool check() const override
Definition BalTreeIn.hpp:106
void readUnlock(unsigned save) const
Definition BalTreeIn.h:253
void writeUnlock(unsigned save) const
Definition BalTreeIn.h:250
Intrusive Binary Tree, Root.
Definition BalTreeIn.h:145
N * base() const
Definition BalTreeIn.h:169
class BalTreeInRoot< R, N, K, s, n > Root
Type of TreeInRoot.
Definition BalTreeIn.h:149
class BalTreeInNode< R, N, K, s, n > Node
Type of DListIInNode.
Definition BalTreeIn.h:150
N * last() const
Definition BalTreeIn.h:171
bool check() const override
Definition BalTreeIn.hpp:107
class TreeInRoot< R, N, K, s, n > Base
Definition BalTreeIn.h:148
int compare(N const &node1, N const &node2) const
Definition BalTreeIn.h:156
N * first() const
Definition BalTreeIn.h:170
unsigned writeLock(bool upgrade) const
Definition BalTreeIn.h:176
void readUnlock(unsigned save) const
Definition BalTreeIn.h:180
virtual ~BalTreeInRoot()
Destructor.
Definition BalTreeIn.hpp:125
void writeUnlock(unsigned save) const
Definition BalTreeIn.h:177
int compareKey(N const &node, K key) const
Definition BalTreeIn.h:159
unsigned readLock(bool upgrade) const
Definition BalTreeIn.h:179
BalTreeInRoot()
Constructor.
Definition BalTreeIn.hpp:116
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.
unsigned readLock(bool upgradable) const
void readUnlock(unsigned code) const
unsigned writeLock(bool upgrade) const
void writeUnlock(unsigned code) const
Intrusive Binary Tree, Node.
Definition TreeIn.h:276
Intrusive Binary Tree, Root.
Definition TreeIn.h:154