IBAMR  IBAMR version 0.19.
Public Member Functions | Private Attributes | List of all members
SAMRAI::hier::BoxIterator< DIM > Class Template Reference

#include <Box.h>

Public Member Functions

 BoxIterator ()
 
 BoxIterator (const Box< DIM > &box)
 
 BoxIterator (const BoxIterator< DIM > &iterator)
 
BoxIterator< DIM > & operator= (const BoxIterator< DIM > &iterator)
 
 ~BoxIterator ()
 
void initialize (const Box< DIM > &box)
 Initializer for the box iterator. More...
 
const Index< DIM > & operator* () const
 
const Index< DIM > & operator() () const
 
 operator bool () const
 
 operator const void * () const
 
bool operator! () const
 
void operator++ (int)
 
bool operator== (const BoxIterator< DIM > &iterator) const
 
bool operator!= (const BoxIterator< DIM > &iterator) const
 

Private Attributes

Index< DIM > d_index
 
Box< DIM > d_box
 

Detailed Description

template<int DIM>
class SAMRAI::hier::BoxIterator< DIM >

Class BoxIterator is an iterator that provides methods for stepping through the index space associated with a box. The indices are enumerated in column-major (e.g., Fortran) order. The iterator should be used as follows:

Box<DIM> box;
...
for (Box<DIM>::Iterator b(box); b; b++) {
   // use index b of the box
}

Note that the box iterator may not compile to efficient code, depending on your compiler. Many compilers are not smart enough to optimize the looping constructs and indexing operations.

See also
hier::Index
hier::Box

Constructor & Destructor Documentation

◆ BoxIterator() [1/3]

template<int DIM>
SAMRAI::hier::BoxIterator< DIM >::BoxIterator ( )

Default constructor for the box iterator. The iterator must be initialized before it can be used to iterate over a box.

See also
initialize().

◆ BoxIterator() [2/3]

template<int DIM>
SAMRAI::hier::BoxIterator< DIM >::BoxIterator ( const Box< DIM > &  box)

Constructor for the box iterator. The iterator will enumerate the indices in the argument box.

◆ BoxIterator() [3/3]

template<int DIM>
SAMRAI::hier::BoxIterator< DIM >::BoxIterator ( const BoxIterator< DIM > &  iterator)

Copy constructor for the box iterator.

◆ ~BoxIterator()

template<int DIM>
SAMRAI::hier::BoxIterator< DIM >::~BoxIterator ( )

Destructor for the box iterator.

Member Function Documentation

◆ operator=()

template<int DIM>
BoxIterator<DIM>& SAMRAI::hier::BoxIterator< DIM >::operator= ( const BoxIterator< DIM > &  iterator)

Assignment operator for the box iterator.

◆ initialize()

template<int DIM>
void SAMRAI::hier::BoxIterator< DIM >::initialize ( const Box< DIM > &  box)

The iterator will enumerate the indices in the box.

◆ operator*()

template<int DIM>
const Index<DIM>& SAMRAI::hier::BoxIterator< DIM >::operator* ( ) const

Return the current index in the box. This operation is undefined if the iterator is past the last Index in the box.

◆ operator()()

template<int DIM>
const Index<DIM>& SAMRAI::hier::BoxIterator< DIM >::operator() ( ) const

Return the current index in the box. This operation is undefined if the iterator is past the last Index in the box.

◆ operator bool()

template<int DIM>
SAMRAI::hier::BoxIterator< DIM >::operator bool ( ) const

Return true if the iterator points to a valid index in the box.

◆ operator const void *()

template<int DIM>
SAMRAI::hier::BoxIterator< DIM >::operator const void * ( ) const

Return a non-NULL if the iterator points to a valid index in the box.

◆ operator!()

template<int DIM>
bool SAMRAI::hier::BoxIterator< DIM >::operator! ( ) const

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

◆ operator++()

template<int DIM>
void SAMRAI::hier::BoxIterator< DIM >::operator++ ( int  )

Increment the iterator to point to the next index in the box.

◆ operator==()

template<int DIM>
bool SAMRAI::hier::BoxIterator< DIM >::operator== ( const BoxIterator< DIM > &  iterator) const

Test two iterators for equality (same index value).

◆ operator!=()

template<int DIM>
bool SAMRAI::hier::BoxIterator< DIM >::operator!= ( const BoxIterator< DIM > &  iterator) const

Test two iterators for inequality (different index values).

Member Data Documentation

◆ d_index

template<int DIM>
Index<DIM> SAMRAI::hier::BoxIterator< DIM >::d_index
private

◆ d_box

template<int DIM>
Box<DIM> SAMRAI::hier::BoxIterator< DIM >::d_box
private

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