|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Singly linked node that stores data of type T.
More...
#include <tpl_snode.H>
Public Member Functions | |
| T & | get_data () |
| Return a modifiable reference to the stored data. | |
| const T & | get_data () const |
| Return a constant reference to the stored data. | |
| Snode ()=default | |
| Default constructor. | |
| Snode (const T &_data) | |
| Constructor that copies the value. | |
| Snode (T &&_data) | |
| Constructor that moves the value. | |
| Snode * | remove_next () |
Remove the node right after this and return it. | |
| Snode *& | get_next () |
Return the next node after this. | |
| const Snode * | get_next () const |
Return the next node after this (const overload). | |
| Snode * | remove_first () |
| Remove and return the first node (for symmetry with list front). | |
| const Snode * | get_first () const |
Return the first node (const alias of get_next). | |
Public Member Functions inherited from Aleph::Slink | |
| Slink () | |
| Default constructor. | |
| void | reset () noexcept |
| Reset the link so it points to itself. | |
| constexpr bool | is_empty () const noexcept |
| Return true if this link is empty (points to itself). | |
| constexpr Slink *& | get_next () noexcept |
| Return the next link. | |
| constexpr const Slink * | get_next () const noexcept |
| Return the next link (const overload). | |
| void | insert_next (Slink *p) |
Insert link p right after this. | |
| Slink * | remove_next () |
Remove the link right after this. | |
Private Attributes | |
| T | data |
Additional Inherited Members | |
Protected Attributes inherited from Aleph::Slink | |
| Slink * | next |
Singly linked node that stores data of type T.
Snode inherits the Slink interface and adds the payload held by the node.
| T | type of the stored value |
Definition at line 65 of file tpl_snode.H.
|
default |
Default constructor.
Constructor that copies the value.
Definition at line 82 of file tpl_snode.H.
Constructor that moves the value.
Definition at line 85 of file tpl_snode.H.
|
inline |
Return a modifiable reference to the stored data.
Definition at line 73 of file tpl_snode.H.
References Aleph::Snode< T >::data.
Referenced by Aleph::DynSlist< T >::Iterator::get_curr(), Aleph::DynSlist< T >::Iterator::get_curr(), Aleph::DynSlist< T >::operator[](), TEST(), and TEST().
Return a constant reference to the stored data.
Definition at line 76 of file tpl_snode.H.
References Aleph::Snode< T >::data.
Return the first node (const alias of get_next).
Definition at line 103 of file tpl_snode.H.
References Aleph::Snode< T >::get_next().
|
inline |
Return the next node after this.
Definition at line 91 of file tpl_snode.H.
References Aleph::Slink::get_next().
Referenced by Aleph::DynSlist< T >::DynSlist(), Aleph::DynSlist< T >::DynSlist(), Aleph::Slist< T >::get_first(), Aleph::Snode< T >::get_first(), Aleph::Slist< T >::get_first_ne(), Aleph::DynSlist< T >::get_previous_to_pos(), Aleph::Slist< T >::Iterator::next(), Aleph::DynSlist< T >::operator=(), Aleph::DynSlist< T >::operator=(), Aleph::DynSlist< T >::operator[](), TEST(), and TEST().
Return the next node after this (const overload).
Definition at line 94 of file tpl_snode.H.
References Aleph::Slink::get_next().
|
inline |
Remove and return the first node (for symmetry with list front).
Definition at line 100 of file tpl_snode.H.
References Aleph::Snode< T >::remove_next().
Referenced by TEST().
|
inline |
Remove the node right after this and return it.
Definition at line 88 of file tpl_snode.H.
References Aleph::Slink::remove_next().
Referenced by Aleph::Slist< T >::remove_first(), Aleph::Snode< T >::remove_first(), Aleph::Slist< T >::remove_first_ne(), and TEST().
|
private |
Definition at line 68 of file tpl_snode.H.
Referenced by Aleph::Snode< T >::get_data(), Aleph::Snode< T >::get_data(), Aleph::DynSlist< T >::insert(), and Aleph::DynSlist< T >::insert().