#include <bidilist.hpp>
This is a generic base type that represents a node of a doubly (bidirectional) linked lists. The effective (instantiated) nodes of the list are to be derived from this type with specifying their very own type name as template parameter TElement. For more information on this design, see explanations of parent type ForwardNode.
By being derived from aforementioned type, instances of TElement may also be added to single-linked lists of type ForwardList). This is for example used by type List to collect erased list elements for recycling.
| TElement | The "final" node type, containing custom data fields, that is to be derived from this struct. |
Definition at line 41 of file bidilist.hpp.
Public Types | |
| using | TFNode = ForwardNode< TElement > |
| using | TNode = BidiNode< TElement > |
Public Types inherited from ForwardNode< TElement > | |
| using | ConstIterator = ForwardListIterator< const TElement > |
| using | Iterator = ForwardListIterator< TElement > |
| using | TNode = ForwardNode< TElement > |
Public Methods | |
| BidiNode () noexcept=default | |
| BidiNode (const TNode &)=delete | |
| BidiNode (TElement *next, TElement *previous) noexcept | |
| BidiNode (TNode &&) noexcept=default | |
| void | addBefore (TElement *elem) |
| void | addBefore (TElement *first, TElement *last) |
| void | addBehind (TElement *elem) |
| void | addBehind (TElement *first, TElement *last) |
| TElement * | next () const |
| BidiNode & | operator= (const TNode &)=delete |
| BidiNode & | operator= (TNode &&) noexcept=default |
| TElement * | prev () const |
| void | remove () |
| void | remove (TElement *last) |
| TElement * | self () |
Public Methods inherited from ForwardNode< TElement > | |
| ForwardNode () noexcept=default | |
| ForwardNode (const TNode &)=delete | |
| ForwardNode (TElement *next) noexcept | |
| ForwardNode (TNode &&) noexcept=default | |
| TElement * | addBehind (TElement *elem) |
| TElement * | addBehind (TElement *first, TElement *last) |
| Iterator | begin () |
| ConstIterator | begin () const |
| ConstIterator | cbegin () const |
| ConstIterator | cend () const |
| Iterator | end () |
| ConstIterator | end () const |
| bool | hasNext () const |
| bool | isLast () const |
| TElement * | makeLast () |
| TElement * | makePointTo (TElement *elem) |
| TElement * | next () const |
| ForwardNode & | operator= (const TNode &)=delete |
| ForwardNode & | operator= (TNode &&) noexcept=default |
| bool | pointsTo (TElement *elem) const |
| TElement * | removeNext () |
| TElement * | removeRangeBehind (TElement *last) |
Private Fields | |
| TElement * | backward |
Additional Inherited Members | |
Public Static Methods inherited from ForwardNode< TElement > | |
| static integer | count (TElement *start, TElement *end=nullptr) |
| static void | moveForward (TElement *&pointer) |
| static TElement * | moveForward (TNode *&pointer) |
| using TFNode = ForwardNode<TElement> |
Alias name for the an instantiation of the base template.
Definition at line 49 of file bidilist.hpp.
Alias name for the an instantiation of this template.
Definition at line 52 of file bidilist.hpp.
|
defaultnoexcept |
Default constructor. (Does not initialize the pointer!)
Deleted copy constructor. This is deleted because it is dangerous, respectively often not possible and also mostly not wanted to be able to create copies of derived type TElement
|
inlinenoexcept |
Constructor accepting a pointer to the next element.
| next | Pointer to the next element. Assigned to inherited field forward. |
| previous | Pointer to the next element. Assigned to field backward. |
Definition at line 90 of file bidilist.hpp.
|
inline |
Hooks the given element before this node.
| elem | The element to add. |
Definition at line 120 of file bidilist.hpp.
|
inline |
Hooks the given range of elements before this node.
| first | The first element of the range to insert. |
| last | The last element of the range to insert. |
Definition at line 131 of file bidilist.hpp.
|
inline |
Hooks the given element behind this node.
| elem | The element to add. |
Definition at line 141 of file bidilist.hpp.
|
inline |
Hooks the given range of elements behind this node.
| first | The first element of the range to insert. |
| last | The last element of the range to insert. |
Definition at line 152 of file bidilist.hpp.
|
inline |
Returns the successor of this node or element.
Definition at line 98 of file bidilist.hpp.
Deleted copy assignment operator. This is deleted because it is dangerous, respectively often not possible and also mostly not wanted to created copies of derived type TElement
Defaulted move assignment operator.
|
inline |
Returns the predecessor of this node or element.
Definition at line 106 of file bidilist.hpp.
|
inline |
Unhooks this node from a list.
Definition at line 162 of file bidilist.hpp.
|
inline |
Unhooks the range of nodes starting with this node and ending with last a list.
| last | The last element of the range to remove. |
Definition at line 170 of file bidilist.hpp.
|
inline |
Returns this node statically casted to TElement.
Definition at line 113 of file bidilist.hpp.
|
private |
In case of derived type TElement this is the pointer to the previous element. In case of derived class BidiList, this is the pointer to the last element of the list.
Definition at line 59 of file bidilist.hpp.