areaDetector  3-5-0
EPICS areaDetector framework
ntndArrayConverter.h
Go to the documentation of this file.
1 #include <NDArray.h>
2 #include <pv/ntndarray.h>
3 
4 typedef struct NTNDArrayInfo
5 {
6  int ndims;
13 
14  struct
15  {
16  int dim;
17  size_t size, stride;
18  }x, y, color;
20 
21 class epicsShareClass NTNDArrayConverter
22 {
23 public:
24  NTNDArrayConverter(epics::nt::NTNDArrayPtr array);
25 
26  NTNDArrayInfo_t getInfo (void);
27  void toArray (NDArray *dest);
28  void fromArray (NDArray *src);
29 
30 private:
31  epics::nt::NTNDArrayPtr m_array;
32 
33  epics::pvData::ScalarType getValueType (void);
34  NDColorMode_t getColorMode (void);
35 
36  template <typename arrayType>
37  void toValue (NDArray *dest);
38  void toValue (NDArray *dest);
39 
40  void toDimensions (NDArray *dest);
41  void toTimeStamp (NDArray *dest);
42  void toDataTimeStamp (NDArray *dest);
43 
44  template <typename pvAttrType, typename valueType>
45  void toAttribute (NDArray *dest, epics::pvData::PVStructurePtr src);
46  void toStringAttribute (NDArray *dest, epics::pvData::PVStructurePtr src);
47  void toUndefinedAttribute (NDArray *dest, epics::pvData::PVStructurePtr src);
48  void toAttributes (NDArray *dest);
49 
50  template <typename arrayType, typename srcDataType>
51  void fromValue (NDArray *src);
52  void fromValue (NDArray *src);
53 
54  void fromDimensions (NDArray *src);
55  void fromTimeStamp (NDArray *src);
56  void fromDataTimeStamp (NDArray *src);
57 
58  template <typename pvAttrType, typename valueType>
59  void fromAttribute (epics::pvData::PVStructurePtr dest, NDAttribute *src);
60  void fromStringAttribute (epics::pvData::PVStructurePtr dest, NDAttribute *src);
61  void fromUndefinedAttribute (epics::pvData::PVStructurePtr dest);
62  void fromAttributes (NDArray *src);
63 };
64 
65 typedef std::tr1::shared_ptr<NTNDArrayConverter> NTNDArrayConverterPtr;
struct NTNDArrayInfo NTNDArrayInfo_t
struct NTNDArrayInfo::@6 color
NDDataType_t
Enumeration of NDArray data types.
Definition: NDAttribute.h:27
int ndims
Definition: ntndArrayConverter.h:6
#define ND_ARRAY_MAX_DIMS
NDArray.h.
Definition: NDArray.h:25
Definition: ntndArrayConverter.h:4
size_t nElements
Definition: ntndArrayConverter.h:8
NDColorMode_t colorMode
Definition: ntndArrayConverter.h:10
size_t totalBytes
Definition: ntndArrayConverter.h:8
NDColorMode_t
Enumeration of color modes for NDArray attribute "colorMode".
Definition: NDArray.h:28
struct NTNDArrayInfo::@6 y
size_t size
Definition: ntndArrayConverter.h:17
Definition: ntndArrayConverter.h:21
int dim
Definition: ntndArrayConverter.h:16
NDDataType_t dataType
Definition: ntndArrayConverter.h:11
int bytesPerElement
Definition: ntndArrayConverter.h:9
NDAttribute class; an attribute has a name, description, source type, source string,...
Definition: NDAttribute.h:87
std::string codec
Definition: ntndArrayConverter.h:12
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:92
Definition: NDFileHDF5Layout.h:42
size_t dims[ND_ARRAY_MAX_DIMS]
Definition: ntndArrayConverter.h:7
size_t stride
Definition: ntndArrayConverter.h:17
struct NTNDArrayInfo::@6 x
std::tr1::shared_ptr< NTNDArrayConverter > NTNDArrayConverterPtr
Definition: ntndArrayConverter.h:65