NDAttribute Class Reference

NDAttribute class; an attribute has a name, description, source type, source string, data type, and value. More...

#include <NDArray.h>

Inheritance diagram for NDAttribute:

paramAttribute PVAttribute

List of all members.

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 NDAttributecopy (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


Detailed Description

NDAttribute class; an attribute has a name, description, source type, source string, data type, and value.

Constructor & Destructor Documentation

NDAttribute::NDAttribute ( const char *  pName,
const char *  pDescription = "",
NDAttrDataType_t  dataType = NDAttrUndefined,
void *  pValue = NULL 
)

NDAttribute constructor.

Parameters:
[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.


Member Function Documentation

NDAttribute * NDAttribute::copy ( NDAttribute pOut  )  [virtual]

Copies properties from this to pOut.

Parameters:
[in] pOut A pointer to the output attribute If NULL the output attribute will be created.
Returns:
Returns a pointer to the copy

int NDAttribute::getValue ( NDAttrDataType_t  dataType,
void *  pValue,
size_t  dataSize = 0 
) [virtual]

Returns the value of this attribute.

Parameters:
[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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[in] pSource String with the source.

int NDAttribute::setValue ( NDAttrDataType_t  dataType,
void *  pValue 
) [virtual]

Sets the value for this attribute.

Parameters:
[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.


Friends And Related Function Documentation

friend class NDArray [friend]

friend class NDAttributeList [friend]


Member Data Documentation

Data type of attribute.

Used for NDAttributeList.

Description string.

Name string.

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.

Value of attribute unless it is a string.


The documentation for this class was generated from the following files:

Generated on Tue Aug 9 14:44:38 2011 for areaDetector by  doxygen 1.5.7.1