'Classic' CCA c++ binding (ccaffeine-only) 0.5.7
Public Types | Public Member Functions | List of all members
classic::gov::cca::RawData Class Reference

A low-level interface for accessing memory. More...

#include <RawData.h>

Inheritance diagram for classic::gov::cca::RawData:
Inheritance graph
[legend]
Collaboration diagram for classic::gov::cca::RawData:
Collaboration graph
[legend]

Public Types

enum  Type {
  Err = 0 , Byte = 1 , Bool = 2 , Char = 3 ,
  WChar = 4 , Int1 = 5 , Int2 = 6 , Int4 = 7 ,
  Int8 = 8 , UInt1 = 9 , UInt2 = 10 , UInt4 = 11 ,
  UInt8 = 12 , Float4 = 13 , Float8 = 14 , Float16 = 15 ,
  Complex4 = 16 , Complex8 = 17 , Complex16 = 18 , Complex32 = 19 ,
  PtrByte = 65 , PtrBool = 66 , PtrChar = 67 , PtrWChar = 68 ,
  PtrInt1 = 69 , PtrInt2 = 70 , PtrInt4 = 71 , PtrInt8 = 72 ,
  PtrUInt1 = 73 , PtrUInt2 = 74 , PtrUInt4 = 75 , PtrUInt8 = 76 ,
  PtrFloat4 = 77 , PtrFloat8 = 78 , PtrFloat16 = 79 , PtrComplex4 = 80 ,
  PtrComplex8 = 81 , PtrComplex16 = 82 , PtrComplex32 = 83 , PtrRawData = 84
}
 An enum over C/Fortran primitives in multiple precisions. More...
 

Public Member Functions

virtual const char * getName () CLASSIC_CCA_PURE
 Name associated with this set of buffers.
 
virtual int getNumberOfBuffers () CLASSIC_CCA_PURE
 The total number of encapsulated buffers.
 
virtual void getBufferInfo (int bufferIndex, const char *&elementName, enum RawDataType &elementType, int &elementCount, void *&buffer) CLASSIC_CCA_PURE
 Returns information about the buffer at the given index.
 
virtual unsigned long sizeofDataType (enum RawDataType) CLASSIC_CCA_PURE
 Returns the size of the given RawDataType in bytes.
 
- Public Member Functions inherited from classic::gov::cca::Port
virtual ~Port ()
 obligatory virtual destructor
 

Detailed Description

A low-level interface for accessing memory.

This interface is designed principally for writers of tools rather than end users because it provides pointers directly to computer memory. This interface may be an efficient way to copy data between components, but end users are normally encouraged to use higher-level interfaces or "views" on data. An example would be one providing for array access patterns.

Another use of this interface is to provide a wrapper for user defined types, as each element can be assigned a unique name. In addition to the primitive data types (and pointers to them), a data element can be a pointer to a RawData object instance, which allows for use of the composite design pattern.

Member Enumeration Documentation

◆ Type

An enum over C/Fortran primitives in multiple precisions.

52 {
53 Err = 0,
54 Byte = 1,
55 Bool = 2,
56 Char = 3,
57 WChar = 4,
58 Int1 = 5,
59 Int2 = 6,
60 Int4 = 7,
61 Int8 = 8,
62 UInt1 = 9,
63 UInt2 = 10,
64 UInt4 = 11,
65 UInt8 = 12,
66 Float4 = 13,
67 Float8 = 14,
68 Float16 = 15,
69 Complex4 = 16,
70 Complex8 = 17,
71 Complex16 = 18,
72 Complex32 = 19,
73 PtrByte = 65,
74 PtrBool = 66,
75 PtrChar = 67,
76 PtrWChar = 68,
77 PtrInt1 = 69,
78 PtrInt2 = 70,
79 PtrInt4 = 71,
80 PtrInt8 = 72,
81 PtrUInt1 = 73,
82 PtrUInt2 = 74,
83 PtrUInt4 = 75,
84 PtrUInt8 = 76,
85 PtrFloat4 = 77,
86 PtrFloat8 = 78,
87 PtrFloat16 = 79,
88 PtrComplex4 = 80,
89 PtrComplex8 = 81,
90 PtrComplex16 = 82,
91 PtrComplex32 = 83,
92 PtrRawData = 84
93 };

Member Function Documentation

◆ getName()

virtual const char * classic::gov::cca::RawData::getName ( )
virtual

Name associated with this set of buffers.

Returns
the name.

◆ getNumberOfBuffers()

virtual int classic::gov::cca::RawData::getNumberOfBuffers ( )
virtual

The total number of encapsulated buffers.

Returns
nBuffers.

◆ getBufferInfo()

virtual void classic::gov::cca::RawData::getBufferInfo ( int  bufferIndex,
const char *&  elementName,
enum RawDataType &  elementType,
int &  elementCount,
void *&  buffer 
)
virtual

Returns information about the buffer at the given index.

Buffers are indexed from 0 .. getNumberOfBuffers-1.

Parameters
bufferIndexInput: the index (from 0) of buffer requested.
elementNameOutput: name associated with the buffer (default value is "_UNNAMED")
elementTypeOutput: enumerated type of the elements in the buffer.
elementCountOutput: length of the buffer.
bufferOutput: pointer to data buffer.

◆ sizeofDataType()

virtual unsigned long classic::gov::cca::RawData::sizeofDataType ( enum  RawDataType)
virtual

Returns the size of the given RawDataType in bytes.


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