Class mapping for generating Ada 95 (Ada code)
For each Class, ACS generates an Ada package, protected type, protected object, record type, variant record type, task type or task:
If the Class 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 Class is stereotyped by the «Ada Protected Type» stereotype, ACS generates an Ada protected type.
If the Class is stereotyped by the «Ada Protected Type» and «Ada Anonymous» stereotypes, ACS generates an Ada protected object.
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, protected type, protected object, record type or task is declared:
If the Class' Visibility property is set to Public or Package, the declaration is made in the public part of the parent Ada package specification.
If the Class' Visibility property is set to Protected, the declaration is made in the private region of the Ada package specification.
If the Class' Visibility property is set to Private, the declaration is made in the parent Ada package body.
The following properties of a Class are ignored:
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 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 has Sub-classes (defined through Generalizations), the record type is generated as tagged.
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 or Class through a Dependency, ACS generates a with or use clause for the package created for the associated Package or Class, 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 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 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, 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 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 Class.
Ada protected type generation
For information setting up protected types and protected objects in Modeler, see Modeling protected types and protected objects in Modeler (Ada code).
The protected 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 Protected Type» stereotype, ACS generates an Ada protected type.
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 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 Class 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 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 protected object generation
For information setting up protected objects and protected types in Modeler, see Modeling protected types and protected objects in Modeler (Ada code).
The protected object 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 Protected Type» and «Ada Anonymous» stereotypes, ACS generates an Ada protected object.
If the Class 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 Class 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 Class 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 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 record type and variant record type generation
For information setting up record types and variant record types in Modeler, see
The record type is derived from the properties of the Class, and the Stereotypes and Tag Definitions that are applied to the Class:
ACS generates a record type or variant record type as tagged, if either of the following circumstances apply:
The Class 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 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 Class 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 Class 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 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).
Was this helpful?