Statically allocated circular double linked list of nodes. More...
#include <cmsis-plus/utils/lists.h>
Inheritance diagram for os::utils::static_double_list: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. | |
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 | ) |
Initialise the mandatory node with links to itself.
Definition at line 108 of file lists.cpp.
References head_, os::utils::static_double_list_links::next(), and os::utils::static_double_list_links::prev().
Referenced by os::utils::double_list::double_list(), os::rtos::internal::ready_threads_list::link(), and os::rtos::internal::terminated_threads_list::link().
|
inline |
| true | The list has no nodes. |
| false | The list has at least one node. |
Definition at line 1001 of file lists.h.
References head_, and os::utils::static_double_list_links::next().
Referenced by os::utils::double_list::~double_list(), os::rtos::internal::clock_timestamps_list::check_timestamp(), os::rtos::internal::clock_timestamps_list::link(), os::rtos::internal::ready_threads_list::link(), os::rtos::internal::waiting_threads_list::link(), os::rtos::internal::waiting_threads_list::resume_one(), and os::rtos::internal::ready_threads_list::unlink_head().
|
inline |
|
protected |
| node | Reference to node to insert. |
| after | Reference to existing node. |
Definition at line 121 of file lists.cpp.
References os::utils::static_double_list_links::next(), os::utils::static_double_list_links::prev(), and os::trace::printf().
Referenced by os::rtos::internal::thread_children_list::link(), os::rtos::internal::clock_timestamps_list::link(), os::rtos::internal::ready_threads_list::link(), os::rtos::internal::waiting_threads_list::link(), and os::rtos::internal::terminated_threads_list::link().
|
inline |
Definition at line 1014 of file lists.h.
References head_, and os::utils::static_double_list_links::prev().
Referenced by os::rtos::internal::thread_children_list::link(), os::rtos::internal::clock_timestamps_list::link(), os::rtos::internal::ready_threads_list::link(), os::rtos::internal::waiting_threads_list::link(), and os::rtos::internal::terminated_threads_list::link().
|
inline |
| true | The list was not initialised. |
| false | The list was initialised. |
Definition at line 994 of file lists.h.
References head_, and os::utils::static_double_list_links::prev().
|
protected |
To simplify processing, the list always has a node.
Definition at line 473 of file lists.h.
Referenced by os::rtos::internal::waiting_threads_list::begin(), os::rtos::internal::clock_timestamps_list::check_timestamp(), clear(), empty(), os::rtos::internal::waiting_threads_list::end(), head(), os::rtos::internal::clock_timestamps_list::link(), os::rtos::internal::ready_threads_list::link(), os::rtos::internal::waiting_threads_list::link(), os::rtos::internal::terminated_threads_list::link(), tail(), and uninitialized().