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 protected types and protected objects in Modeler (Ada code)
  
Modeling protected types and protected objects in Modeler (Ada code)
You model a protected type in Modeler through a Class or Data Type stereotyped by the «Ada Protected Type» stereotype. If you additionally stereotype the Class or Data Type with an «Ada Anonymous» stereotype, ACS generates a protected object. Operations stereotyped by the «Ada Entry» stereotype are generated as entries, with the tagged value of the Ada Entry Barrier tag definition generated as the entry guard.
* 
This procedure applies only to the Ada 95 Code Generator DLL.
Protected type example:
Protected object example:
To model a protected type or protected object in Modeler:
1. If you have not done so already, add the Ada Profilepackage to the Model. How?
2. In the required Package, create a Class or Data Type to represent the protected type or protected object.
3. Name the Class or Data Type to that of the protected type or protected object.
4. Apply the «Ada Protected Type» stereotype to the Class or Data Type. How?
5. If you want to model a protected object, apply the «Ada Anonymous» stereotype to the Class or Data Type. How?
6. If the protected Type or protected object has a discriminant:
a. Create a child Attribute for the Class or Data Type.
b. Name the Attribute as is appropriate.
c. Stereotype the Attribute with the «Ada Discriminant» stereotype.
7. For each entry in the protected type or protected object:
a. Create a child Operation of the Class or Data Type.
b. Name the Operation to that of the entry.
c. Apply the «Ada Entry» stereotype to the Operation. How?
d. Set the tagged value of the Ada Entry Barrier tag definition (applied by the «Ada Entry» stereotype) to the entry barrier text, that is, the text after the 'when' and before the 'is'.
e. If the entry uses an array of Ada entries, use the appropriate «Ada Entry» stereotype tag definitions to record the array:
For an array such as (1..6), use the Ada Entry Family Index tag definition.
For an array such as (T), where T is a type, use Ada Entry Family Index Type tag definition to reference the appropriate Type Definition.
For an array such as (For N in T), use Ada Entry Index Specification tag definition.
f. Set the properties of the Operation as required.
g. Create Operation Parameters to model any entry parameters.
8. If you want to generate the protected type or protected object as a separate:
a. Apply the «Ada Separate» stereotype to the 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.
9. Set up Attributes and Operations up as required.