Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > Ada Code > Generating Ada code > Mapping information for generation > Mapping information for Ada 95 generation scheme > Data type mapping for generating Ada 95 (Ada code)
  
Data type mapping for generating Ada 95 (Ada code)
For each Data Type, ACS generates an Ada package, protected type, protected object, record type, variant record type, task type or task:
If the Data Type is not stereotyped by an «Ada Protected Type», «Ada Record», «Ada Variant Record» or «Ada Task» stereotype, ACS generates an Ada package(package specification file and a package body file).
If the Data Type is stereotyped by the «Ada Protected Type» stereotype, ACS generates an Ada protected type.
If the Data Type is stereotyped by the «Ada Protected Type» and «Ada Anonymous» stereotypes, ACS generates an Ada protected object.
If the Data Type is stereotyped by the «Ada Record» or «Ada Variant Record» stereotype, ACS generates an Ada record type or variant record type.
If the Data Type is stereotyped by the «Ada Task» stereotype but not the «Ada Anonymous» stereotype, ACS generates an Ada task type.
If the Data Type is stereotyped by the «Ada Task» and «Ada Anonymous» stereotypes, ACS generates an Ada task.
In each case, the Data Type's Visibility property determines where the Ada package, protected type, protected object, record type or task is declared:
If the Data Type's Visibility property is set to Public or Package, the declaration is made in the public part of the parent Ada package specification.
If the Data Type's Visibility property is set to Protected, the declaration is made in the private region of the Ada package specification.
If the Data Type's Visibility property is set to Private, the declaration is made in the parent Ada package body.
The following properties of a Data Type are ignored:
Persistent
Template
Template Specialization
Union
ACS typically generates a package specification file and a package body file for a Data Type, even if the package body file is not required. To prevent ACS from generating a package body file that is not required for a Data Type, apply the «Ada Source» to the Data Type, and then set the tagged value of the Ada Requires Body tag definition to FALSE.
Ada package generation
The package is a logically nested child package of the containing namespace package if one exists. For more information about setting up Packages in Modeler, click here .
The package specification and body files are derived from the properties of the Data Type, and the Stereotypes and Tag Definitions that are applied to the Data Type:
If the Data Type contains on-instance attributes, inherited data members or composite aggregations, the package specification declares a record type, called Object.
You can change the default name that is used to generate record types. For more information, see Model settings files (Ada code).
If you want Data Type members to be generated in a specific order, apply the «Ada Source» stereotype to the Data Type and then use the Ada Generation Order tag definition to order the members in the required order. Within the appropriate part of a generated file, members referenced through the Ada Generation Order tag definition are ordered accordingly and are generated before members that are not referenced by the Ada Generation Order tag definition. For more information about ordering a Data Type's members through the Ada Generation Order tag definition, click here Specifying the generation order of model, package, class or data type members (Ada code)..
If the Data Type has Sub-classes (defined through Generalizations), the record type is generated as tagged.
If the Data Type owns an Operation that is stereotyped by the «Ada Create» stereotype, ACS generates the body of the Operation as the body code of the Ada Package.
If the Data Type is linked to a Package, Class or Data Type through a Dependency, ACS generates a with or use clause for the package created for the associated Package, Class or Data Type, unless the Dependency is stereotyped by the «Ada Ignore» stereotype.
If the Data Type is stereotyped by the «Ada Context» stereotype, ACS can generate with or use clauses to packages that are not modeled in the Model, or use type clauses to packages that are or are not modeled in the Modeler. The «Ada Context» stereotype applies the Ada_Declaration_Dependencies and Ada_Implementation_Dependencies tag definitions:
The tagged value of the Ada_Declaration_Dependencies tag definition is generated in the package specification created for the Data Type.
The tagged value of the Ada_Implementation_Dependencies tag definition is generated in the package body created for the Data Type.
For more information about modeling dependencies to packages in the Model, click here Modeling with, use and use type clauses in Modeler (Ada code).
If the Data Type is stereotyped by the «Ada Generic» stereotype, ACS generates a generic package. The tagged value of the Ada Generic Parameters tag definition (applied by the «Ada Generic» stereotype) is generated as the parameters of the generic package. For more information about setting up a Data Type to represent a generic package, click here Modeling generic packages and instantiated generic packages in Modeler (Ada code)
If the Data Type is stereotyped by the «Ada Generic Instance» stereotype, ACS generates an instantiated generic package. The «Ada Generic Instance» stereotype applies three Tag Definitions:
The tagged value of the Ada Generic Parameters tag definition is generated as the parameters of the instantiated generic package.
If the associated generic package is modeled in the Model, the tagged value of the Ada Generic Parent tag definition identifies the Package, Class or Data Type that is generated as the associated generic package.
If the associated generic package is not modeled in the Model, the tagged value of the Ada Generic Parent Text tag definition specifies the name of the associated generic package.
For more information about setting up a Data Type to represent an instantiated generic package, click here Modeling generic packages and instantiated generic packages in Modeler (Ada code).
If the Data Type is stereotyped by the «Ada Renames» stereotype, the Data Type is generated as a renames declaration.
If the Ada Renames Target Text tag definition (applied by the «Ada Renames» stereotype) specifies the name of a target Ada package, the renames declaration renames the specified Ada package.
If the Ada Renames Target Text tag definition is blank and the Ada Rename Target tag definition (applied by the «Ada Renames» stereotype) references a Class or Data Type in the Model, the renames declaration renames the Ada package that is generated from the referenced item.
If the Data Type is stereotyped by the «Ada Pragma» stereotype, the tagged value of the Ada Pragma Text tag definition (applied by the «Ada Pragma» stereotype) is used to generate the pragmas.
If the Data Type is stereotyped by the «Ada Configuration Pragma» stereotype, the tagged value of the Ada Configuration Pragma Text tag definition (applied by the «Ada Configuration Pragma» stereotype) is used to generate file scoped pragmas.
If the Data Type is stereotyped by the «Ada Separate» stereotype, ACS generates the body of the package in a separate file. A body stub is generated in the parent package body.
The tagged value of the Ada Parent Subprogram tag definition (applied by the «Ada Separate» stereotype) specifies which subprogram owns the separate.
If the Data Type is stereotyped by the «Ada Source» stereotype, the tagged value of the Ada Library Unit tag definition determines whether the package is generated in its own file (set to TRUE) or nested inside its parent (set to FALSE). If the «Ada Separate» stereotype is applied to the Data Type, the Ada Library Unit tag definition is ignored.
* 
ACS uses the tagged values of the Ada_Spec and Ada_Body tag definitions (applied by the «Ada Source» stereotype) to retrieve the location of generated or reverse engineered files from the registry. In Modeler, this information is used to populate the files listed on the Open Ada File context submenu for a Data Type.
Ada protected type generation
For information setting up protected types and protected objects in Modeler, click here Modeling protected types and protected objects in Modeler (Ada code).
The protected type is derived from the properties of the Data Type, and the Stereotypes and Tag Definitions that are applied to the Data Type:
If the Data Type is stereotyped by the «Ada Protected Type» stereotype, ACS generates an Ada protected type.
If the Data Type is stereotyped by the «Ada Separate»stereotype, ACS generates the body of the protected type in a separate file. A body stub is generated in the parent package body.
The tagged value of the Ada Parent Subprogram tag definition (applied by the «Ada Separate» stereotype) specifies which subprogram owns the separate.
If the Data Type owns an Attribute that is stereotyped by the «Ada Discriminant» stereotype, ACS generates the Attribute as the discriminant for the protected type. Other Attributes are generated as normal.
If the Data Type owns Operations that are stereotyped by the «Ada Entry» stereotype, ACS generates the Operation as an Ada entry. The tagged value of the Ada Entry Barrier is generated as the entry barrier. The «Ada Entry» stereotype's other tag definitions are used to generate Ada Entries that use an array. Other Operations are generated as normal.
If you want Data Type members to be generated in a specific order, apply the «Ada Source» stereotype to the Data Type and then use the Ada Generation Order tag definition to order the members in the required order. Within the appropriate part of a generated file, members referenced through the Ada Generation Order tag definition are ordered accordingly and are generated before members that are not referenced by the Ada Generation Order tag definition. For more information about ordering a Data Type's members through the Ada Generation Order tag definition, click here Specifying the generation order of model, package, class or data type members (Ada code)..
Ada protected object generation
For information setting up protected objects and protected types in Modeler, click here Modeling protected types and protected objects in Modeler (Ada code).
The protected object is derived from the properties of the Data Type, and the Stereotypes and Tag Definitions that are applied to the Data Type:
If the Data Type is stereotyped by the «Ada Protected Type» and «Ada Anonymous» stereotypes, ACS generates an Ada protected object.
If the Data Type is stereotyped by the «Ada Separate» stereotype, ACS generates the body of the protected object in a separate file. A body stub is generated in the parent package body.
The tagged value of the Ada Parent Subprogram tag definition (applied by the «Ada Separate» stereotype) specifies which subprogram owns the separate.
If the Data Type owns an Attribute that is stereotyped by the «Ada Discriminant» stereotype, ACS generates the Attribute as the discriminant for the protected object. Other Attributes are generated as normal.
If the Data Type owns Operations that are stereotyped by the «Ada Entry» stereotype, ACS generates the Operation as an Ada entry. The tagged value of the Ada Entry Barrier is generated as the entry barrier. The «Ada Entry» stereotype's other tag definitions are used to generate Ada Entries that use an array. Other Operations are generated as normal.
If you want Data Type members to be generated in a specific order, apply the «Ada Source» stereotype to the Data Type and then use the Ada Generation Order tag definition to order the members in the required order. Within the appropriate part of a generated file, members referenced through the Ada Generation Order tag definition are ordered accordingly and are generated before members that are not referenced by the Ada Generation Order tag definition. For more information about ordering a Data Type's members through the Ada Generation Order tag definition, click here Specifying the generation order of model, package, class or data type members (Ada code)..
Ada record type and variant record type generation
For information setting up record types and variant record types in Modeler, click here
The record type is derived from the properties of the Data Type, and the Stereotypes and Tag Definitions that are applied to the Data Type:
ACS generates a record type or variant record type as tagged, if either of the following circumstances apply:
The Data Type has any Sub-classes, which are defined through Generalizations.
The Ada Tagged tag definition (applied by the «Ada Record» or «Ada Variant Record» stereotype) is set to TRUE.
If the abstract property is set to TRUE (Abstract check box selected on Property Pages) and the record type or variant record type is generated as tagged, the abstract keyword is used.
If the Data Type is stereotyped by the «Ada Record» stereotype, the Data Type is generated as a record type. For more information about modeling record types in Modeler, click here Modeling record types in Modeler (Ada code).
If the Data Type is stereotyped by the «Ada Pragma» stereotype, the tagged value of the Ada Pragma Text tag definition (applied by the «Ada Pragma» stereotype) is used to generate the pragmas.
If the Data Type is stereotyped by the «Ada Private» stereotype, ACS generates the record type with the 'private' keyword. If the tagged value of the Ada Limited tag definition (applied by the «Ada Private» stereotype) is set to TRUE, ACS generates the type with the 'limited private' keywords.
If the Data Type is stereotyped by the «Ada Representation» stereotype, the Data Type is generated with a representation clause. The tagged value of the Ada Representation Text tag definition is used to generate the representation clauses.
If the Data Type is stereotyped by the «Ada Separate» stereotype, ACS generates the body of the record type in a separate file. A body stub is generated in the parent package body.
The tagged value of the Ada Parent Subprogram tag definition (applied by the «Ada Separate» stereotype) specifies which subprogram owns the separate.
If the Data Type is stereotyped by the «Ada Variant Record» stereotype, the Data Type is generated as a variant record type. For more information about modeling variant record types in Modeler, click here Modeling variant record types in Modeler (Ada code).
If the Data Type owns an Attribute that is stereotyped by the «Ada Discriminant» stereotype, ACS generates the Attribute as the discriminant for the variant record type.
If the Data Type owns an Attribute that is stereotyped by the «Ada Variant» stereotype, ACS generates the component of the record as a variant for the variant record type, unless the Ada Case Block tag definition has a value. The value of the Ada Case tag definition (applied by the «Ada Variant» stereotype) is generated as the variant text.
* 
«Ada Variant» stereotyped Attributes are used for single-discriminant variant record type, and the Ada Case Block tag definition is used for multi-discriminant variant records.
If the Ada Case Block tag definition (applied by the «Ada Variant Record» stereotype) has a value, the value is generated as the case block. The Ada Case Block tag definition is used for multi-discriminant variant records.
* 
«Ada Variant» stereotyped Attributes are used for single-discriminant variant record types, and the Ada Case Block tag definition is used for multi-discriminant variant records.
If you want Data Type members to be generated in a specific order, apply the «Ada Source» stereotype to the Data Type and then use the Ada Generation Order tag definition to order the members in the required order. Within the appropriate part of a generated file, members referenced through the Ada Generation Order tag definition are ordered accordingly and are generated before members that are not referenced by the Ada Generation Order tag definition. For more information about ordering a Data Type's members through the Ada Generation Order tag definition, click here Specifying the generation order of model, package, class or data type members (Ada code)..
Ada task type generation
For information setting up task types in Modeler, click here Modeling task types in Modeler (Ada code).
The task is derived from the properties of the Data Type and its Operations, and the Stereotypes and Tag Definitions that are applied to the Data Type:
If the Data Type is stereotyped by the «Ada Task» stereotype but not the «Ada Anonymous» stereotype, ACS generates an Ada task type.
If the Data Type is stereotyped by the «Ada Separate» stereotype, ACS generates the body of the task type in a separate file. A body stub is generated in the parent package body.
The tagged value of the Ada Parent Subprogram tag definition (applied by the «Ada Separate» stereotype) specifies which subprogram owns the separate.
If you want Data Type members to be generated in a specific order, apply the «Ada Source» stereotype to the Data Type and then use the Ada Generation Order tag definition to order the members in the required order. Within the appropriate part of a generated file, members referenced through the Ada Generation Order tag definition are ordered accordingly and are generated before members that are not referenced by the Ada Generation Order tag definition. For more information about ordering a Data Type's members through the Ada Generation Order tag definition, click here Specifying the generation order of model, package, class or data type members (Ada code)..
Ada task generation
For information setting up tasks in Modeler, click here Modeling tasks in Modeler (Ada code).
The task is derived from the properties of the Data Type and its Operations, and the Stereotypes and Tag Definitions that are applied to the Data Type:
If the Data Type is stereotyped by the «Ada Task» and «Ada Anonymous» stereotypes, ACS generates an Ada task.
If the Data Type is stereotyped by the «Ada Separate» stereotype, ACS generates the body of the task in a separate file. A body stub is generated in the parent package body.
The tagged value of the Ada Parent Subprogram tag definition (applied by the «Ada Separate» stereotype) specifies which subprogram owns the separate.
If you want Data Type members to be generated in a specific order, apply the «Ada Source» stereotype to the Data Type and then use the Ada Generation Order tag definition to order the members in the required order. Within the appropriate part of a generated file, members referenced through the Ada Generation Order tag definition are ordered accordingly and are generated before members that are not referenced by the Ada Generation Order tag definition. For more information about ordering a Data Type's members through the Ada Generation Order tag definition, click here Specifying the generation order of model, package, class or data type members (Ada code)..