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

◆ ArrayAccess() [1/4]

template<typename T >
void drama::sds::Id::ArrayAccess ( ArrayAccessHelper< T > *const  data) const
inline

Access the data of a single dimensional SDS primitive array item of a specified number of elements.

Accesses an array using an ArrayWriteHelper or ArrayReadHelper of the appropriate type.
This version allows access to a one dimensional array of any size. Various other versions also exist.

On return, "data[index]" can be used to access the array element at the specified index. See the sds::AccessArrayHelper:: class for more information.

This version uses the number of elements in the SDS array.

In this example, we instantiate value to provide access to an array of SDS short items.

   sds::Id structure;
   ...
   sds::ArrayReadHelper<short> value;
   structure.ArrayAccess(&value);
   unsigned long count = value.Size();
   for (unsigned long i = 0; i < count ; ++i)
       printf("Element %ld = %d\\n", i, (int)value[i]);
See also
sds::ArrayAccessHelper
sds::ArrayWriteHelper
sds::ArrayReadHelper
Parameters
dataA pointer to an object which allows you to access the underlying SDS data. It must be an Instantiation of a sub-class of ArrayAccessHelper appropiate for type T.
Template Parameters
TThe array access helper to use.

References drama::sds::ArrayAccessHelper< T >::Code(), and drama::CreateRunDramaTask().

Referenced by ArrayAccess().