Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > Ada Code > Generating Ada code > Modeling Ada code in Modeler > Modeling generic subprograms and instantiated generic subprograms in Modeler (Ada code)
  
Modeling generic subprograms and instantiated generic subprograms in Modeler (Ada code)
You model generic subprograms and instantiated generic subprograms for Ada 83 and Ada 95 through the «Ada Generic» and «Ada Generic Instance» stereotypes.
To set up an Operation to represent a generic subprogram:
1. If you have not done so already, add the Ada Profile package to the Model. How?
2. In Modeler, create an Operation.
3. Open the Operation's Property Pages.
4. Apply the «Ada Generic» stereotype to the Operation. How?
5. Click the Ada Generic tab, select the Ada Generic Parameters entry, and then on the Property Pages click the Properties button.
6. In the text window, type the parameters.
7. On the Text Format Toolbar, click the Save button, and then close the text window.
8. If you want to generate the subprogram body as a separate:
a. Apply the «Ada Separate» stereotype to the Operation. How?
b. Through the Ada Parent Subprogram tag definition (applied by the «Ada Separate» stereotype), reference the Operation that is generated as the subprogram that owns the separate.
To set up an Operation to represent an instantiated generic subprogram:
1. If you have not done so already, add the Ada Profile package to the Model. How?
2. In Modeler, create an Operation.
3. Open the Operation's Property Pages.
4. Apply the «Ada Generic Instance» stereotype to the Operation. How?
5. Click the Ada Generic Instance tab.
6. Select the Ada Generic Parameters entry, and then on the Property Pages click the Properties button.
7. In the text window, type the parameters.
8. On the Text Format Toolbar, click the Save button, and then close the text window.
9. If the associated generic subprogram is modeled in the Model:
a. Select the Ada Generic Parent entry, and then on the Property Pages click the Properties button.
b. In the Model Items List, click Operation.
c. Select the check box associated with the Operation from which the associated generic subprogram is generated, and then click OK.
10. If the associated generic subprogram is not modeled in the Model:
a. Select the Ada Generic Parent Text entry, and then on the Property Pages click the Properties button.
b. In the text window, type the name of the associated generic subprogram.
c. On the Text Format Toolbar, click the Save button, and then close the text window.
11. If you want to generate the subprogram body as a separate:
a. Apply the «Ada Separate» stereotype to the Operation. How?
b. Through the Ada Parent Subprogram tag definition (applied by the «Ada Separate» stereotype), reference the Operation that is generated as the subprogram that owns the separate.