ORIGINAL
|
Forward iterator for skipList. More...
#include <skipList.h>
Protected Member Functions | |
Iterator (skipListNode *cur=nullptr) | |
Constructs iterator. | |
Iterator (const Iterator &other) | |
Copy constructor. | |
Iterator & | operator= (const Iterator &other) |
Copy assignment operator. | |
bool | hasNext () const |
Checks if more elements exist forward. | |
void | next () const |
Moves to next element. | |
Iterator * | clone () const |
Creates a copy of this iterator. | |
void | operator+= (integer steps) const |
Advances iterator by steps. | |
integer | operator- (const Iterator &other) const |
Calculates distance between iterators. | |
couple< const K_TYPE, V_TYPE > & | get () |
Gets current element (non-const) | |
couple< const K_TYPE, V_TYPE > | get () const |
Gets current element (const) | |
bool | isValid () const |
Checks if iterator is valid. | |
Static Protected Member Functions | |
static integer | ptrDistance (const Iterator *start, const Iterator *end) |
Calculates distance between two iterators. | |
Protected Attributes | |
skipListNode * | cur_ |
Current node pointer. | |
Forward iterator for skipList.
Provides iteration over list elements in sorted order
|
explicitprotected |
Constructs iterator.
cur | Current node pointer |
|
protected |
Creates a copy of this iterator.
|
protected |
Gets current element (non-const)
|
protected |
Gets current element (const)
|
protected |
Checks if more elements exist forward.
|
protected |
Checks if iterator is valid.
|
protected |
Advances iterator by steps.
steps | Number of positions to advance |
|
protected |
Calculates distance between iterators.
other | Iterator to compare with |
|
staticprotected |
Calculates distance between two iterators.
start | Starting iterator |
end | Ending iterator |