AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
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... | |
Group * | asGroup () |
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... | |
View * | asView () |
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... | |
Iterate recursively over a Group.
axom::sidre::Iterator::~Iterator | ( | ) |
dtor.
bool axom::sidre::Iterator::isValid | ( | ) |
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.
Group* axom::sidre::Iterator::asGroup | ( | ) |
Group const* axom::sidre::Iterator::asGroup | ( | ) | const |
View* axom::sidre::Iterator::asView | ( | ) |
View const* axom::sidre::Iterator::asView | ( | ) | const |
const std::string& axom::sidre::Iterator::getName | ( | ) | const |
Return const reference to name of current iterator object.