AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface

◆ Index()

virtual Id drama::sds::Id::Index ( const long  index,
bool  throwOnNotFound = true 
) const
virtual

Factory constructor method Constructor which returns an id
to a structured item indexed by position.

This non-static factory constructor uses the specified index to
find an item within an SDS structure.

The object on which the method is invoked must reference an SDS Structure item (rather then an array or primitive).

Note that if working through a structure (incrementing index), then you might find drama::sds::IdIterator provides a neater solution over a loop calling this method.

See also
SdsIndex()
drama::sds::IdIterator
Parameters
indexThe index of the item fo find. Items in a structure are numbered in order of creation starting with one.
throwOnNotFoundIf true (default), will throw an exception if the the index does not exist. Otherwise will return a null SDS item. Any other errors will cause an exception to be thrown regardless.
Returns
An Id providing a reference to the item.

Referenced by drama::sds::IdIterator::operator*().