51template <
class R,
class N, ContainerThreadSafety s,
int n>
53 bool flag = Base::check();
58template <
class R,
class N, ContainerThreadSafety s,
int n>
60 bool flag = Base::check();
61 flag &=
static_cast<Root*
>(root())->compare(*
static_cast<N const*
>(
this), *next()) >= 0;
62 flag &=
static_cast<Root*
>(root())->compare(*next(), *
static_cast<N const*
>(
this)) <= 0;
75template<
class R,
class N, ContainerThreadSafety s,
int n_>
80 if(mynode.root() !=
nullptr) mynode.remove();
82 unsigned save = readLock(
true);
86 while(node2 && this->compare(*node2, node) >= 0) {
88 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 Singly Linked List, Implementation.
Intrusive Sorted Double Linked List.
void addTo(R &root)
Add ourself to a list at "natural" position.
Definition SortListIn.hpp:122
SortListInNode(R *root=nullptr)
Constructor.
Definition SortListIn.hpp:167
class SortListInRoot< R, N, s, n > Root
Type of DListInRoot.
Definition SortListIn.h:225
bool check() const override
Definition SortListIn.hpp:59
~SortListInNode()
Destructor.
Definition SortListIn.hpp:189
void add(N &node)
Add node to list based on sorting function in Root.
Definition SortListIn.hpp:76
~SortListInRoot()
Destructor.
Definition SortListIn.hpp:157
SortListInRoot()
Constructor.
Definition SortListIn.hpp:148
class SortListInNode< R, N, s, n > Node
Type of DListIInNode.
Definition SortListIn.h:152
bool check() const override
Definition SortListIn.hpp:52