op_ev_ici()

Abstract

Obtains the ICI associated with an event.

Syntax

op_ev_ici (evhandle)
Argument Type Description
evhandle Evhandle event handle that identifies the event
[An event handle can be obtained from several KPs in this package—such as op_ev_current(), op_ev_seek_time(), and op_ev_next()—and others such as op_intrpt_schedule_self().].

Return Type

Ici*

Pointer to the ICI that is associated with the event.

The constant OPC_NIL is returned when there is no ICI associated with the event or if a recoverable error occurs.

Example

/* Obtain the ICI for the next local self intrpt */
/* if there are any. */
ici_ptr = OPC_NIL;
event = op_ev_next_local (op_ev_current ());
while (op_ev_valid (event))
	{
	if (op_ev_type (event) == OPC_INTRPT_SELF)
		{
		/* This is the first self intrpt, so */
		/* get the ICI and break out of the loop. */
		ici_ptr = op_ev_ici (event);
		break;
		}

	/* It must not have been a self intrpt. */
	/* Try the next one. */
	event = op_ev_next_local (event);
	}

Details

Events carry several types of information with them: the type of event, a code associated with the event, and optionally, an ICI. Obtaining a pointer to the ICI then allows the process to extract its contents via op_ici_attr_get().

Note: Calling op_ev_ici() does not remove an ICI; it remains installed with the event.

Purpose

Provides a mechanism for obtaining a pointer to the ICI that is associated with an event. Once the pointer is obtained, the contents of the ICI can be extracted via the KP op_ici_attr_get().

Typically this KP is applied to the current event (an Evhandle for the current event can be obtained via the KP op_ev_current()) in order to obtain information that the source process placed into the accompanying ICI when the event was generated.

Errors

  • Program Abort: Segmentation violation. (due to a malformed event handle)
  • Recoverable Error: Event handle refers to an event that is either invalid or not currently scheduled.

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