µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os::utils::intrusive_list< T, N, MP, U > Class Template Reference

List of intrusive nodes. More...

#include <cmsis-plus/utils/lists.h>

+ Inheritance diagram for os::utils::intrusive_list< T, N, MP, U >:

Public Types

using difference_type = ptrdiff_t
 
using iterator = intrusive_list_iterator< T, N, MP, U >
 
using iterator_pointer = N *
 Type of reference to the iterator internal pointer.
 
using pointer = U *
 
using reference = U &
 
using value_type = U
 

Public Member Functions

Constructors & Destructor
 intrusive_list ()
 Construct an intrusive list.
 
 intrusive_list (bool clr)
 Construct an intrusive list with controlled inits.
 
 ~intrusive_list ()
 Destruct the list.
 
Public Member Functions
void link (reference node)
 Add a node to the tail of the list.
 
iterator begin ()
 Iterator begin.
 
iterator end () const
 Iterator begin.
 
pointer unlink_head (void)
 Unlink the first element from the list.
 
pointer unlink_tail (void)
 Unlink the last element from the list.
 
Public Member Functions
bool uninitialized (void) const
 Check if the list is uninitialised.
 
void clear (void)
 Clear the list.
 
bool empty (void) const
 Check if the list is empty.
 
volatile static_double_list_linkshead (void) const
 Get the list head.
 
volatile static_double_list_linkstail (void) const
 Get the list tail.
 

Protected Member Functions

pointer get_pointer (iterator_pointer node) const
 
Private Member Functions
void insert_after (static_double_list_links &node, static_double_list_links *after)
 Insert a new node after existing node.
 

Protected Attributes

Private Member Variables
static_double_list_links head_
 A list node used to point to head and tail.
 

Detailed Description

template<typename T, typename N, N T::* MP, typename U = T>
class os::utils::intrusive_list< T, N, MP, U >

List of intrusive nodes.

Template Parameters
TType of object that includes the intrusive node.
NType of intrusive node. Must have the public members prev & next.
MPName of the intrusive node member in object T.
UType stored in the list, derived from T.
Examples
using threads_list = utils::intrusive_list<
thread, utils::double_list_links, &thread::child_links_>;
List of intrusive nodes.
Definition lists.h:705
Standard thread.

Definition at line 704 of file lists.h.

Member Typedef Documentation

◆ difference_type

template<typename T , typename N , N T::* MP, typename U = T>
using os::utils::intrusive_list< T, N, MP, U >::difference_type = ptrdiff_t

Definition at line 711 of file lists.h.

◆ iterator

template<typename T , typename N , N T::* MP, typename U = T>
using os::utils::intrusive_list< T, N, MP, U >::iterator = intrusive_list_iterator<T, N, MP, U>

Definition at line 713 of file lists.h.

◆ iterator_pointer

template<typename T , typename N , N T::* MP, typename U = T>
using os::utils::intrusive_list< T, N, MP, U >::iterator_pointer = N*

Type of reference to the iterator internal pointer.

Definition at line 718 of file lists.h.

◆ pointer

template<typename T , typename N , N T::* MP, typename U = T>
using os::utils::intrusive_list< T, N, MP, U >::pointer = U*

Definition at line 709 of file lists.h.

◆ reference

template<typename T , typename N , N T::* MP, typename U = T>
using os::utils::intrusive_list< T, N, MP, U >::reference = U&

Definition at line 710 of file lists.h.

◆ value_type

template<typename T , typename N , N T::* MP, typename U = T>
using os::utils::intrusive_list< T, N, MP, U >::value_type = U

Definition at line 708 of file lists.h.

Constructor & Destructor Documentation

◆ intrusive_list() [1/2]

template<typename T , typename N , N T::* MP, typename U >
os::utils::intrusive_list< T, N, MP, U >::intrusive_list
inline

Construct an intrusive list.

Definition at line 1167 of file lists.h.

◆ intrusive_list() [2/2]

template<typename T , typename N , N T::* MP, typename U >
os::utils::intrusive_list< T, N, MP, U >::intrusive_list ( bool  clr)
inline

