Eventsdefine-event-classadd-event-functionGoTo Top

add-event-function   function [event-class-specifier [unit-class-or-instance-specifier]] &key slot-names paths permanent priority[Function]

Purpose
Add an event function for one or more event classes.

Package   :gbbopen

Module   :gbbopen-core

Arguments and values

function     A function designator
event-class-specifier     An extended event-class specification (see below; default is t)
unit-class-or-instance-specifier     An extended unit-class or instance specification (see below; default is t)
slot-names or slot-name      A slot-name or list of slot-names (default is t)
paths or path      A space-instance path regular expression (default is (*))
permanent     A generalized boolean (default is nil)
priority     An integer between -127 and 127, inclusive (default is 0)

Detailed syntax

event-class-specifier ::= atomic-event-class | (atomic-event-class subeventing-specifier) | t

atomic-event-class ::= event-class | event-class-name
subeventing-specifier ::= :plus-subevents | :no-subevents + | =

The shorthand + subevents specifier is equivalent to :plus-subevents and = to :no-subevents.

unit-class-or-instance-specifier ::= unit-instance | (unit-instance*) |
atomic-unit-class |
(atomic-unit-class subclassing-specifier) | t
atomic-unit-class ::= unit-class | unit-class-name
subclassing-specifier ::= :plus-subclasses | :no-subclasses | + | =

The shorthand + subclasses specifier is equivalent to :plus-subclasses and = to :no-subclasses.

Description
The specified function must accept the arguments associated with every event class to which it is added. In addition, function should accept additional arguments that are associated with all subevents of the specified event classes. (This can be achieved by specifying &allow-other-keys in the lambda list of function.)

The paths argument is either the symbol t (indicating all space instances) or a list representing a regular expression where the following reserved symbols are interpreted as follows:

= matches one occurrence in a space-instance path
? matches zero or one occurrence in a space-instance path
+ matches one or more occurrences in a space-instance path
* matches zero or more occurrences in a space-instance path
   ^    move to parent

See also
    remove-event-function
    remove-all-event-functions

Examples
Add the event function evfn-printv to the set of functions to be invoked when instance-created-event is signaled on a hyp unit instance:

  (add-event-function 'evfn-printv 'instance-created-event 'hyp)
Add the event function evfn-printv to the set of functions to be invoked when instance-created-event is signaled on a hyp unit instance or its subclasses:
  (add-event-function 'evfn-printv 'instance-created-event '(hyp :plus-subclasses))
or simply:
  (add-event-function 'evfn-printv 'instance-created-event '(hyp +))

Note
Unit-instance-specific event functions are not yet implemented in GBBopen.


The GBBopen Project


Eventsdefine-event-classadd-event-functionGoTo Top