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













































== *$type* TCL engine command

Those commands manipulate IDL type objects and return information about
them. They all take a type object as their first argument, noted `$type` in
the following command descriptions. Such an object is typically returned by
other procedures, such as
link:cmd-dotgen{outfilesuffix}#dotgen_types[`dotgen types`].






















































































[[kind]]
=== *$type kind*

Return a string describing the nature of the IDL type, such as `long`,
`double`, `struct` ...






[[name]]
=== *$type name*

Return the name of the IDL type. No namespace components are included in
the result.






[[fullname]]
=== *$type fullname*

Return the fully qualified name of the IDL type. The result includes
the namespace hierarchy in which the type is defined and the last
component is the result of `$type name`.






[[scope]]
=== *$type scope*

Return the list of lexical scopes in which the type is defined. Each
element of the list contains two values: the nature of the scope and its
name. The nature of the scope will be either `module` for IDL modules,
or `struct` if the type is defined inside an IDL `struct`.
















[[fixed]]
=== *$type fixed*

Return a boolean indicating if the type is of fixed, constant size
(true) or not (false).






[[final]]
=== *$type final*

Return a new type object with all aliases resolved. For `const` types,
this returns the type of the constant. For `typedef`, this return the
first non-aliased type. For `struct` and `union` members, this returns
the type of the member.






[[parent]]
=== *$type parent*

Return the parent type of a nested type definition, or raise an error if
the type is not nested.








[[nested]]
=== *$type nested*

Return the nested types defined by the given type




















[[types]]
=== *$type types* ['filter']

Return the list of all types that are recursively used by the given
type. In other words, this is the list of types that must be known in
order to completely define the given `$type`.

For all basic types such as `long`, `double` and so forth, the returned
list is empty. For enumerated types, the result is the list of
enumerators. For aggregates such as `struct`, `union` or `exception`,
the result is the list of all members, expanded recursively with the
same rules. Finally, for `array`s or `sequence`s, this returns the type
of the array or sequence elements, recursively expanded.

.Arguments
[horizontal]
'filter'::
The optional filter can be used to filter out some elements from the
type list. The filter must be a tcl anonymous function (see tcl
`[apply]` command) that accepts one argument that is a genom object. It
must return a boolean to indicate whether the type should be included
(true) or excluded (false).





















[[type]]
=== *$type type*

Return the underlying type of a type that contains another type
definition. For instance, this procedure invoked on an `array` or
`sequence` type returns the element type. It returns the aliased type
for `typedef`.












[[length]]
=== *$type length*

Return the length of an `array`, `sequence` or `string` type.












[[value]]
=== *$type value*

Return the value associated with a `const` type.






















[[valuekind]]
=== *$type valuekind*

Return the nature of the value associated with a `const` type.










[[members]]
=== *$type members*

Return a list of types defined by the given `struct`, `union` or `enum`
type.






[[discriminator]]
=== *$type discriminator*

Return the discriminator of the given `union`.










[[port]]
=== *$type port*

Return the port object referenced by the given `port`.










[[remote]]
=== *$type remote*

Return the remote object referenced by the given `remote`.










[[cname]]
=== *$type cname*

Return a string representing the type name in the current language.

[[mangle]]
=== *$type mangle*

Return a string uniquely describing the given type, suitable for use as
an identifier in source code written in the current programming
language.

[[mapping]]
=== *$type mapping*

Return an ASCII string representing the implementation (definition) of
the given type, suitable for use in source code written in the current
programming language.



















[[declarator]]
=== *$type declarator* ['var'] ['qualifier']

Return the declarator for $type with optional 'qualifier' or for a
variable 'var' of that type, in the current language.

.Arguments
[horizontal]
'var'::
The variable being declared. If not given, an abstract declarator is
returned.

[[address]]
=== *$type address* 'var'

Return an expression representing the address of a variable of the given
type in the current language.

.Arguments
[horizontal]
'var'::
The variable of which the address must be taken.




















[[argument]]
=== *$type argument* *value|reference* ['var']

Return an expression that declares a parameter 'var' of the given
type, passed by value or reference according to the second parameter.

.Arguments
[horizontal]
'var'::
The argument name being declared. If not given, an abstract declarator
is returned.

[[pass]]
=== *$type pass* *value|reference* 'var'

Return an expression that passes a variable 'var' of the given type
as a function parameter. The variable is passed by value or reference
according to second argument.

.Arguments
[horizontal]
'var'::
The variable that must be passed.

[[dereference]]
=== *$type dereference* *value|reference* 'var'

Return an expression that retrieves the value of a parameter 'var',
passed by value or reference according to the second argument.

.Arguments
[horizontal]
'var'::
The argument name.






















[[digest]]
=== *$type digest*

Return an ASCII representaion (32 characters) of an MD5 digest of the
given type. This is useful for implementing a cheap runtime verification
that two types match.



















[[masquerade]]
=== *$type masquerade*

Return any value defined in a `#pragma masquerade` for that type,
if the current template matches the corresponding parameter of the
`#pragma`. See
link:../dotgen/pragma{outfilesuffix}#pragma_masquerade[`#pragma
masquerade`].































[[loc]]
=== *$type loc* [file|line|column|context]

Return a list describing the source location where that type is
defined. The list contains four elements: the file name, the line
number, the column number and the original component context of the
definition. If an optional argument is given, only the corresponding
element is returned.







[[class]]
=== *$type class*

Always returns the string "type". Useful to determine at runtime
that the object is a type object.








































// eof