Construct an intrusive list with controlled inits.

Parameters
clrIf true, the list is cleared.

Definition at line 1173 of file lists.h.

◆ ~intrusive_list()

template<typename T , typename N , N T::* MP, typename U >
os::utils::intrusive_list< T, N, MP, U >::~intrusive_list
inline

Destruct the list.

Definition at line 1183 of file lists.h.

Member Function Documentation

◆ begin()

template<typename T , typename N , N T::* MP, typename U >
intrusive_list< T, N, MP, U >::iterator os::utils::intrusive_list< T, N, MP, U >::begin
inline

Iterator begin.

Returns
An iterator positioned at the first element.
Note
It is not const because it may initialise on first use.

Definition at line 1220 of file lists.h.

◆ clear()

void os::utils::static_double_list::clear ( void  )
inherited

Clear the list.

Parameters
None.
Returns
Nothing.

Initialise the mandatory node with links to itself.

Definition at line 105 of file lists.cpp.

◆ empty()

bool os::utils::static_double_list::empty ( void  ) const
inlineinherited

Check if the list is empty.

Parameters
None.
Return values
trueThe list has no nodes.
falseThe list has at least one node.

Definition at line 1028 of file lists.h.

◆ end()

template<typename T , typename N , N T::* MP, typename U >
intrusive_list< T, N, MP, U >::iterator os::utils::intrusive_list< T, N, MP, U >::end
inline

Iterator begin.

Returns
An iterator positioned after the last element.

Definition at line 1233 of file lists.h.

◆ get_pointer()

template<typename T , typename N , N T::* MP, typename U >
intrusive_list< T, N, MP, U >::pointer os::utils::intrusive_list< T, N, MP, U >::get_pointer ( iterator_pointer  node) const
inlineprotected

Definition at line 1244 of file lists.h.

◆ head()

volatile static_double_list_links * os::utils::static_double_list::head ( void  ) const
inlineinherited

Get the list head.

Parameters
None.
Returns
Pointer to head node.

Definition at line 1035 of file lists.h.

◆ insert_after()

void os::utils::static_double_list::insert_after ( static_double_list_links node,
static_double_list_links after 
)
protectedinherited

Insert a new node after existing node.

Parameters
nodeReference to node to insert.
afterReference to existing node.
Returns
Nothing.

Definition at line 118 of file lists.cpp.

◆ link()

template<typename T , typename N , N T::* MP, typename U >
void os::utils::intrusive_list< T, N, MP, U >::link ( reference  node)

Add a node to the tail of the list.

Parameters
[in]nodeReference to a list node.
Returns
Nothing.

Definition at line 1189 of file lists.h.

◆ tail()

volatile static_double_list_links * os::utils::static_double_list::tail ( void  ) const
inlineinherited

Get the list tail.

Parameters
None.
Returns
Pointer to tail node.

Definition at line 1041 of file lists.h.

◆ uninitialized()

bool os::utils::static_double_list::uninitialized ( void  ) const
inlineinherited

Check if the list is uninitialised.

Parameters
None.
Return values
trueThe list was not initialised.
falseThe list was initialised.

Definition at line 1021 of file lists.h.

◆ unlink_head()

template<typename T , typename N , N T::* MP, typename U >
intrusive_list< T, N, MP, U >::pointer os::utils::intrusive_list< T, N, MP, U >::unlink_head ( void  )

Unlink the first element from the list.

Returns
Pointer to the first element in the list.

Definition at line 1261 of file lists.h.

◆ unlink_tail()

template<typename T , typename N , N T::* MP, typename U >
intrusive_list< T, N, MP, U >::pointer os::utils::intrusive_list< T, N, MP, U >::unlink_tail ( void  )

Unlink the last element from the list.

Returns
Pointer to the last element in the list.

Definition at line 1274 of file lists.h.

Member Data Documentation

◆ head_

static_double_list_links os::utils::static_double_list::head_
protectedinherited

A list node used to point to head and tail.

To simplify processing, the list always has a node.

Definition at line 482 of file lists.h.


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