Events

The Events style of composition uses the ?? Operator. Ports of type Event are represented as

Component EventTester{
 * Event EventName = boolean methodName(parameterlist)

Event Evt = boolean Trigger(int num); //Event Evt = public boolean Trigger(int num); //won't work - modifiers are not allowed //Event Evt = void Trigger(int num); //won't work - event return type cannot be void //Event Evt = int Trigger(int num); //won't work - event return type can only be boolean Event Evt = boolean Trigger;

Handler Hnd = int Processor(int number); Sink Snk = void Pit(int finalnumber); }

?? represents the event connector to implement the following compositions { 	/* logic implementation */ }
 * HandlerName ??  EventName
 * SinkName ?? EventName
 * ?? EventName

In the first case, either of the following will then apply

In the third case, the value of the trapped event is returned in the form of __returnvalue which again may need to be type casted to the required type.
 * result = HandlerName ?? EventName
 * conditional checking of returned values

An example using the Events style of composition is given here.

Next : Event test case (covers negative test cases also)