Previous Table of Contents Next


3.11 Type Declaration

   OMG IDL provides constructs for naming data types; that is, it provides C language-like declarations that associate an identifier with a type. OMG IDL uses the typedef keyword to associate a name with a data type; a name is also associated with a data type via the struct, union, enum, and native declarations; the syntax is:

   For type declarations, OMG IDL defines a set of type specifiers to represent typed values. The syntax is as follows:

   The <scoped_name> in <simple_type_spec> must be a previously defined type introduced by an interface declaration (<interface_dcl> - see Section 3.8, “Interface Declaration ), a value declaration (<value_dcl>, <value_box_dcl> or <abstract_value_dcl> - see Section 3.9, “Value Declaration) or a type declaration (<type_dcl> - see Section 3.11, “Type Declaration). Note that exceptions are not considered types in this context.

   As seen above, OMG IDL type specifiers consist of scalar data types and type constructors. OMG IDL type specifiers can be used in operation declarations to assign data types to operation parameters. The next sections describe basic and constructed type specifiers.