// Generated from idltype-tmpl.y - manual changes will be lost
ifdef::sidebartoc[]
include::_Sidebar.adoc[]
endif::[]



























IDL Template types
------------------

The template types are:
****
[horizontal]
(88) `*template-type-spec    ::=*` ::
   <<grammar#dotgen-rule-sequence-type,`sequence-type`>> +
                              `|` <<grammar#dotgen-rule-optional-type,`optional-type`>> +
                              `|` <<grammar#dotgen-rule-string-type,`string-type`>> +
                              `|` <<grammar#dotgen-rule-fixed-type,`fixed-type`>>
****




=== Sequences

A sequence is a one-dimensional array with two characteristics: a maximum
size (which is fixed at compile time) and a length (which is determined at
run time).

****
[horizontal]
(89) `*sequence-type         ::=*` ::
   `"sequence"` `"<"` <<grammar#dotgen-rule-simple-type-spec,`simple-type-spec`>> `(` `">"` +
                              `|` `","` <<grammar#dotgen-rule-positive-int-const,`positive-int-const`>> `">"` `)`
****

The second parameter in a sequence declaration indicates the maximum size of
the sequence. If a positive integer constant is specified for the maximum
size, the sequence is termed a bounded sequence. If no maximum size is
specified, size of the sequence is unspecified (unbounded).

Prior to passing a bounded or unbounded sequence as a function argument (or
as a field in a structure or union), the length of the sequence must be set
in a language- mapping dependent manner. After receiving a sequence as an
input parameter, the length of the returned sequence will have been set;
this value may be obtained in a language-mapping dependent manner.

A sequence type may be used as the type parameter for another sequence
type. For example, the following: declares an “unbounded sequence of
unbounded sequence of long”.

----
sequence< sequence<long> >
----

Note that for nested sequence declarations, white space must be used to
separate the two “>” tokens ending the declaration so they are not parsed as
a single “>>”














=== Optional

Optional types represent a value that may or may not be present.

****
[horizontal]
(90) `*optional-type         ::=*` ::
   `"optional"` `"<"` <<grammar#dotgen-rule-simple-type-spec,`simple-type-spec`>> `">"`
****

The parameter of the 'optional' declaration describes the data type of the
value.









=== Strings

A string is similar to a sequence of char.

****
[horizontal]
(91) `*string-type           ::=*` ::
   `"string"` `[` `"<"` <<grammar#dotgen-rule-positive-int-const,`positive-int-const`>> `">"` `]`
****

The argument to the string declaration is the maximum size of the string. If
a positive integer maximum size is specified, the string is termed a bounded
string; if no maximum size is specified, the string is termed an unbounded
string.  Strings are singled out as a separate type because many languages
have special built-in functions or standard library functions for string
manipulation. A separate string type may permit substantial optimization in
the handling of strings compared to what can be done with sequences of
general types.














=== Fixed type

The ﬁxed data type represents a fixed-point decimal number

****
[horizontal]
(92) `*fixed-type            ::=*` ::
   `"fixed"` `[` `"<"` <<grammar#dotgen-rule-positive-int-const,`positive-int-const`>> `","` <<grammar#dotgen-rule-positive-int-const,`positive-int-const`>> `">"` `]`
****

[CAUTION]
Fixed types are not properly handled in existing genom
templates. You must not use them at the moment.














// eof
