µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
os::utils::intrusive_list< T, N, MP, U > Class Template Reference

List of intrusive nodes. More...

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

Inherits os::utils::static_double_list.

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. More...
 
using pointer = U *
 
using reference = U &
 
using value_type = U
 

Public Member Functions

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

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. More...
 

Protected Attributes

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

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_>;

Definition at line 708 of file lists.h.

Types

◆ 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 715 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 717 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 722 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 713 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 714 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 712 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 1173 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 1180 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 1190 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 1223 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 108 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 1032 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 ( ) const
inline

Iterator begin.

Returns
An iterator positioned after the last element.

Definition at line 1236 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 1245 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 1039 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 115 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 1197 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 1045 of file lists.h.

◆ uninitialized()

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

Check if the list is unitialised.

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

Definition at line 1025 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 1262 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 1275 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 486 of file lists.h.


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