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