Ema_Object_Prom_Attr_Set()
Abstract
Defines the properties of a promoted attribute expected from a lower-level model or object.
Syntax
Ema_Object_Prom_Attr_Set (model_id, object_id, attr_name, attr_properties)
| Argument | Type | Description |
|---|---|---|
model_id |
EmaT_Model_Id |
numeric model ID of the model-of-interest [This value is a numeric identifier that references a model. A model ID can be obtained from several EMA functions.] |
object_id |
EmaT_Object_Id |
numeric object ID of the object-of-interest [This value is a numeric identifier that references an object. An object ID can be obtained from several EMA functions.] |
attr_name |
char* |
name of the promoted attribute |
attr_properties |
EmaT_Object_Id |
numeric object ID of the properties object for the attribute |
Return Type
void
No return value.
Header
ema.h
Details
This function implements the prom_attr_set operator for objects.
Setting a value for a promoted attribute via this function is different from setting the promote component of an attribute via Ema_Object_Attr_Set(). Setting an object attribute's promote component to 1 causes that attribute to be promoted to a higher level object. Ema_Object_Prom_Attr_Set() defines the properties for an attribute that is expected to be promoted from a lower level; however, it does not actually set the value for the promoted attribute. You must call Ema_Object_Attr_Set() after calling Ema_Object_Prom_Attr_Set() to actually set the attribute's value. Within the graphical editors or a simulation, if an object has values set for promoted attributes and these attributes do not match attributes actually promoted from lower-level models or objects, the set values are discarded and an error message occurs.
Because this function allocates a storage cell to hold a value for a promoted attribute, it should only be called once for a particular object's attribute; repeated calls to set the same promoted attribute on an object will cause an error. However, once a promoted attribute has been set using this function, its value can be queried by Ema_Object_Attr_Get() and modified by Ema_Object_Attr_Set(), just as if it were a built-in attribute.