areaDetector  3-14
EPICS areaDetector framework
Public Member Functions | Static Public Member Functions | Friends | List of all members
NDAttribute Class Reference

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

#include <NDAttribute.h>

Inheritance diagram for NDAttribute:
PVAttribute functAttribute paramAttribute

Public Member Functions

 NDAttribute (const char *pName, const char *pDescription, NDAttrSource_t sourceType, const char *pSource, NDAttrDataType_t dataType, void *pValue)
 NDAttribute constructor. More...
 
 NDAttribute (NDAttribute &attribute)
 NDAttribute copy constructor. More...
 
virtual ~NDAttribute ()
 NDAttribute destructor. More...
 
virtual NDAttributecopy (NDAttribute *pAttribute)
 Copies properties from this to pOut. More...
 
virtual const char * getName ()
 Returns the name of this attribute. More...
 
virtual const char * getDescription ()
 Returns the description of this attribute. More...
 
virtual const char * getSource ()
 Returns the source string of this attribute. More...
 
virtual const char * getSourceInfo (NDAttrSource_t *pSourceType)
 Returns the source information of this attribute. More...
 
virtual NDAttrDataType_t getDataType ()
 Returns the data type of this attribute. More...
 
virtual int getValueInfo (NDAttrDataType_t *pDataType, size_t *pDataSize)
 Returns the data type and size of this attribute. More...
 
virtual int getValue (NDAttrDataType_t dataType, void *pValue, size_t dataSize=0)
 Returns the value of this attribute. More...
 
virtual int getValue (std::string &value)
 Returns the value of an NDAttrString attribute as an std::string. More...
 
virtual int setDataType (NDAttrDataType_t dataType)
 Sets the data type of this attribute. More...
 
virtual int setValue (const void *pValue)
 Sets the value for this attribute. More...
 
virtual int setValue (const std::string &)
 Sets the value for this attribute. More...
 
virtual int updateValue ()
 Updates the current value of this attribute. More...
 
virtual int report (FILE *fp, int details)
 Reports on the properties of the attribute. More...
 

Static Public Member Functions

static const char * attrSourceString (NDAttrSource_t type)
 

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() [1/2]

NDAttribute::NDAttribute ( const char *  pName,
const char *  pDescription,
NDAttrSource_t  sourceType,
const char *  pSource,
NDAttrDataType_t  dataType,
void *  pValue 
)

NDAttribute constructor.

Parameters
[in]pNameThe name of the attribute to be created.
[in]sourceTypeThe source type of the attribute (NDAttrSource_t).
[in]pSourceThe source string for the attribute.
[in]pDescriptionThe description of the attribute.
[in]dataTypeThe data type of the attribute (NDAttrDataType_t).
[in]pValueA pointer to the value for this attribute.

◆ NDAttribute() [2/2]

NDAttribute::NDAttribute ( NDAttribute attribute)

NDAttribute copy constructor.

Parameters
[in]attributeThe attribute to copy from

◆ ~NDAttribute()

NDAttribute::~NDAttribute ( )
virtual

NDAttribute destructor.

Member Function Documentation

◆ attrSourceString()

const char * NDAttribute::attrSourceString ( NDAttrSource_t  type)
static

◆ copy()

NDAttribute * NDAttribute::copy ( NDAttribute pOut)
virtual

Copies properties from this to pOut.

Parameters
[in]pOutA pointer to the output attribute If NULL the output attribute will be created using the copy constructor Only the value is copied, all other fields are assumed to already be the same in pOut
Returns
Returns a pointer to the copy

Reimplemented in PVAttribute, paramAttribute, and functAttribute.

◆ getDataType()

NDAttrDataType_t NDAttribute::getDataType ( )
virtual

Returns the data type of this attribute.

◆ getDescription()

const char * NDAttribute::getDescription ( )
virtual

Returns the description of this attribute.

◆ getName()

const char * NDAttribute::getName ( )
virtual

Returns the name of this attribute.

◆ getSource()

const char * NDAttribute::getSource ( )
virtual

Returns the source string of this attribute.

◆ getSourceInfo()

const char * NDAttribute::getSourceInfo ( NDAttrSource_t pSourceType)
virtual

Returns the source information of this attribute.

Parameters
[out]pSourceTypeSource type (NDAttrSource_t) of this attribute.
Returns
The source type string of this attribute

◆ getValue() [1/2]

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

Returns the value of this attribute.

Parameters
[in]dataTypeData type for the value.
[out]pValuePointer to location to return the value.
[in]dataSizeSize of the input data location; only used when dataType is NDAttrString.

Does data type conversions between numeric data types

◆ getValue() [2/2]

int NDAttribute::getValue ( std::string &  value)
virtual

Returns the value of an NDAttrString attribute as an std::string.

Parameters
[out]valueLocation to return the value.

Does data type conversions between numeric data types

◆ getValueInfo()

int NDAttribute::getValueInfo ( NDAttrDataType_t pDataType,
size_t *  pSize 
)
virtual

Returns the data type and size of this attribute.

Parameters
[out]pDataTypePointer to location to return the data type.
[out]pSizePointer 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.

◆ report()

int NDAttribute::report ( FILE *  fp,
int  details 
)
virtual

Reports on the properties of the attribute.

Parameters
[in]fpFile pointer for the report output.
[in]detailsLevel of report details desired; currently does nothing

Reimplemented in PVAttribute, paramAttribute, and functAttribute.

◆ setDataType()

int NDAttribute::setDataType ( NDAttrDataType_t  type)
virtual

Sets the data type of this attribute.

This can only be called once.

◆ setValue() [1/2]

int NDAttribute::setValue ( const std::string &  value)
virtual

Sets the value for this attribute.

Parameters
[in]valuevalue of this attribute.

◆ setValue() [2/2]

int NDAttribute::setValue ( const void *  pValue)
virtual

Sets the value for this attribute.

Parameters
[in]pValuePointer to the value.

◆ updateValue()

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 PVAttribute, paramAttribute, and functAttribute.

Friends And Related Function Documentation

◆ NDArray

friend class NDArray
friend

◆ NDAttributeList

friend class NDAttributeList
friend

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