|
AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
|
inline |
Access the data of an SDS primitive item array.
Number of dimensions specified, actual size from data.
Accesses an array using an ArrayWriteHelper or ArrayReadHelper of the appropriate type.
This version allows access to an array of a specified number of dimensions. Various other versions also exist.
On return, "data[index]" can be used to access the array element at the specified index. See the sds::ArrayAccessHelper:: class for more information. Note that Multidimensional arrays must be indexed by calculating the equivalent single dimensional index (otherwise the type definitions are too hard).
In this example, we instantiate value to provide access to a 1 dimensional array of SDS short items.
sds::Id structure; ... std::vector<unsigned long> dims; sds::ArrayReadHelper<short> value; structure.ArrayAccess(&value, 1, &dims); for (unsigned long i = 0; i < dims[0] ; ++i) printf("Element %ld = %d\\n", i, (int)value[i]);
| data | A pointer to an object which allows you to access the underlying SDS data. It must be an Instantiations of a sub-class of ArrayAccessHelper appropriate for type T. |
| ndims | The number of dimensions there should be in the structure. |
| dims | The dimensions are written to this array. This container will be cleared and then push_back() applied up to 7 times. |
| T | The array access helper to use. |
| ContainerType | A container with clear() and push_back() methods. The push_back() method must accept unsigned long items. |
References drama::sds::ArrayAccessHelper< T >::Code(), drama::CreateRunDramaTask(), and DramaTHROW_F.