Next: , Previous: , Up: Dezyne Syntax   [Contents][Index]


8.4 Interface Models

An interface has a name, can define some local types, defines a collection of events, and a behaviour describing the protocol on its events. A syntax example:

interface MyInterface
{
  enum MyEnumType { Val1, Val2, Val3 };
  extern MyString $std::string$;
  in MyEnumType myValuedEvent(MyString s);
  out void myReply();
  behaviour
  {
    on myValuedEvent(s) : { reply MyEnumType.Val3; }
  }
}

In this example a number of keywords are introduced: interface, in, out, void, behaviour, on, and reply.

The example defines an interface named MyInterface with two local types, two events, and the interface behaviour (see below for a syntax description of events and behaviour).

8.4.1 Events

An event has (in this order):

Some examples:

  in void e2();            // a void in event called 'e2' with an empty parameter list
  in MyEnumType e3();      // a valued in event called 'e3'
  out void e4(MyString s); // a void out event called 'e4' with one data parameter

There is a restriction on event declarations: an out event must be void.

8.4.2 Behaviour

The behaviour section of an interface contains the protocol description of the interface. See Interface and Component Behaviour, for an elaborate description.