32 template <
class T,
class List,
class Node>
85 template <
class T,
class List,
class Node>
99 template <
class T,
class List,
class Node>
Iterator class that works genericly on a List containing Node elements with data of type T.
~Iterator()
Destroy iterator.
void removedBefore(Node *after, int count)
Update this iterator, if appropriate, that count positions were removed before after.
bool operator!=(const Iterator &rhs) const
Iterator & operator=(const Iterator &rhs)
Update Iterator to be at the same position of the same list as rhs.
bool operator==(const Iterator &rhs) const
Iterator & operator-=(int positions)
Decrement this iterator positions, if possible, and return this iterator.
Iterator & operator++()
Advance this iterator one position and return this iterator.
Iterator operator+(int positions)
void insertedBefore(Node *after, int count)
Update this iterator, if appropriate, that count positions were added before after.
Iterator & operator+=(int positions)
Advance this iterator positions, if possible, and return this iterator.
void moveBefore(Iterator &other)
Move the value at this itherator before the value at other.
void swapWith(Iterator &other)
Swap the values at this and other iterators.
Iterator(List *theList, Node *at)
Create Iterator for theList at the value of at.
Iterator operator-(int positions)
void swapOccurred(Node *a, Node *b)
Update this iterator, if appropriate, that the values at a and b swapped positions.
Iterator & operator--()
Decrement this iterator one position and return this iterator.
This file is to be included at the end of Iterator.h.
void moveBefore(Iterator< T, List, Node > &a, Iterator< T, List, Node > &b)
Move the value at a before b.
void swap(Iterator< T, List, Node > &a, Iterator< T, List, Node > &b)
Swap the values at a and b.