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

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

#include <ManyMany.h>

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

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
 

Detailed Description

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

Node 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< N, L, s, 2 *n+1 > ManyManyNode< 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 > ManyManyNode< 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 > ManyManyNode< 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 > ManyManyNode< R, N, s, n, L >::Root
private

Constructor & Destructor Documentation

◆ ManyManyNode()

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

◆ ~ManyManyNode()

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

Member Function Documentation

◆ add() [1/6]

void DListInRoot< N, 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< N, 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 ManyManyNode< R, N, s, n, L >::add ( R & root,
L & link )

◆ add() [4/6]

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

◆ add() [5/6]

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

◆ add() [6/6]

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

◆ addFirst() [1/6]

void DListInRoot< N, 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< N, 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 ManyManyNode< R, N, s, n, L >::addFirst ( R & root,
L & link )

◆ addFirst() [4/6]

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

◆ addFirst() [5/6]

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

◆ addFirst() [6/6]

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

◆ addLast() [1/6]

void DListInRoot< N, 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< N, 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 ManyManyNode< R, N, s, n, L >::addLast ( R & root,
L & link )

◆ addLast() [4/6]

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

◆ addLast() [5/6]

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

◆ addLast() [6/6]

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

◆ check()

template<class R , class N , ContainerThreadSafety s, int n, class L >
bool ManyManyNode< 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< N, L, s, 2 *n+1 >.

◆ first()

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

◆ last()

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

◆ readLock() [1/2]

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

◆ readLock() [2/2]

template<class R , class N , ContainerThreadSafety s, int n, class L >
unsigned ManyManyNode< 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 ManyManyNode< R, N, s, n, L >::readUnlock ( unsigned save) const
inline

References Container< s >::readUnlock().

Here is the call graph for this function:

◆ remove() [1/4]

void DListInRoot< N, L, s, n_ >::remove ( L & node)
inlineinherited

Remove Node from 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
nodenode to be removed.

If node is not on this list, nothing will be done.

◆ remove() [2/4]

void DListInRoot< N, L, s, n_ >::remove ( L * node)
inlineinherited

Remove Node from 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
nodePointer to node to be removed. If node is null, operation will be ignored. If node is not on this list, nothing will be done.

◆ remove() [3/4]

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

◆ remove() [4/4]

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

◆ writeLock() [1/2]

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

◆ writeLock() [2/2]

template<class R , class N , ContainerThreadSafety s, int n, class L >
unsigned ManyManyNode< 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 ManyManyNode< 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 ManyManyNode< R, N, s, n, L >::Link
private

◆ m_first

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

Pointer to first node on list.

◆ m_last

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

Pointer to last node on list.

◆ Root

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

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