Next: , Up: Interfaces   [Contents][Index]


10.4.1 Events

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:

10.4.1.1 Modeling Events

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).