1#ifndef _DRAMA2_SDSARRAY_INC
2#define _DRAMA2_SDSARRAY_INC
42 template<
typename SDS_T>
int CodeForType() {
return -1; }
158 unsigned long elements;
167 void SetDataToAddr(
void *
dataAddr) {
177 void SetNumElements(
unsigned long nelem) {
187 void CheckIndexAndData(
unsigned long index)
const {
191 "drama::Sds::ArrayAccessHelper Index %, Code %, elements % - data is invalid", index, code, elements);
193 if (index >= elements)
196 "drama::Sds::ArrayAccessHelper Index %, Code %, elements % - index is invalid", index, code, elements);
227 "ArrayAccessHelper constructor with invalid code %, must be in range 0 to %s",
240 unsigned long Size()
const {
return elements; }
276 template <
typename T>
class ArrayWriteHelper :
public ArrayAccessHelper<T> {
297 this->CheckIndexAndData(index);
307 T
const &
operator[](
const unsigned long index)
const {
311 this->CheckIndexAndData(index);
358 template <
typename T>
class ArrayReadHelper :
public ArrayAccessHelper<T> {
375 T
const &
operator[](
const unsigned long index)
const {
379 this->CheckIndexAndData(index);
SdsCodeType Code() const
Return the SDS type code of the item being accessed.
Definition sdsarray.hh:262
ArrayAccessHelper()
Create a drama::sds::ArrayAccessHelper object.
Definition sdsarray.hh:251
unsigned long Size() const
Return the number of elements in the array.
Definition sdsarray.hh:267
const T * GetDataAddress() const
Return the address of the data.
Definition sdsarray.hh:240
T * GetDataAddress()
Return the address of the data.
Definition sdsarray.hh:233
Helper class for access to an SDS Scalar Arrays.
Definition sdsarray.hh:180
ArrayReadHelper()
Create a drama::sds::ArrayReadHelper object.
Definition sdsarray.hh:393
T const & operator[](const unsigned long index) const
SDS array subscript operator.
Definition sdsarray.hh:402
const T * DataAddress() const
Access the data directly - read only.
Definition sdsarray.hh:417
Helper class for reading data from SDS Scalar Arrays.
Definition sdsarray.hh:385
ArrayWriteHelper()
Create a drama::sds::ArrayWriteHelper object.
Definition sdsarray.hh:311
T & operator[](const unsigned long index)
SDS array subscript operator - non-const version.
Definition sdsarray.hh:320
T const & operator[](const unsigned long index) const
SDS array subscript operator - const version.
Definition sdsarray.hh:334
T * DataAddress()
Access the data directly.
Definition sdsarray.hh:350
Helper class for writing data to SDS Scalar Arrays.
Definition sdsarray.hh:303
A C++ Interface to the handling SDS structures.
Definition sds.hh:428
#define DramaTHROW_S(status_, format_,...)
Throw a Drama exception with safe string formatting.
Definition exception.hh:110
int CodeForType< short >()
Returns the SDS type for a short - SDS_SHORT.
int CodeForType< unsigned short >()
Returns the SDS type for an unsigned short - SDS_USHORT.
int CodeForType< double >()
Returns the SDS type for a double - SDS_DOUBLE.
int CodeForType< const std::string & >()
Returns the SDS type for a string - ARG_STRING.
int CodeForType< signed char >()
Returns the SDS type for a signed char - SDS_BYTE.
int CodeForType< char >()
Returns the SDS type for a char - SDS_CHAR.
int CodeForType< unsigned char >()
Returns the SDS type for an unsigned char - SDS_UBYTE.
int CodeForType< INT64 >()
Returns the SDS type for a 64 bit integer - SDS_I64.
int CodeForType()
Functions which returns the SDS type of a given C type.
Definition sdsarray.hh:69
int CodeForType< UINT32 >()
Returns the SDS type for an unsigned integer - SDS_UINT.
int CodeForType< float >()
Returns the SDS type for a flat - SDS_FLOAT.
int CodeForType< UINT64 >()
Returns the SDS type for an unsigned 64 bit integer - SDS_UI64.
int CodeForType< INT32 >()
Returns the SDS type for a 32 bit integer - SDS_INT.
int CodeForType< bool >()
Return the SDS type code for C - SDS_SHORT
void CreateRunDramaTask()
Create and run a DRAMA task, with standard exception handling.
Definition task.hh:1322
The drama namespace contains all the classes, types etc of the DRAMA 2 implementation.
Definition drama.hh:93