This class, together with sibling class SidiNodeBase provide the tools to implement a single linked list of TElement instances.
| TElement | The "final" custom type that (by contract) is derived from SidiNodeBase. |
Definition at line 178 of file sidilist.inl.
Public Type Index: | |
| using | TNode = SidiNodeBase<TElement> |
| An alias for the node type. | |
Public Method Index: | |
| SidiListHook () noexcept | |
| Default constructor. Initializes this list to be empty. | |
| SidiListHook (const SidiListHook ©)=delete | |
| SidiListHook (SidiListHook &&) noexcept=default | |
| integer | count (TElement *end=nullptr) const noexcept |
| TNode * | findAndRemove (TElement *elem) noexcept |
| TElement * | findLast () const noexcept |
| TElement * | findLast (TElement *hint) const noexcept |
| TElement * | findLastBefore (TElement *elem) noexcept |
| TElement * | first () const noexcept |
| bool | isEmpty () const noexcept |
| SidiListHook & | operator= (const SidiListHook &) noexcept=delete |
| SidiListHook & | operator= (SidiListHook &&) noexcept=default |
| TElement * | popFront () noexcept |
| void | pushFront (TElement *elem) noexcept |
| void | pushFront (TElement *first, TElement *last) |
| void | reset () noexcept |
| Resets this list to zero elements. | |
| Public Method Index: inherited from alib::lang::SidiNodeBase< TElement > | |
| SidiNodeBase () noexcept=default | |
| Default constructor. (Does not initialize the pointer.). | |
| SidiNodeBase (const SidiNodeBase &)=delete | |
| SidiNodeBase (SidiNodeBase &&) noexcept=default | |
| Defaulted move constructor. | |
| SidiNodeBase (TElement *next) noexcept | |
| TElement * | addBehind (TElement *elem) noexcept |
| integer | count (SidiNodeBase *end=nullptr) const noexcept |
| bool | hasNext () const |
| TElement * | next () const |
| void | next (SidiNodeBase *p) |
| SidiNodeBase & | operator= (const SidiNodeBase &)=delete |
| SidiNodeBase & | operator= (SidiNodeBase &&) noexcept=default |
| bool | pointsTo (const SidiNodeBase *elem) const |
| TElement * | removeNext () noexcept |
| TElement * | removeRangeBehind (TElement *last) noexcept |
Additional Inherited Members | |
| Public Field Index: inherited from alib::lang::SidiNodeBase< TElement > | |
| TElement * | n |
| using alib::lang::SidiListHook< TElement >::TNode = SidiNodeBase<TElement> |
An alias for the node type.
Definition at line 181 of file sidilist.inl.
|
inlinenoexcept |
Default constructor. Initializes this list to be empty.
Definition at line 184 of file sidilist.inl.
|
delete |
Deleted copy constructor.
|
defaultnoexcept |
Move constructor. Copies the link from move and sets the link of move to nullptr.
|
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 303 of file sidilist.inl.
|
inlinenoexcept |
Searches the predecessor of the given element using findLastBefore and unhooks the element from the list.
nullptr access).| elem | The element to remove. |
Definition at line 291 of file sidilist.inl.
|
inlinenodiscardnoexcept |
Searches and returns the last element.
false). Otherwise, this method has undefined behavior (dereference of a nullptr). To find the pointer to the last element, use findLastBefore providing nullptr. Definition at line 250 of file sidilist.inl.
|
inlinenodiscardnoexcept |
Searches and returns the last element.
| hint | An element of this list used to start the search. |
Definition at line 261 of file sidilist.inl.
|
inlinenodiscardnoexcept |
Searches the node or element that points to the given element.
nullptr exception will occur! | elem | The element to search for. |
Definition at line 273 of file sidilist.inl.
|
inlinenodiscardnoexcept |
Returns the start element of this list.
nullptr if this list is empty. Definition at line 216 of file sidilist.inl.
|
inlinenodiscardnoexcept |
Tests if this list is empty.
false if the list is empty, true otherwise. Definition at line 208 of file sidilist.inl.
|
deletenoexcept |
Deleted copy assignment operator.
|
defaultnoexcept |
Move assignment operator. Copies the link to the first element from move and sets the link in move to nullptr.
|
inlinenoexcept |
Removes and returns the first element from this list.
nullptr if the list was empty. Definition at line 236 of file sidilist.inl.
|
inlinenoexcept |
Hooks the given element to the beginning of this list.
| elem | The element to insert to at the start. |
Definition at line 220 of file sidilist.inl.
|
inline |
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 228 of file sidilist.inl.
|
inlinenoexcept |
Resets this list to zero elements.
Definition at line 211 of file sidilist.inl.