AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::sidre::Iterator Class Reference

Iterate recursively over a Group. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/sidre/core/Iterator.hpp>

Public Member Functions

Iterator ctor and dtor
 Iterator (Group *grp)
 ctor that creates a Iterator which starts at grp. More...
 
 ~Iterator ()
 dtor. More...
 
Methods to iterate through a Group.
bool isValid ()
 Return true if the Iterator references a Group or View. Return false if the Iterator has finished its traversal. More...
 
void advanceToNext ()
 Advance Iterator to the next Group or View. More...
 
Methods to query iterator.
bool isGroup () const
 Return true if the Iterator references a Group. More...
 
bool isView () const
 Return true if the Iterator references a View. More...
 
GroupasGroup ()
 Return pointer to non-const Group at current iterator position. More...
 
Group const * asGroup () const
 Return pointer to const Group at current iterator position. More...
 
ViewasView ()
 Return pointer to non-const View at current iterator position. More...
 
View const * asView () const
 Return pointer to const View at current iterator position. More...
 
const std::string & getName () const
 Return const reference to name of current iterator object. More...
 

Detailed Description

Iterate recursively over a Group.

Constructor & Destructor Documentation

◆ Iterator()

axom::sidre::Iterator::Iterator ( Group grp)

ctor that creates a Iterator which starts at grp.

◆ ~Iterator()

axom::sidre::Iterator::~Iterator ( )

dtor.

Member Function Documentation

◆ isValid()

bool axom::sidre::Iterator::isValid ( )

Return true if the Iterator references a Group or View. Return false if the Iterator has finished its traversal.

◆ advanceToNext()

void axom::sidre::Iterator::advanceToNext ( )

Advance Iterator to the next Group or View.

For each group, its child Groups are traversed first, then its child Views. They are traversed in index order. Typically, this is the order in which Groups and Views are created. However, if a Group or View is deleted and a new one created, the index number will be reused.

After calling advanceToNext, isValid will return true if the Iterator represents a Group or View and false if the traversal has finished. Additional calls to advanceToNext will do nothing once isValid returns false.

◆ isGroup()

bool axom::sidre::Iterator::isGroup ( ) const

Return true if the Iterator references a Group.

◆ isView()

bool axom::sidre::Iterator::isView ( ) const

Return true if the Iterator references a View.

◆ asGroup() [1/2]

Group* axom::sidre::Iterator::asGroup ( )

Return pointer to non-const Group at current iterator position.

If the current position is not a Group, return nullptr.

◆ asGroup() [2/2]

Group const* axom::sidre::Iterator::asGroup ( ) const

Return pointer to const Group at current iterator position.

If the current position is not a Group, return nullptr.

◆ asView() [1/2]

View* axom::sidre::Iterator::asView ( )

Return pointer to non-const View at current iterator position.

If the current position is not a View, return nullptr.

◆ asView() [2/2]

View const* axom::sidre::Iterator::asView ( ) const

Return pointer to const View at current iterator position.

If the current position is not a View, return nullptr.

◆ getName()

const std::string& axom::sidre::Iterator::getName ( ) const

Return const reference to name of current iterator object.

See also
getPath(), getPathName()

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