Next: Behavior, Up: Interfaces [Contents][Index]
Events are messages or function calls and returns that are communicated between components.
event ::= direction type identifier "(" parameter-list? ")" ";"
direction ::= "in" | "out"
parameter-list
::= parameter ( "," parameter)*
parameter ::= parameter-direction? data-type identifier
parameter-direction
::= "in" | "out" | "inout"
Some examples.
A void in-event called e with an empty parameter list:
in void e ();
a typed in-event called e2:
in enum_type e2 ();
a void in-event called e3 with two data parameters
out void e3 (some_id in_id, out some_id out_id);
a void out-event called e4 with a data parameter
out void e4 (some_string s);
Note: There are two restrictions on
out-event definitions:
out-events must be of typevoid, andout-events can only takeinparameters.
Apart from user-defined events, Dezyne has two special builtin events
called optional and inevitable. These are called
“modeling events” and are used in interface to specify
decoupled behavior (See Using inevitable and optional).