49template <
class R,
class N, ContainerThreadSafety s,
int n>
51 bool flag = Base::check();
56template <
class R,
class N, ContainerThreadSafety s,
int n>
58 bool flag = Base::check();
59 flag &=
static_cast<Root*
>(root())->compare(*
static_cast<N const*
>(
this), *prev()) <= 0;
60 flag &=
static_cast<Root*
>(root())->compare(*prev(), *
static_cast<N const*
>(
this)) >= 0;
61 flag &=
static_cast<Root*
>(root())->compare(*
static_cast<N const*
>(
this), *prev()) <= 0;
62 flag &=
static_cast<Root*
>(root())->compare(*prev(), *
static_cast<N const*
>(
this)) >= 0;
76template<
class R,
class N, ContainerThreadSafety s,
int n_>
81 if(mynode.root() !=
nullptr) mynode.remove();
82 unsigned save = readLock(
true);
87 while(node2 && this->compare(*node2, node) >= 0) {
89 node2 =
static_cast<Node*
>(node2)->next();
94 node1->Node::addAfter(node,
true);
96 Base::addFirst(node,
true);
110template<
class R,
class N, ContainerThreadSafety s,
int n_>
112 if (node !=
nullptr) add(*node);
121template<
class R,
class N, ContainerThreadSafety s,
int n>
123 static_cast<Root&
>(myRoot).add(
static_cast<N*
>(
this));
132template<
class R,
class N, ContainerThreadSafety s,
int n>
135 static_cast<Root*
>(myRoot)->add(
static_cast<N*
>(
this));
147template <
class R,
class N, ContainerThreadSafety s,
int n>
156template <
class R,
class N, ContainerThreadSafety s,
int n>
158 while (first()) remove(first());
166template <
class R,
class N, ContainerThreadSafety s,
int n>
169 if (myRoot) addTo(myRoot);
177template <
class R,
class N, ContainerThreadSafety s,
int n>
188template <
class R,
class N, ContainerThreadSafety s,
int n>
Intrusive Double Linked List, Implementation.
class SortDListInRoot< R, N, s, n > Root
Type of DListInRoot.
Definition SortDListIn.h:233
SortDListInNode(R *root=nullptr)
Constructor.
Definition SortDListIn.hpp:167
void addTo(R &root)
Add ourself to a list at "natural" position.
Definition SortDListIn.hpp:122
~SortDListInNode()
Destructor.
Definition SortDListIn.hpp:189
bool check() const override
Check a DListInNode.
Definition SortDListIn.hpp:57
SortDListInRoot()
Constructor.
Definition SortDListIn.hpp:148
~SortDListInRoot()
Destructor.
Definition SortDListIn.hpp:157
class SortDListInNode< R, N, s, n > Node
Type of DListIInNode.
Definition SortDListIn.h:151
bool check() const override
Check a DListInRoot and the list connected.
Definition SortDListIn.hpp:50
void add(N &node)
Add node to list based on sorting function in Root.
Definition SortDListIn.hpp:77