template <class T> class ListIterator

Iterate over a List

Inheritance:

ListIterator


public members:

inline ListIterator (const List<T>& aList)
inline ListIterator (const ListIterator<T>& rhs)
inline void rewind ()
inline const T& operator() () const
inline const T& operator* () const
inline operator bool () const
inline bool operator! () const
inline const T& value () const
inline ListIterator<T>& operator++ ()
inline ListIterator<T>& operator-- ()
inline ListIterator<T> operator-- (int)
inline ListIterator<T> operator++ (int)
inline bool operator== (const ListIterator<T>&) const
inline bool operator!= (const ListIterator<T>&) const

Documentation

The class ListIterator<T> is an iterator over class List<T>.

This class does NOT provide a default constructor or an assignment operator.

inline ListIterator (const List<T>& aList)
Construct a ListIterator<T> to first element of aList.

inline ListIterator (const ListIterator<T>& rhs)
The copy constructor.

inline void rewind ()
Reset this ListIterator<T> to point to the first element in the List<T>.

inline const T& operator() () const
Return a constant reference to the object in the List<T> currently pointed to by this ListIterator<T>.

inline const T& operator* () const
Return a constant reference to the object in the List<T> currently pointed to by this ListIterator<T>.

inline operator bool () const
This is a conversion operator that 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.

inline bool operator! () const
Returns true if ListIterator<T> doesn't point to any element on the List<T>.

inline const T& value () const
Return a constant reference to the object in the List<T> currently pointed to by the iterator.

inline ListIterator<T>& operator++ ()
This is the prefix auto-increment operator. It 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.

inline ListIterator<T>& operator-- ()
This is the prefix auto-decrement operator. It moves the ListIterator<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.

inline ListIterator<T> operator-- (int)
This is the postfix auto-decrement operator. It 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.

inline ListIterator<T> operator++ (int)
This is the postfix auto-increment operator. It 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.

inline bool operator== (const ListIterator<T>&) const
Do the two ListIterator<T>s point to the same List<T> and the same element within the List<T>?

inline bool operator!= (const ListIterator<T>&) const
Are the ListIterator<T>s not equal?


this class has no child classes.

alphabetic index hierarchy of classes


Chombo

Copyright Notice

This software is copyright (C) by the Lawrence Berkeley National Laboratory. Permission is granted to reproduce this software for non-commercial purposes provided that this notice is left intact.

It is acknowledged that the U.S. Government has rights to this software under Contract DE-AC03-765F00098 between the U.S. Department of Energy and the University of California.

This software is provided as a professional and academic contribution for joint exchange. Thus it is experimental, is provided ``as is'', with no warranties of any kind whatsoever, no support, no promise of updates, or printed documentation. By using this software, you acknowledge that the Lawrence Berkeley National Laboratory and Regents of the University of California shall have no liability with respect to the infringement of other copyrights by any part of this software.