areaDetector  3-5-0
EPICS areaDetector framework
NDAttribute.h
Go to the documentation of this file.
1 
9 #ifndef NDAttribute_H
10 #define NDAttribute_H
11 
12 #include <string>
13 
14 #include <stdio.h>
15 #include <string.h>
16 
17 #include <ellLib.h>
18 #include <epicsTypes.h>
19 
21 #define ND_SUCCESS 0
22 
23 #define ND_ERROR -1
24 
25 
27 typedef enum
28 {
37 } NDDataType_t;
38 
40 typedef enum
41 {
53 
55 typedef enum
56 {
63 
65 typedef union {
66  epicsInt8 i8;
67  epicsUInt8 ui8;
68  epicsInt16 i16;
69  epicsUInt16 ui16;
70  epicsInt32 i32;
71  epicsUInt32 ui32;
72  epicsFloat32 f32;
73  epicsFloat64 f64;
74 } NDAttrValue;
75 
79 typedef struct NDAttributeListNode {
80  ELLNODE node;
83 
87 class epicsShareClass NDAttribute {
88 public:
89  /* Methods */
90  NDAttribute(const char *pName, const char *pDescription,
91  NDAttrSource_t sourceType, const char *pSource, NDAttrDataType_t dataType, void *pValue);
92  NDAttribute(NDAttribute& attribute);
93  static const char *attrSourceString(NDAttrSource_t type);
94  virtual ~NDAttribute();
95  virtual NDAttribute* copy(NDAttribute *pAttribute);
96  virtual const char *getName();
97  virtual const char *getDescription();
98  virtual const char *getSource();
99  virtual const char *getSourceInfo(NDAttrSource_t *pSourceType);
100  virtual NDAttrDataType_t getDataType();
101  virtual int getValueInfo(NDAttrDataType_t *pDataType, size_t *pDataSize);
102  virtual int getValue(NDAttrDataType_t dataType, void *pValue, size_t dataSize=0);
103  virtual int getValue(std::string& value);
104  virtual int setDataType(NDAttrDataType_t dataType);
105  virtual int setValue(const void *pValue);
106  virtual int setValue(const std::string&);
107  virtual int updateValue();
108  virtual int report(FILE *fp, int details);
109  friend class NDArray;
110  friend class NDAttributeList;
111 
112 
113 private:
114  template <typename epicsType> int getValueT(void *pValue, size_t dataSize);
115  std::string name_;
116  std::string description_;
117  NDAttrDataType_t dataType_;
118  NDAttrValue value_;
119  std::string string_;
120  std::string source_;
121  NDAttrSource_t sourceType_;
122  std::string sourceTypeString_;
123  NDAttributeListNode listNode_;
124 };
125 
126 #endif
ELLNODE node
Definition: NDAttribute.h:80
Signed 16-bit integer.
Definition: NDAttribute.h:44
NDDataType_t
Enumeration of NDArray data types.
Definition: NDAttribute.h:27
NDAttrDataType_t
Enumeration of NDAttribute attribute data types.
Definition: NDAttribute.h:40
epicsFloat32 f32
32-bit float
Definition: NDAttribute.h:72
Signed 32-bit integer.
Definition: NDAttribute.h:33
Attribute is obtained directly from driver.
Definition: NDAttribute.h:57
Unsigned 16-bit integer.
Definition: NDAttribute.h:32
Attribute is obtained from a user-specified function.
Definition: NDAttribute.h:60
Signed 8-bit integer.
Definition: NDAttribute.h:42
32-bit float
Definition: NDAttribute.h:48
NDAttrSource_t
Enumeration of NDAttibute source types.
Definition: NDAttribute.h:55
epicsUInt16 ui16
Unsigned 16-bit integer.
Definition: NDAttribute.h:69
list value
Definition: makeDbAndEdl.py:234
Signed 8-bit integer.
Definition: NDAttribute.h:29
epicsUInt8 ui8
Unsigned 8-bit integer.
Definition: NDAttribute.h:67
Signed 32-bit integer.
Definition: NDAttribute.h:46
epicsUInt32 ui32
Unsigned 32-bit integer.
Definition: NDAttribute.h:71
Attribute is obtained from an EPICS PV.
Definition: NDAttribute.h:59
epicsFloat64 f64
64-bit float
Definition: NDAttribute.h:73
class NDAttribute * pNDAttribute
Definition: NDAttribute.h:81
struct NDAttributeListNode NDAttributeListNode
Structure used by the EPICS ellLib library for linked lists of C++ objects.
Undefined data type.
Definition: NDAttribute.h:51
Unsigned 8-bit integer.
Definition: NDAttribute.h:30
Dynamic length string.
Definition: NDAttribute.h:50
NDAttributeList.h.
Definition: NDAttributeList.h:21
Union defining the values in an NDAttribute object.
Definition: NDAttribute.h:65
64-bit float
Definition: NDAttribute.h:36
epicsInt8 i8
Signed 8-bit integer.
Definition: NDAttribute.h:66
Signed 16-bit integer.
Definition: NDAttribute.h:31
Unsigned 32-bit integer.
Definition: NDAttribute.h:34
32-bit float
Definition: NDAttribute.h:35
epicsInt16 i16
Signed 16-bit integer.
Definition: NDAttribute.h:68
epicsInt32 i32
Signed 32-bit integer.
Definition: NDAttribute.h:70
NDAttribute class; an attribute has a name, description, source type, source string,...
Definition: NDAttribute.h:87
Structure used by the EPICS ellLib library for linked lists of C++ objects.
Definition: NDAttribute.h:79
64-bit float
Definition: NDAttribute.h:49
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
Unsigned 8-bit integer.
Definition: NDAttribute.h:43
Attribute source is undefined.
Definition: NDAttribute.h:61
Attribute is obtained from parameter library.
Definition: NDAttribute.h:58
Unsigned 16-bit integer.
Definition: NDAttribute.h:45
Unsigned 32-bit integer.
Definition: NDAttribute.h:47