#include <List.H>
Collaboration diagram for ListIterator< T >:
Public Methods | |
ListIterator (const List< T > &aList) | |
Construct a ListIterator<T> to first element of aList. | |
ListIterator (const ListIterator< T > &rhs) | |
The copy constructor. | |
void | rewind () |
Reset this ListIterator<T> to point to the first element in the List<T>. | |
void | begin () |
Reset this ListIterator<T> to point to the first element in the List<T>. | |
const T & | operator() () const |
Return a constant reference to the object in the List<T> currently pointed to by this ListIterator<T>. | |
T & | operator() () |
const T & | operator * () const |
Return a constant reference to the object in the List<T> currently pointed to by this ListIterator<T>. | |
operator bool () const | |
This is a conversion operator to makes the iterator look like a pointer. | |
bool | ok () const |
Return true if the iterator is not past the end of the list. | |
bool | operator! () const |
Returns true if ListIterator<T> doesn't point to any element on the List<T>. | |
const T & | value () const |
Return a constant reference to the object in the List<T> currently pointed to by the iterator. | |
const T & | value () |
Return a constant reference to the object in the List<T> currently pointed to by the iterator. | |
ListIterator< T > & | operator++ () |
The prefix auto-increment operator. | |
ListIterator< T > & | operator-- () |
The prefix auto-decrement operator. | |
ListIterator< T > | operator-- (int) |
The postfix auto-decrement operator. | |
ListIterator< T > | operator++ (int) |
The postfix auto-increment operator. | |
bool | operator== (const ListIterator< T > &) const |
Equality test for two ListIterator<T>s. | |
bool | operator!= (const ListIterator< T > &) const |
Are the ListIterator<T>s not equal? | |
Protected Methods | |
ListIterator (const List< T > &_list, ListLink< T > *_p) | |
Protected Attributes | |
const List< T > & | list |
ListLink< T > * | p |
Friends | |
class | List< T > |
The class ListIterator<T> is an iterator over class List<T>. This class does NOT provide a default constructor or an assignment operator.
|
Construct a ListIterator<T> to first element of aList.
|
|
The copy constructor.
|
|
Construct a ListIterator<T> to a List<T> and object in that List<T>. |
|
Reset this ListIterator<T> to point to the first element in the List<T>. Same as rewind(), but included to be consistent with other iterators. |
|
Return true if the iterator is not past the end of the list. Same as bool(), but included to be consistent with other iterators. |
|
Return a constant reference to the object in the List<T> currently pointed to by this ListIterator<T>.
|
|
This is a conversion operator to makes the iterator look like a pointer. This operator makes it easy to check if the iterator is pointing to an element on the List<T>. If the iterator has been moved off the List<T> or if the List<T> is empty, this conversion returns the NULL pointer. |
|
Returns true if ListIterator<T> doesn't point to any element on the List<T>.
|
|
Are the ListIterator<T>s not equal?
|
|
|
|
Return a constant reference to the object in the List<T> currently pointed to by this ListIterator<T>.
|
|
The postfix auto-increment operator. This advances the ListIterator<T> to point to the next element on the List<T>. It then returns a ListIterator<T> that points to the old element to allow for chaining with other operators. |
|
The prefix auto-increment operator. Advances the ListIterator<T> to point to the next element on the List<T>. It then returns a reference to itself to allow for chaining with other operators. |
|
The postfix auto-decrement operator. Moves the ListIterator<T> to point to the previous element on the List<T>. It then returns a ListIterator<T> that points to the old element to allow for chaining with other operators. |
|
The prefix auto-decrement operator. Moves theListIterator<T> to point to the previous element on the List<T>. It then returns a reference to itself to allow for chaining with other operators. |
|
Equality test for two ListIterator<T>s. Do the two ListIterator<T>s point to the same List<T> and the same element within the List<T>? |
|
Reset this ListIterator<T> to point to the first element in the List<T>.
|
|
Return a constant reference to the object in the List<T> currently pointed to by the iterator.
|
|
Return a constant reference to the object in the List<T> currently pointed to by the iterator.
|
|
|
|
A reference to the List<T> to which we point. |
|
A pointer to the element in the List<T> to which we point. |