op_hla_obj_attr_enqueue()
Note: Requires High-Level Architecture functionality
Abstract
Informs the HLA-PM of a change in an attribute in a specified object.
Syntax
op_hla_obj_attr_enqueue (objid, attr_name)
| Argument | Type | Description |
|---|---|---|
objid |
Objid |
object ID of the object-of-interest |
attr_name |
const char * |
name of the attribute-of-interest |
Return Type
Compcode
Completion code indicating success or failure in queuing the request. The procedure returns OPC_COMPCODE_SUCCESS if the request was queued for later processing by the HLA-PM. It returns OPC_COMPCODE_FAILURE otherwise.
Example
op_ima_obj_attr_get (my_id, "Update Request", &value);
if (value != request_value)
{
int num_units;
. . .
op_ima_obj_attr_get (row_id, "Number Units", &num_units);
op_ima_obj_attr_set (row_id, "Number Units", ++num_units);
op_hla_obj_attr_enqueue (node_id, "Number Units");
Details
This KP informs the HLA-PM of a change to attr_name so that, if the attribute is mapped to a published HLA attribute, an appropriate RTI attribute update event is generated after all the events at the current simulation time have been processed. All changes for a given object are sent using a single RTI attribute update.
Purpose
Provides a mechanism to have the HLA-PM immediately register an attribute change for eventual generation of appropriate RTI attribute updates.
Errors
- Recoverable Error: Objid (
<objid>): Unable to queue request of outgoing update for attribute (<attr_name>). (due to memory allocation failure)
Reference
- Use one of the op_ima_obj_attr_set() KPs to set the attribute of an object without informing the HLA-PM of the change
- Use the KP op_hla_obj_attr_set() to have the HLA-PM automatically take into account attribute changes
- Use the KP op_hla_attr_change_notify() to let the HLA-PM check all published attributes of an object for possible changes