This transformation uses the "C++ Transformation" profile to convey information about the model that is not readily available in UML. The profile includes the following stereotypes:
Stereotype |
Applicable to |
Attributes |
Type |
cpp_type |
Parameter, Property |
isMutable, qualifier (String), InitializerKind (Enumeration) |
Boolean with default value of false |
cpp_generalization |
Generalization |
GeneralizationKind |
Enumeration |
cpp_struct |
Class |
|
Boolean with default value of false |
cpp_union |
Class |
isAnonymousUnion |
Boolean with default value of false |
cpp_typedef |
Class |
ImplementationType |
String |
cpp_dependency |
Dependency |
isInclusionInHeader |
Boolean with default value of false |
cpp_friend |
Dependency |
|
Boolean with default value of false |
cpp_namespace |
Package, Model |
NamespaceName |
String |
cpp_operation |
Operation |
isInline, isVirtual, isFriend |
Boolean with default value of false |
cpp_constructor |
Operation |
isExplicit, isInline |
Boolean with default value of false |
cpp_copy_constructor |
Operation |
isExplicit, isInline |
Boolean with default value of false |
cpp_destructor |
Operation |
isVirtual, isInline |
Boolean with default value of false |
cpp_assignment |
Operation |
isInline |
Boolean with default value of false |
You should not apply more than one C++ transformation stereotype to a UML object. Applying multiple stereotypes has the following effects:
· UML class (cpp_struct, cpp_union, cpp_typedef): The transformation creates only one object, regardless of how many stereotypes you apply. The transformation gives priority to cpp_typedef. If the cpp_typedef stereotype is not applied, and if you apply both the cpp_struct and cpp_union stereotypes, the transformation generates a C++ struct with no standard operations.
· UML dependency (cpp_dependency, cpp_friend): If you apply both stereotypes, the transformation processes both stereotypes and crates a "friend" relationship and a dependency.
· UML operation (cpp_operation, cpp_constructor, cpp_copy_constructor, cpp_destructor, cpp_assignment): The transformation creates only one object regardless of how many stereotypes you apply to the operations. The following list shows the priority of stereotypes, from highest to lowest:
o cpp_constructor,
o cpp_copy_constructor,
o cpp_destructor,
o cpp_assignment,
o cpp_operation