Data Structures in C++
|
Object that provides iterative powers to classes composed of Node. More...
#include <Iterator.hpp>
Public Member Functions | |
Iterator (Node< T > *n) | |
Creates an iterator. More... | |
bool | hasNext () |
Returns whether the iterator has a next value to explore. More... | |
bool | hasPrevious () |
Returns whether the iterator has a previous value to explore. More... | |
T | next () |
Go to the next value. More... | |
T | previous () |
Go to the previous value. More... | |
T | current () |
Get the current value the iterator holds. More... | |
Private Attributes | |
Node< T > * | node |
bool | firstRun = true |
Object that provides iterative powers to classes composed of Node.
Definition at line 13 of file Iterator.hpp.
Creates an iterator.
n | The starting node for the iteration |
Definition at line 23 of file Iterator.hpp.
|
inline |
Get the current value the iterator holds.
Definition at line 60 of file Iterator.hpp.
|
inline |
Returns whether the iterator has a next value to explore.
Definition at line 29 of file Iterator.hpp.
|
inline |
Returns whether the iterator has a previous value to explore.
Definition at line 35 of file Iterator.hpp.
|
inline |
Go to the next value.
Definition at line 41 of file Iterator.hpp.
|
inline |
Go to the previous value.
Definition at line 53 of file Iterator.hpp.
|
private |
Definition at line 17 of file Iterator.hpp.
Definition at line 16 of file Iterator.hpp.