op_ev_count_local()

Abstract

Obtains the number of events to be delivered to the current module.

Syntax

op_ev_count_local ()
Argument Type Description
no arguments

Return Type

int

the number of events destined for the invoking process including the current event and all forced events.

Example

/* Count the self interrupts this module scheduled */
/* by looping through all of the local events and */
/* verifying if each is a self interrupt. */
self_i_count = 0;
num_events = op_ev_count_local ();
next_event = op_ev_current ();
for (i = 0; i<num_events; i++)
	{
	if (op_ev_type (next_event) == OPC_INTRPT_SELF)
		{
		self_i_count++;
		}
	next_event = op_ev_next_local (next_event);
	}

Details

The number of local events includes the current event, local forced events and local events in the event list. All events that will occur or are occurring at the process that invokes this KP are counted.

Purpose

Provides a count of the number of events that are scheduled to occur or are occurring at the invoking process. This number is useful as an upper bound when looping through all of the local events using op_ev_next_local().

Note: This KP works only in a sequential simulation context. In a parallel simulation, where events in the current time cell might be executed in varying fashion based on what the threads are doing, it will act as if there are no events after the current one.

Errors

  • Program Abort KP requires process context. (e.g., due to invoking this KP from a pipeline stage)

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