Type definition mapping for C# (C# code)
ACS can generate the following code elements from a Type Definition:
• Array – set the construction to Array and use the Array as a type.
• Enums – set the construction to Enumeration and apply the «C# Enum» stereotype.
• Nullable Type – set the construction to Alias and reference the type. When the Alias is used as a type, ACS generates the type as a nullable type.
• Pointer Type – set the construction to Alias, select the Pointer check box, and reference the type. When the Alias is used as a type, ACS generates the type as a pointer type.
ACS generates the child items, properties and tagged values of a Type Definition as follows.
Child items:
Properties:
• For arrays, ACS uses the value of the Upper Bounds to generate the dimensions of the array.
• The Construction property can be set to Enumeration, Alias, Sequence or Array:
◦ When set to Enumeration, ACS generates the Type Definition as an enum.
◦ When set to Alias, for Modeler items that use the Type Definition as a type, ACS generates the item that is referenced through the Data Type property as a nullable type or pointer type.
◦ When set to Sequence, ACS ignores the Type Definition.
◦ When set to Array, for Modeler items that use the Type Definition as a type, ACS generates that item's code using information specified for the Type Definition.
• For aliases, ACS generates the Data Type as the type of the alias. For arrays, ACS generates the Data Type as the type of the array.
• ACS generates the Name property as the identifier of the enum.
| Note that ACS may modify the Type Definition name that is added to the code to make it valid for C#. You can specify the exact identifier to add to the code through the CODE_GENERATION_NAME property of a Type Definition.
Tell me more... |
• If the Pointer property is set to true (Property check box selected on Property Pages) and the Type Definition is an Alias; for Modeler items that use the Type Definition as a type, ACS generates the item that is referenced through the Data Type property as a pointer type.
Tag Definitions:
The «C# Enum» stereotype allows you to specify additional information for Type Definitions that are set up as enumerations. The «C# Enum» stereotype applies the following Tag Definitions to a Type Definition:
• If a value is set for the tagged value of the C# Attributes tag definition, ACS generates the value as the attributes of the enum.
• If a value is set for the tagged value of the C# Enum Base tag definition, ACS generates the value as the default type for the literals.
• If the tagged value of the C# Internal tag definition is set to Internal, ACS generates the enum with the internal modifier. If a value of the C# Internal tag definition is set to Protected Internal, ACS generates the enum with the protected internal modifiers.
• If the tagged value of the C# New tag definition is set to True, ACS generates the new keyword when appropriate.