The double_list_links_base Class Reference
A base class for a doubly linked list. More...
Fully Qualified Name
micro_os_plus::utils::double_list_links_base
Included Headers
#include <micro-os-plus/utils/lists.h>
Derived Classes
class | |
A class for the core of a doubly linked list (pointers to neighbours). More... | |
class | |
A class for the core of a statically allocated doubly linked list (pointers to neighbours). More... | |
Protected Member Attributes
Pointer to the next node. More... | |
Pointer to the previous node. More... | |
Member Functions
constexpr | |
Construct an uninitialised list node. More... | |
constexpr | |
Destruct the node. More... | |
void | initialize (void) |
Initialise the node links. More... | |
void | initialize_once (void) |
Initialize the list only at first run. More... | |
void | link_next (double_list_links_base *node) |
Link the new node as next. More... | |
void | link_previous (double_list_links_base *node) |
Link the new node as previous. More... | |
bool | linked (void) const |
Check if the node is linked to a double list. More... | |
next (void) const | |
Get the link to the next node. More... | |
previous (void) const | |
Get the link to the previous node. More... | |
bool | uninitialized (void) const |
Check if the node is uninitialised. More... | |
void | unlink (void) |
Remove this node from the list. More... | |
Description
A pair of uninitialised pointers to the next and previous list elements, plus a set of simple (some inlined) methods to access the pointers.
Both the regular and the statically allocated list elements are derived from this class.
Definition at line 111 of file lists.h.
Protected Member Attributes
next_
| protected |
previous_
Constructors
double_list_links_base()
| constexpr |
Construct an uninitialised list node.
This must be an empty constructor, that does not touch the pointers, but leaves them unchanged.
For statically initialised lists, this means a pair of nullptr
pointers.
For regular lists, the constructor of the derived class will handle the initialisations.
Code analysis may trigger:
- Member
previous_
was not initialized in constructor - Member
next_
was not initialized in constructor
Destructor
~double_list_links_base()
| constexpr |
Member Functions
initialize()
| constexpr |
initialize_once()
|
Initialize the list only at first run.
- Parameters
None.
- Returns
Nothing.
If the statically allocated list is still in the initial uninitialised state (with both pointers nullptr
), initialise the list to the empty state, with both pointers pointing to itself.
For non-statically initialised lists, this method is ineffective, since the node is always initialised at construct time.
This method must be manually called for statically allocated list before inserting elements, or performing any other operations.
link_next()
|
link_previous()
|
linked()
|
next()
| constexpr |
previous()
| constexpr |
uninitialized()
|
Check if the node is uninitialised.
- Parameters
None.
- Return Values
true The links are not initialised. false The links are initialised.
An uninitialized node is a node with the pointers set to nullptr
.
Only statically allocated nodes in the initial state are uninitialized. Regular nodes are always initialised.
unlink()
|
Generated via docusaurus-plugin-doxygen by Doxygen 1.13.2