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 packages and instantiated generic packages in Modeler (Ada code)
  
Modeling generic packages and instantiated generic packages in Modeler (Ada code)
You model generic packages and instantiated generic packages for Ada 83 and Ada 95 through the «Ada Generic» and «Ada Generic Instance» stereotypes.
To set up a package, class or data type to represent a generic package:
1. If you have not done so already, add the Ada Profile package to the Model. How?
2. In Modeler, create a Package, Class or Data Type.
3. Open the Property Pages of the Package, Class or Data Type.
4. Apply the «Ada Generic» stereotype to the Package, Class or Data type. How?
5. For a Package, click the Options tab, and then select the Namespace option.
6. Click the Ada Generic tab, 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 you want to generate the package body as a separate:
a. Apply the «Ada Separate» stereotype to the Package, Class or Data Type. 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 a package, class or data type to represent an instantiated generic package:
1. If you have not done so already, add the Ada Profilepackage to the Model. How?
2. In Modeler, create a Package, Class or Data Type.
3. Open the Property Pages of the Package, Class or Data Type.
4. Apply the «Ada Generic Instance» stereotype to the Package, Class or Data type. How?
5. For a Package, click the Options tab, and then select the Namespace option.
6. Click the Ada Generic Instance tab.
7. Select the Ada Generic Parameters entry, and then on the Property Pages click the Properties button.
8. In the text window, type the parameters.
9. On the Text Format Toolbar, click the Save button, and then close the text window.
10. If the associated generic package 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 Package, Class or Data Type, depending on whether the associated package is modeled through a Package, Class or Data Type.
c. Select the check box associated with the Package, Class or Data Type from which the associated generic package is generated, and then click OK.
11. If the associated generic package is notmodeled 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 package.
c. On the Text Format Toolbar, click the Save button, and then close the text window.
12. If you want to generate the package body as a separate:
a. Apply the «Ada Separate» stereotype to the Package, Class or Data Type. 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.