Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > IDL Code > Mapping information > Mapping information for UML items > Type Definition mapping for IDL (IDL code)
  
Type Definition mapping for IDL (IDL code)
ACS generates a Type Definition as a typedef or enum declaration. ACS generates code similar to this:
// Typedef declarations
typedef char Alias_Typedef
typedef sequence <char, 16> Sequence_Typedef
typedef fixed Array_Typedef[12];
enum Enumeration_Typedef
{
_Enumeration1,
_Enumeration2,
_Enumeration3
};
The generation of a typedef or enum declaration from a Type Definition in an IDL file is derived from the properties of the Type Definition, and for an enumeration Type Definition, the child Enumeration Literals.
Child items:
If the Type Definition has Enumeration construction and it owns Enumeration Literals, ACS generates enum literals within the enum declaration.
Properties:
If the Construction property can be set to Enumeration, Alias, Sequence or Array:
When set to Enumeration, ACS generates an enum declaration.
You can apply the «CORBAEnum» stereotype to a Type Definition, however this stereotype does not affect how ACS generates the Type Definition.
When set to Alias, ACS generates a typedef declaration.
You can apply the «CORBATypedef» stereotype to a Type Definition, however this stereotype does not affect how ACS generates the Type Definition.
If the «CORBAString» or «CORBAWstring» stereotype is applied to an Alias, the data type is ignored. For more information, see the Tag Definitions section that follows.
When set to Array, ACS generates a fixed typedef declaration.
You can apply the «CORBAArray» stereotype to a Type Definition, however this stereotype does not affect how ACS generates the Type Definition.
When set to Sequence, ACS generates a sequence typedef declaration.
If the «CORBASequence» stereotype is applied to the Type Definition, ACS generates the typedef declaration using the tagged value of the bound tag definition, rather than the value of the Maximum Size property.
If the Data Type property is set, ACS generates the value as the typedef's data type, unless the «CORBAString» or «CORBAWstring» stereotype has been applied to the Type Definition. For more information, see the Tag Definitions section that follows.
If no data type is specified, ACS generates UNDEFINED_TYPE.
If the Description property has a value, ACS generates the Description as a comment for the enum or typedef declaration.
For Array Type Definitions, ACS uses the Lower Bound and Upper Bound properties to calculate the array size of the typedef declaration.
For dimensional arrays, you can specify the array dimensions (without the outer brackets) in the Upper Bound property of an array Type Definition.
For Sequence Type Definitions, ACS generates the value of the Maximum Size property in the typedef declaration unless the «CORBASequence» stereotype is applied to the Type Definition, in which case the tagged value of the bound tag definition is used in the typedef declaration.
Note that the Minimum Size property is ignored.
ACS generates the Name property as the name of the enum or typedef in the code.
Note ACS may modify the Type Definition name that is added to the code to make it valid for IDL. You can specify the exact typedef or enum name to add to the code through the CODE_GENERATION_NAME property of an Attribute. Tell me more...
Other properties are ignored.
Tag Definitions:
When the «CORBASequence» stereotype is applied to a Type Definition of Sequence Construction, ACS ignores the Maximum Size property and instead uses the tagged value of thebound tag definition (applied through the «CORBASequence» stereotype) to generated the typedef declaration.
If the tagged value of the bound tag definition (applied through the «CORBAString» stereotype) is set for a Type Definition of Alias construction, ACS does not generate a declaration for the Type Definition. However, when the Type Definition is used as a type, ACS generates the type as follows: string<bound value, where bound value is the tagged value of the bound tag definition that is applied by the «CORBAString» stereotype.
If the tagged value of the bound tag definition (applied through the «CORBAWstring» stereotype) is set for a Type Definition of Alias construction, ACS does not generate a declaration for the Type Definition. However, when the Type Definition is used as a type, ACS generates the type as follows: wstring<bound value, where bound value is the tagged value of the bound tag definition that is applied by the «CORBAWstring» stereotype.
If the «CORBABoxedValue» stereotype is applied to the Type Definition, ACS generates a boxed valuetype declaration for the Type Definition.