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 lang::SidiNodeBase .
By being derived from aforementioned type, instances of TElement may also be added to single-linked lists of type lang::SidiListHelper ). This is for example used by types List and HashTable 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.
#include <bidilist.hpp>
Public Type Index: | |
using | FWDNode = SidiNodeBase<TElement> |
Public Field Index: | |
TElement * | pprev |
Public Field Index: inherited from SidiNodeBase< TElement > | |
TElement * | pnext |
Public Method Index: | |
BidiNodeBase () noexcept=default | |
BidiNodeBase (BidiNodeBase &&) noexcept=default | |
BidiNodeBase (const BidiNodeBase &)=delete | |
BidiNodeBase (TElement *next, TElement *prev) noexcept | |
void | addBefore (TElement *elem) |
void | addBehind (TElement *elem) |
BidiNodeBase & | operator= (BidiNodeBase &&) noexcept=default |
BidiNodeBase & | operator= (const BidiNodeBase &)=delete |
TElement * | prev () const |
void | prev (BidiNodeBase *newPrev) |
void | remove () |
void | remove (TElement *last) |
Public Method Index: inherited from SidiNodeBase< TElement > | |
SidiNodeBase () noexcept=default | |
SidiNodeBase (const SidiNodeBase &)=delete | |
SidiNodeBase (SidiNodeBase &&) noexcept=default | |
SidiNodeBase (TElement *next) noexcept | |
TElement * | addBehind (TElement *elem) |
integer | count (SidiNodeBase *end=nullptr) const |
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 () |
TElement * | removeRangeBehind (TElement *last) |
using FWDNode = SidiNodeBase<TElement> |
Alias name for the an instantiation of the base template.
Definition at line 44 of file bidilist.hpp.
TElement* pprev |
A pointer to the previous element in the list.
Definition at line 50 of file bidilist.hpp.
|
defaultnoexcept |
Default constructor. (Does not initialize the pointer!)
|
delete |
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
|
defaultnoexcept |
Defaulted move constructor.
|
inlinenoexcept |
Constructor accepting a pointer to the next and previous elements.
next | Pointer to the next element. Assigned to inherited field lang::SidiNodeBase::pnext . |
prev | Pointer to the next element. Assigned to field pprev. |
Definition at line 78 of file bidilist.hpp.
|
inline |
Hooks the given element before this node.
elem | The element to add. |
Definition at line 93 of file bidilist.hpp.
|
inline |
Hooks the given element behind this node.
elem | The element to add. |
Definition at line 103 of file bidilist.hpp.
|
defaultnoexcept |
Defaulted move assignment operator.
|
delete |
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
|
inline |
Returns the backward pointer of this node.
Definition at line 85 of file bidilist.hpp.
|
inline |
Sets the backward pointer of this node.
newPrev | Pointer to the previous element. |
Definition at line 89 of file bidilist.hpp.
|
inline |
Unhooks this node from a list.
Definition at line 112 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 120 of file bidilist.hpp.