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

NDAttributeList.h. More...

#include <NDAttributeList.h>

Public Member Functions

 NDAttributeList ()
 NDAttributeList.cpp. More...
 
 ~NDAttributeList ()
 NDAttributeList destructor. More...
 
int add (NDAttribute *pAttribute)
 Adds an attribute to the list. More...
 
NDAttributeadd (const char *pName, const char *pDescription="", NDAttrDataType_t dataType=NDAttrUndefined, void *pValue=NULL)
 Adds an attribute to the list. More...
 
NDAttributefind (const char *pName)
 Finds an attribute by name; the search is now case sensitive (R1-10) More...
 
NDAttributenext (NDAttribute *pAttribute)
 Finds the next attribute in the linked list of attributes. More...
 
int count ()
 Returns the total number of attributes in the list of attributes. More...
 
int remove (const char *pName)
 Removes an attribute from the list. More...
 
int clear ()
 Deletes all attributes from the list. More...
 
int copy (NDAttributeList *pOut)
 Copies all attributes from one attribute list to another. More...
 
int updateValues ()
 Updates all attribute values in the list; calls NDAttribute::updateValue() for each attribute in the list. More...
 
int report (FILE *fp, int details)
 Reports on the properties of the attribute list. More...
 

Detailed Description

NDAttributeList.h.

Mark Rivers University of Chicago October 18, 2013 NDAttributeList class; this is a linked list of attributes.

Constructor & Destructor Documentation

◆ NDAttributeList()

NDAttributeList::NDAttributeList ( )

NDAttributeList.cpp.

Mark Rivers University of Chicago October 18, 2013 NDAttributeList constructor

◆ ~NDAttributeList()

NDAttributeList::~NDAttributeList ( )

NDAttributeList destructor.

Member Function Documentation

◆ add() [1/2]

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

Adds an attribute to the list.

This is a convenience function for adding attributes to a list. It first searches the list to see if there is an existing attribute with the same name. If there is it just changes the properties of the existing attribute. If not, it creates a new attribute with the specified properties. IMPORTANT: This method is only capable of creating attributes of the NDAttribute base class type, not derived class attributes. To add attributes of a derived class to a list the NDAttributeList::add(NDAttribute*) method must be used.

Parameters
[in]pNameThe name of the attribute to be added.
[in]pDescriptionThe description of the attribute.
[in]dataTypeThe data type of the attribute.
[in]pValueA pointer to the value for this attribute.

◆ add() [2/2]

int NDAttributeList::add ( NDAttribute pAttribute)

Adds an attribute to the list.

If an attribute of the same name already exists then the existing attribute is deleted and replaced with the new one.

Parameters
[in]pAttributeA pointer to the attribute to add.

◆ clear()

int NDAttributeList::clear ( )

Deletes all attributes from the list.

◆ copy()

int NDAttributeList::copy ( NDAttributeList pListOut)

Copies all attributes from one attribute list to another.

It is efficient so that if the attribute already exists in the output list it just copies the properties, and memory allocation is minimized. The attributes are added to any existing attributes already present in the output list.

Parameters
[out]pListOutA pointer to the output attribute list to copy to.

◆ count()

int NDAttributeList::count ( )

Returns the total number of attributes in the list of attributes.

Returns
Returns the number of attributes.

◆ find()

NDAttribute * NDAttributeList::find ( const char *  pName)

Finds an attribute by name; the search is now case sensitive (R1-10)

Parameters
[in]pNameThe name of the attribute to be found.
Returns
Returns a pointer to the attribute if found, NULL if not found.

◆ next()

NDAttribute * NDAttributeList::next ( NDAttribute pAttributeIn)

Finds the next attribute in the linked list of attributes.

Parameters
[in]pAttributeInA pointer to the previous attribute in the list; if NULL the first attribute in the list is returned.
Returns
Returns a pointer to the next attribute if there is one, NULL if there are no more attributes in the list.

◆ remove()

int NDAttributeList::remove ( const char *  pName)

Removes an attribute from the list.

Parameters
[in]pNameThe name of the attribute to be deleted.
Returns
Returns ND_SUCCESS if the attribute was found and deleted, ND_ERROR if the attribute was not found.

◆ report()

int NDAttributeList::report ( FILE *  fp,
int  details 
)

Reports on the properties of the attribute list.

Parameters
[in]fpFile pointer for the report output.
[in]detailsLevel of report details desired; if >10 calls NDAttribute::report() for each attribute.

◆ updateValues()

int NDAttributeList::updateValues ( )

Updates all attribute values in the list; calls NDAttribute::updateValue() for each attribute in the list.


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