AAO DRAMA/DRAMA2 C++ Interface
|
An iterator for working through SDS Structures and SDS arrays of structures.
This class provides a forward iterator which can be used to work through the items within an SDS structure, or the elements of a one dimension array of SDS structures.
This iterator is designed for use with C++11 for loops using the range constructor, so it provides the operator++, operator!= and operator* methods. It will work in other cases as well, but it is not clear if the implementation is currently complete for other standard cases.
The example below shows how to work through the items in the structure "id". Each time around the loop, variable "s" will refer to the next item in the structure or structure array.
for (auto s:id) { s.List(); }
The std::begin() and std::end() methods overriden, to provide implementations that take a * drama::sds::Id argument and returns drama::sds::IdIterator.
#include "sds.hh"
Inherits iterator< std::forward_iterator_tag, Id >.
Public Member Functions | |
IdIterator (const Id &id, const bool setEnd=false) | |
Construct a forward iterator for working through an SDS structure or array of structures. More... | |
bool | operator!= (const IdIterator &other) const |
Inequality operator. More... | |
Id | operator* () const |
Dereference operator - return the sds::Id item the iterator is pointing to. More... | |
const IdIterator & | operator++ () |
Increment operator (prefix version). More... | |
|
inlineexplicit |
Construct a forward iterator for working through an SDS structure or array of structures.
Currently, if an array of structures, this iterator can only work with a single dimensional array.
id | The SDS structure we want to iterator through. |
setEnd | If true, the current cell is set to the end() value. Used to implement std::end(). |
References DramaTHROW, DramaTHROW_S, drama::sds::Id::GetCode(), and drama::sds::Id::GetDims().
|
inline |
Inequality operator.
Returns true if are pointing to a different element from that the other iterator is pointing too.
other | The other item we want to compare against. |
|
inline |
Dereference operator - return the sds::Id item the iterator is pointing to.
References drama::sds::Id::Cell(), DramaTHROW, and drama::sds::Id::Index().
|
inline |
Increment operator (prefix version).
Increments the iterator to point to the next object.
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tjf@aao.gov.au Generated on Mon Feb 22 2016 15:57:53 for AAO DRAMA/DRAMA2 C++ Interface by