op_ev_dst_id()

Abstract

Obtains the object ID of the event’s destination module.

Syntax

op_ev_dst_id (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

Objid

Object ID of the module that is the destination of the specified event.

The symbolic constant OPC_OBJID_INVALID is returned when recoverable errors occur.

Example

/* Find the first event for the receiver after */
/* 5.0 seconds from the current time and cancel it. */
time = op_sim_time () + 5.0;
event = op_ev_seek_time (time, OPC_EVSEEK_TIME_POST);
while (op_ev_valid (event))
	{
	if (op_ev_dst_id (event) == recv_id)
		{
		op_ev_cancel (event);
		break;
		}
	else
		event = op_ev_next (event);
	}

Details

This KP is valid for all event types, except multicast interrupts since such interrupts have no single destination module.

Purpose

Provides a mechanism to determine at which object an event will be delivered.

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.
  • Recoverable Error: Event is a multicast interrupt and therefore has no single destination object.
  • Recoverable Error: Event has no destination object. (i.e., is not for any particular module)

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