SAMRAI::tbox::ListIterator< TYPE > Class Template Reference

#include <source/toolbox/base/List.h>

List of all members.

Public Member Functions

 ListIterator ()
 ListIterator (const List< TYPE > &list)
 ListIterator (const ListIterator< TYPE > &iterator)
ListIterator< TYPE > & operator= (const ListIterator< TYPE > &iterator)
 ~ListIterator ()
TYPE & operator * ()
const TYPE & operator * () const
TYPE & operator() ()
const TYPE & operator() () const
 operator bool () const
 operator const void * () const
bool operator! () const
void operator++ (int)
void operator-- (int)
void rewindIterator ()
void fastforwardIterator ()
bool operator== (const ListIterator< TYPE > &iterator) const
bool operator!= (const ListIterator< TYPE > &iterator) const

Friends

class List< TYPE >


Detailed Description

template<class TYPE>
class SAMRAI::tbox::ListIterator< TYPE >

Class ListIterator provides methods for stepping through lists. This class definition should be nested within List, but nested template classes can cause some compilers to barf. The user should access this class through the name List<TYPE>::Iterator rather than through ListIterator<TYPE>, since the implementation may change as compilers mature.

The list iterator should be used as follows:

   List<TYPE> list;
   ...
   for (List<TYPE>::Iterator l(list); l; l++) {
      ... = l();
   }
   

See also:
tbox::List


Constructor & Destructor Documentation

template<class TYPE>
SAMRAI::tbox::ListIterator< TYPE >::ListIterator (  )  [inline]

Default constructor for ListIterator. This must be initialized before it can be used to iterate over a list.

template<class TYPE>
SAMRAI::tbox::ListIterator< TYPE >::ListIterator ( const List< TYPE > &  list  )  [inline]

Create a list iterator pointing to the beginning of the specified list.

template<class TYPE>
SAMRAI::tbox::ListIterator< TYPE >::ListIterator ( const ListIterator< TYPE > &  iterator  )  [inline]

Copy constructor for ListIterator. Make this iterator point to the same list and item as the argument.

template<class TYPE>
SAMRAI::tbox::ListIterator< TYPE >::~ListIterator (  )  [inline]

Destructor for class ListIterator.


Member Function Documentation

template<class TYPE>
ListIterator< TYPE > & SAMRAI::tbox::ListIterator< TYPE >::operator= ( const ListIterator< TYPE > &  iterator  )  [inline]

Make the list iterator point to the same list and position as the argument.

template<class TYPE>
TYPE & SAMRAI::tbox::ListIterator< TYPE >::operator * (  )  [inline]

Return the current item from the list. The iterator must point to a valid item in the list; otherwise, this function may barf.

template<class TYPE>
const TYPE & SAMRAI::tbox::ListIterator< TYPE >::operator * (  )  const [inline]

Return a const references to the current item from the list. The iterator must point to a valid item in the list; otherwise, this function may barf.

template<class TYPE>
TYPE & SAMRAI::tbox::ListIterator< TYPE >::operator() (  )  [inline]

Return the current item from the list. The iterator must point to a valid item in the list; otherwise, this function may barf.

template<class TYPE>
const TYPE & SAMRAI::tbox::ListIterator< TYPE >::operator() (  )  const [inline]

Return a const reference to the current item from the list. The iterator must point to a valid item in the list; otherwise, this function may barf.

template<class TYPE>
SAMRAI::tbox::ListIterator< TYPE >::operator bool (  )  const [inline]

Return true if the iterator points to a valid list item.

template<class TYPE>
SAMRAI::tbox::ListIterator< TYPE >::operator const void * (  )  const [inline]

Return a non-NULL value if the iterator points to a valid list item.

template<class TYPE>
bool SAMRAI::tbox::ListIterator< TYPE >::operator! (  )  const [inline]

Return whether the iterator points to a valid list item. This operator mimics the !p operation applied to a pointer p.

template<class TYPE>
void SAMRAI::tbox::ListIterator< TYPE >::operator++ ( int   )  [inline]

Increment the iterator to point to the next element in the list.

template<class TYPE>
void SAMRAI::tbox::ListIterator< TYPE >::operator-- ( int   )  [inline]

Decrement the iterator to point to the previous element in the list.

template<class TYPE>
void SAMRAI::tbox::ListIterator< TYPE >::rewindIterator (  )  [inline]

Rewind the iterator to point to the first element in the list.

template<class TYPE>
void SAMRAI::tbox::ListIterator< TYPE >::fastforwardIterator (  )  [inline]

Fast forward the iterator to point to the last element in the list.

template<class TYPE>
bool SAMRAI::tbox::ListIterator< TYPE >::operator== ( const ListIterator< TYPE > &  iterator  )  const [inline]

Test two iterators for equality (pointing to the same list item). This does not check whether two list items have the same value, but whether they are the same item. Thus, if a and b are iterators, "a == b" (object sameness) is more restrictive than "a() == b()" (object equality).

template<class TYPE>
bool SAMRAI::tbox::ListIterator< TYPE >::operator!= ( const ListIterator< TYPE > &  iterator  )  const [inline]

Test two iterators for inequality (pointing to different list items). See the comments for operator== for more information about equality for list items.


Friends And Related Function Documentation

template<class TYPE>
friend class List< TYPE > [friend]


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:59 2009 for SAMRAI by  doxygen 1.5.1