The user can view Cxx code generated for a selected model element by using the image "Edit header" and image "Edit body" buttons in the "Cxx" property view.

image
The "Edit header" and "Edit body" buttons in the "Cxx" property view

Let’s use these buttons to view the code generated for our "SimpleProject" class. We can see Cxx constructors, operators and destructors generated from the model-level Coplien pattern, as well as "TODO" notes.

First of all, click on the image "Edit header" button to view the header file code generated for the "SimpleProject" class.

image
Code editor on the header file

Next, click on the image "Edit body" button to view the body file code generated for the "SimpleProject" class.

image
Code editor on the body file

The //begin of modifiable zone…​. type of comment provides the markup used to ensure model/code consistency. You can enter your code between markups, and this code is then transferred back into the model to the respective Cxx code notes when the editor is saved. The code is read only outside the marked zone, preventing unwanted modifications in the model.

Note: We recommend that the "Edit header" and "Edit body" buttons be used to enter implementation code, and that the code preview function be used to examine how UML model elements and their Cxx properties (entered manually or deduced automatically) are translated to Cxx code.