![]() |
![]() |
![]() |
![]() |
OMadd_notify_req, OMdel_notify_req
Synopsis
void OMadd_notify_req (OMobj_id object_id,
OMobj_id template_id,OMobj_id method_id,
OMobj_id argument_id, unsigned int event_mask,int mode );
void OMdel_notify_req (OMobj_id object_id,OMobj_id template_id,
OMobj_id method_id,OMobj_id argument_id,
unsigned int event_mask, int mode );Description
These routines add or delete a notification request. These routines are used by method objects to implement their callback functionality. You do not typically need to call them yourself.Arguments
object_idThe id of the object on which to place the notification request. That is, a notification request is to be generated when an event occurs in object_id .
template_idThe optional id of a template of subobjects on which to place the notification. See Example 2 below.To indicate no object, specify OMnull_obj.
method_idargument_idevent_maskThe events that, when they occur in object_id , will cause a notification on the function.The events are as follows:
Notes:1. a. Propagated means that the notification request extends to objects referenced in the object_id 's value parameter, and to objects referenced by those objects, and so forth.Queued means that if the notification is generated, it is added to AVS/Express' internal queue of notifications to process. Not queued means that AVS/Express processes the notifications immediately.
modeOptions when adding notifications. mode is ignored in a call to OMdel_notify_req.mode can be any of the following. You can OR together individual modes.
The notification is generated only if an event occurs on object_id itself. By default, a notification is generated if the event occurs on either object_id or any of its subobjects.
If the notification is generated, it is processed immediately, even if its property is queued on the events specified.
Example 1
/* Notify myfunc_id when val1_id's property has changed.
___Pass myfunc_id as an argument. */
OMobj_id myfunc_id, val1_id,my_arg;
...
OMadd_notify_req(val1_id, OMnull_obj, myfunc_id, my_arg,
OM_EVENT_PROP, 0);Example 2
Here is an example of using template_id .The V code below defines group g3 as follows:group g1 {
int a;
int b;
};
group g2 {
int c;
};
g1+g2 g3 {
int d;
};If you put a notification request on g3, by default a notification will be generated if any of g3's subobjects change, including subobjects a, b, c, and d.To limit the notification to g3 and the subobjects inherited from g1, you can do the following:OMobj_id myfunc_id, g3_id, g1_id, my_arg;
...
OMadd_notify_req(g3_id, g1_id, myfunc_id, may_arg,
OM_EVENT_VAL, 0);See Also
![]() |
![]() |
![]() |
![]() |