The gen method
is an overloaded public method used by a sender object to send an
event to a receiver object. gen first checks to see
whether the receiver object is under destruction.
In
uninstrumented code, the call gen(OMEvent) is always
sufficient. The call is also sufficient in instrumented code when
you include the notifyContextSwitch method.
Multi-thread instrumented applications should use the
call
gen(OMEvent* event, void* sender).
If the sender is a GUI element, use the syntax gen(theEvent,
OMGUI). OMGui is defined in the file aoxf.h.
Signaturesvirtual OMBoolean gen (OMEvent *event,
OMBoolean genFromISR = FALSE);
virtual OMBoolean gen (OMEvent *event, void * sender);
void gen (AOMEvent *theEvent, void * sender)
Parameters
for signature 1event
Specifies a pointer to the event to
be sent to the reactive object.
genFromISR
Indicates whether the event is from
an operating system interrupt service request (ISR). If it is, it
requires special treatment.
Parameters
for signature 2event
Specifies the event to send
sender
Specifies the object sending the event
Parameters for signature 3theEvent
Specifies the event to send
sender
Specifies the object sending the event
ReturnsThe
method returns one of the following Boolean values:
- TRUE - The event was successfully
queued.
- FALSE - The event
was not queued.
Notes- The gen method is typically used
within actions and methods that you write.
- Note
the following distinctions between the different
method calls:
- The first method syntax does
not specify a sender. gen first
checks to see whether the receiver object is under destruction.
- This version of the method is expanded by the following
macros:
- The
second version of the method is used to send
events from external elements, such as a GUI. It registers the "top"
of the call stack as its sender.
- This version
of the method is expanded by the
OMGuard class macro, which
also creates the event. - The genFromISR flag
supports RTOSes
(for example, VxWorks) that have restrictions on resource usage (for
example, no memory allocation or waiting on semaphores) during an
ISR.
- To extend framework customization, the gen method
was set to virtual in Version 3.0.