Chombo + EB  3.0
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
LayoutIterator Class Reference

An Iterator based on a BoxLayout object. More...

#include <LayoutIterator.H>

Inheritance diagram for LayoutIterator:
Inheritance graph
[legend]

Public Member Functions

 LayoutIterator ()
 a null constructed LayoutIterator will return false on ok() More...
 
virtual ~LayoutIterator ()
 
const LayoutIndexoperator() () const
 return the index that this iterator is at More...
 
LayoutIndex i () const
 return a copy of the index that this iterator is at More...
 
virtual void operator++ ()
 move the iterator to the next Box in the layout More...
 
void incr ()
 move the iterator to the next Box in the layout More...
 
virtual bool ok () const
 return true if this iterator is still in its Layout More...
 
void begin ()
 initialize this iterator to the first Box in its Layout More...
 
void reset ()
 same as begin() More...
 
void end ()
 move this iterator to after the last Box in the layout More...
 

Protected Member Functions

 LayoutIterator (const BoxLayout &a_boxlayout, const int *a_layoutID)
 

Protected Attributes

BoxLayout m_layout
 
RefCountedPtr< Vector
< LayoutIndex > > 
m_indicies
 
int m_current
 

Friends

class BoxLayout
 
class DisjointBoxLayout
 
class TimedDataIterator
 

Detailed Description

An Iterator based on a BoxLayout object.

An Iterator based on a BoxLayout object. It does not support a dereferencing operation(1), since it is intended to work with all of BoxLayouts, DisjointBoxLayouts, BoxLayoutDatas LevelData's, and any object that is built on top of a BoxLayout object. LayoutIterator accesses the data in a BoxLayout-based object in a NON-data-parallel manner (i.e. every processor iterates through all the Boxes in the BoxLayout). This differs from the DataIterator class.

BoxLayout-based objects can act as the Factory for the LayoutIterator.

(1) STL-speak. not critical for comprehension, but can help people familiar with STL iterators and expecting similar behaviour.

Constructor & Destructor Documentation

LayoutIterator::LayoutIterator ( )
inline

a null constructed LayoutIterator will return false on ok()

virtual LayoutIterator::~LayoutIterator ( )
inlinevirtual
LayoutIterator::LayoutIterator ( const BoxLayout a_boxlayout,
const int *  a_layoutID 
)
protected

Member Function Documentation

const LayoutIndex & LayoutIterator::operator() ( ) const
inline

return the index that this iterator is at

References CH_assert, m_current, m_indicies, and ok().

Referenced by i(), and DataIterator::operator()().

LayoutIndex LayoutIterator::i ( ) const
inline

return a copy of the index that this iterator is at

References operator()().

void LayoutIterator::operator++ ( )
inlinevirtual

move the iterator to the next Box in the layout

Reimplemented in TimedDataIterator.

References m_current.

void LayoutIterator::incr ( )
inline

move the iterator to the next Box in the layout

bool LayoutIterator::ok ( ) const
inlinevirtual
void LayoutIterator::begin ( )
inline

initialize this iterator to the first Box in its Layout

References m_current.

Referenced by MultilevelLinearOp< T >::dotProduct(), and regionGather().

void LayoutIterator::reset ( )

same as begin()

void LayoutIterator::end ( )

move this iterator to after the last Box in the layout

The iterator will be !ok() afterwards.

Friends And Related Function Documentation

friend class BoxLayout
friend
friend class DisjointBoxLayout
friend
friend class TimedDataIterator
friend

Member Data Documentation

BoxLayout LayoutIterator::m_layout
protected
RefCountedPtr<Vector<LayoutIndex> > LayoutIterator::m_indicies
protected

Referenced by operator()().

int LayoutIterator::m_current
protected

Referenced by begin(), ok(), operator()(), and operator++().


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