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 83 generation scheme > Class mapping for generating Ada 83 (Ada code)
  
Class mapping for generating Ada 83 (Ada code)
For each Class, ACS generates an Ada package, record type, variant record type, task or task type:
If the Class is not stereotyped by an «Ada Record», «Ada Variant Record» or «Ada Task» stereotype, ACS generates an Ada package (package specification file and a package body file).
If the Class is stereotyped by the «Ada Record» or «Ada Variant Record» stereotype, ACS generates an Ada record type or variant record type.
If the Class is stereotyped by the «Ada Task» stereotype but not the «Ada Anonymous» stereotype, ACS generates an Ada task type.
If the Class is stereotyped by the «Ada Task» and «Ada Anonymous» stereotypes, ACS generates an Ada task.
In each case, the Class' Visibility property determines where the Ada package, record type or task is declared:
If the Class' Visibility property is set to Public or Package, the Ada package, record type or task is declared in the public part of the parent Ada package specification.
If the Class' Visibility property is set to Protected, the Ada package, record type or task is declared in the private region of the Ada package specification.
If the Class' Visibility property is set to Private, the Ada package, record type or task is declared in the parent Ada package body.
The following properties of a Class are ignored:
Abstract
Persistent
Template
Template Specialization
Union
ACS typically generates a package specification file and a package body file for a Class, even if the package body file is not required. To prevent ACS from generating a package body file that is not required for a Class, apply the «Ada Source» to the Class, 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, Class or Data Type if one exists. For more information about setting up Packages in Modeler, see
The package specification and body files are derived from the properties of the Class, and the Stereotypes and Tag Definitions that are applied to the Class:
If the Class 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 Class members to be generated in a specific order, apply the «Ada Source» stereotype to the Class 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 Class' members through the Ada Generation Order tag definition, see Specifying the generation order of model, package, class or data type members (Ada code).
If the Class 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 Class 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 Class 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 Class.
The tagged value of the Ada_Implementation_Dependencies tag definition is generated in the package body created for the Class.
For more information about modeling dependencies to packages in the Model, see Modeling with, use and use type clauses in Modeler (Ada code).
If the Class 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 Class to represent a generic package, see Modeling generic packages and instantiated generic packages in Modeler (Ada code).
If the Class 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 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 Class to represent an instantiated generic package, see Modeling generic packages and instantiated generic packages in Modeler (Ada code).
If the Class is stereotyped by the «Ada Renames» stereotype, the Class is generated as a renames declaration.
If the Ada Rename 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 Rename 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 Class 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 Class 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 Class 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 Class is stereotyped by the «Ada Source» stereotype and the tagged value of the Ada 83 Dotted Name tag definition (applied by the «Ada Source» stereotype) is set to TRUE, ACS treats the Class as follows:
ACS does not generate an Ada package for the Class.
ACS does not mangle references to the Ada package, so periods in the package name remain as periods.
The Ada 83 Dotted Name tag definition is useful for modeling dependencies to libraries, which may use periods in the library name.
If the Class is stereotyped by the «Ada Source»stereotype, the tagged value of the Ada Library Unittag 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 Class, 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 record the location of the associated package specification and body files. In Modeler, this information is used to populate the files listed on the Open Ada File context submenu for a Class.
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 Class, and the Stereotypes and Tag Definitions that are applied to the Class:
If the Class is stereotyped by the «Ada Record» stereotype, the Class is generated as a record type. For more information about modeling record types in Modeler, see Modeling record types in Modeler (Ada code).
If the Class 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 Class 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 Class is stereotyped by the «Ada Representation» stereotype, the generated type includes a representation clause. The tagged value of the Ada Representation Text tag definition is used to generate the representation clauses.
If the Class 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 Class is stereotyped by the «Ada Variant Record» stereotype, the Class is generated as a variant record type. For more information about modeling variant record types in Modeler, see Modeling variant record types in Modeler (Ada code).
If the Class 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 Class 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 Class members to be generated in a specific order, apply the «Ada Source» stereotype to the Class 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 Class' members through the Ada Generation Order tag definition, see 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, see Modeling task types in Modeler (Ada code).
The task is derived from the properties of the Class and its Operations, and the Stereotypes and Tag Definitions that are applied to the Class:
If the Class is stereotyped by the «Ada Task» stereotype but not the «Ada Anonymous» stereotype, ACS generates an Ada task type.
If the Class 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 Class members to be generated in a specific order, apply the «Ada Source» stereotype to the Class 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 Class' members through the Ada Generation Order tag definition, see Specifying the generation order of model, package, class or data type members (Ada code).
Ada task generation
For information setting up tasks in Modeler, see Modeling tasks in Modeler (Ada code)
The task is derived from the properties of the Class and its Operations, and the Stereotypes and Tag Definitions that are applied to the Class:
If the Class is stereotyped by the «Ada Task» and «Ada Anonymous» stereotypes, ACS generates an Ada task.
If the Class 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 Class members to be generated in a specific order, apply the «Ada Source» stereotype to the Class 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 Class' members through the Ada Generation Order tag definition, see Specifying the generation order of model, package, class or data type members (Ada code).