UML-to-C++ transformation profile

The UML-to-C++ transformation profile contains several stereotypes that you can use to mark up your UML model and to control how the transformation transforms each model element into C++ code. The stereotypes of the profile become available when you apply the profile to your source model.

You can apply the stereotypes of the UML-to-C++ transformation profile to model elements in your source model to specify how the transformation generates C++ code. For example, when you apply the «cpp_operation» stereotype to an operation in the model, and set the isInline stereotype property to true, the transformation generates an inline operation.

You should not apply more than one stereotype to a model element. The transformation creates only one C++ object for each model element, regardless of how many stereotypes you apply. The following table lists the effects of applying multiple stereotypes to model elements:
UML element Effects
Class The «cpp_typedef» stereotype has the highest priority

If you do not apply this stereotype, and if you apply both the «cpp_struct» and «cpp_union» stereotypes, the transformation generates a C++ union

Dependency If you apply both the «cpp_dependency» and «cpp_friend» stereotypes to a UML dependency, the transformation processes both stereotypes and generates a friend relationship and a dependency
Operation The transformation processes stereotypes in the following order, from highest priority to lowest priority:
  • «cpp_constructor»
  • «cpp_copy_consructor»
  • «cpp_destructor»
  • «cpp_assignment»
  • «cpp_operation»

Feedback