areaDetector 3-14
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#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
25#define ND_ERROR -1
26
27
42
59
70
72typedef union {
73 epicsInt8 i8;
74 epicsUInt8 ui8;
75 epicsInt16 i16;
76 epicsUInt16 ui16;
77 epicsInt32 i32;
78 epicsUInt32 ui32;
79 epicsInt64 i64;
80 epicsUInt64 ui64;
81 epicsFloat32 f32;
82 epicsFloat64 f64;
84
92
97public:
98 /* Methods */
99 NDAttribute(const char *pName, const char *pDescription,
100 NDAttrSource_t sourceType, const char *pSource, NDAttrDataType_t dataType, void *pValue);
101 NDAttribute(NDAttribute& attribute);
102 static const char *attrSourceString(NDAttrSource_t type);
103 virtual ~NDAttribute();
104 virtual NDAttribute* copy(NDAttribute *pAttribute);
105 virtual const char *getName();
106 virtual const char *getDescription();
107 virtual const char *getSource();
108 virtual const char *getSourceInfo(NDAttrSource_t *pSourceType);
109 virtual NDAttrDataType_t getDataType();
110 virtual int getValueInfo(NDAttrDataType_t *pDataType, size_t *pDataSize);
111 virtual int getValue(NDAttrDataType_t dataType, void *pValue, size_t dataSize=0);
112 virtual int getValue(std::string& value);
113 virtual int setDataType(NDAttrDataType_t dataType);
114 virtual int setValue(const void *pValue);
115 virtual int setValue(const std::string&);
116 virtual int updateValue();
117 virtual int report(FILE *fp, int details);
118 friend class NDArray;
119 friend class NDAttributeList;
120
121
122private:
123 template <typename epicsType> int getValueT(void *pValue, size_t dataSize);
124 std::string name_;
125 std::string description_;
126 NDAttrDataType_t dataType_;
127 NDAttrValue value_;
128 std::string string_;
129 std::string source_;
130 NDAttrSource_t sourceType_;
131 std::string sourceTypeString_;
132 NDAttributeListNode listNode_;
133};
134
135#endif
#define ADCORE_API
Definition ADCoreAPI.h:41
NDDataType_t dataType
Definition ADPylon.cpp:60
NDDataType_t
Enumeration of NDArray data types.
Definition NDAttribute.h:30
@ NDUInt32
Unsigned 32-bit integer.
Definition NDAttribute.h:36
@ NDUInt16
Unsigned 16-bit integer.
Definition NDAttribute.h:34
@ NDUInt64
Unsigned 64-bit integer.
Definition NDAttribute.h:38
@ NDInt32
Signed 32-bit integer.
Definition NDAttribute.h:35
@ NDFloat64
64-bit float
Definition NDAttribute.h:40
@ NDInt16
Signed 16-bit integer.
Definition NDAttribute.h:33
@ NDFloat32
32-bit float
Definition NDAttribute.h:39
@ NDInt8
Signed 8-bit integer.
Definition NDAttribute.h:31
@ NDUInt8
Unsigned 8-bit integer.
Definition NDAttribute.h:32
@ NDInt64
Signed 64-bit integer.
Definition NDAttribute.h:37
NDAttrDataType_t
Enumeration of NDAttribute attribute data types.
Definition NDAttribute.h:45
@ NDAttrInt64
Signed 64-bit integer.
Definition NDAttribute.h:52
@ NDAttrUInt32
Unsigned 32-bit integer.
Definition NDAttribute.h:51
@ NDAttrFloat64
64-bit float
Definition NDAttribute.h:55
@ NDAttrInt32
Signed 32-bit integer.
Definition NDAttribute.h:50
@ NDAttrString
Dynamic length string.
Definition NDAttribute.h:56
@ NDAttrInt8
Signed 8-bit integer.
Definition NDAttribute.h:46
@ NDAttrFloat32
32-bit float
Definition NDAttribute.h:54
@ NDAttrUInt8
Unsigned 8-bit integer.
Definition NDAttribute.h:47
@ NDAttrUInt16
Unsigned 16-bit integer.
Definition NDAttribute.h:49
@ NDAttrUInt64
Unsigned 64-bit integer.
Definition NDAttribute.h:53
@ NDAttrInt16
Signed 16-bit integer.
Definition NDAttribute.h:48
@ NDAttrUndefined
Undefined data type.
Definition NDAttribute.h:57
NDAttrSource_t
Enumeration of NDAttibute source types.
Definition NDAttribute.h:62
@ NDAttrSourceUndefined
Attribute source is undefined.
Definition NDAttribute.h:68
@ NDAttrSourceConst
Attribute is obtained from a user-specified value in the xml file.
Definition NDAttribute.h:67
@ NDAttrSourceDriver
Attribute is obtained directly from driver.
Definition NDAttribute.h:63
@ NDAttrSourceParam
Attribute is obtained from parameter library.
Definition NDAttribute.h:64
@ NDAttrSourceFunct
Attribute is obtained from a user-specified function.
Definition NDAttribute.h:66
@ NDAttrSourceEPICSPV
Attribute is obtained from an EPICS PV.
Definition NDAttribute.h:65
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition NDArray.h:99
NDAttribute class; an attribute has a name, description, source type, source string,...
Definition NDAttribute.h:96
NDAttributeList.h.
Definition NDAttributeList.h:21
Structure used by the EPICS ellLib library for linked lists of C++ objects.
Definition NDAttribute.h:88
class NDAttribute * pNDAttribute
Definition NDAttribute.h:90
ELLNODE node
Definition NDAttribute.h:89
Union defining the values in an NDAttribute object.
Definition NDAttribute.h:72
epicsUInt32 ui32
Unsigned 32-bit integer.
Definition NDAttribute.h:78
epicsInt8 i8
Signed 8-bit integer.
Definition NDAttribute.h:73
epicsUInt64 ui64
Unsigned 64-bit integer.
Definition NDAttribute.h:80
epicsFloat32 f32
32-bit float
Definition NDAttribute.h:81
epicsUInt16 ui16
Unsigned 16-bit integer.
Definition NDAttribute.h:76
epicsUInt8 ui8
Unsigned 8-bit integer.
Definition NDAttribute.h:74
epicsInt32 i32
Signed 32-bit integer.
Definition NDAttribute.h:77
epicsFloat64 f64
64-bit float
Definition NDAttribute.h:82
epicsInt16 i16
Signed 16-bit integer.
Definition NDAttribute.h:75
epicsInt64 i64
Signed 64-bit integer.
Definition NDAttribute.h:79