op_hla_attr_info_get()
Note: Requires High-Level Architecture functionality
Abstract
Obtains RTI-related information associated with the attribute of an object.
Syntax
op_hla_attr_info_get (objid, attr_name, attr_info_ptr)
| Argument | Type | Description |
|---|---|---|
objid |
Objid |
object ID of object-of-interest |
attr_name |
const char * |
name of the attribute of the object-of-interest |
attr_info_ptr |
Hla_Attr_Info * |
pointer to a structure that will be filled if the execution if successful |
Return Type
Compcode
Completion code indicating success or failure in retrieving the data. The procedure returns OPC_COMPCODE_SUCCESS if the attribute information could be gathered. It returns OPC_COMPCODE_FAILURE otherwise.
Example
static void check_attr_info (Objid obj_id, const char * attr_name)
{
Hla_Attr_Info attr_info;
Compcode result;
result = op_hla_attr_info_get (obj_id, attr_name, &attr_info)
}
Details
When a Riverbed Modeler object is mapped to a discovered RTI object, a subset of the Riverbed Modeler attributes is mapped to corresponding RTI attributes, based on the mapping file provided to the HLA-PM. Each attribute can be published (in which case changes in the Riverbed Modeler federate will be sent out to other federates) or subscribed to (in which case changes made by other federates will be received by the HLA-PM and applied to the Riverbed Modeler attributes).
Use this KP to determine if an attribute of a Riverbed Modeler object is currently mapped to some RTI attribute.
Hla_Attr_Info is a structure composed of three fields:
is_published—set toOPC_TRUEif the attribute is published,OPC_FALSEotherwise.is_subscribed—set toOPC_TRUEif the attribute is subscribed to,OPC_FALSEotherwiserti_id—if the attribute is either published or subscribed to, then this field contains the ID used by the RTI to identify the attribute-of-interest. If the attribute is neither published not subscribed, this field is left undefined.
Purpose
Provides a way to get the RTI-related information associated with the attribute of an object.
Errors
- Recoverable Error: Objid (
<objid>): Unable to obtain information for attribute (“<attr_name>”). - Recoverable Error: Objid (
<objid>): Error parsing attribute name (“<attr_name>”).
Reference
- Use the KP op_hla_obj_info_get() to obtain RTI information for a Riverbed Modeler object