Intrusive Containers
|
Intrusive Doubly Linked List, List. More...
#include <SortListIn.h>
Public Member Functions | |
SortListInRoot () | |
Constructor. | |
~SortListInRoot () | |
Destructor. | |
void | add (N &node) |
Add node to list based on sorting function in Root. | |
void | add (N *node) |
Add node to our list, at "natural" point. | |
bool | check () const override |
int | compare (N const &node1, N const &node2) const |
This member function to be provided by the user to define the sort order. | |
N * | first () const |
N * | last () const |
unsigned | readLock (bool upgrade) const |
void | readUnlock (unsigned save) const |
void | remove (N &node) |
void | remove (N *node) |
unsigned | writeLock (bool upgrade) const |
void | writeUnlock (unsigned save) const |
Private Types | |
typedef class ListInRoot< R, N, s, n > | Base |
typedef class SortListInNode< R, N, s, n > | Node |
Type of DListIInNode. | |
typedef class SortListInRoot< R, N, s, n > | Root |
Type of DListInRoot. | |
Private Member Functions | |
void | add (N &node, bool upgrade=false) |
Add node to our list, at "natural" point. | |
void | add (N *node, bool upgrade=false) |
Add node to our list, at "natural" point. | |
void | addFirst (N &node, bool upgrade=false) |
Add node to front of our list. | |
void | addFirst (N *node, bool upgrade=false) |
Add node to front of our list. | |
void | addLast (N &node, bool upgrade=false) |
Add node to end of our list. | |
void | addLast (N *node, bool upgrade=false) |
Add node to end of our list. | |
Private Attributes | |
N * | m_first |
Pointer to first Node on list. | |
N * | m_last |
Pointer to last Node on list. | |
friend | N |
Friends | |
class | ListInNode< R, N, s, n > |
class | ListInRoot< R, N, s, n > |
class | SortListInNode< R, N, s, n > |
Intrusive Doubly Linked List, List.
L | The class that will be the owner of the List. Must derive from DListInRoot<R, N, n> |
N | The class that will be the nodes of the List. Must derive from DListInNode<R, N, n> |
n | A numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided. |
|
private |
|
private |
Type of DListIInNode.
|
private |
Type of DListInRoot.
SortListInRoot< R, N, s, n >::SortListInRoot | ( | ) |
Constructor.
Starts us as an empty list.
SortListInRoot< R, N, s, n >::~SortListInRoot | ( | ) |
Destructor.
Removes all nodes attached to us.
|
inlineprotectedinherited |
Add node to our list, at "natural" point.
Note that this is the front for singly linked lists and the end for doubly linked list.
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> |
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. |
node | The node to add to the list If node is currently on a list (even us) it is removed before being added to the list |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
inlineprotectedinherited |
Add node to our list, at "natural" point.
Note that this is the front for singly linked lists and the end for doubly linked lists.
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> |
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. |
node | The node to add to the list If node is nulR, Nothing is done. If node is currently on a list (even us) it is removed before being added to the list |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
inline |
Add node to list based on sorting function in Root.
The node is placed such that compare(node, this) will be positive (or zero) for all nodes before this one, and negative for nodes after (or zero if they were added after us)
node | The node to add to the list If node is currently on a list (even us) it is removed before being added to the list |
|
inline |
Add node to our list, at "natural" point.
Note that this is the front for singly linked lists and the end for doubly linked lists.
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 |
|
inlineprotectedinherited |
Add node to front of our list.
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> |
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. |
node | The node to add to the list If node is currently on a list (even us) it is removed before being added to the list |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
References ListInNode< R, N, s, n >::m_next, ListInNode< R, N, s, n >::m_root, ListInNode< R, N, s, n >::remove(), and ListInNode< R, N, s, n >::setRoot().
|
inlineprotectedinherited |
Add node to front of our list.
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> |
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. |
node | The node to add to the list If node is currently on a list (even us) it is removed before being added to the list |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
inlineprotectedinherited |
Add node to end of our list.
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> |
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 |
node | The node to add to the list If node is currently on a list (even us) it is removed before being added to the list |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
References ListInNode< R, N, s, n >::m_next, ListInNode< R, N, s, n >::m_root, ListInNode< R, N, s, n >::remove(), and ListInNode< R, N, s, n >::setRoot().
|
inlineprotectedinherited |
Add node to end of our list.
Note that this operation is O(n) on list current size. See DListInRoot to make this O(1).
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> |
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. |
node | The node to add to the list If node is currently on a list (even us) it is removed before being added to the list |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
overridevirtual |
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> |
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. |
Reimplemented from ListInRoot< R, N, s, n >.
int SortListInRoot< R, N, s, n >::compare | ( | N const & | node1, |
N const & | node2 ) const |
This member function to be provided by the user to define the sort order.
node1 | |
node2 |
Sort order for nodes on the list should not change after they are added.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |
|
privateinherited |
Pointer to first Node on list.
Referenced by ListInRoot< R, N, s, n >::first(), and ListInNode< R, N, s, n >::remove().
|
privateinherited |
Pointer to last Node on list.
Referenced by ListInRoot< R, N, s, n >::last(), and ListInNode< R, N, s, n >::remove().
|
privateinherited |