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 122 of file bidilist.inl.
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 125 of file bidilist.inl.
| using alib::lang::BidiListHook< TElement >::TNode = BidiNodeBase<TElement> |
An alias for the node type of this list.
Definition at line 128 of file bidilist.inl.
| TNode alib::lang::BidiListHook< TElement >::hook |
The root node. Points twice to itself when the list is empty.
Definition at line 131 of file bidilist.inl.
|
inlinenoexcept |
Default constructor. Initializes this list to be empty.
Definition at line 134 of file bidilist.inl.
|
inlinenoexcept |
Move constructor. Takes elements of move and sets move to empty.
| move | The list to move. |
Definition at line 141 of file bidilist.inl.
|
inlineexplicitnoexcept |
Constructor accepting a pointer to the first element.
| first | The element to use as the first element of this list. |
Definition at line 161 of file bidilist.inl.
|
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 171 of file bidilist.inl.
|
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 255 of file bidilist.inl.
|
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 191 of file bidilist.inl.
|
inlinenodiscardnoexcept |
Returns the first element of this list.
Definition at line 198 of file bidilist.inl.
|
inlinenodiscardnoexcept |
Tests if this list is empty.
false if the list is empty, true otherwise. Definition at line 181 of file bidilist.inl.
|
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 209 of file bidilist.inl.
|
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 215 of file bidilist.inl.
|
inlinenodiscardnoexcept |
Returns the last element of this list.
Definition at line 203 of file bidilist.inl.
|
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 243 of file bidilist.inl.
|
inlinenoexcept |
Removes and returns the first element from this list. Must not be invoked on empty lists.
Definition at line 238 of file bidilist.inl.
|
inlinenoexcept |
Hooks the given element to the end of this list.
| elem | The element to insert to at the start. |
Definition at line 228 of file bidilist.inl.
|
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 233 of file bidilist.inl.
|
inlinenoexcept |
Hooks the given element to the beginning of this list.
| elem | The element to insert to at the start. |
Definition at line 219 of file bidilist.inl.
|
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 224 of file bidilist.inl.
|
inlinenoexcept |
Resets this list to zero elements.
Definition at line 184 of file bidilist.inl.