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

◆ Cell() [2/2]

Id drama::sds::Id::Cell ( unsigned long  index,
bool  throwOnNotFound = true 
) const
inline

Factory constructor method Constructor that returns a cell of a SDS structure which must be a single dimensional array structures.

This non-static factory constructor is used to access a specified cell of an existing one dimensional SDS structure array. A different overload allows you to access the cell of a multi-dimensional array.

The object on which the method is invoked must reference an SDS Array (rather then an SDS structure or primitive). It must also be an internal item (rather then external).

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

Warning
index argument can give problems in resolving this overload versions the other overload of this name. That other overload accepts a container in that position and sometimes compilers default to that rather then this method. The solution is to ensure the index argument is cast explicitly to "unsigned long".
See also
SdsCell().
drama::sds::IdIterator
Parameters
indexThe index of the cell to be accessed. 1 based.
throwOnNotFoundIf true (default), will throw an exception if the an item of 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 cell.

References drama::CreateRunDramaTask(), DramaTHROW_S, and List().