Component declaration
A component declaration describes a instance of the genom component
model. It is defined by a unique name (an identifier) that also defines an
IDL scope for any embedded types.
Components export objects from the genom component model, namely:
IDS, tasks,
ports, attributes or
services.
Components may also define new types via IDL statements. Any such types are defined within the component scope.
A number of properties can be attached to a component:
- doc
-
A string that describes the functionality of the component.
- version
-
The component version number, as a string.
- lang
-
The programming language of the codels interface. At the moment, only "c" is supported.
-
A string containing the contact e-mail address to reach support for the component.
- requires
-
A list of dependencies of the component (see #pragma requires). Each string should contain a package name in
pkg-configformat. - codels-requires
-
A list of dependencies of the codels. Each string should contain a package name in
pkg-configformat. - clock-rate
-
The period of the internal component clock. It is usually not necessary to define it explicitly. If the component defines periodic task, the component clock period will be automatically computed as the greatest common divisor of the period of all periodic tasks.
- provides
-
A list of interfaces (see Interface declaration) that the component implements. All objects from the interface are imported as-is into the component description. Ports and services may be further refined once imported, typically by defining codels (see Codel declaration) that implement the services.
- uses
-
A list of interfaces (see Interface declaration) that the component uses. Ports are imported in the opposite direction (e.g. a
port outis imported as aport in). Services are imported asremoteobjects that can be accessed via codel parameters (see Codel declaration). Other objects are imported as-is.
Example
This would define an empty component with no service and no functionality:
component foo {
version "1.0";
email "me@example.com";
lang "c";
require "genom3 >= 2.99.20";
};