Previous: Event Syntax, Up: Specifying Events [Contents][Index]
The following interface has three events defined: two in events and one out event.
The direction is as seen from the component implementing this interface.
interface IMotion { in void start(); in void stop(); out void ready(); behaviour { on start, stop: {} } }
This interface has three events defined: two incoming events and one outgoing event. One of the incoming events is of an enum type, that is defined in the first line of the interface declaration.
interface iSimpleProtocol { enum Result {Ok, Failed, Error}; in Result connect(); in Result disconnect(); behaviour { on connect: reply(Result.Ok); // Action = set return value to 'Result.Ok' on disconnect: reply(Result.Ok); // Action = set return value to 'Result.Ok' } }