#include <NDArray.h>
Public Member Functions | |
NDAttributeList () | |
NDAttributeList constructor. | |
~NDAttributeList () | |
NDAttributeList destructor. | |
int | add (NDAttribute *pAttribute) |
Adds an attribute to the list. | |
NDAttribute * | add (const char *pName, const char *pDescription="", NDAttrDataType_t dataType=NDAttrUndefined, void *pValue=NULL) |
Adds an attribute to the list. | |
NDAttribute * | find (const char *pName) |
Finds an attribute by name; the search is case-insensitive. | |
NDAttribute * | next (NDAttribute *pAttribute) |
Finds the next attribute in the linked list of attributes. | |
int | count () |
Returns the total number of attributes in the list of attributes. | |
int | remove (const char *pName) |
Removes an attribute from the list. | |
int | clear () |
Deletes all attributes from the list. | |
int | copy (NDAttributeList *pOut) |
Copies all attributes from one attribute list to another. | |
int | updateValues () |
Updates all attribute values in the list; calls NDAttribute::updateValue() for each attribute in the list. | |
int | report (int details) |
Reports on the properties of the attribute list. |
NDAttributeList::NDAttributeList | ( | ) |
NDAttributeList constructor.
NDAttributeList::~NDAttributeList | ( | ) |
NDAttributeList destructor.
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.
[in] | pName | The name of the attribute to be added. |
[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. |
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.
[in] | pAttribute | A pointer to the attribute to add. |
int NDAttributeList::clear | ( | ) |
Deletes all attributes from the list.
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.
[out] | pListOut | A pointer to the output attribute list to copy to. |
int NDAttributeList::count | ( | ) |
Returns the total number of attributes in the list of attributes.
NDAttribute * NDAttributeList::find | ( | const char * | pName | ) |
Finds an attribute by name; the search is case-insensitive.
[in] | pName | The name of the attribute to be found. |
NDAttribute * NDAttributeList::next | ( | NDAttribute * | pAttributeIn | ) |
Finds the next attribute in the linked list of attributes.
[in] | pAttributeIn | A pointer to the previous attribute in the list; if NULL the first attribute in the list is returned. |
int NDAttributeList::remove | ( | const char * | pName | ) |
Removes an attribute from the list.
[in] | pName | The name of the attribute to be deleted. |
int NDAttributeList::report | ( | int | details | ) |
Reports on the properties of the attribute list.
[in] | details | Level of report details desired; if >10 calls NDAttribute::report() for each attribute. |
int NDAttributeList::updateValues | ( | ) |
Updates all attribute values in the list; calls NDAttribute::updateValue() for each attribute in the list.