|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator over singly linked nodes. More...
#include <tpl_slist.H>
Public Types | |
| typedef Snode< T > | Set_Type |
| Type of the set being iterated. | |
| typedef Snode< T > * | Item_Type |
| Type of the element returned by get_curr(). | |
Public Member Functions | |
| Iterator (Slist &_list) noexcept | |
Construct an iterator over list. | |
| bool | has_curr () const noexcept |
| Return true if the iterator currently points to a node. | |
| Node * | get_curr () |
| Return the current node. | |
| void | next () |
| Advance the iterator to the next node. | |
| void | reset_first () noexcept |
| Reset the iterator to the first node of the list. | |
| Iterator & | operator= (Node *node) |
Assign the iterator to point to node. | |
Private Attributes | |
| Slist * | list |
| Node * | current |
Iterator over singly linked nodes.
This iterator walks the list from the head sentinel forward.
Definition at line 173 of file tpl_slist.H.
Type of the element returned by get_curr().
Definition at line 185 of file tpl_slist.H.
Type of the set being iterated.
Definition at line 183 of file tpl_slist.H.
|
inlineexplicitnoexcept |
Construct an iterator over list.
| [in] | _list | list to traverse |
Definition at line 191 of file tpl_slist.H.
|
inline |
Return the current node.
| overflow_error | if the iterator is not positioned on a node |
Definition at line 205 of file tpl_slist.H.
References ah_overflow_error_if, Aleph::Slist< T >::Iterator::current, Aleph::Slist< T >::Iterator::has_curr(), and Aleph::maps().
Referenced by Aleph::DynSlist< T >::Iterator::get_curr(), Aleph::DynSlist< T >::Iterator::get_curr(), and TEST().
|
inlinenoexcept |
Return true if the iterator currently points to a node.
Definition at line 198 of file tpl_slist.H.
References Aleph::Slist< T >::Iterator::current, and Aleph::Slist< T >::Iterator::list.
Referenced by Aleph::Slist< T >::Iterator::get_curr(), Aleph::Slist< T >::Iterator::next(), TEST(), TEST(), and TEST().
|
inline |
Advance the iterator to the next node.
| overflow_error | if the iterator is not positioned on a node |
Definition at line 215 of file tpl_slist.H.
References ah_overflow_error_if, Aleph::Slist< T >::Iterator::current, Aleph::Snode< T >::get_next(), Aleph::Slist< T >::Iterator::has_curr(), and Aleph::maps().
Assign the iterator to point to node.
| [in] | node | node to point to |
Definition at line 233 of file tpl_slist.H.
References Aleph::Slist< T >::Iterator::current.
|
inlinenoexcept |
Reset the iterator to the first node of the list.
Definition at line 223 of file tpl_slist.H.
References Aleph::Slist< T >::Iterator::current, Aleph::Slist< T >::get_first_ne(), Aleph::Slink::is_empty(), and Aleph::Slist< T >::Iterator::list.
|
private |
Definition at line 179 of file tpl_slist.H.
Referenced by Aleph::Slist< T >::Iterator::get_curr(), Aleph::Slist< T >::Iterator::has_curr(), Aleph::Slist< T >::Iterator::next(), Aleph::Slist< T >::Iterator::operator=(), and Aleph::Slist< T >::Iterator::reset_first().
|
private |
Definition at line 178 of file tpl_slist.H.
Referenced by Aleph::Slist< T >::Iterator::has_curr(), and Aleph::Slist< T >::Iterator::reset_first().