dag_component_get_indexed_attribute_uuid(3)

NAME
dag_component_get_indexed_attribute_uuid - get the identifier of an attribute that belongs to a given component by index

SYNOPSIS
#include "dag_component.h "

attr_uuid_t
dag_component_get_indexed_attribute_uuid(dag_component_t component, int index);

DESCRIPTION
dag_component_get_indexed_attribute_uuid returns a component attribute by index.

This routine does not distinguish between configuration (read-write) and status (read-only) attributes.

RETURN VALUE
An identifier that can be used to reference an attribute in other Configuration and Status API routines.

ERRORS
If the specified attribute is invalid (e.g. index is out of range for the specified component) then the constant kNullAttributeUuid will be returned. Applications should test for this value before assuming the return value is valid.

EXAMPLE

The following snippet of code illustrates two ways to iterate over the attributes of a component. The only difference between the two is the order in which the attributes are passed to the process_attribute routine.

    /* Method One: all attributes at once. */
    count = dag_component_get_attribute_count(component);
    for (index = 0; index < count; index++)
    {
    	attr_uuid_t uuid = dag_component_get_indexed_attribute_uuid(component, index);
    	/* Do something with the attribute. */
    	process_attribute(uuid);
    }
    /* Method Two: config attributes followed by status attributes. */
    count = dag_component_get_config_attribute_count(component);
    for (index = 0; index < count; index++)
    {
    	attr_uuid_t uuid = dag_component_get_indexed_config_attribute_uuid(component, index);
    	/* Do something with the attribute. */
    	process_attribute(uuid);
    }
    count = dag_component_get_status_attribute_count(component);
    for (index = 0; index < count; index++)
    {
    	attr_uuid_t uuid = dag_component_get_indexed_status_attribute_uuid(component, index);
    	/* Do something with the attribute. */
    	process_attribute(uuid);
    }

SEE ALSO
dagconfigapi(3), dag_component_get_attribute_count(3), dag_component_get_config_attribute_count(3), dag_component_get_status_attribute_count(3), dag_component_get_indexed_config_attribute_uuid(3), dag_component_get_indexed_status_attribute_uuid(3).

BUGS
Report bugs to <support@endace.com>.

LAST UPDATED
$Author: koryn $
$Revision: 2474 $
$Date: 2005-11-10 11:13:19 +1300 (Thu, 10 Nov 2005) $

COPYRIGHT
(c) 2004-2005 Endace Technology, Hamilton, New Zealand. All Rights Reserved.