Signatures are defined in files with extension '.signature'. A signature model may optionally:
-
import existing type models
import "myTypes.types"
It is also possible to import namespaces:
import myproject.types.*
File imports and namespace imports cannot be used together (see the Help page on namespaces).
-
define new types visible only in the interface model.
An example signature:
signature myFirstInterface
Optionally, define local types, for instance,
types // local to this interface type Command type MyType vector Requests = Command []
Optionally define
-
Commands: synchronous input calls that require a reply possibly with a value. The caller is blocked until the reply is received
-
Signals: asynchronous input calls, no reply is required. The caller is not blocked.
-
Notifications: asynchronous output - not blocking.
The example below contains all three parts; note that commands start with the type of the return value. Commands may have in, inout, and out parameters. When the direction is not explicitly given in is assumed as default. Signals and notifications can only have in parameters.
commands Time CurrentTime ( Status st, string info, out bool error ) string Command (Request req, inout int result) void Null int Reset real Value (in int something) signals start (real val) doIt (in Request req) go notifications myState (Status s) error no