Intrusive Containers
|
Intrusive Doubly Linked List, Node. More...
#include <SortListIn.h>
Public Member Functions | |
SortListInNode (R &) | |
Constructor. | |
SortListInNode (R *root=nullptr) | |
Constructor. | |
~SortListInNode () | |
Destructor. | |
void | addTo (R &root) |
Add ourself to a list at "natural" position. | |
void | addTo (R *root) |
Add ourself to a list at "natural" position. | |
bool | check () const override |
N * | next () const |
Return pointer to next node on list. | |
N * | prev () const |
Return pointer to previous node on list. | |
unsigned | readLock (bool upgrade) const |
void | readUnlock (unsigned save) const |
void | remove () |
R * | root () const |
Return pointer to list we are on. | |
unsigned | writeLock (bool upgrade) const |
void | writeUnlock (unsigned save) const |
Private Types | |
typedef class ListInNode< R, N, s, n > | Base |
typedef Container< s > | C |
The type of the Container that we are part of. | |
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 | addAfter (N &myNode, bool upgrade=false) |
Add ourself to a list after another node. | |
void | addAfter (N *myNode, bool upgrade=false) |
Add ourself to a list after another node. | |
void | addTo (R &myRoot, bool upgrade=false) |
Add ourself to a list at "natural" postion. | |
void | addTo (R *myRoot, bool upgrade=false) |
Add ourself to a list at "natural" postion. | |
void | addToEnd (R &myRoot, bool upgrade=false) |
Add ourselfs to the end of a list. | |
void | addToEnd (R *myRoot, bool upgrade=false) |
Add ourselves to the End of a list. | |
void | addToFront (R &myRoot, bool upgrade=false) |
Add ourselfs to the front of a list. | |
void | addToFront (R *myRoot, bool upgrade=false) |
Add ourselfs to the front of a list. | |
void | setRoot (C *root) |
Set our Container. | |
void | setRoot (R *root) |
Private Attributes | |
N * | m_next |
Pointer to next Node in list. | |
R * | m_root |
Pointer to list we are on. | |
friend | R |
Friends | |
class | ListInNode< R, N, s, n > |
class | ListInRoot< R, N, s, n > |
class | SortListInRoot< R, N, s, n > |
Intrusive Doubly Linked List, Node.
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. |
New:
From ListIn.h, ListInNode:
Last Criteria is closet expression to the fact that root.m_first points to a node that other node points to as its m_next
|
private |
|
privateinherited |
The type of the Container that we are part of.
|
private |
Type of DListIInNode.
|
private |
Type of DListInRoot.
SortListInNode< R, N, s, n >::SortListInNode | ( | R * | myRoot = nullptr | ) |
Constructor.
myRoot | Pointer to list for node to be added to (if not NULL). |
SortListInNode< R, N, s, n >::SortListInNode | ( | R & | myRoot | ) |
Constructor.
myRoot | list we are to be added to. |
SortListInNode< R, N, s, n >::~SortListInNode | ( | ) |
Destructor.
Remove us from we are on, if any.
|
inlineprotectedinherited |
Add ourself to a list after another node.
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 ourself after. If node is not on a list, do nothing. |
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 >::writeLock(), and ListInNode< R, N, s, n >::writeUnlock().
|
inlineprotectedinherited |
Add ourself to a list after another node.
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 ourself after. If Node is NULL, or not on a list, do nothing. |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
protectedinherited |
Add ourself to a list at "natural" postion.
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. |
myRoot | List to add to. |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
Referenced by ListInNode< R, N, s, n >::ListInNode(), and ListInNode< R, N, s, n >::ListInNode().
|
protectedinherited |
Add ourself to a list at "natural" postion.
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. |
myRoot | List to add to. |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
void SortListInNode< R, N, s, n >::addTo | ( | R & | myRoot | ) |
Add ourself to a list at "natural" position.
Note that this is the front for singly linked lists, and the end for doubly linked lists.
myRoot | List to add to. |
void SortListInNode< R, N, s, n >::addTo | ( | R * | myRoot | ) |
Add ourself to a list at "natural" position.
Note that this is the front for singly linked lists, and the end for doubly linked lists.
myRoot | List to add to. |
|
inlineprotectedinherited |
Add ourselfs to the end of a 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. |
myRoot | List to add to. |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
inlineprotectedinherited |
Add ourselves to the End of a 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. |
myRoot | List to add to. If NULL, just remove from all lists. |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
inlineprotectedinherited |
Add ourselfs to the front of a 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. |
myRoot | List to add to. |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
inlineprotectedinherited |
Add ourselfs to the front of a 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. |
myRoot | List to add to. If NULL, just remove from all lists. |
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 ListInNode< R, N, s, n >.
|
inline |
Return pointer to next node on list.
|
inline |
Return pointer to previous node on list.
|
inline |
|
inline |
|
inline |
|
inline |
Return pointer to list we are on.
|
inlineprotectedinherited |
Set our Container.
Used to allow to Node to record what Container it is in. Used only if safety method need resources from the Container, like a Mutex
If an operation changes the root of a node, then it needs to save the original root to exit the critical section on that container that it entered before the operation.
Referenced by ContainerNode< s >::ContainerNode(), DListInNode< R, N, s, n >::setRoot(), ListInNode< R, N, s, n >::setRoot(), and TreeInNode< R, N, K, s, n >::setRoot().
|
inlineprotectedinherited |
References ListInNode< R, N, s, n >::m_root, ListInNode< R, N, s, n >::root(), and ContainerNode< s >::setRoot().
Referenced by ListInRoot< R, N, s, n >::addFirst(), and ListInRoot< R, N, s, n >::addLast().
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |
|
privateinherited |
Pointer to next Node in list.
Referenced by ListInNode< R, N, s, n >::addAfter(), ListInRoot< R, N, s, n >::addFirst(), ListInRoot< R, N, s, n >::addLast(), ListInNode< R, N, s, n >::next(), and ListInNode< R, N, s, n >::remove().
|
privateinherited |
Pointer to list we are on.
Referenced by ListInNode< R, N, s, n >::addAfter(), ListInRoot< R, N, s, n >::addFirst(), ListInRoot< R, N, s, n >::addLast(), ListInRoot< R, N, s, n >::remove(), ListInNode< R, N, s, n >::root(), and ListInNode< R, N, s, n >::setRoot().
|
privateinherited |