Statically allocated circular double linked list of nodes. More...
#include <cmsis-plus/utils/lists.h>
Public Member Functions | |
Constructors & Destructor | |
static_double_list () | |
Construct a list. | |
~static_double_list () | |
Destruct 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_links * | head (void) const |
Get the list head. | |
volatile static_double_list_links * | tail (void) const |
Get the list tail. | |
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. | |
Protected Attributes | |
Private Member Variables | |
static_double_list_links | head_ |
A list node used to point to head and tail. | |
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.
|
inline |
|
inline |
void os::utils::static_double_list::clear | ( | void | ) |
|
inline |
|
inline |
|
protected |
|
inline |
|
inline |
|
protected |