AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Member Functions | Protected Member Functions | List of all members
drama::sds::ArrayReadHelper< T > Class Template Reference

Detailed Description

template<typename T>
class drama::sds::ArrayReadHelper< T >

Helper class for reading data from SDS Scalar Arrays.

This is Data helper class for the ArrayAccess methods of the sds::Id class. The main point here is to set up a relationship between a primitive data type and the relevant underlying SDS primitive types (SdsCodeType) of the SDS scalar array we wish to access.

The user creates an object of this type, specifying the data type of the primitive item. They then call drama::sds::Id::ArrayAccess() with the address of this item.
From that point, you can use the methods of this object to access the data.

The type specified for the template must be one of the SDS primitive data types, being double, float, short, INT32, INT64, unsigned short, UINT32, UINT64, signed char, or unsigned char.

Warning
The array index operator will throw a exception if there is no data to access or if the index for the data is invalid.
See also
drama::sds::Id::ArrayAccess
Template Parameters
TThe type of the SDS primitive type we are accessing, one of double, float, short, INT32, INT64, unsigned short, UINT32, UINT64, signed char, or unsigned char.

#include "sdsarray.hh"

Inheritance diagram for drama::sds::ArrayReadHelper< T >:
drama::sds::ArrayAccessHelper< T >

Public Member Functions

 ArrayReadHelper ()
 Create a drama::sds::ArrayReadHelper object.
 
SdsCodeType Code () const
 Return the SDS type code of the item being accessed.
 
const T * DataAddress () const
 Access the data directly - read only.
 
T constoperator[] (const unsigned long index) const
 SDS array subscript operator.
 
unsigned long Size () const
 Return the number of elements in the array.
 

Protected Member Functions

T * GetDataAddress ()
 Return the address of the data.
 
const T * GetDataAddress () const
 Return the address of the data.
 

The documentation for this class was generated from the following file: