AAO DRAMA/DRAMA2 C++ Interface
Public Member Functions | List of all members
drama::sds::ArrayWriteHelper< T > Class Template Reference

Detailed Description

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

Helper class for writing data to 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::ArrayWriteHelper< T >:
drama::sds::ArrayAccessHelper< T >

Public Member Functions

 ArrayWriteHelper ()
 Create a drama::sds::ArrayWriteHelper object. More...
 
T * DataAddress ()
 Access the data directly. More...
 
T & operator[] (const unsigned long index)
 SDS array subscript operator - non-const version. More...
 
T const & operator[] (const unsigned long index) const
 SDS array subscript operator - const version. More...
 
- Public Member Functions inherited from drama::sds::ArrayAccessHelper< T >
 ArrayAccessHelper ()
 Create a drama::sds::ArrayAccessHelper object. More...
 
SdsCodeType Code () const
 Return the SDS type code of the item being accessed. More...
 
unsigned long Size () const
 Return the number of elements in the array. More...
 

Additional Inherited Members

- Protected Member Functions inherited from drama::sds::ArrayAccessHelper< T >
T * GetDataAddress ()
 Return the address of the data. More...
 
const T * GetDataAddress () const
 Return the address of the data. More...
 

Constructor & Destructor Documentation

template<typename T >
drama::sds::ArrayWriteHelper< T >::ArrayWriteHelper ( )
inline

Create a drama::sds::ArrayWriteHelper object.

These objects help access the contents of an array of primitive items stored within SDS.

Member Function Documentation

template<typename T >
T* drama::sds::ArrayWriteHelper< T >::DataAddress ( )
inline

Access the data directly.

read/write.

Returns the address of the raw data. The user is responsible for ensuring that any accesses are within the correct range - not more then Size() elements.

References drama::sds::ArrayAccessHelper< T >::GetDataAddress().

template<typename T >
T& drama::sds::ArrayWriteHelper< T >::operator[] ( const unsigned long  index)
inline

SDS array subscript operator - non-const version.

Set/Access the data using the subscript operator

Parameters
indexThe index to access
Returns
A reference to the value.

References drama::sds::ArrayAccessHelper< T >::GetDataAddress().

template<typename T >
T const& drama::sds::ArrayWriteHelper< T >::operator[] ( const unsigned long  index) const
inline

SDS array subscript operator - const version.

Access the data using the subscript operator

Parameters
indexThe index to access
Returns
A reference to the value.

References drama::sds::ArrayAccessHelper< T >::GetDataAddress().


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

Click here for the DRAMA home page and here for the AAO home page.

For more information, contact tjf@aao.gov.au 

Generated on Mon Feb 22 2016 15:57:53 for AAO DRAMA/DRAMA2 C++ Interface by doxygen 1.8.10