areaDetector 1-8
|
NDAttribute class; an attribute has a name, description, source type, source string, data type, and value. More...
#include <NDArray.h>
Public Member Functions | |
NDAttribute (const char *pName, const char *pDescription="", NDAttrDataType_t dataType=NDAttrUndefined, void *pValue=NULL) | |
NDAttribute constructor. | |
virtual | ~NDAttribute () |
NDAttribute destructor Frees the strings for the name, and if they exist, the description and pString. | |
virtual NDAttribute * | copy (NDAttribute *pAttribute) |
Copies properties from this to pOut. | |
virtual int | setDescription (const char *pDescription) |
Sets the description string for this attribute. | |
virtual int | setSource (const char *pSource) |
Sets the source string for this attribute. | |
virtual int | getValueInfo (NDAttrDataType_t *pDataType, size_t *pDataSize) |
Returns the data type and size of this attribute. | |
virtual int | getValue (NDAttrDataType_t dataType, void *pValue, size_t dataSize=0) |
Returns the value of this attribute. | |
virtual int | setValue (NDAttrDataType_t dataType, void *pValue) |
Sets the value for this attribute. | |
virtual int | updateValue () |
Updates the current value of this attribute. | |
virtual int | report (int details) |
Reports on the properties of the attribute. | |
Public Attributes | |
char * | pName |
Name string. | |
char * | pDescription |
Description string. | |
char * | pSource |
Source string - EPICS PV name or DRV_INFO string. | |
NDAttrSource_t | sourceType |
Source type; driver hardcoded, EPICS PV or driver/plugin parameter. | |
NDAttrDataType_t | dataType |
Data type of attribute. | |
Protected Attributes | |
NDAttrValue | value |
Value of attribute unless it is a string. | |
char * | pString |
Value when attribute type is NDAttrString; dynamic length string. | |
NDAttributeListNode | listNode |
Used for NDAttributeList. | |
Friends | |
class | NDArray |
class | NDAttributeList |
NDAttribute class; an attribute has a name, description, source type, source string, data type, and value.
NDAttribute::NDAttribute | ( | const char * | pName, |
const char * | pDescription = "" , |
||
NDAttrDataType_t | dataType = NDAttrUndefined , |
||
void * | pValue = NULL |
||
) |
NDAttribute constructor.
[in] | pName | The name of the attribute to be created. |
[in] | pDescription | The description of the attribute. |
[in] | dataType | The data type of the attribute. |
[in] | pValue | A pointer to the value for this attribute. |
NDAttribute::~NDAttribute | ( | ) | [virtual] |
NDAttribute destructor Frees the strings for the name, and if they exist, the description and pString.
NDAttribute * NDAttribute::copy | ( | NDAttribute * | pOut | ) | [virtual] |
Copies properties from this to pOut.
[in] | pOut | A pointer to the output attribute If NULL the output attribute will be created. |
int NDAttribute::getValue | ( | NDAttrDataType_t | dataType, |
void * | pValue, | ||
size_t | dataSize = 0 |
||
) | [virtual] |
Returns the value of this attribute.
[in] | dataType | Data type for the value. |
[out] | pValue | Pointer to location to return the value. |
[in] | dataSize | Size of the input data location; only used when dataType is NDAttrString. |
Currently the dataType parameter is only used to check that it matches the actual data type, and ND_ERROR is returned if it does not. In the future data type conversion may be added.
int NDAttribute::getValueInfo | ( | NDAttrDataType_t * | pDataType, |
size_t * | pSize | ||
) | [virtual] |
Returns the data type and size of this attribute.
[out] | pDataType | Pointer to location to return the data type. |
[out] | pSize | Pointer to location to return the data size; this is the data type size for all data types except NDAttrString, in which case it is the length of the string including 0 terminator. |
int NDAttribute::report | ( | int | details | ) | [virtual] |
Reports on the properties of the attribute.
[in] | details | Level of report details desired; currently does nothing |
Reimplemented in paramAttribute, and PVAttribute.
int NDAttribute::setDescription | ( | const char * | pDescription | ) | [virtual] |
Sets the description string for this attribute.
This method must be used to set the description string; pDescription must not be directly modified.
[in] | pDescription | String with the desciption. |
int NDAttribute::setSource | ( | const char * | pSource | ) | [virtual] |
Sets the source string for this attribute.
This method must be used to set the source string; pSource must not be directly modified.
[in] | pSource | String with the source. |
int NDAttribute::setValue | ( | NDAttrDataType_t | dataType, |
void * | pValue | ||
) | [virtual] |
Sets the value for this attribute.
[in] | dataType | Data type of the value. |
[in] | pValue | Pointer to the value. |
int NDAttribute::updateValue | ( | ) | [virtual] |
Updates the current value of this attribute.
The base class does nothing, but derived classes may fetch the current value of the attribute, for example from an EPICS PV or driver parameter library.
Reimplemented in paramAttribute.
friend class NDArray [friend] |
friend class NDAttributeList [friend] |
Data type of attribute.
NDAttributeListNode NDAttribute::listNode [protected] |
Used for NDAttributeList.
Description string.
char* NDAttribute::pName |
Name string.
char* NDAttribute::pSource |
Source string - EPICS PV name or DRV_INFO string.
char* NDAttribute::pString [protected] |
Value when attribute type is NDAttrString; dynamic length string.
Source type; driver hardcoded, EPICS PV or driver/plugin parameter.
NDAttrValue NDAttribute::value [protected] |
Value of attribute unless it is a string.