IBAMR  IBAMR version 0.19.
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SAMRAI::tbox::ListIterator< TYPE > Class Template Reference

#include <tbox/List.h>

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
 

Private Member Functions

 ListIterator (List< TYPE > *list, ListNode< TYPE > *node)
 

Private Attributes

List< TYPE > * d_list
 
ListNode< TYPE > * d_node
 

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

◆ ListIterator() [1/4]

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

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

◆ ListIterator() [2/4]

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

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

◆ ListIterator() [3/4]

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

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

◆ ~ListIterator()

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

Destructor for class ListIterator.

◆ ListIterator() [4/4]

template<class TYPE >
SAMRAI::tbox::ListIterator< TYPE >::ListIterator ( List< TYPE > *  list,
ListNode< TYPE > *  node 
)
private

Member Function Documentation

◆ operator=()

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

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

◆ operator*() [1/2]

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

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

◆ operator*() [2/2]

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

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.

◆ operator()() [1/2]

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

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

◆ operator()() [2/2]

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

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.

◆ operator bool()

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

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

◆ operator const void *()

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

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

◆ operator!()

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

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

◆ operator++()

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

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

◆ operator--()

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

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

◆ rewindIterator()

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

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

◆ fastforwardIterator()

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

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

◆ operator==()

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

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).

◆ operator!=()

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

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

◆ List< TYPE >

template<class TYPE >
friend class List< TYPE >
friend

Member Data Documentation

◆ d_list

template<class TYPE >
List<TYPE>* SAMRAI::tbox::ListIterator< TYPE >::d_list
private

◆ d_node

template<class TYPE >
ListNode<TYPE>* SAMRAI::tbox::ListIterator< TYPE >::d_node
private

The documentation for this class was generated from the following file: