Code templates are editable strings that you can use
to specify formatting such as the white space and indentation of generated
C++ code. You can also use code templates to control the actual
code that the C++ transformation generates at a basic level. For
example, you can use a code template that replaces tags in the header
of a class with values for the name and body of the class.
To specify the format of C++ code generated by
the C++ transformation:
- Click .
- Expand Modeling, expand Transformations,
click UML to C++ Transformation.
- Click the Templates tab.
- On the Templates page, in the Configure
generated code list, click a template.
- To edit the header section of a template, in the Header field,
type your changes.
- To edit the body section of a template, in the Body field,
type your changes.
- To display a message when a new version of a modified
template is available, select Show warning when an updated
template set is available.
Note: The message is displayed when you open
the Templates page of the Preferences window
and when you run a C++ transformation.
- Click OK.
The edited templates are applied the next time that you
run this transformation configuration.