Code Generation Properties
ContentsThis chapter is organized as follows:
- Model Properties
- Class Properties
- Operation Properties
- Has Properties
- Attribute Properties
- Association Role Properties
- Association Properties
- UML Package Properties
- Module Spec Properties
- Module Body Properties
Model PropertiesThe model properties are described on the following pages:
- Spec File Extension
- Spec File Backup Extension
- Spec File Temporary Extension
- Body File Extension
- Body File Backup Extension
- Body File Temporary Extension
- Create Missing Directories
- Generate Bodies
- Generate Standard Operations
- Implicit Parameter
- Stop On Error
- Error Limit
- File Name Format
- Directory
Spec File Extension
The Spec File Extension property specifies the file name extension that the Ada Generator uses when creating Ada specification files. For Rational Apex the extension should be .1.ada.
Spec File Backup Extension
If the Ada Generator produces an Ada specification file that already exists, the previous version of the file is renamed to a backup file. The Spec File Backup Extension property specifies the file name extension that the Ada Generator uses when creating backup files for Ada specifications.
Spec File Temporary Extension
When the Ada Generator writes a specification file, it actually writes the code to a temporary file. Once the code is completely written, the following steps are taken:
- 1 The backup file (see the Spec File Backup Extension property) is deleted, if there is one.
- 2 The existing specification file is renamed to the backup file, assuming an existing specification file is present.
- 3 The temporary file is renamed to be the new specification file.
- 4 The Spec File Temporary Extension property specifies the filename extension that the Ada Generator uses when creating temporary specification files.
Body File Extension
The Body File Extension property specifies the file name extension that the Ada Generator uses when creating Ada body files. For Rational Apex, the extension should be 2.ada.
Body File Backup Extension
If the Ada Generator produces an Ada body file that already exists, the previous version of the file is copied to a backup file. The Body File Backup Extension property specifies the file name extension that the Ada Generator uses when creating backup files for Ada bodies.
Body File Temporary Extension
When the Ada Generator writes a body file, it actually writes the code to a temporary file. Once the code is completely written, the following steps are taken:
- 1 The backup file (see the Body File Backup Extension property) is deleted, if there is one.
- 2 The existing body file is renamed to the backup file, assuming an existing body file is present.
- 3 The temporary file is renamed to be the new body file.
- 4 The Body File Temporary Extension property specifies the filename extension that the Ada Generator uses when creating temporary body files.
Create Missing Directories
The Create Missing Directories property indicates whether or not the Ada Generator should create directories needed to mirror the model's UML package hierarchy, or stop and report an error if such directories are missing.
Generate Bodies
The Generate Bodies property indicates whether or not the Ada Generator should create Ada body files for the classes or modules that are selected for code generation.
When
True
, the Ada Generator will automatically create Ada bodies for selected classes and for module specs which have corresponding module bodies defined for them. Ada bodies will not be created for module specs which have no corresponding module body.When
False
, the Ada Generator will not automatically create Ada bodies for selected classes or module specs. Ada bodies will still be created for module bodies that are explicitly selected.Generate Standard Operations
The Generate Standard Operations property indicates whether or not the Ada Generator should create the standard operations for the classes selected for code generation. The property is used in conjunction with the class property of similar name. When set to
True
, the class property is then taken into consideration. When set toFalse
, no standard operations are generated.Implicit Parameter
The Implicit Parameter property indicates whether or not the Ada Generator should provide an implicit class parameter object for all the user-defined operations of a class. The property is used in conjunction with the class property of similar name. When set to
True
, the class property is then taken into consideration. When set toFalse
, no implicit parameter is generated.Stop On Error
The Stop On Error property indicates whether or not the Ada Generator stops generating code when the error count threshold is exceeded (see Error Limit property). This threshold does not apply to warnings (for which there is no limit) or fatal errors (which cause the Ada Generator to terminate immediately).
Error Limit
The Error Limit property specifies the error count threshold used in conjunction with the Stop On Error property.
File Name Format
The File Name Format property controls the automatic generation of directory and file names when the value of the model Directory property, or a UML package Directory property is
AUTO GENERATE
.The value is expected to be an integer followed by zero or more flag characters. The integer is the maximum number of characters in a file or directory name. The flags are:
_ retain underscores
v retain vowels
u convert all letters to upper case
l convert all letters to lower case
x retain case
The default, if the property is blank, is to compress the filename to 8 characters on Windows, or 32 on UNIX, eliminate vowels first, eliminate white-space, and eliminate underscores. When a blank or underscore is eliminated, the next character is capitalized.
Directory
The Directory property specifies the project directory, which is the directory in which all subsystems for a project are generated. This property defaults to
AUTO GENERATE
, which tells the Ada Generator to use the current working directory.
Class PropertiesThe class properties are described on the following pages:
- Representation
- Generate Accessor Operations
- Access Class Wide (Ada 95)
- Code Name
- Type Name (Ada 95) / Class Name (Ada 83)
- Type Visibility (Ada 95) / Class Access (Ada 83)
- Type Implementation (Ada 95)
- Type Control (Ada 95)
- Type Control Name (Ada 95)
- Type Definition (Ada 95) / Implementation Type (Ada 83)
- Record Implementation (Ada 95)
- Record Kind Package Name (Ada 95)
- Is Limited (Ada 95)
- Is Subtype
- Polymorphic Unit (Ada 83)
- Handle Name (Ada 83)
- Handle Access (Ada 83)
- Discriminant (Ada 83)
- Variant (Ada 83)
- Generate Access Type (Ada 95)
- Access Type Name (Ada 95)
- Access Type Visibility (Ada 95)
- Access Type Definition (Ada 95)
- Maybe Aliased (Ada 95)
- Parameterized Implementation (Ada 95)
- Parent Class Name (Ada 95)
- Enumeration Literal Prefix
- Record Field Prefix
- Array Of Type Name (Ada 95)
- Access Array Of Type Name (Ada 95)
- Array Of Access Type Name (Ada 95)
- Access Array Of Access Type Name (Ada 95)
- Array Index Definition (Ada 95)
- Generate Standard Operations
- Implicit Parameter
- Implicit Parameter Name (Ada 95) / Class Parameter Name (Ada 83)
- Generate Default Constructor (Ada 95)/Default Constructor Kind (Ada 83)
- Default Constructor Name
- Inline Default Constructor
- Generate Copy Constructor (Ada 95) / Copy Constructor Kind (Ada 83)
- Copy Constructor Name (Ada 95)
- Inline Copy Constructor
- Generate Destructor (Ada 95)
- Destructor Name
- Inline Destructor
- Generate Type Equality (Ada 95)
- Type Equality Name (Ada 95) / Class Equality Operation (Ada 83)
- Handle Equality Operation (Ada 83)
- Inline Equality
- Is Task (Ada 83)
Representation
The Representation property is used to specify one or more representation items, including pragmas. The constructs must be fully defined, including a terminating semicolon. The following predefined names yield the name of the entity which can be used within the property definition:
- type
- access_type
- component_clauses -- yields a list of component_clause
- array_type -- Ada95 only
- access_array_type -- Ada95 only
- array_access_type -- Ada95 only
- access_array_access_type -- Ada95 only
The predefined "component_clauses" is used to construct the record representation clause in the class. For example,
for $type use record $component_clauses end record;The placement of the representations, in a class, comes after the full definition of the type plus any other auxiliary type definitions. For a task or protected type, the representation comes after the "is" in the specification.
Generate Accessor Operations
The Generate Accessor Operations property indicates whether or not the Ada Generator should create the accessor operations for this class. Both the model and class property must be set to True for this to take effect.
Access Class Wide (Ada 95)
The Access Class Wide property specifies that the access type is class-wide. For example:
type AccessTypeName is access TypeName'Class;Code Name
The Code Name property specifies the name for the class in the generated code. You need to set this property only if you want the class to be named differently than it is in the Rose model. This is especially useful when the Rose model and code are expressed in different natural languages. The value of this property should be a valid Ada identifier.
Type Name (Ada 95) / Class Name (Ada 83)
The Type Name property determines the Ada type name used by the Ada Generator to represent a Rose class. For example, if Type Name (Ada 95) / Class Name (Ada 83) is set to
File_Type
, the Ada Generator will output:
type File_Type is ...;If Type Name (Ada 95) / Class Name (Ada 83) is set to
Object
, the Ada Generator will output:
type Object is ...;You have the option of setting the Type Name (Ada 95) / Class Name (Ada 83) property to
${class}
, where the Ada Generator will use the name of the Rose class for the name of the type.Note, that this property is ignored if the class name uses the colon notation, ClassName:TypeName.
The default setting is
Object
.Type Visibility (Ada 95) / Class Access (Ada 83)
The Type Visibility (Ada 95)/Class Access (Ada 83) property controls the definition of the Ada type used by the Ada Generator to represent a Rose class.
The default setting is
Private
.Type Implementation (Ada 95)
The Type Implementation property controls the implementation of the Ada type used by the Ada Generator to represent a Rose class.
The default setting is
Tagged
.Type Control (Ada 95)
The Type Control property specifies whether a controlled type implementation should be generated for the Ada type. The Type Implementation property must be set to
Tagged
.
Type Control Name (Ada 95)
The Type Control Name property controls the name of the auxiliary controlled type.
The default setting is
Controlled_${type}
.Type Definition (Ada 95) / Implementation Type (Ada 83)
The Type Definition (Ada 95)/Implementation Type (Ada 83) property allows a Rose class to be defined as something other than one of the types available in Type Implementation.For example, if Type Definition is set to
range 1 .. 500
, the Ada Generator will output:
type TypeName is range 1 .. 500;If Type Definition is set to
new String (1 .. 4)
, the Ada Generator will output:
type TypeName is new String (1 .. 4);
For Ada 95, when the Type Definition property is set, it dominates the Type Implementation property.Record Implementation (Ada 95)
The Record Implementation property controls the implementation of the Ada record type. It is used in conjunction with the property Type Implementation when set to Record.
Single Type A single type is created for the complete generalization hierarchy.
Multiple Types One record type is created for each class in the generalization hierarchy.
The default setting is
Single Type
.Record Kind Package Name (Ada 95)
The Record Kind Package Name property controls the name of the auxiliary package used to declare the enumeration type Kinds of the root class.
The default setting is
${class}_Record_Kinds
.Is Limited (Ada 95)
The Is Limited property controls whether the type is limited. This applies to tagged types and record types with private visibility.
Is Subtype
For Ada 95: The Is Subtype property is used in conjunction with the Type Definition property and a Single Type Record Implementation to define a subtype declaration.
For Ada 83: The Is Subtype property is used in conjunction with the Implementation Type property to define an subtype declaration. It is ignored when the Implementation Type property is blank.
Polymorphic Unit (Ada 83)
The Polymorphic Unit property tells the Ada Generator to treat the class as a polymorphic class instead of as a normal class. A polymorphic class must have a single dependency relationship, the supplier of which is the root of the generalization hierarchy for which a polymorphic package is to be created.
Handle Name (Ada 83)
The Handle Name property determines the name of the type created by the Ada Generator for "By Reference" instances of the class. For example, if Handle Name is set to
Handle
(and all other properties have their default values), the Ada Generator will output:
type Object is private; type Handle is access Object;If Handle Name is set to
Object_Name
, the Ada Generator will output:
type Object is private; type Object_Name is access Object;Handle Access (Ada 83)
The Handle Access property controls the definition of the Ada type used by the Ada Generator for "By Reference" instances of the class.
Discriminant (Ada 83)
The Discriminant property specifies the discriminant of the Ada type used by the Ada Generator to represent a Rose class. For example, if Discriminant is set to
Size : Positive := 100
(and all other properties have their default values), the Ada Generator will output:
type Object (Size : Positive := 100) is private;The class property Variant and the "has" properties Container Type and Variant are also used when defining discriminated records.
Variant (Ada 83)
The Variant property is used in conjunction with the Discriminant property to define a single variant part for a discriminated record. The Variant property should be set to the simple name of a discriminant defined in the Discriminant property. For example, if Discriminant contains
Unit : Device := Disk
(and all other properties have their default values), the Ada Generator will output:
type Object (Unit : Device := Disk) is record ... end record;If Variant is set to
Unit
, the Ada Generator will output:
type Object (Unit : Device := Disk) is record ... case Unit is ... end case; end record;The Variant property is only used in the complete type declaration in the private part of the Ada specification. It has no effect on the visible type declaration. The Variant property is ignored when the Discriminant property is blank.
Generate Access Type (Ada 95)
The Generate Access Type property controls the generation of the Ada type used by the Ada Generator for By-Reference instances of the class.
Always The type will always be generated.
Auto The type will be defined as needed.
Access Type Name (Ada 95)
The Access Type Name property determines the name of the type created by the Ada Generator for By-Reference instances of the class. For example, if Access Type Name is set to
Handle
, the Ada Generator will output:
type TypeName is private; type Handle is access TypeName;If Access Type Name is set to
Object_Name
, the Ada Generator will output:
type TypeName is private; type Object_Name is accessTypeName
;The default setting is
Handle
.Access Type Visibility (Ada 95)
The Access Type Visibility property controls the definition of the Ada type used by the Ada Generator for By-Reference instances of the class.
Public The type will be defined as "access TypeName".
Private The type will be defined as private.
The default setting is
Public
.Access Type Definition (Ada 95)
The Access Type Definition property allows the access to a Rose class to be defined as something other than:
type AccessTypeName is access TypeName;If Access Type Definition is set to
array (Positive range 1 .. 10) of Object
, the Ada Generator will output:
type AccessTypeName is array (Positive range 1..10) of Object;Maybe Aliased (Ada 95)
The Maybe Aliased property specifies that the access type is a general access-to-variable type. For example,
type AccessTypeName is access all TypeName'Class;Parameterized Implementation (Ada 95)
The Parameterized Implementation property controls the mapping of parameterized and bound classes.
Generic The type will be declared in generic units.
Unconstrained The discriminant part of the type is derived from the class parameters.
The default setting is Generic.
Parent Class Name (Ada 95)
The Parent Class Name property specifies the name used to reference the superclass, for a parameterized class whose Parameterized Implementation property has been set to Generic.
The default setting is
Superclass
.Enumeration Literal Prefix
The Enumeration Literal Prefix property specifies the prefix that is prefixed to enumeration literal values, that the Ada Generator automatically generates.
Record Field Prefix
The Record Field Prefix property specifies the prefix that is prefixed to component and discriminant identifiers, that the Ada Generator automatically generates.
Array Of Type Name (Ada 95)
The property Array Of Type Name specifies the name of the array type of a one-to-many by-value "has" relationship. The string can include the variable
${type}
, which expands to the type name of the class.The default setting is
Array_Of_${type}
.Access Array Of Type Name (Ada 95)
The property Access Array Of Type Name specifies the name of the access type whose designated type is given by the property Array Of Type Name.
The default setting is
Access_Array_Of_${type}
.Array Of Access Type Name (Ada 95)
The property Array Of Access Type Name specifies the name of the array type of a one-to-many by-reference "has" relationship. The string can include the variable
${access_type}
, which expands to the access type name of the class.The default setting is
Array_Of_${access_type}
.Access Array Of Access Type Name (Ada 95)
The property Access Array Of Access Type Name specifies the name of the access type whose designated type is given by the property Array Of Access Type Name.
The default setting is
Access_Array_Of_${access_type}
.Array Index Definition (Ada 95)
The property Array Index Definition supplies the index subtype definition for the array type definitions given by the properties Array Of Type Name and Array Of Access Type Name.
The default setting is
Positive range <>
.Generate Standard Operations
The Generate Standard Operations property indicates whether or not the Ada Generator should create the standard operations for this class. Both the model and class property must be set to True for this to take effect.
Note: To auto-generate set operation (Project/Class property Generate Standard Operations set to
True
) you must have the attributes set to public.Implicit Parameter
The Implicit Parameter property indicates whether or not the Ada Generator should provide an implicit class parameter object for all the user-defined operations of this class. Both the model and class property must be set to True for this to take effect.
Implicit Parameter Name (Ada 95) / Class Parameter Name (Ada 83)
All operations of a class can have as an implicit parameter a class object. The Implicit Parameter Name (Ada 95) / Class Parameter Name (Ada 83) property specifies the formal parameter name used by the Ada Generator for this class object. For example, if the Implicit Parameter Name (Ada 95) / Class Parameter Name (Ada 83) is set to
This
, (the property Generate Standard Operations must be active for Ada 95; all other properties have their default values for Ada 83), the class destructor will be declared as:
procedure Free (This : in out TypeName);If Implicit Parameter Name (Ada 95) / Class Parameter Name (Ada 83) is changed to
The_Object
, the class destructor would be:
procedure Free (The_Object : in out TypeName);The Implicit Parameter Name (Ada 95) / Class Parameter Name (Ada 83) property also controls the declaration of the class parameter to the constructor subprogram, get/set subprograms, inherited subprograms and subprograms for user-defined operations. It does not affect the names of the class parameters to the copy and equality subprograms.
Generate Default Constructor (Ada 95)/Default Constructor Kind (Ada 83)
The Generate Default Constructor (Ada 95)/Default Constructor Kind (Ada 83) property determines the kind of subprogram declared as the class constructor by the Ada Generator. The declaration of a class constructor can also be suppressed. If Generate Default Constructor (Ada 95)/Default Constructor Kind (Ada 83) is set to
Function
, the declaration output by the Ada Generator will be of the form:
function Create return TypeName;If Generate Default Constructor (Ada 95)/Default Constructor Kind (Ada 83) is set to
Procedure
, the declaration output by the Ada Generator will be of the form:
procedure Create (ImplicitParameterName : in outTypeName);The properties Generate Standard Operations, Type Name (Ada 95) / Class Name (Ada 83), Implicit Parameter Name (Ada 95)/Class Parameter Name (Ada 83), and Default Constructor Name also affect the declaration of the class constructor.
Function The class constructor will be declared as a function.
Procedure The class constructor will be declared as a procedure.
Do Not Create No class constructor will be declared.
The default setting is
Function
.Default Constructor Name
The Default Constructor Name property controls the simple name of the class constructor subprogram. For example, if the Default Constructor Name property is set to
Create
, the Ada Generator will output:
function Create return TypeName;If the Default Constructor Name property is set to
New_Item
, the Ada Generator will output:
function New_Item return TypeName;The default setting is
Create
.Inline Default Constructor
The Inline Default Constructor property specifies whether an inline pragma should be generated for the Default Constructor.
Generate Copy Constructor (Ada 95) / Copy Constructor Kind (Ada 83)
The Generate Copy Constructor (Ada 95)/Copy Constructor Kind (Ada 83) property determines the kind of subprogram declared as the class constructor by the Ada Generator. The declaration of a class constructor can also be suppressed. If Generate Copy Constructor (Ada 95)/Copy Constructor Kind (Ada 83) is set to
Function
, the declaration output by the Ada Generator will be of the form:
function Copy (From : in TypeName) return TypeName;If Generate Copy Constructor (Ada 95)/Copy Constructor Kind (Ada 83) is set to
Procedure
, the declaration output by the Ada Generator will be of the form:
procedure Copy (From : in TypeName; To: in out TypeName);
Function The copy constructor will be declared as a function.
Procedure The copy constructor will be declared as a procedure.
Do Not Create No copy constructor will be declared.
The default setting is
Function
.Copy Constructor Name (Ada 95)
The Copy Constructor Name property controls the simple name of the class constructor subprogram. For example, if the Copy Constructor Name property is set to Copy, the Ada Generator will output:
function Copy return TypeName;If the Copy Constructor Name property is set to
Clone_Item
, the Ada Generator will output:
function Clone_Item return TypeName;Inline Copy Constructor
The Inline Copy Constructor property specifies whether an inline pragma should be generated for the Copy Constructor.
Generate Destructor (Ada 95)
The Generate Destructor property specifies whether a destructor is declared by the Ada Generator.
If Generate Destructor is set to
Procedure
, the declaration output by the Ada Generator will be of the form:
procedure Free (ImplicitParameterName : in outTypeName);The properties Generate Standard Operations, Type Name, Implicit Parameter Name, and Destructor Name also affect the declaration of the destructor.
Procedure The class destructor will be declared as a procedure.
Do Not Create No class destructor will be declared.
The default setting is
Procedure
.Destructor Name
The Destructor Name property controls the simple name of the class destructor subprogram by the Ada Generator. For example, if the Destructor Name property is set to
Free
, the Ada Generator will output:
procedure Free ( ImplicitParameterName : in outTypeName);If the Destructor Name property is set to
Deallocate_Item
, the Ada Generator will output:
procedure Deallocate_Item ( ImplicitParameterName : in outTypeName);If the Destructor Name is blank, no destructor will be generated.
Inline Destructor
The Inline Destructor property specifies whether an inline pragma should be generated for the Destructor.
Generate Type Equality (Ada 95)
The Generate Type Equality property determines whether the function is declared or suppressed.
Function The type equality function will be declared.
Do Not Create No type equality function will be declared.
The default setting is
Do Not Create
.Type Equality Name (Ada 95) / Class Equality Operation (Ada 83)
The Type Equality Name (Ada 95)/Class Equality Operation (Ada 83) property controls the designator of the equality function declared by the Ada Generator to compare class objects. For example, if the Type Equality Name (Ada 95)/Class Equality Operation (Ada 83) property is set to
${quote}=${quote}
:
function "=" (L, R : in TypeName) return Boolean;If the Type Equality Name (Ada 95)/Class Equality Operation (Ada 83) property is set to
Is_Equal
, the Ada Generator will output:
function Is_Equal (L, R : in TypeName) return Boolean;The default setting is
${quote}=${quote}
.Handle Equality Operation (Ada 83)
The Handle Equality Operation property controls the designator of the equality function declared by the Ada Generator to compare class handles. For example, if the Handle Equality Operation property is set to
${quote}=${quote}
(and all other properties have their default values), the Ada Generator will output:
function "=" (L, R : in Handle) return Boolean;If the Handle Equality Operation property is set to
Is_Equal
, the Ada Generator will output:
function Is_Equal (L, R : in Handle) return Boolean;If the property is blank, no handle equality function is output by the Ada Generator.
Inline Equality
The Inline Equality property specifies whether an inline pragma should be generated for the Equality operations.
Is Task (Ada 83)
The Is Task property is used to define a class as a task type. Operations become entries, and attributes are ignored.
Operation PropertiesThe operation properties are described on the following pages:
- Implicit Parameter Class Wide (Ada 95)
- Representation
- Use Colon Notation
- Generate Accessor Operations
- Use File Name
- Code Name
- Subprogram Implementation
- Renames (Ada 95)
- Generate Overriding (Ada 95)
- Implicit Parameter Mode (Ada 95) / Class Parameter Mode (Ada 83)
- Generate Access Operation (Ada 95)
- Inline
- Entry Code
- Exit Code
- Entry Barrier Condition (Ada 95)
Implicit Parameter Class Wide (Ada 95)
The Implicit Parameter Class Wide property specifies whether the class parameter is specified with the
`Class
attribute.Representation
The Representation property is used to specify one or more representation items, including pragmas. The constructs must be fully defined, including a terminating semicolon. The predefined name "operation" yields the name of the entity which can be used within the property definition.
The placement of the representations for an operation comes after the subprogram specification.
Use Colon Notation
The Use Colon Notation property is used to control whether colon notation is permitted to be used. Turning this off will cause errors to be generated for classes using colon notation.
Generate Accessor Operations
The Generate Accessor Operations property indicates whether or not the Ada Generator should create the accessor operations for the classes selected for code generation. The property is used in conjunction with the class property of similar name. When set to True, the class property is then taken into consideration. When set to False, no accessor operations are generated.
Use File Name
The Use File Name property is used to control the Module Spec/Body Property File Name.
Code Name
The Code Name property specifies the name for the operation in the generated code. You need to set this property only if you want the operation to be named differently than it is in the Rose model. This is especially useful when the Rose model and code are expressed in different natural languages. The value of this property should be a valid Ada identifier.
Subprogram Implementation
The Subprogram Implementation property is used to control the code generated for a subprogram body. This property can take on the following values.
In addition, the code generation property Inline is used to control whether or not a pragma
Inline
is generated for the operation.Renames (Ada 95)
The Renames property is used in conjunction with the Subprogram Implementation property when set to Renaming. It specifies the name of the renamed subprogram.
Generate Overriding (Ada 95)
The Generate Overriding property specifies whether an overriding declaration should be generated.
Implicit Parameter Mode (Ada 95) / Class Parameter Mode (Ada 83)
The Implicit Parameter Mode (Ada 95)/Class Parameter Mode (Ada 83) property determines the mode of the class parameter for standard and user-defined operations.
The default setting is
In Out
.Generate Access Operation (Ada 95)
The Generate Access Operation property specifies whether an access operation should be generated.
Inline
The Inline property specifies whether an inline pragma should be generated for the operation.
Entry Code
The Entry Code property provides the capability to insert code or comments at the beginning of the subprogram. This property is useful for inserting instrumentation, or adhering to documentation standards.
Exit Code
The Exit Code property provides the capability to insert code or comments at the end of the subprogram. This property is useful for inserting instrumentation, or adhering to documentation standards.
Entry Barrier Condition (Ada 95)
The Entry Barrier Condition property specifies the boolean expression used for the barrier of the entry body.
Has PropertiesThe has properties are described on the following pages:
- Is Constant
- Is Aliased (Ada 95)
- Code Name
- Name If Unlabeled
- Record Field Implementation (Ada 95)
- Record Field Name (Ada 95) / Data Member Name (Ada 83)
- Generate Get (Ada 95)
- Generate Access Get (Ada 95)
- Get Name
- Inline Get
- Generate Set (Ada 95)
- Generate Access Set (Ada 95)
- Set Name
- Inline Set
- Is Constant (Ada 83)
- Initial Value
- Variant (Ada 83)
- Container Implementation (Ada 95)
- Container Generic
- Container Type
- Container Declarations
Is Constant
If the "has" relationship is static and the Is Constant property is set to True, the Ada Generator will create a constant declaration rather than a variable declaration.
Is Aliased (Ada 95)
The Is Aliased property specified that the object or component is to be defined as aliased.
Code Name
The Code Name property specifies the name for the "has" relationship in the generated code. You need to set this property only if you want the "has" relationship to be named differently than it is in the Rose model. This is especially useful when the Rose model and code are expressed in different natural languages. The value of this property should be a valid Ada identifier.
Name If Unlabeled
The Name If Unlabeled property specifies the name which the Ada Generator will use for an unlabeled "has" relationship. The string can include the variable
${supplier}
, which expands to the name of the supplier class of the "has" relationship. For example, if class Message and class Priority are the client and the supplier, respectively, of an unlabeled "has" relationship, the stringThe_${supplier}
resolves toThe_Priority
.The default setting is
The_${supplier}
.Record Field Implementation (Ada 95)
The Record Field Implementation property controls the definition of the field within the record type definition for the "has" relationship.
The default setting is
Component
.Record Field Name (Ada 95) / Data Member Name (Ada 83)
The Record Field Name (Ada 95) / Data Member Name (Ada 83) property specifies the name the Ada Generator outputs for the record field of a "has" relationship. The string can include the variable
${supplier}
, which expands to the name of the supplier class of the "has" relationship, and the variable${relationship}
, which expands to the name of the "has" relationship itself.If the variable
${relationship}
is used, and the "has" relationship is unlabeled, then the value of${relationship}
will be the value of the property Name If Unlabeled.The default setting is
${relationship}
.Generate Get (Ada 95)
The Generate Get property determines whether the function is declared or suppressed by the Ada Generator.
Function The Get operation will be declared as a function.
Do Not Create No Get operation will be declared.
The default setting is
Function
.Generate Access Get (Ada 95)
The Generate Access Get property determines whether the function is declared or suppressed by the Ada Generator.
Function The Access Get operation will be declared.
Do Not Create No Access Get operation will be declared.
The default setting is
Do Not Create
.Get Name
The Get Name property specifies the name the Ada Generator outputs for the get accessor of a "has" relationship. The string can include the variable
${supplier}
, which expands to the name of the supplier class of the "has" relationship, and the variable${relationship}
, which expands to the name of the "has" relationship itself.If the variable
${relationship}
is used, and the "has" relationship is unlabeled, then the value of${relationship}
will be the value of the property Name If Unlabeled.The default setting is
Get_${relationship}
.Inline Get
The Inline Get property specifies whether an inline pragma should be generated for the Get operation.
Generate Set (Ada 95)
The Generate Set property determines whether the procedure is declared or suppressed by the Ada Generator.
Procedure The Set operation will be declared.
Do Not Create No Set operation will be declared.
The default setting is
Procedure
.Generate Access Set (Ada 95)
The Generate Set property determines whether the procedure is declared or suppressed by the Ada Generator.
Procedure The Set operation will be declared.
Do Not Create No Set operation will be declared.
The default setting is
Do Not Create
.Set Name
The Set Name property specifies the name the Ada Generator outputs for the set accessor of a "has" relationship. The string can include the variable
${supplier}
, which expands to the name of the supplier class of the "has" relationship, and the variable${relationship}
, which expands to the name of the "has" relationship itself.If the variable
${relationship}
is used, and the "has" relationship is unlabeled, then the value of${relationship}
will be the value of the property Name If Unlabeled.The default setting is
Set_${relationship}
.Inline Set
The Inline Set property specifies whether an inline pragma should be generated for the Set operation.
Is Constant (Ada 83)
If a "has" relationship is static, and the Is Constant property is set to
True
, the Ada Generator will create a constant declaration rather than a variable declaration.To create a named number declaration, do not set Is Constant to
True
; rather, set the type of the attribute to constant.To define the value of the constant or named number, use the Initial Value property.
Initial Value
The Initial Value property attaches an initial value to a field declaration, variable declaration, or constant declaration.
Variant (Ada 83)
The Variant property is used in conjunction with the Class properties Discriminant and Variant to define a class as an Ada variant record. This Variant property assigns the component for the "has" relationship to a particular variant of the variant part of the record. For example, assume that class Peripheral has the following Ada declaration:
type Object is record Unit : Device; Status : State; Line_Count : Integer; Cylinder : Cylinder_Index; Track : Track_Number; end record;Assume that type Device has the enumerated values (Printer, Disk, Drum). This declaration can be changed to a discriminated record through the following steps:
Remove the Unit "has" relationship and set the Class property Discriminant to
Unit : Device
:
type Object (Unit : Device) is record Status : State; Line_Count : Integer; Cylinder : Cylinder_Index; Track : Track_Number; end record;Set the Class property Variant to Unit:
type Object (Unit : Device) is record Status : State; Line_Count : Integer; Cylinder : Cylinder_Index; Track : Track_Number; case Unit is end case; end record;Set the Variant property for the Line_Count "has" relationship to Printer, and set the Variant property for the Track and Cylinder "has" relationships to others:
type Object (Unit : Device) is record Status : State; case Unit is when Printer => Line_Count : Integer; when others => Cylinder : Cylinder_Index; Track : Track_Number; end case; end record;The Ada Generator will always put the others variant last in the variant part.
Container Implementation (Ada 95)
The Container Implementation property controls the implementation scheme for a container type by the Ada Generator.
Array Create an unconstrained array type and access to that array type.
Generic Use the generic unit given by the property Container Generic Name.
Container Generic
The Container Generic property provides some control over the generic package instantiated to handle one-to-many "has" relationships. For example, if Container Generic is set to
List
, then the packageList_Generic
will be instantiated (if the maximum allowable cardinality of the "has" relationship is larger than 1). If Container Generic is changed toQueue
, the packageQueue_Generic
will be instantiated.Container Type
The Container Type property specifies a data type for the record field generated for a "has" relationship. The Container Type property can be set to refer to an existing container class, and the Ada Generator will use that container class instead of generating its own container class.
Container Declarations
The Container Declarations property lets you create any declarations, such as array type declarations or generic instantiations, to support the Container Type property.
Attribute PropertiesThe attribute properties are described on the following pages:
- Initial Value
- Representation
- Is Constant
- Is Aliased (Ada 95)
- Code Name
- Record Field Implementation (Ada 95)
- Record Field Name (Ada 95) / Data Member Name (Ada 83)
- Generate Get (Ada 95)
- Generate Access Get (Ada 95)
- Get Name
- Inline Get
- Generate Set (Ada 95)
- Generate Access Set (Ada 95)
- Set Name
- Inline Set
Initial Value
The Initial Value property attaches an initial value to an object or component.
Representation
The Representation property is used to specify one or more representation items, including pragmas. The constructs must be fully defined, including a terminating semicolon. The predefined name "attribute" yields the name of the entity, which can be used within the property definition.
For an attribute, the representation depends on whether it is static, i.e. treated as an object declaration, or non-static, treated as a component declaration. For the latter, use the syntax for a component_clause.
The placement of the representations for an attribute comes after the object declaration.
Is Constant
If the attribute is static and the Is Constant property is set to
True
, the Ada Generator will create a constant declaration rather than a variable declaration.Is Aliased (Ada 95)
The Is Aliased property specified that the object or component is to be defined as aliased.
Code Name
The Code Name property specifies the name for the attribute in the generated code. You need to set this property only if you want the attribute to be named differently than it is in the Rose model. This is especially useful when the Rose model and code are expressed in different natural languages. The value of this property should be a valid Ada identifier.
Record Field Implementation (Ada 95)
The Record Field Implementation property controls the definition of the field within the record type definition for attributes of the class.
Component The attribute will be defined as a component.
Discriminant The attribute will be defined as a discriminant.
Access Discriminant The attribute will be defined as an access discriminant.
The default setting is
Component
.Record Field Name (Ada 95) / Data Member Name (Ada 83)
The Record Field Name (Ada 95) / Data Member Name (Ada 83) property specifies the name the Ada Generator outputs for the record field of an attribute. The string can include the variable
${attribute}
, which expands to the name of the label of the class attribute in the model or the name specified in the attribute's Code Name property.The default setting is
${attribute}
.Generate Get (Ada 95)
The Generate Get property determines whether the function is declared or suppressed by the Ada Generator.
Function The Get operation will be declared.
Do Not Create No Get operation will be declared.
The default setting is
Function
.Generate Access Get (Ada 95)
The Generate Access Get property determines whether the function is declared or suppressed by the Ada Generator.
Function The Access Get operation will be declared.
Do Not Create No Access Get operation will be declared.
The default setting is
Do Not Create.
Get Name
The Get Name property specifies the name the Ada Generator outputs for the get accessor of an attribute. The string can include the variable
${attribute}
, which expands to the name of the label of the class attribute in the model or the name specified in the attribute's Code Name propertyThe default setting is
Get_${attribute}
.Inline Get
The Inline Get property specifies whether an inline pragma should be generated for the Get operation.
Generate Set (Ada 95)
The Generate Set property determines whether the procedure is declared or suppressed by the Ada Generator.
Procedure The Set operation will be declared.
Do Not Create No Set operation will be declared.
The default setting is
Do Not Create
.Generate Access Set (Ada 95)
The Generate Access Set property determines whether the procedure is declared or suppressed by the Ada Generator.
Procedure The Access Set operation will be declared.
Do Not Create No Access Set operation will be declared.
The default setting is
Do Not Create
.Set Name
The Set Name property specifies the name the Ada Generator outputs for the set accessor of an attribute. The string can include the variable
${attribute}
, which expands to the name of the label of the class attribute in the model or the name specified in the attribute's Code Name property.The default setting is
Set_${attribute}
.Inline Set
The Inline Set property specifies whether an inline pragma should be generated for the Set operation.
Association Role PropertiesThe association role properties are described on the following pages:
- Record Field Implementation
- Is Constant
- Is Aliased (Ada 95)
- Code Name
- Name If Unlabeled
- Record Field Name (Ada 95) / Data Member Name (Ada 83)
- Generate Get (Ada 95)
- Generate Access Get (Ada 95)
- Get Name
- Inline Get
- Generate Set (Ada 95)
- Set Name
- Inline Set
- Initial Value
- Container Implementation (Ada 95)
- Container Generic
- Container Type
- Container Declarations
Record Field Implementation
The Record Field Implementation property controls the definition of the field within the record type definition for roles of the class.
Is Constant
If the role is static and the Is Constant property is set to
True
, the Ada Generator will create a constant declaration rather than a variable declaration.Is Aliased (Ada 95)
The Is Aliased property specified that the object or component is to be defined as aliased.
Code Name
The Code Name property specifies the name for the association role in the generated code. You need to set this property only if you want the association role to be named differently than it is in the Rose model. This is especially useful when the Rose model and code are expressed in different natural languages. The value of this property should be a valid Ada identifier.
Name If Unlabeled
The Name If Unlabeled property specifies the name to be used for an unlabeled role. The Ada Generator uses the name of the role to construct names for the corresponding component and get and set operations. If the role is not named, the Ada Generator uses this property to determine the name of the role.
When the Ada Generator needs the name of the role to generate a name for a component or a get or set operations,
${targetClass}
expands to the name of the association class or the association if there is one. Otherwise it expands to the name of the supplier class. If${association}
is used in the Name If Unlabeled property, it expands to the name of the association.The default setting is
The_${targetClass}
.Record Field Name (Ada 95) / Data Member Name (Ada 83)
The Record Field Name (Ada 95) / Data Member Name (Ada 83) property specifies the name the Ada Generator outputs for the record field for an association role. The string can include the variable
${target}
, which expands to the name of the target of the component. If there is an association (class), this is the name of the association (class). If there is not an association (class), this is the name of the supplier role.The default setting is
${target}
.Generate Get (Ada 95)
The Generate Get property determines whether the function is declared or suppressed by the Ada Generator.
Function The Get operation will be declared.
Do Not Create No Get operation will be declared.
The default setting is
Function
.Generate Access Get (Ada 95)
The Generate Access Get property determines whether the function is declared or suppressed by the Ada Generator.
Function The Access Get operation will be declared.
Do Not Create No Access Get operation will be declared.
The default setting is
Do Not Create
.Get Name
The Get Name property specifies the name the Ada Generator outputs for the get accessor of an association role. The string can include the variable
${target}
, which expands to the name of the target of the component. If there is an association class, this is the name of the association class. If there is not an association class, this is the name of the supplier role.The default setting is
Get_${target}
.Inline Get
The Inline Get property specifies whether an inline pragma should be generated for the Get operation.
Generate Set (Ada 95)
The Generate Set property determines whether the procedure is declared or suppressed by the Ada Generator.
Procedure The Set operation will be declared.
Do Not Create No Set operation will be declared.
The default setting is
Procedure
.Set Name
The Set Name property specifies the name the Ada Generator outputs for the set accessor of an association role. The string can include the variable
${target}
, which expands to the name of the target of the component. If there is an association class, this is the name of the association class. If there is not an association class, this is the name of the supplier role.The default setting is
Set_${target}
.Inline Set
The Inline Set property specifies whether an inline pragma should be generated for the Set operation.
Initial Value
The Initial Value property attaches an initial value to a field declaration.
Container Implementation (Ada 95)
The Container Implementation property controls the implementation scheme for a container type by the Ada Generator.
Array Create an unconstrained array type and access to that array type.
Generic Use the generic unit given by the property Container Generic Name.
Container Generic
The Container Generic property provides some control over the generic package instantiated to handle one-to-many association roles. For example, if Container Generic is set to
List
, then the packageList_Generic
will be instantiated (if the maximum allowed cardinality of the "has" relationship is larger than 1). If Container Generic is changed toQueue
, the packageQueue_Generic
will be instantiated.Container Type
The Container Type property specifies a data type for the record field generated for an association role. The Container Type property can be set to refer to an existing container class, and the Ada Generator will use that container class instead of generating its own container class.
Container Declarations
The Container Declarations property lets you create any declarations, such as array type declarations or generic instantiations, to support the Container Type property.
Association PropertiesThe association properties are described on the following pages:
- Name If Unlabeled
- Generate Get (Ada 95)
- Get Name
- Inline Get
- Generate Set (Ada 95)
- Set Name
- Inline Set
- Generate Associate
- Associate Name
- Inline Associate
- Generate Dissociate
- Dissociate Name
- Inline Dissociate
Name If Unlabeled
The Name If Unlabeled property specifies the name to be used for an unlabeled association. The Ada Generator uses the name of the association to construct names for the corresponding component and get and set operations. If the association is not named, the Ada Generator uses this property to determine the name of the association.
When the Ada Generator needs the name of the association to generate a name for a component or a get or set operations,
${targetClass}
expands to the name of the association class or the association if there is one. Otherwise it expands to the name of the supplier class.The default setting is
The_${targetClass}
.Generate Get (Ada 95)
The Generate Get property determines whether the function is declared or suppressed by the Ada Generator.
Function The Get operation will be declared as a function.
Do Not Create No Get operation will be declared.
The default setting is
Function
.Get Name
The Get Name property specifies the name the Ada Generator outputs for the get accessor of an association class. The string can include the variable
${association}
, which expands to the name of the association. If the association is unnamed, then the name of the association class is used.The default setting is
Get_${association}
.Inline Get
The Inline Get property specifies whether an inline pragma should be generated for the Get operation.
Generate Set (Ada 95)
The Generate Set property determines whether the procedure is declared or suppressed by the Ada Generator.
Procedure The Set operation will be declared.
Do Not Create No Set operation will be declared.
The default setting is
Procedure
.Set Name
The Set Name property specifies the name the Ada Generator outputs for the Set accessor of an association class. The string can include the variable
${association}
, which expands to the name of the association. If the association is unnamed, then the name of the association class is used.The default setting is
Set_${association}
.Inline Set
The Inline Set property specifies whether an inline pragma should be generated for the Set operation.
Generate Associate
The Generate Association property determines whether the procedure is declared or suppressed by the Ada Generator.
Procedure The Associate operation will be declared.
Do Not Create No Associate operation will be declared.
The default setting is
Procedure
.Associate Name
The Associate Name property specifies the name the Ada Generator outputs for the Associate operation of an association.
The default setting is
Associate
.Inline Associate
The Inline Associate property specifies whether an inline pragma should be generated for the Associate operation.
Generate Dissociate
The Generate Dissociate property determines whether the procedure is declared or suppressed by the Ada Generator.
Procedure The Dissociate operation will be declared.
Do Not Create No Dissociate operation will be declared.
The default setting is
Procedure
.Dissociate Name
The Dissociate Name property specifies the name the Ada Generator outputs for the Dissociate operation of an association.
The default setting is
Dissociate
.Inline Dissociate
The Inline Dissociate property specifies whether an inline pragma should be generated for the Dissociate operation.
UML Package PropertiesDirectory
The Directory property specifies the UML package. This property defaults to
AUTO GENERATE
.
Module Spec PropertiesThe model spec properties are described on the following pages:
Generate
The Generate property specifies whether or not the Ada Generator will generate a code file for the module spec.
This property allows you to prevent code from ever being generated for a module, such as modules in third party libraries, even if it is selected when the Ada Generator is invoked.
Copyright Notice
The Copyright Notice property contains text that is placed in a comment block at the beginning of the Ada specification file created by the Ada Generator for the module spec. This property can be used to include copyright notices or project identification information at the beginning of a module. The text in the Copyright Notice property is preceded by comment delimiters ("--"), so they do not need to be included in the text of the property itself.
Return Type
The Return Type property specifies the subtype indication for the return value of a subprogram module. For example, if the Return Type property is set to Calendar.Time for a subprogram specification module named Current_Time, the Ada Generator will output:
function Current_Time return Calendar.Time;If Return Type is set to blank, the Ada Generator will output:
procedure Current_Time;The Return Type property is ignored when the module spec is not a subprogram specification.
Generic Formal Parameters
The Generic Formal Parameters property is used to specify the generic formal part of a generic module spec. For example, if the Generic Formal Parameters property is set to
type Item is private
for a generic package specification module named Stack, the Ada Generator will output:
generic type Item is private; package Stack is ... end Stack;If
Size : in Positive
is added to Generic Formal Parameters, the Ada Generator will output:
generic type Item is private; Size : in Positive; package Stack is ... end Stack;The Generic Formal Parameters property is ignored when the module spec is not a generic. Additional generic formal parameters may be added to the generic formal part if a generic class is assigned to the module, because the generic formal parameters of the generic class will be merged with those of the module.
Additional Withs
The Additional Withs property specifies additional with clauses to be included in the context clause of the module spec. For example, if the Additional Withs property is set to
Text_Io
for a subprogram specification module namedQuadratic_Equation
, the Ada Generator will output:
-- Additional Withs: with Text_Io; procedure Quadratic_Equation;If
Real_Operations
is added to Additional Withs, the Ada Generator will output:
-- Additional Withs: with Text_Io; with Real_Operations; procedure Quadratic_Equation;Only the simple names of the library units should be listed in the Additional Withs property, with one library unit per line.
Module Body PropertiesThe module body properties are described on the following pages:
Is Subunit
The Is Subunit property specifies whether the component is a subunit. For a component to be considered a subunit, the component name must be an expanded name, composed of the parent unit name and the name of the subunit. A dependency must be established between the subprogram body component and the package body component. The subunit name must correspond to a subprogram within an associated class of the parent component, where the property Subprogram Implementation is set to "Separate".
Is Private (Ada 95)
The Is Private property controls whether the package is private or not.
Generate
The Generate property specifies whether or not the Ada Generator will generate a code file for the module body.
This property allows you to prevent code from ever being generated for a module, such as modules in third party libraries, even if it is selected when the Ada Generator is invoked.
Copyright Notice
The Copyright Notice property contains text that is placed in a comment block at the beginning of the Ada body file created by the Ada Generator for the module body. This property can be used to include copyright notices or project identification information at the beginning of a module. The text in the Copyright Notice property is preceded by comment delimiters ("--"), so they do not need to be included in the text of the property itself.
Return Type
The Return Type property specifies the subtype indication for the return value of a subprogram module. For example, if the Return Type property is set to
Calendar.Time
for a subprogram body module namedCurrent_Time
, the Ada Generator will output:
function Current_Time return Calendar.Time is ...If Return Type is set to blank, the Ada Generator will output:
procedure Current_Time is ...The Return Type property is ignored when the module body is not a subprogram body.
Additional Withs
The Additional Withs property specifies additional with clauses to be included in the context clause of the module body. For example, if the Additional Withs property is set to
Text_Io
for a subprogram body module named Quadratic_Equation, the Ada Generator will output:
-- Additional Withs: with Text_Io; procedure Quadratic_Equation is ...If
Real_Operations
is added to Additional Withs, the Ada Generator will output:
-- Additional Withs: with Text_Io; with Real_Operations; procedure Quadratic_Equation is ...Only the simple names of the library units should be listed in the Additional Withs property, with one library unit per line.
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |