Intrusive Containers
Loading...
Searching...
No Matches
ManyManyRoot< R, N, s, n, L > Class Template Reference

Root side of a many-many relationship. More...

#include <ManyMany.h>

Inheritance diagram for ManyManyRoot< R, N, s, n, L >:
Collaboration diagram for ManyManyRoot< R, N, s, n, L >:

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
 

Detailed Description

template<class R, class N, ContainerThreadSafety s, int n, class L>
class ManyManyRoot< R, N, s, n, L >

Root side of a many-many relationship.

Invariant
From DListInRoot:

Member Typedef Documentation

◆ Base

template<class R , class N , ContainerThreadSafety s, int n, class L >
class DListInRoot< R, L, s, 2 *n > ManyManyRoot< R, N, s, n, L >::Base
private

◆ Link

template<class R , class N , ContainerThreadSafety s, int n, class L >
class ManyManyLink< R, N, s, n, L > ManyManyRoot< R, N, s, n, L >::Link
private

◆ Node

template<class R , class N , ContainerThreadSafety s, int n, class L >
class ManyManyNode< R, N, s, n, L > ManyManyRoot< R, N, s, n, L >::Node
private

◆ Root

template<class R , class N , ContainerThreadSafety s, int n, class L >
class ManyManyRoot< R, N, s, n, L > ManyManyRoot< R, N, s, n, L >::Root
private

Constructor & Destructor Documentation

◆ ManyManyRoot()

template<class R , class N , ContainerThreadSafety s, int n, class L >
ManyManyRoot< R, N, s, n, L >::ManyManyRoot ( N * node = nullptr,
L * link = nullptr )

◆ ~ManyManyRoot()

template<class R , class N , ContainerThreadSafety s, int n, class L >
ManyManyRoot< R, N, s, n, L >::~ManyManyRoot ( )

Member Function Documentation

◆ add() [1/6]

void DListInRoot< R, L, s, n_ >::add ( L & node,
bool upgrade = false )
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

Template Parameters
RThe class that will be the owner of the Tree. Must derive from TreeInRoot<R, N, K, n>
NThe class that will be the nodes of the Tree. Must derive from TreeInNode<R, N, K, n>
sThe ContainerThreadSafety value to define the thread safety model of the Container
nA numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided.
Parameters
nodeThe node to add to the list
upgradeSet True if caller has an upgradable Read Lock (Used by SortDListInNode)

◆ add() [2/6]

void DListInRoot< R, L, s, n_ >::add ( L * node,
bool upgrade = false )
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.

Template Parameters
RThe class that will be the owner of the Tree. Must derive from TreeInRoot<R, N, K, n>
NThe class that will be the nodes of the Tree. Must derive from TreeInNode<R, N, K, n>
sThe ContainerThreadSafety value to define the thread safety model of the Container
nA numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided.
Parameters
nodeThe 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
upgradeSet True if caller has an upgradable Read Lock (Used by SortDListInNode)

