Previous: language invoke, Up: TCL Engine


IDL Type manipulation procedures

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 dotgen types (see dotgen types).

— TCL Backend: $type kind

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

— TCL Backend: $type name

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

— TCL Backend: $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.

— TCL Backend: $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.

— TCL Backend: $type fixed

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

— TCL Backend: $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.

— TCL Backend: $type parent

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

— TCL Backend: $type nested

Return the nested types defined by the given type

— TCL Backend: $type types [filter]

Return a list of all types recursively defined in the given type. This is mostly useful for struct or union types.

Parameters:

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).

— TCL Backend: $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.

— TCL Backend: $type length

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

— TCL Backend: $type value

Return the value associated with a const type.

— TCL Backend: $type valuekind

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

— TCL Backend: $type members

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

— TCL Backend: $type discriminator

Return the discriminator of the given union.

— TCL Backend: $type port

Return the port object referenced by the given port.

— TCL Backend: $type remote

Return the remote object referenced by the given remote.

— TCL Backend: $type cname

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

— TCL Backend: $type mangle

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

— TCL Backend: $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.

— TCL Backend: $type declarator [var]

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

Parameters:

var
The variable being declared. If not given, an abstract declarator is returned.

— TCL Backend: $type address var

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

Parameters:

var
The variable of which the address must be taken.

— TCL Backend: $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.

Parameters:

var
The argument name being declared. If not given, an abstract declarator is returned.

— TCL Backend: $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.

Parameters:

var
The variable that must be passed.

— TCL Backend: $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.

Parameters:

var
The argument name.

— TCL Backend: $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.

— TCL Backend: $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 #pragma masquerade.

— TCL Backend: $type loc

Return list describing the source location where that type is defined. The list contains three elements: the file name, the line number and the column number.

— TCL Backend: $type class

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