#include <bidilist.hpp>
template<typename TElement>
struct aworx::lib::detail::BidiListHelper< TElement >
This struct, together with sibling struct detail::BidiNodeBase provide the tools to implement a doubly linked list of TElement instances.
Template type TElement have to extend struct BidiNodeBase<TElement>.
- See also
- Types detail::SidiNodeBase,
detail::SidiListHelper and
detail::BidiNodeBase.
- Template Parameters
-
Definition at line 144 of file bidilist.hpp.
◆ TFNode
An alias for the base type of the node type of this list.
Definition at line 147 of file bidilist.hpp.
◆ TNode
An alias for the node type of this list.
Definition at line 150 of file bidilist.hpp.
◆ BidiListHelper() [1/5]
Default constructor. Initializes this list to be empty.
Definition at line 156 of file bidilist.hpp.
◆ BidiListHelper() [2/5]
Deleted copy constructor.
◆ BidiListHelper() [3/5]
Move constructor. Takes elements of move
and sets move
to empty.
- Parameters
-
Definition at line 168 of file bidilist.hpp.
◆ BidiListHelper() [4/5]
Constructor accepting a pointer to the first element.
- Parameters
-
first | The element to use as the first element of this list.
|
Definition at line 190 of file bidilist.hpp.
◆ BidiListHelper() [5/5]
Constructor accepting a pointer to the first and last element.
- Parameters
-
first | The element to use as the first element of this list. |
last | The element to use as the last element of this list.
|
Definition at line 201 of file bidilist.hpp.
◆ count()
Counts the number of elements found in the range starting with this list's first element and ending with the element before end.
- Parameters
-
end | The element after the last one to count. Defaults to a nullptr marking the end of the list. |
- Returns
- The number of elements in the range.
Definition at line 319 of file bidilist.hpp.
◆ end()
Returns a pointer to the hook node casted to a pointer to a mutable element. This method must only be used in cases where such conversion is allowed, i.e. with iterator types that use this pointer exclusively for pointer value comparison, but do not allow (by contract) to dereference or otherwise use this pointer.
- Returns
- The first element of this list.
Definition at line 228 of file bidilist.hpp.
◆ first()
TElement* first |
( |
| ) |
const |
|
inline |
Returns the first element of this list.
- Returns
- The first element of this list.
Definition at line 236 of file bidilist.hpp.
◆ isEmpty()
Tests if this list is empty.
- Returns
false
if the list is empty, true
otherwise.
Definition at line 211 of file bidilist.hpp.
◆ isFirst()
bool isFirst |
( |
TElement * |
elem | ) |
const |
|
inline |
Tests if given elem is the first element of this list.
- Parameters
-
elem | The element to test for being the first. |
- Returns
true
if elem is the first element of this list, false
otherwise.
Definition at line 251 of file bidilist.hpp.
◆ isLast()
bool isLast |
( |
TElement * |
elem | ) |
const |
|
inline |
Tests if given elem is the last element of this list.
- Parameters
-
elem | The element to test for being the last. |
- Returns
true
if elem is the last element of this list, false
otherwise.
Definition at line 259 of file bidilist.hpp.
◆ last()
Returns the last element of this list.
- Returns
- The last element of this list.
Definition at line 243 of file bidilist.hpp.
◆ operator=() [1/2]
Defaulted move assignment operator.
- Returns
- A reference to this list object.
◆ operator=() [2/2]
Deleted copy assignment operator.
- Returns
- A reference to this list object.
◆ popEnd()
Removes and returns the last element from this list. Must not be invoked on empty lists.
- Returns
- A pointer to the last element (which was removed).
Definition at line 307 of file bidilist.hpp.
◆ popFront()
Removes and returns the first element from this list. Must not be invoked on empty lists.
- Returns
- A pointer to the first element (which was removed).
Definition at line 297 of file bidilist.hpp.
◆ pushEnd() [1/2]
void pushEnd |
( |
TElement * |
elem | ) |
|
|
inline |
Hooks the given element to the end of this list.
- Parameters
-
elem | The element to insert to at the start.
|
Definition at line 281 of file bidilist.hpp.
◆ pushEnd() [2/2]
void pushEnd |
( |
TElement * |
first, |
|
|
TElement * |
last |
|
) |
| |
|
inline |
Hooks the given range of elements to the end of this list.
- Parameters
-
first | The first element of the range to insert. |
last | The last element of the range to insert.
|
Definition at line 289 of file bidilist.hpp.
◆ pushFront() [1/2]
void pushFront |
( |
TElement * |
elem | ) |
|
|
inline |
Hooks the given element to the beginning of this list.
- Parameters
-
elem | The element to insert to at the start.
|
Definition at line 266 of file bidilist.hpp.
◆ pushFront() [2/2]
void pushFront |
( |
TElement * |
first, |
|
|
TElement * |
last |
|
) |
| |
|
inline |
Hooks the given range of elements to the front of this list.
- Parameters
-
first | The first element of the range to insert. |
last | The last element of the range to insert.
|
Definition at line 274 of file bidilist.hpp.
◆ reset()
Resets this list to zero elements.
Definition at line 217 of file bidilist.hpp.
◆ hook
The root node. Points twice to itself when list is empty.
Definition at line 153 of file bidilist.hpp.
The documentation for this struct was generated from the following file: