template<class T, class L = double_list_links>
class micro_os_plus::utils::double_list< T, L >
A class template for a double linked list of nodes.
- Template Parameters
-
A double linked list is a pair of head/tail pointers, allowing to iterate over the nodes.
- Note
- Currently only forward iterators are provided, but there is no problem to add reverse iterators, if needed.
The list elements (of type T) should be derived from the double_list_links_base
class, (usually from double_list_links
) extended with the payload, that may be either the actual content or a pointer to the content.
The iterators return pointers to the list elements, i.e. to the beginning of the objects of type T.
- Note
- The class does not use inheritance, but composition for the links node, to avoid inheriting unwanted methods from it.
Definition at line 486 of file lists.h.
template<class T , class L >
Construct a double linked list.
For non-statically allocated lists, the initial list status is empty.
Statically allocated remain uninitialised.
Definition at line 268 of file inlines.h.
template<class T , class L >
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 null), initialise the list to the empty state, with both pointers pointing to itself.
For non-statically initialised lists, this method is ineffective.
- Note
- Must be manually called for statically allocated list before inserting elements, or any other operations.
Definition at line 349 of file inlines.h.
template<class T , class L >
Check if the list is uninitialised (only statically allocated can be).
- Parameters
- None.
- Return values
-
true | The list was not initialised. |
false | The list was initialised. |
An uninitialized node is a node with any of the pointers set to nullptr
.
Only statically allocated nodes in the initial state are uninitialized.
Definition at line 322 of file inlines.h.
template<class T , class L = double_list_links>
The list top node used to point to head and tail nodes.
The node next pointer points to the list head, and the previous pointer points to the list tail.
To simplify processing, the list always has these pointers set, with an empty list node pointing to itself.
Definition at line 673 of file lists.h.