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() [1/2]

LayoutIterator::LayoutIterator ( )
inline

a null constructed LayoutIterator will return false on ok()

◆ ~LayoutIterator()

virtual LayoutIterator::~LayoutIterator ( )
inlinevirtual

References operator()().

◆ LayoutIterator() [2/2]

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

Member Function Documentation

◆ operator()()

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(), DataIterator::operator()(), and ~LayoutIterator().

◆ i()

LayoutIndex LayoutIterator::i ( ) const
inline

return a copy of the index that this iterator is at

References operator()(), and operator++().

◆ operator++()

void LayoutIterator::operator++ ( )
inlinevirtual

move the iterator to the next Box in the layout

Reimplemented in TimedDataIterator.

References m_current.

Referenced by i().

◆ incr()

void LayoutIterator::incr ( )
inline

move the iterator to the next Box in the layout

References begin(), end(), ok(), and reset().

◆ ok()

bool LayoutIterator::ok ( ) const
inlinevirtual

◆ begin()

void LayoutIterator::begin ( )
inline

initialize this iterator to the first Box in its Layout

References m_current.

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

◆ reset()

void LayoutIterator::reset ( )

same as begin()

Referenced by incr().

◆ end()

void LayoutIterator::end ( )

move this iterator to after the last Box in the layout

The iterator will be !ok() afterwards.

Referenced by incr().

Friends And Related Function Documentation

◆ BoxLayout

friend class BoxLayout
friend

◆ DisjointBoxLayout

friend class DisjointBoxLayout
friend

◆ TimedDataIterator

friend class TimedDataIterator
friend

Member Data Documentation

◆ m_layout

BoxLayout LayoutIterator::m_layout
protected

◆ m_indicies

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

Referenced by operator()().

◆ m_current

int LayoutIterator::m_current
protected

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


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