Intrusive Containers
|
Root side of a many-many relationship. More...
#include <ManyMany.h>
Public Member Functions | |
ManyManyRoot (N *node=nullptr, L *link=nullptr) | |
~ManyManyRoot () | |
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 (N &node, L &link) |
Remove Node for list. | |
void | add (N &node, L *link=nullptr) |
void | add (N *node, L &link) |
void | add (N *node, 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 (N &node, L &link) |
void | addFirst (N &node, L *link=nullptr) |
void | addFirst (N *node, L &link) |
void | addFirst (N *node, 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 (N &node, L &link) |
void | addLast (N &node, L *link=nullptr) |
void | addLast (N *node, L &link) |
void | addLast (N *node, 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 |
bool | remove (N &node) |
Remove Node for list. | |
bool | remove (N *node) |
Remove Node for list. | |
unsigned | writeLock (bool upgrade) const |
unsigned | writeLock () const |
void | writeUnlock (unsigned save) const |
Private Types | |
typedef class DListInRoot< R, L, s, 2 *n > | 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 | Node |
Root side of a many-many relationship.
|
private |
|
private |
|
private |
|
private |
ManyManyRoot< R, N, s, n, L >::ManyManyRoot | ( | N * | node = nullptr, |
L * | link = nullptr ) |
ManyManyRoot< R, N, s, n, L >::~ManyManyRoot | ( | ) |
|
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 ManyManyRoot< R, N, s, n, L >::add | ( | N & | node, |
L & | link ) |
Remove Node for list.
R | |
N | |
s | |
n | |
L |
node | the node to add to this Root |
void ManyManyRoot< R, N, s, n, L >::add | ( | N & | node, |
L * | link = nullptr ) |
void ManyManyRoot< R, N, s, n, L >::add | ( | N * | node, |
L & | link ) |
void ManyManyRoot< R, N, s, n, L >::add | ( | N * | node, |
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 ManyManyRoot< R, N, s, n, L >::addFirst | ( | N & | node, |
L & | link ) |
void ManyManyRoot< R, N, s, n, L >::addFirst | ( | N & | node, |
L * | link = nullptr ) |
void ManyManyRoot< R, N, s, n, L >::addFirst | ( | N * | node, |
L & | link ) |
void ManyManyRoot< R, N, s, n, L >::addFirst | ( | N * | node, |
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 ManyManyRoot< R, N, s, n, L >::addLast | ( | N & | node, |
L & | link ) |
void ManyManyRoot< R, N, s, n, L >::addLast | ( | N & | node, |
L * | link = nullptr ) |
void ManyManyRoot< R, N, s, n, L >::addLast | ( | N * | node, |
L & | link ) |
void ManyManyRoot< R, N, s, n, L >::addLast | ( | N * | node, |
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< R, L, s, 2 *n >.
|
inline |
|
inline |
|
inlineinherited |
|
inline |
|
inline |
bool ManyManyRoot< R, N, s, n, L >::remove | ( | N & | node | ) |
Remove Node for list.
R | |
N | |
L | |
s | |
n |
node | the node to remove |
bool ManyManyRoot< R, N, s, n, L >::remove | ( | N * | node | ) |
Remove Node for list.
R | |
N | |
L | |
s | |
n |
node | pointer to node on list, nullptr removes ALL nodes |
|
inlineinherited |
|
inline |
|
inline |
|
private |
|
privateinherited |
Pointer to first node on list.
|
privateinherited |
Pointer to last node on list.
|
private |