AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Member Functions | List of all members
drama::sds::IdIterator Class Reference

Detailed Description

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 IdIteratoroperator++ ()
 Increment operator (prefix version).
 

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