op_ima_obj_state_get()

Abstract

Obtains a structure or value that has been set on an object using the KP op_ima_obj_state_set().

Syntax

op_ima_obj_state_get (objid)
Argument Type Description
objid Objid object ID of the object-of-interest

Return Type

void*

Returns a pointer to the structure or value set using the KP op_ima_obj_state_set(). If no state has been set, the return value is OPC_NIL.

Example

Excerpt from oms_bgutil.ex.c in models/std/utilities/oms.

/* Our client is not assuming responsibility for storing our routed */
/* state information.  We must do it ourselves. */

/* Get the current routed bgutil state off this channel object. If the object */
/* state pointer is OPC_NIL, we need to set up the routed utilization. */
/* The link object state ptr (accessed via op_ima_obj_state_get) by */
/* convention should be a pointer to a pointer to */
/* OmsT_Bgutil_Routed_State. */
bgutil_routed_state_pptr = (OmsT_Bgutil_Routed_State **)
	op_ima_obj_state_get (tx_ch_objid);
if (bgutil_routed_state_pptr == OPC_NIL)
	{...}

Details

Objects can contain state information in the form of pointers to values or structures. The KP op_ima_obj_state_set() attaches these values or structures to the object, and the KP op_ima_obj_state_get() retrieves a copy of them. The state information remains set on the object and may be gotten again.

Purpose

Provides a mechanism to retrieve state information associated with simulation objects.

Errors

  • Recoverable Error: Object ID (<objid>) is out-of-range.
  • Recoverable Error: Object ID (<objid>) refers to a restricted object.

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