Intrusive Containers
|
Intrusive Doubly Linked List, List. More...
#include <DListIn.h>
Public Member Functions | |
DListInRoot () | |
Constructor. | |
~DListInRoot () | |
Destructor. | |
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. | |
bool | check () const override |
Check a DListInRoot and the list connected. | |
N * | first () const |
N * | last () const |
unsigned | readLock (bool upgrade) const |
void | readUnlock (unsigned save) const |
void | remove (N &node) |
Remove Node from List. | |
void | remove (N *node) |
Remove Node from List. | |
unsigned | writeLock (bool upgrade) const |
void | writeUnlock (unsigned save) const |
Private Types | |
typedef class DListInNode< R, N, s, n > | Node |
Type of DListIInNode. | |
typedef class DListInRoot< R, N, s, n > | Root |
Type of DListInRoot. | |
Private Attributes | |
N * | m_first |
Pointer to first node on list. | |
N * | m_last |
Pointer to last node on list. | |
Friends | |
class | DListInNode< R, N, s, n > |
Intrusive Doubly Linked List, List.
R | 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> |
s | |
n | A numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided. |
|
private |
Type of DListIInNode.
|
private |
Type of DListInRoot.
DListInRoot< R, N, s, n >::DListInRoot | ( | ) |
Constructor.
Starts us as an empty 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. |
DListInRoot< R, N, s, n >::~DListInRoot | ( | ) |
Destructor.
Removes all nodes attached to us.
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. |
|
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 list.
If node is currently on a list (even us) it is removed before being added to the 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 |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
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.
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 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 SortDListInRoot) |
|
inline |
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 SortDListInRoot) |
|
inline |
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 SortDListInRoot) |
|
inline |
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 SortDListInRoot) |
|
overridevirtual |
Check a DListInRoot and the list connected.
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. |
Implements Container< s >.
Reimplemented in ManyManyNode< R, N, s, n, L >, ManyManyRoot< R, N, s, n, L >, and SortDListInRoot< R, N, s, n >.
|
inline |
References DListInRoot< R, N, s, n >::m_first.
|
inline |
References DListInRoot< R, N, s, n >::m_last.
|
inline |
|
inline |
|
inline |
Remove Node from 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 | node to be removed. |
If node is not on this list, nothing will be done.
|
inline |
Remove Node from 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 | Pointer to node to be removed. If node is null, operation will be ignored. If node is not on this list, nothing will be done. |
|
inline |
|
inline |
|
friend |
|
private |
Pointer to first node on list.
Referenced by DListInRoot< R, N, s, n >::first().
|
private |
Pointer to last node on list.
Referenced by DListInRoot< R, N, s, n >::last().