Skip to main content

The double_list_links Class Reference

A class for the core of a doubly linked list (pointers to neighbours). More...

Fully Qualified Name

micro_os_plus::utils::double_list_links

Included Headers

Base class

class

A base class for a doubly linked list. More...

Member Typedefs

using
is_statically_allocated = std::false_type

Type indicating that the links node is not statically allocated. More...

Member Functions

constexpr

Construct a list node (initialise the pointers). More...

constexpr

Destruct the node. More...

void
initialize (void)

Initialise the node links. More...

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...

Protected Member Attributes

Pointer to the next node. More...

Pointer to the previous node. More...

Description

The pair of pointers to the next and previous list elements and the methods to access the pointers are inherited from the base class.

The constructor initialises the pointers to an empty list (both pointers point to the node).

Definition at line 250 of file lists.h.

Member Typedefs

is_statically_allocated

using micro_os_plus::utils::double_list_links::is_statically_allocated = std::false_type

Type indicating that the links node is not statically allocated.

Definition at line 257 of file lists.h.

Constructors

double_list_links()

micro_os_plus::utils::double_list_links::double_list_links ()
constexpr

Construct a list node (initialise the pointers).

Definition at line 262 of file lists.h.

Destructor

~double_list_links()

micro_os_plus::utils::double_list_links::~double_list_links ()
constexpr

Destruct the node.

Definition at line 285 of file lists.h.

Member Functions

initialize()

void micro_os_plus::utils::double_list_links_base::initialize (void)
constexpr

Initialise the node links.

Parameters

None.

Returns

Nothing.

Set both pointers to point to this node.

This is the definition of an unlinked node.

info

After unlinking the node from a list, it must be returned to this state.

Definition at line 160 of file lists.h.

initialize_once()

void micro_os_plus::utils::double_list_links_base::initialize_once (void)

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.

info

This method must be manually called for statically allocated list before inserting elements, or performing any other operations.

Definition at line 170 of file lists.h.

link_next()

void micro_os_plus::utils::double_list_links_base::link_next (double_list_links_base * node)

Link the new node as next.

Parameters

None.

Returns

Nothing.

Insert the new node between the next pointer and the node pointed by it.

Used by lists to link new nodes to the list head.

Definition at line 180 of file lists.h.

link_previous()

void micro_os_plus::utils::double_list_links_base::link_previous (double_list_links_base * node)

Link the new node as previous.

Parameters

None.

Returns

Nothing.

Insert the new node between the previous pointer and the node pointed by it.

Used by lists to link new nodes to the list tail.

Definition at line 190 of file lists.h.

linked()

bool micro_os_plus::utils::double_list_links_base::linked (void) const

Check if the node is linked to a double list.

Return Values
trueThe node is linked with both pointers.
falseThe node is not linked.

To be linked, both pointers must point to different nodes than itself (double list requirement).

Definition at line 206 of file lists.h.

next()

double_list_links_base * micro_os_plus::utils::double_list_links_base::next (void) const
constexpr

Get the link to the next node.

Return Values
Pointerto the next node.

Definition at line 213 of file lists.h.

previous()

double_list_links_base * micro_os_plus::utils::double_list_links_base::previous (void) const
constexpr

Get the link to the previous node.

Return Values
Pointerto the previous node.

Definition at line 220 of file lists.h.

uninitialized()

bool micro_os_plus::utils::double_list_links_base::uninitialized (void) const

Check if the node is uninitialised.

Parameters

None.

Return Values
trueThe links are not initialised.
falseThe 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.

Definition at line 150 of file lists.h.

unlink()

void micro_os_plus::utils::double_list_links_base::unlink (void)

Remove this node from the list.

Returns

Nothing.

Update both neighbours to point to each other, practically removing the node from the list.

The node is returned to the initial state (empty), with both pointers pointing to itself.

Definition at line 198 of file lists.h.

Protected Member Attributes

next_

double_list_links_base* micro_os_plus::utils::double_list_links_base::next_
protected

Pointer to the next node.

Definition at line 231 of file lists.h.

previous_

double_list_links_base* micro_os_plus::utils::double_list_links_base::previous_
protected

Pointer to the previous node.

Definition at line 226 of file lists.h.


Generated via docusaurus-plugin-doxygen by Doxygen 1.13.2