µ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::static_double_list Class Reference

Statically allocated circular double linked list of nodes. More...

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

Inherited by os::rtos::internal::ready_threads_list, os::rtos::internal::terminated_threads_list, os::utils::double_list, and os::utils::intrusive_list< T, N, MP, U >.

Public Member Functions

Constructors & Destructor
 static_double_list ()
 Construct a list. More...
 
 ~static_double_list ()
 Destruct 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

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

Statically allocated circular double linked list of nodes.

This is the simplest list, used as base class for scheduler lists that must be available for any statically constructed thread while still avoiding the 'static initialisation order fiasco'.

The idea is to design the object in such a way as to benefit from the standard BSS initialisation, in other words take nullptr as starting values.

This has the downside of requiring additional tests before adding new nodes to the list, to create the initial self links, and when checking if the list is empty.

Definition at line 353 of file lists.h.

Constructor & Destructor Documentation

◆ static_double_list()

os::utils::static_double_list::static_double_list ( )
inline

Construct a list.

The initial list status is empty by having the pointers null.

Definition at line 1008 of file lists.h.

◆ ~static_double_list()

os::utils::static_double_list::~static_double_list ( )
inline

Destruct the list.

There must be no nodes in the list.

Definition at line 1019 of file lists.h.

Member Function Documentation

◆ clear()

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

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
inline

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.

◆ head()

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

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 
)
protected

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.

◆ tail()

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

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
inline

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.

Member Data Documentation

◆ head_

static_double_list_links os::utils::static_double_list::head_
protected

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 files: