areaDetector  3-13
EPICS areaDetector framework
Public Member Functions | List of all members
PVAttribute Class Reference

Attribute that gets its value from an EPICS PV. More...

#include <PVAttribute.h>

Inheritance diagram for PVAttribute:
NDAttribute

Public Member Functions

 PVAttribute (const char *pName, const char *pDescription, const char *pSource, chtype dbrType)
 Constructor for an EPICS PV attribute. More...
 
 PVAttribute (PVAttribute &attribute)
 Copy constructor for an EPICS PV attribute. More...
 
 ~PVAttribute ()
 
PVAttributecopy (NDAttribute *pAttribute)
 Copies properties from this to pOut. More...
 
virtual int updateValue ()
 Updates the current value of this attribute. More...
 
void connectCallback (struct connection_handler_args cha)
 Connection callback called whenever an EPICS PV connects or disconnects. More...
 
void monitorCallback (struct event_handler_args cha)
 Monitor callback called whenever an EPICS PV changes value. More...
 
int report (FILE *fp, int details)
 Reports on the properties of the PVAttribute object; calls base class NDAttribute::report() to report on the parameter value. More...
 
- Public Member Functions inherited from NDAttribute
 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 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from NDAttribute
static const char * attrSourceString (NDAttrSource_t type)
 

Detailed Description

Attribute that gets its value from an EPICS PV.

Constructor & Destructor Documentation

◆ PVAttribute() [1/2]

PVAttribute::PVAttribute ( const char *  pName,
const char *  pDescription,
const char *  pSource,
chtype  dbrType 
)

Constructor for an EPICS PV attribute.

Parameters
[in]pNameThe name of the attribute to be created; case-insensitive.
[in]pDescriptionThe description of the attribute.
[in]pSourceThe name of the EPICS PV to be used to obtain the attribute value.
[in]dbrTypeThe EPICS DBR_XXX type to be used (DBR_STRING, DBR_DOUBLE, etc). In addition to the normal DBR types a special type, DBR_NATIVE, may be used, which means to use the native data type returned by Channel Access for this PV.

◆ PVAttribute() [2/2]

PVAttribute::PVAttribute ( PVAttribute attribute)

Copy constructor for an EPICS PV attribute.

Parameters
[in]attributeThe PVAttribute to copy from. NOTE: The copy is not "functional", i.e. it does not update when the PV changes, the value is frozen.

◆ ~PVAttribute()

PVAttribute::~PVAttribute ( )

Member Function Documentation

◆ connectCallback()

void PVAttribute::connectCallback ( struct connection_handler_args  cha)

Connection callback called whenever an EPICS PV connects or disconnects.

If it is a connection event it calls ca_add_masked_array_event to request callbacks whenever the value changes.

Parameters
[in]chaConnection handler argument structure passed by channel access.

◆ copy()

PVAttribute * PVAttribute::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 from NDAttribute.

◆ monitorCallback()

void PVAttribute::monitorCallback ( struct event_handler_args  eha)

Monitor callback called whenever an EPICS PV changes value.

Calls NDAttribute::setValue to store the new value.

Parameters
[in]ehaEvent handler argument structure passed by channel access.

◆ report()

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

Reports on the properties of the PVAttribute object; calls base class NDAttribute::report() to report on the parameter value.

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

Reimplemented from NDAttribute.

◆ updateValue()

int PVAttribute::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 from NDAttribute.


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