All data types manipulated by Genom are described with a subset of the OMG IDL syntax. Those types map into traditional programming languages types using the specific mappings described in the GenoM IDL mappings section.
The following set of type specifiers to represent typed values is available:
IDL base types: integers, floating point values …
IDL template types: sequences, strings …
IDL constructed types: structs, unions, enums, …
Type defined with the following syntax can then be used in the component interface definition and anywhere a type value is expected.
Types are most often given a unique name thanks to a typedef
declaration;
a name is also associated with a data type via the struct
, union
,
enum
, native
and exception
declarations.
It is possible to hide the actual definition of a data type from Genom (and
its IDL parser) when it will never be directly used in the interface of the
component, but can nevertheless be needed by codels. These types can be
declared using the native
attribute.
For example: native foo;
Exceptions are thrown by services in case of error. The exception
keyword
declares an exception, which is an identifier with an optional associated
data type.
A simple exception declaration would be :
exception INVALID_SPEED;
or with an associated type (to store the actual value for instance):
exception INVALID_SPEED { double speed; };