◆ add() [3/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::add ( N & node,
L & link )

Remove Node for list.

Template Parameters
R
N
s
n
L
Parameters
nodethe node to add to this Root
Returns
True if node was on list

◆ add() [4/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::add ( N & node,
L * link = nullptr )

◆ add() [5/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::add ( N * node,
L & link )

◆ add() [6/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::add ( N * node,
L * link = nullptr )

◆ addFirst() [1/6]

void DListInRoot< R, L, s, n_ >::addFirst ( L & node,
bool upgrade = false )
inlineinherited

Add node to front of our list.

Template Parameters
RThe class that will be the owner of the Tree. Must derive from TreeInRoot<R, N, K, n>
NThe class that will be the nodes of the Tree. Must derive from TreeInNode<R, N, K, n>
sThe ContainerThreadSafety value to define the thread safety model of the Container
nA numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided.
Parameters
nodeThe node to add to the list If node is currently on a list (even us) it is removed before being added to the list
upgradeSet True if caller has an upgradable Read Lock (Used by SortDListInRoot)

◆ addFirst() [2/6]

void DListInRoot< R, L, s, n_ >::addFirst ( L * node,
bool upgrade = false )
inlineinherited

Add node to front of our list.

Template Parameters
RThe class that will be the owner of the Tree. Must derive from TreeInRoot<R, N, K, n>
NThe class that will be the nodes of the Tree. Must derive from TreeInNode<R, N, K, n>
sThe ContainerThreadSafety value to define the thread safety model of the Container
nA numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided.
Parameters
nodeThe node to add to the list If node is currently on a list (even us) it is removed before being added to the list
upgradeSet True if caller has an upgradable Read Lock (Used by SortDListInRoot)

◆ addFirst() [3/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::addFirst ( N & node,
L & link )

◆ addFirst() [4/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::addFirst ( N & node,
L * link = nullptr )

◆ addFirst() [5/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::addFirst ( N * node,
L & link )

◆ addFirst() [6/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::addFirst ( N * node,
L * link = nullptr )

◆ addLast() [1/6]

void DListInRoot< R, L, s, n_ >::addLast ( L & node,
bool upgrade = false )
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).

Template Parameters
RThe class that will be the owner of the Tree. Must derive from TreeInRoot<R, N, K, n>
NThe class that will be the nodes of the Tree. Must derive from TreeInNode<R, N, K, n>
sThe ContainerThreadSafety value to define the thread safety model of the Container
nA numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided.
Parameters
nodeThe node to add to the list If node is currently on a list (even us) it is removed before being added to the list
upgradeSet True if caller has an upgradable Read Lock (Used by SortDListInRoot)

◆ addLast() [2/6]

void DListInRoot< R, L, s, n_ >::addLast ( L * node,
bool upgrade = false )
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).

Template Parameters
RThe class that will be the owner of the Tree. Must derive from TreeInRoot<R, N, K, n>
NThe class that will be the nodes of the Tree. Must derive from TreeInNode<R, N, K, n>
sThe ContainerThreadSafety value to define the thread safety model of the Container
nA numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided.
Parameters
nodeThe node to add to the list If node is currently on a list (even us) it is removed before being added to the list
upgradeSet True if caller has an upgradable Read Lock (Used by SortDListInRoot)

◆ addLast() [3/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::addLast ( N & node,
L & link )

◆ addLast() [4/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::addLast ( N & node,
L * link = nullptr )

◆ addLast() [5/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::addLast ( N * node,
L & link )

◆ addLast() [6/6]

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::addLast ( N * node,
L * link = nullptr )

◆ check()

template<class R , class N , ContainerThreadSafety s, int n, class L >
bool ManyManyRoot< R, N, s, n, L >::check ( ) const
inlineoverridevirtual

Check a DListInRoot and the list connected.

Template Parameters
RThe class that will be the owner of the Tree. Must derive from TreeInRoot<R, N, K, n>
NThe class that will be the nodes of the Tree. Must derive from TreeInNode<R, N, K, n>
sThe ContainerThreadSafety value to define the thread safety model of the Container
nA numerical parameter to allow a give List/Node combination to have multiple list-node relationships. Defaults to 0 if not provided.
Returns
true if check passes

Reimplemented from DListInRoot< R, L, s, 2 *n >.

◆ first()

template<class R , class N , ContainerThreadSafety s, int n, class L >
L * ManyManyRoot< R, N, s, n, L >::first ( ) const
inline

◆ last()

template<class R , class N , ContainerThreadSafety s, int n, class L >
L * ManyManyRoot< R, N, s, n, L >::last ( ) const
inline

◆ readLock() [1/2]

unsigned DListInRoot< R, L, s, n >::readLock ( bool upgrade) const
inlineinherited

◆ readLock() [2/2]

template<class R , class N , ContainerThreadSafety s, int n, class L >
unsigned ManyManyRoot< R, N, s, n, L >::readLock ( ) const
inline

References Container< s >::readLock().

Here is the call graph for this function:

◆ readUnlock()

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::readUnlock ( unsigned save) const
inline

References Container< s >::readUnlock().

Here is the call graph for this function:

◆ remove() [1/2]

template<class R , class N , ContainerThreadSafety s, int n, class L >
bool ManyManyRoot< R, N, s, n, L >::remove ( N & node)

Remove Node for list.

Template Parameters
R
N
L
s
n
Parameters
nodethe node to remove
Returns
True if node was on list

◆ remove() [2/2]

template<class R , class N , ContainerThreadSafety s, int n, class L >
bool ManyManyRoot< R, N, s, n, L >::remove ( N * node)

Remove Node for list.

Template Parameters
R
N
L
s
n
Parameters
nodepointer to node on list, nullptr removes ALL nodes
Returns
True if node was on list

◆ writeLock() [1/2]

unsigned DListInRoot< R, L, s, n >::writeLock ( bool upgrade) const
inlineinherited

◆ writeLock() [2/2]

template<class R , class N , ContainerThreadSafety s, int n, class L >
unsigned ManyManyRoot< R, N, s, n, L >::writeLock ( ) const
inline

References Container< s >::writeLock().

Here is the call graph for this function:

◆ writeUnlock()

template<class R , class N , ContainerThreadSafety s, int n, class L >
void ManyManyRoot< R, N, s, n, L >::writeUnlock ( unsigned save) const
inline

References Container< s >::writeUnlock().

Here is the call graph for this function:

Member Data Documentation

◆ Link

template<class R , class N , ContainerThreadSafety s, int n, class L >
friend ManyManyRoot< R, N, s, n, L >::Link
private

◆ m_first

L* DListInRoot< R, L, s, n >::m_first
privateinherited

Pointer to first node on list.

◆ m_last

L* DListInRoot< R, L, s, n >::m_last
privateinherited

Pointer to last node on list.

◆ Node

template<class R , class N , ContainerThreadSafety s, int n, class L >
friend ManyManyRoot< R, N, s, n, L >::Node
private

The documentation for this class was generated from the following files: