SUBSYSTEM OVERVIEW
Entity Attribute Manager (EAM) Subsystem
The EAM subsystem maintains a stack of attributes associated with each entity at every level.
USAGE
To use the entity attribute manager you must first allocate an entity attribute stack with eam_AllocateAttrStack. The EAM_INFO argument must contain the size of the attributes, the default attributes and a function to invoke by the attribute manager. This function is invoked in two different ways, the first is when an attribute is added, and the second is when the attributes are applied. The arguments of this function are an option, an EAM_STACK structure pointer, and an entity structure pointer. The option argument is passed from the calling program and is not used by the EAM functions. The EAM options are set with the eam_SetOption function and may be one of the following; EAM_NOOPT, EAM_APPLY, and EAM_DEFAULT. To check if an option is set use the eam_CheckOption function and to clear an option use eam_ClearOption. When attributes are added to the stack or applied by a specified entity, an implicit function is invoked. The eam_CopyCurrentAttr function may be used to obtain the current attributes and the eam_CopyDefaultAttr function may be used to obtain the default attributes if EAM_DEFAULT is a specified option. Once the attributes are obtained and processed by the implicit function, the new attributes are returned to the calling program.
After an entity attribute stack has been allocated, attributes may be added to the stack with eam_AddToAttrStack. Attributes may be removed from the entity attribute stack with eam_RemoveFromAttrStack. A new entity attribute stack may be created with eam_CopyAttrStack. The eam_CopyAttrStack routine makes a duplicate copy of the specified entity attribute stack and its contents. The entity attribute stack may be initialized with eam_InitAttrStack to remove all levels on the stack and set a new default. Two routines are available to get access to the attributes of an entity attribute stack. To get the default (top) attributes use eam_GetDefaultAttr. To get the current attributes use eam_GetCurrentAttr. Both of these functions return a pointer which must not be modified. The remaining routine, eam_GetAppliedAttr, will apply the attributes of an entity to the current or default attributes and return an attribute pointer. This pointer is allocated and must be freed by the application when done. When finished with the entity attribute stack, eam_FreeAttrStack should be called to free all memory associated with the entity attribute stack.