DRAMA C++ Intro   Class Hierarchy   Alphabetical List of types   List of Classes   File List   Class Member Index   File Members Index   Related Pages  

Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
SdsArrayAccessHelper< T > Class Template Reference

Helper class for access to an SDS Scaler Array. More...

#include <sds.h>

Classes

class  InvalidIndexException
 This class is thrown by the SdsArrayAccessHelper index operator when it is found the index is invalid. More...
 
class  NoDataException
 This class is thrown by the SdsArraAccessHelper index operator when it is found there is no data to access. More...
 

Public Member Functions

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...
 
T const & operator[] (const unsigned long index) const
 SDS array subscript operator (const version) More...
 
T & operator[] (const unsigned long index)
 SDS array subscript operator (non-const version) More...
 
T * DataAddressRW ()
 Access the data directly. More...
 
const T * DataAddressRO () const
 Access the data directly - read only. More...
 

Protected Member Functions

 SdsArrayAccessHelper (SdsCodeType c)
 Constructor - only available to sub-classes. More...
 

Friends

class SdsId
 

Detailed Description

template<typename T>
class SdsArrayAccessHelper< T >

Helper class for access to an SDS Scaler Array.

This is Data helper class for the ArrayAccess methods of the SdsId:: class. The main point here is to set up a releationship between an SDS data type and the relevant underlying Sds code - SdsCodeType of the SDS scalar array we wish to access. Once the relationship is set up (by creating an subclass using this template) and a call is made to SdsId::ArrayAccess(), then the methods of this class allow access to the data using the index operator.

Warning
The array index operator will throw an NoDataException exception if there is no data to access or a InvalidIndexException exception if the index for the data is invalid.
See also
SdsId::ArrayAccess

Various defined Instantiations of this template are provided - for each SDS code associated with the a scalar.

See also
SdsArrayChar
SdsArrayUbyte
SdsArrayByte
SdsArrayShort
SdsArrayUshort
SdsArrayINT32
SdsArrayUINT32
SdsArrayINT64
SdsArrayUINT64
SdsArrayFloat
SdsArrayDouble

Constructor & Destructor Documentation

template<typename T>
SdsArrayAccessHelper< T >::SdsArrayAccessHelper ( SdsCodeType  c)
inlineprotected

Constructor - only available to sub-classes.

Construct an SdsArrayAccessHelper item. Only sub-classes can invoke this.

Parameters
cThe SDS Code assoicated with the template type.

Member Function Documentation

template<typename T>
SdsCodeType SdsArrayAccessHelper< T >::Code ( ) const
inline

Return the SDS type code of the item being accessed.

Referenced by SdsId::ArrayAccess().

template<typename T>
const T* SdsArrayAccessHelper< T >::DataAddressRO ( ) const
inline

Access the data directly - read only.

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.

template<typename T>
T* SdsArrayAccessHelper< T >::DataAddressRW ( )
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.

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

SDS array subscript operator (const version)

Access the data using the subscript operator - the only way of getting at the data at the moment.

Exceptions
SdsArrayAccessHelper::NoDataExceptionNormally indicates that the array access operation failed.
SdsArrayAccessHelper::InvalidIndexExceptionThe index is invalid.
Parameters
indexThe index to access
Returns
A reference to the value.
template<typename T>
T& SdsArrayAccessHelper< T >::operator[] ( const unsigned long  index)
inline

SDS array subscript operator (non-const version)

Set/Access the data using the subscript operator - the only way of getting at the data at the moment.

Exceptions
SdsArrayAccessHelper::NoDataException,:Normally indicates that the array access operation failed.
SdsArrayAccessHelper::InvalidIndexException,:The index is invalid.
Parameters
indexThe index to access
Returns
A reference to the value.
template<typename T>
unsigned long SdsArrayAccessHelper< T >::Size ( ) const
inline

Return the number of elements in the array.


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 13:58:31 for AAO DRAMA C++ Interfaces by doxygen 1.8.10