AAO DRAMA C++ Interface (Old style)
DRAMA C++, Depreciated, don't use for new code

◆ ArrayAccess() [1/4]

template<typename T >
void SdsId::ArrayAccess ( const unsigned long  expitems,
SdsArrayAccessHelper< T > *const  data,
StatusType *const  status 
)
inline

Access the data of a single dimensional SDS array.

Accesses an array using an SdsArrayAccessHelper of the appropiate 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.

In this version uses the number of elements in the SDS array must match the specified number of elements, otherwise status is set to SDS__INVDIMS.

Remarks
Only available if the marcro DRAMA_ALLOW_CPP_STDLIB is defined.

In this example, SdsArrayShort is a sub-class of SdsArrayAccessHelper.

   SdsId structure;
   ...
   SdsArrayShort value;
   structure.ArrayAccess(10, &value, status);
   if (*status == STATUS__OK)
   {
      for (unsigned long i = 0; i < 10 ; ++i)
        printf("Element %ld = %d\\n", i, (int)value[i]);
   }
  • See also
    SdsArrayAccessHelper
    Parameters
    expitemsThe number of items expected in the array.
    dataA pointer to an object which allows you to access the underlying SDS data. It must be a sub-class of SdsArrayAccessHelper appropiate for type T.
    statusInherited status. In addition to the values returned by SdsInfo() and SdsPointer(), the values SDS__TYPE, SDS__NOTARR and SDS__INVDIMS may be returned.

References SdsArrayAccessHelper< T >::Code().