AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later 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"
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. | |
bool | operator!= (const IdIterator &other) const |
Inequality operator. | |
Id | operator* () const |
Dereference operator - return the sds::Id item the iterator is pointing to. | |
const IdIterator & | operator++ () |
Increment operator (prefix version). | |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au
Generated on Thu Dec 12 2024 23:07:36 for AAO DRAMA/DRAMA2 C++ Interface by 1.9.8