Intrusive Containers
|
Node side of a many-many relationship. More...
#include <ManyMany.h>
Public Member Functions | |
ManyManyNode (R *root=nullptr, L *link=nullptr) | |
~ManyManyNode () | |
void | add (L &node, bool upgrade=false) |
Add node to our list, at "natural" point. | |
void | add (L *node, bool upgrade=false) |
Add node to our list, at "natural" point. | |
void | add (R &root, L &link) |
void | add (R &root, L *link=nullptr) |
void | add (R *root, L &link) |
void | add (R *root, L *link=nullptr) |
void | addFirst (L &node, bool upgrade=false) |
Add node to front of our list. | |
void | addFirst (L *node, bool upgrade=false) |
Add node to front of our list. | |
void | addFirst (R &root, L &link) |
void | addFirst (R &root, L *link=nullptr) |
void | addFirst (R *root, L &link) |
void | addFirst (R *root, L *link=nullptr) |
void | addLast (L &node, bool upgrade=false) |
Add node to end of our list. | |
void | addLast (L *node, bool upgrade=false) |
Add node to end of our list. | |
void | addLast (R &root, L &link) |
void | addLast (R &root, L *link=nullptr) |
void | addLast (R *root, L &link) |
void | addLast (R *root, L *link=nullptr) |
bool | check () const override |
Check a DListInRoot and the list connected. | |
L * | first () const |
L * | last () const |
unsigned | readLock (bool upgrade) const |
unsigned | readLock () const |
void | readUnlock (unsigned save) const |
void | remove (L &node) |
Remove Node from List. | |
void | remove (L *node) |
Remove Node from List. | |
bool | remove (R &node) |
bool | remove (R *node) |
unsigned | writeLock (bool upgrade) const |
unsigned | writeLock () const |
void | writeUnlock (unsigned save) const |
Private Types | |
typedef class DListInRoot< N, L, s, 2 *n+1 > | Base |
typedef class ManyManyLink< R, N, s, n, L > | Link |
typedef class ManyManyNode< R, N, s, n, L > | Node |
typedef class ManyManyRoot< R, N, s, n, L > | Root |
Private Attributes | |
friend | Link |
L * | m_first |
Pointer to first node on list. | |
L * | m_last |
Pointer to last node on list. | |
friend | Root |
Node side of a many-many relationship.
|
private |
|
private |
|
private |
|
private |
ManyManyNode< R, N, s, n, L >::ManyManyNode | ( | R * | root = nullptr, |
L * | link = nullptr ) |
ManyManyNode< R, N, s, n, L >::~ManyManyNode | ( | ) |
|
inlineinherited |
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) |
|
inlineinherited |
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) |
void ManyManyNode< R, N, s, n, L >::add | ( | R & | root, |
L & | link ) |
void ManyManyNode< R, N, s, n, L >::add | ( | R & | root, |
L * | link = nullptr ) |
void ManyManyNode< R, N, s, n, L >::add | ( | R * | root, |
L & | link ) |
void ManyManyNode< R, N, s, n, L >::add | ( | R * | root, |
L * | link = nullptr ) |
|
inlineinherited |
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) |
|
inlineinherited |
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) |
void ManyManyNode< R, N, s, n, L >::addFirst | ( | R & | root, |
L & | link ) |
void ManyManyNode< R, N, s, n, L >::addFirst | ( | R & | root, |
L * | link = nullptr ) |
void ManyManyNode< R, N, s, n, L >::addFirst | ( | R * | root, |
L & | link ) |
void ManyManyNode< R, N, s, n, L >::addFirst | ( | R * | root, |
L * | link = nullptr ) |
|
inlineinherited |
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) |
|
inlineinherited |
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) |
void ManyManyNode< R, N, s, n, L >::addLast | ( | R & | root, |
L & | link ) |
void ManyManyNode< R, N, s, n, L >::addLast | ( | R & | root, |
L * | link = nullptr ) |
void ManyManyNode< R, N, s, n, L >::addLast | ( | R * | root, |
L & | link ) |
void ManyManyNode< R, N, s, n, L >::addLast | ( | R * | root, |
L * | link = nullptr ) |
|
inlineoverridevirtual |
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. |
Reimplemented from DListInRoot< N, L, s, 2 *n+1 >.
|
inline |
|
inline |
|
inlineinherited |
|
inline |
|
inline |
|
inlineinherited |
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.
|
inlineinherited |
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. |
bool ManyManyNode< R, N, s, n, L >::remove | ( | R & | node | ) |
bool ManyManyNode< R, N, s, n, L >::remove | ( | R * | node | ) |
|
inlineinherited |
|
inline |
|
inline |
|
private |
|
privateinherited |
Pointer to first node on list.
|
privateinherited |
Pointer to last node on list.
|
private |