Event semantics
An event is created when it is sent by one object to another, then queued on the queue of the target object thread (thread partitioning is not covered in this guide).
An event that gets to the head of the queue is dispatched to the target object. Once dispatched to an object, it is processed by the object according to the semantics of event propagation in statecharts and the run-to-completion semantics. After the event is processed, it no longer exists and the execution framework implicitly deletes it.
Internal events
An internal event occurs when an object sends a message to itself. To create an internal event, omit the destination object from the send operation, as follows:
GEN(warmEngine(95))
Private events
You can control which classes can generate events to which classes using
friendship. In this way, you can ensure that events come from trusted classes only. The event
request and queueing function is controlled by the gen()
methods, which are public
by default in the framework base class OMReactive
. If you want to control the
generation of events using friendship, make the first gen()
method in
Share\oxf\OMReactive.h
protected. This effort is a one-time effort. Do not change
the second gen()
method, which is used for instrumentation.
Inside each application class, grant friendship to the classes that need to generate events for it. If you do not grant friendship, your program will no longer compile.