Setting preferences for UML-to-C++ transformations

You can set preferences for UML-to-C++ transformations. For example, you can specify C++ preface and ending comments, and specify code formatting preferences.

You can specify comments that the transformation inserts at the beginning and end of the files that it generates. The text that you enter is inserted into the source code exactly as it appears in the text area. You must include the appropriate C++ comment notation. For example, you can specify copyright information, or other authoring information that must appear in each source file. You can also select formatting preferences for tab spacing, the display order of class attributes and operations, and indentation styles.

To set preferences for the UML-to-C++ transformation:

  1. Click Window > Preferences.
  2. In the Preferences window, expand Modeling > Transformations.
  3. Click UML to C++ transformation.
  4. To specify file preface and file ending comments, click the General tab, and type the comments in the appropriate text field.
  5. To set code formatting preferences, click the Edit styles tab, and select your formatting preferences:
    • To display class attributes followed by operations, with both sorted by C++ visibility rules, click Sort by visibility.
    • To display class attributes and operations in the same order as they are stored in the UML model, click Sort by storage.
    • To specify an indentation style for the code that the transformation generates, click an option in the Indentation styles pane. The style that you select, combined with the value that you specify for the Tab spaces field, determines the actual indentation of the code that the transformation generates.
  6. Click OK.
The transformation applies the preferences the next time that you run the transformation.
Related concepts
UML-to-C++ transformations
Related reference
Interpretation of UML model elements by UML-to-C++ transformations

Feedback