Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > Ada Code > Reverse engineering legacy Ada code > Mapping information for Reverse engineering Ada > Type mapping for reverse engineering Ada - record type (Ada code)
  
Type mapping for reverse engineering Ada - record type (Ada code)
For each record type, the Reverser creates a Class in the Model.
The name of the Class is set to that of the record type identifier.
The Class is stereotyped by either the «Ada Record» OR «Ada Variant Record» stereotype:
If the record type does not have a discriminant, the Class is stereotyped by the «Ada Record» stereotype.
If the record type has a discriminant, the Class is stereotyped by the «Ada Variant Record» stereotype.
For information about how record types and variant record types are modeled in Modeler, click here
For each component of the record, the Reverser creates an Attribute of the Class created for the record type. The name of the Attribute is set to the name of the component.
The Visibility property of the reverse engineered Class is set according to how the type is declared:
If the type is declared in the parent Ada package specification, the Visibility property is set to Public.
If the type is declared in the private region of the parent Ada package specification, the Visibility property is set to protected.
If the type is declared in the parent package body, the Visibility property is set to Private.
If the component is a variant, the Attribute is stereotyped by the «Ada Variant» stereotype. The variant text is reverse engineered to the tagged value of the Ada Case tag definition, which is applied to the Attribute by the «Ada Variant» stereotype.
If the type uses the private keyword, the Class is stereotyped by the «Ada Private» stereotype.
If the type uses the limited private keywords, the Class is stereotyped by the «Ada Private» stereotype and the tagged value of the Ada Limited tag definition (applied by the «Ada Private» stereotype) is set to TRUE.
If the component's type is not an anonymous, array, record or subtype indication that has a constraint, the following applies:
The Read Only property of the Attribute is set to TRUE, that is, the Read Only check box on the Attribute's Property Pages is selected.
The Storage property of the Attribute is set to On Instance.
The component's type is reverse engineered as the Type property of the Attribute. If the Reverser can match the name of the Type to a Type in the Model, the matching Type is referenced.
If the target type is parameterized (for example an array with unbounded range or a variant record), the Attribute is stereotyped by the «Ada Type Binding» stereotype. The parameter text (the text between the opening and closing parentheses) is reverse engineered to the tagged value of the Ada Type Parameters tag definition, which is applied to the Attribute by the «Ada Type Binding» stereotype.
The component's initial value is reverse engineered to the Default property of the Attribute.
If the component's type is an anonymous, array, record or subtype indication that has a constraint, the following applies:
The Read Only property of the Attribute is set to TRUE, that is, the Read Only check box on the Attribute's Property Pages is selected.
The Storage property of the Attribute is set to On Class.
The component's type is created in the Model and referenced through the Type property of the Attribute.
The name of the component's type is suffixed with '-Type'.