Intrusive Containers
|
Intrusive Doubly Linked List, Node. More...
#include <SortDListIn.h>
Public Member Functions | |
SortDListInNode (R &) | |
Constructor. | |
SortDListInNode (R *root=nullptr) | |
Constructor. | |
~SortDListInNode () | |
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 |
Check a DListInNode. | |
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 DListInNode< R, N, s, n > | Base |
typedef Container< s > | C |
The type of the Container that we are part of. | |
typedef class SortDListInNode< R, N, s, n > | Node |
Type of DListIInNode. | |
typedef class SortDListInRoot< R, N, s, n > | Root |
Type of DListInRoot. | |
Private Member Functions | |
void | addAfter (N &node, bool upgrade=false) |
Add ourself to a list after another node. | |
void | addAfter (N *node, bool upgrade=false) |
Add ourself to a list after another node. | |
void | addTo (R &root, bool upgrade=false) |
Add ourself to a list at "natural" postion. | |
void | addTo (R *root, bool upgrade=false) |
Add ourself to a list at "natural" postion. | |
void | addToEnd (R &root, bool upgrade=false) |
Add ourselfs to the end of a list. | |
void | addToEnd (R *root, bool upgrade=false) |
Add ourselfs to the End of a list. | |
void | addToFront (R &root, bool upgrade=false) |
Add ourselves to the front of a list. | |
void | addToFront (R *root, 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 net node on list. | |
N * | m_prev |
Pointer to previous node on list. | |
R * | m_root |
Pointer to list we are on. | |
Friends | |
class | DListInNode< R, N, s, n > |
class | DListInRoot< R, N, s, n > |
class | SortDListInRoot< 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 DListIn.h DListInNode
|
private |
|
privateinherited |
The type of the Container that we are part of.
|
private |
Type of DListIInNode.
|
private |
Type of DListInRoot.
SortDListInNode< R, N, s, n >::SortDListInNode | ( | R * | myRoot = nullptr | ) |
Constructor.
myRoot | Pointer to list for node to be added to (if not NULL). |
SortDListInNode< R, N, s, n >::SortDListInNode | ( | R & | myRoot | ) |
Constructor.
myRoot | list we are to be added to. |
SortDListInNode< R, N, s, n >::~SortDListInNode | ( | ) |
Destructor.
Remove us from we are on, if any.
|
inlineinherited |
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 that node is not on a list, do nothing. |
upgrade | Set True if caller has an upgradable Read Lock (Used by SortDListInNode) |
|
inlineinherited |
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) |
|
inherited |
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 DListInNode< R, N, s, n >::DListInNode(), and DListInNode< R, N, s, n >::DListInNode().
|
inherited |
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 SortDListInNode< 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 SortDListInNode< 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. |
|
inlineinherited |
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) |
|
inlineinherited |
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) |
If NULL, just remove from all lists.
|
inlineinherited |
Add ourselves 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) |
|
inlineinherited |
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 |
Check a DListInNode.
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 DListInNode< 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().
|
inlineinherited |
References DListInNode< R, N, s, n >::m_root, DListInNode< R, N, s, n >::root(), and ContainerNode< s >::setRoot().
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |
|
privateinherited |
Pointer to net node on list.
Referenced by DListInNode< R, N, s, n >::next().
|
privateinherited |
Pointer to previous node on list.
Referenced by DListInNode< R, N, s, n >::prev().
|
privateinherited |
Pointer to list we are on.
Referenced by DListInNode< R, N, s, n >::root(), and DListInNode< R, N, s, n >::setRoot().