Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > C++ code > Generating C++ code > Generating C++ code > Modeling C++ code in Modeler > Setting up template class derivations for generating C++ code (C++ code)
  
Setting up template class derivations for generating C++ code (C++ code)
For information about a template class derivations, see Template class derivation mapping.
To set up a template class derivation:
1. Create the template class and specify its formal parameters:
a. On the Class Diagram, create a Class, Data Type, Interface or Signal and name it as required.
b. Open the Property Pages for the Class, Data Type, Interface or Signal.
c. On the Options tab, select the Template check box.
d. In the Formal Template Parameters text box, type the formal parameters, delimiting each Parameter with a comma.
2. Create the instantiation class and specify its template specification parameters:
a. On the Class Diagram, create a Class, Data Type, Interface or Signal.
b. Open the Property Pages for the Class, Data Type, Interface or Signal.
c. On the Options tab, select the Template Specialization check box.
d. In the Template Specialization Parameters text box, type the specialization parameters, delimiting each Parameter with a comma.
3. Create the derived class:
On the Class Diagram, create a Class, Data Type, Interface or Signal and name it as required.
4. Add the Generalizations:
a. On the Class Diagram toolbar, click the Generalization button.
b. Click the template class you created in Step 1.
c. Click the instantiation class you created in Step 2.
d. Click the Generalization button.
e. Click the instantiation class you created in Step 2.
f. Click the derived class you created in Step 3.