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
- Use the KP op_ev_valid() to determine if the Evhandle is valid
- Use the KP op_ev_src_id() to obtain the source object’s ID
- Use the KP op_ev_time() to obtain the scheduled time of the event
- Use the KP op_ev_type() to obtain the type of the event