Statically allocated core of a double linked list, pointers to next, previous. More...
#include <cmsis-plus/utils/lists.h>
Inheritance diagram for os::utils::static_double_list_links:Public Member Functions | |
Constructors & Destructor | |
| static_double_list_links () | |
| Construct a list node (BSS initialised). | |
| ~static_double_list_links () | |
| Destruct the node. | |
Public Member Functions | |
| void | unlink (void) |
| Remove the node from the list. | |
| bool | unlinked (void) |
| Check if the node is unlinked. | |
| static_double_list_links * | next (void) const |
| static_double_list_links * | prev (void) const |
| void | next (static_double_list_links *n) |
| void | prev (static_double_list_links *n) |
Protected Attributes | |
Private Member Variables | |
| static_double_list_links * | prev_ |
| Pointer to previous node. | |
| static_double_list_links * | next_ |
| Pointer to next node. | |
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.
|
inline |
|
inline |
|
inline |
Definition at line 847 of file lists.h.
References next_.
|
inline |
Definition at line 835 of file lists.h.
References next_.
Referenced by os::rtos::internal::waiting_threads_list::begin(), os::rtos::internal::clock_timestamps_list::check_timestamp(), os::utils::static_double_list::clear(), os::utils::static_double_list::empty(), os::utils::static_double_list::head(), and os::utils::static_double_list::insert_after().
|
inline |
Definition at line 853 of file lists.h.
References prev_.
|
inline |
Definition at line 841 of file lists.h.
References prev_.
Referenced by os::utils::static_double_list::clear(), os::utils::static_double_list::insert_after(), 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(), os::utils::static_double_list::tail(), and os::utils::static_double_list::uninitialized().
| void os::utils::static_double_list_links::unlink | ( | void | ) |
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 59 of file lists.cpp.
References next_, prev_, os::trace::printf(), and unlinked().
Referenced by os::rtos::internal::timeout_thread_node::action(), os::rtos::internal::timer_node::action(), and os_rtos_idle_actions().
|
inline |
|
protected |
Definition at line 137 of file lists.h.
Referenced by os::utils::double_list_links::double_list_links(), next(), next(), unlink(), and unlinked().
|
protected |