Asynchronous Messages
The RXF supports communication via asynchronous messages, also known as
events. This is a strong mechanism for decoupling object-oriented
software in run time behavior.
Event receptions in a UML model are usually consumed by classes, which
have their behavior modeled via a statechart. An event can for example
be perfectly used to trigger a transition to another state.
Dynamic Events vs Static Events
Events can either be dynamic or static with respect to allocation. In
RXF V8 C++ Event receptions will be generated as operation calls and
events will always be allocated in the reciever instance. To send an
event the GEN macro has to be used.
- Dynamic events are used unless you specify a static event: dynamic events are commonly used.
For Events the new Operator is overridden to allocate space in one of the static Memory pools.
- Static events are statically allocated. That means there is no memory allocated from Memory pools,
but an existing preallocated event instance is used. Therefore it is
faster than first allocating memory. In V8 those instances are
generated in the class that contains the event reception and on the
interface side, there is no difference between sending a static or
sending a dynamic event.
All
events that have no Arguments and have the property
CG::Event::DeleteAfterConsumption overridden to false, will be
generated as static events.
It is recommendet to use static events (Events without parameter) in
Interrupt Service Routines to shorten the execution time of an ISR