µ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_links Class Reference

Statically allocated core of a double linked list, pointers to next, previous. More...

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

Inherited by os::utils::double_list_links.

Public Member Functions

Constructors & Destructor
 static_double_list_links ()
 Construct a list node (BSS initialised). More...
 ~static_double_list_links ()
 Destruct the node. More...
Public Member Functions
void unlink (void)
 Remove the node from the list. More...
bool unlinked (void)
 Check if the node is unlinked. More...
static_double_list_linksnext (void) const
static_double_list_linksprev (void) const
void next (static_double_list_links *n)
void prev (static_double_list_links *n)

Protected Attributes

Private Member Variables
 Pointer to previous node. More...
 Pointer to next node. More...

Detailed Description

Statically allocated core of a double linked list, pointers to next, previous.

This is the simplest list node, used as base class for other list nodes and as storage for static_double_list, that must be available for any statically constructed objects 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.

Definition at line 52 of file lists.h.

Constructor & Destructor Documentation

◆ static_double_list_links()

os::utils::static_double_list_links::static_double_list_links ( )

Construct a list node (BSS initialised).

Definition at line 835 of file lists.h.

◆ ~static_double_list_links()

os::utils::static_double_list_links::~static_double_list_links ( )

Destruct the node.

Definition at line 841 of file lists.h.

Member Function Documentation

◆ next() [1/2]

static_double_list_links * os::utils::static_double_list_links::next ( void  ) const

Definition at line 853 of file lists.h.

◆ next() [2/2]

void os::utils::static_double_list_links::next ( static_double_list_links n)

Definition at line 865 of file lists.h.

◆ prev() [1/2]

static_double_list_links * os::utils::static_double_list_links::prev ( void  ) const

Definition at line 859 of file lists.h.

◆ prev() [2/2]

void os::utils::static_double_list_links::prev ( static_double_list_links n)

Definition at line 871 of file lists.h.

◆ unlink()

void os::utils::static_double_list_links::unlink ( void  )

Remove the node from the list.


Update the neighbours to point to each other, skipping the node.

For more robustness, to prevent unexpected accesses, the links in the removed node are nullified.

Definition at line 60 of file lists.cpp.

◆ unlinked()

bool os::utils::static_double_list_links::unlinked ( void  )

Check if the node is unlinked.

Return values
trueThe node is not linked.
falseThe node is linked to a list.

Definition at line 847 of file lists.h.

Member Data Documentation

◆ next_

static_double_list_links* os::utils::static_double_list_links::next_

Pointer to next node.

Definition at line 142 of file lists.h.

◆ prev_

static_double_list_links* os::utils::static_double_list_links::prev_

Pointer to previous node.

Definition at line 137 of file lists.h.

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