This struct, together with sibling struct BidiNodeBase provide the tools to implement a doubly linked list of TElement instances.
Template type TElement has to extend struct BidiNodeBase<TElement>.
| TElement | The "final" custom type that (by contract) is derived from BidiNodeBase. |
Definition at line 121 of file bidilist.hpp.
#include <bidilist.hpp>
Public Type Index: | |
| using | TFNode = SidiNodeBase<TElement> |
| An alias for the base type of the node type of this list. | |
| using | TNode = BidiNodeBase<TElement> |
| An alias for the node type of this list. | |
Public Field Index: | |
| TNode | hook |
| The root node. Points twice to itself when the list is empty. | |
Public Method Index: | |
| BidiListHook () noexcept | |
| Default constructor. Initializes this list to be empty. | |
| BidiListHook (BidiListHook &&move) noexcept | |
| BidiListHook (const BidiListHook &)=delete | |
| Deleted copy constructor. | |
| BidiListHook (TElement *first) noexcept | |
| BidiListHook (TElement *first, TElement *last) noexcept | |
| integer | count (const TNode *end=nullptr) const noexcept |
| TElement * | end () const noexcept |
| TElement * | first () const noexcept |
| bool | isEmpty () const noexcept |
| bool | isFirst (const TElement *elem) const noexcept |
| bool | isLast (const TElement *elem) const noexcept |
| TElement * | last () const noexcept |
| BidiListHook & | operator= (BidiListHook &&) noexcept=default |
| BidiListHook & | operator= (const BidiListHook &)=delete |
| TElement * | popEnd () noexcept |
| TElement * | popFront () noexcept |
| void | pushEnd (TElement *elem) noexcept |
| void | pushEnd (TElement *first, TElement *last) noexcept |
| void | pushFront (TElement *elem) noexcept |
| void | pushFront (TElement *first, TElement *last) noexcept |
| void | reset () noexcept |
| Resets this list to zero elements. | |
| using alib::lang::BidiListHook< TElement >::TFNode = SidiNodeBase<TElement> |
An alias for the base type of the node type of this list.
Definition at line 123 of file bidilist.hpp.
| using alib::lang::BidiListHook< TElement >::TNode = BidiNodeBase<TElement> |
An alias for the node type of this list.
Definition at line 126 of file bidilist.hpp.
| TNode alib::lang::BidiListHook< TElement >::hook |
The root node. Points twice to itself when the list is empty.
Definition at line 129 of file bidilist.hpp.
|
inlinenoexcept |
Default constructor. Initializes this list to be empty.
Definition at line 132 of file bidilist.hpp.
|
inlinenoexcept |
Move constructor. Takes elements of move and sets move to empty.
| move | The list to move. |
Definition at line 139 of file bidilist.hpp.
|
inlineexplicitnoexcept |
Constructor accepting a pointer to the first element.
| first | The element to use as the first element of this list. |
Definition at line 159 of file bidilist.hpp.
|
inlinenoexcept |
Constructor accepting a pointer to the first and last element.
| 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 169 of file bidilist.hpp.
|
inlinenodiscardnoexcept |
Counts the number of elements found in the range starting with this list's first element and ending with the element before end.
| end | The element after the last one to count. Defaults to a nullptr marking the end of the list. |
Definition at line 253 of file bidilist.hpp.
|
inlinenoexcept |
Returns a pointer to the hook node cast 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.
Definition at line 189 of file bidilist.hpp.
|
inlinenodiscardnoexcept |
Returns the first element of this list.
Definition at line 196 of file bidilist.hpp.
|
inlinenodiscardnoexcept |
Tests if this list is empty.
false if the list is empty, true otherwise. Definition at line 179 of file bidilist.hpp.
|
inlinenodiscardnoexcept |
Tests if given elem is the first element of this list.
| elem | The element to test for being the first. |
true if elem is the first element of this list, false otherwise. Definition at line 207 of file bidilist.hpp.
|
inlinenodiscardnoexcept |
Tests if given elem is the last element of this list.
| elem | The element to test for being the last. |
true if elem is the last element of this list, false otherwise. Definition at line 213 of file bidilist.hpp.
|
inlinenodiscardnoexcept |
Returns the last element of this list.
Definition at line 201 of file bidilist.hpp.
|
defaultnoexcept |
Defaulted move assignment operator.
|
delete |
Deleted copy assignment operator.
|
inlinenoexcept |
Removes and returns the last element from this list. Must not be invoked on empty lists.
Definition at line 241 of file bidilist.hpp.
|
inlinenoexcept |
Removes and returns the first element from this list. Must not be invoked on empty lists.
Definition at line 236 of file bidilist.hpp.
|
inlinenoexcept |
Hooks the given element to the end of this list.
| elem | The element to insert to at the start. |
Definition at line 226 of file bidilist.hpp.
|
inlinenoexcept |
Hooks the given range of elements to the end of this list.
| first | The first element of the range to insert. |
| last | The last element of the range to insert. |
Definition at line 231 of file bidilist.hpp.
|
inlinenoexcept |
Hooks the given element to the beginning of this list.
| elem | The element to insert to at the start. |
Definition at line 217 of file bidilist.hpp.
|
inlinenoexcept |
Hooks the given range of elements to the front of this list.
| first | The first element of the range to insert. |
| last | The last element of the range to insert. |
Definition at line 222 of file bidilist.hpp.
|
inlinenoexcept |
Resets this list to zero elements.
Definition at line 182 of file bidilist.hpp.