op_ima_obj_attr_get_int32()

Abstract

Obtains the value of an integer attribute in the specified object.

Syntax

op_ima_obj_attr_get_int32 (objid, attr_name, value_ptr)
Argument Type Description
objid Objid object ID of the object-of-interest
[An object ID can be obtained from several KPs in the Topo and Id packages: op_id_self(), op_topo_parent(), op_topo_child(), op_id_from_userid(), and op_id_from_name().]
attr_name const char * name of the attribute-of-interest
[This attribute must be of type integer and defined in the specified object, or an error will occur.]
value_ptr int * pointer to a variable to be filled with the specified attribute’s value

Return Type

Compcode

OPC_COMPCODE_SUCCESS if the attribute value was successfully obtained; OPC_COMPCODE_FAILURE otherwise.

If you are dealing with merged compound attributes that are equal (see Note), value_ptr is set to the object ID of one of the merged compound attributes (which one is not specified) and OPC_COMPCODE_SUCCESS is returned. If the merged compound attributes are not equal, OPC_COMPCODE_FAILURE is returned.

Note: In the context of merged compound attributes, “equal” means that all attributes on the compound attribute object have the same name, type, and value, and all the child objects of the compound attribute are equal as well.

Example

int     my_dce_address;

/* Get my own address. */
op_ima_obj_attr_get_int32 (self_id , "X25 DCE Address", &my_dce_address);

Details

None.

Purpose

Provides a mechanism to dynamically obtain object attributes during the course of the simulation. This KP works identically to op_ima_obj_attr_get(), but applies only to object attributes of data type integer. Refer to op_ima_obj_attr_get() for full purpose and details.

Errors

  • Same as op_ima_obj_attr_get(), plus the following:
  • Program Abort: Attribute (<name>) is of type (<type>). Can’t get its value as type (integer).

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com