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 attributes for generating C++ code (C++ code)
  
Setting up attributes for generating C++ code (C++ code)
In addition to the standard Attribute properties in Modeler, you can apply the «C++ Attribute» stereotype to an Attribute, and then use their Tag Definitions to define C++ specific information.
1. If you have not done so already, add the C++ Profile package to your Model. How?
2. Set the standard properties of the Attribute as required. Tell me more...
If you want ACS to generate an Attribute as a #define rather than an attribute, set up the Attribute as Read Only with a Default, but no Type. You can then ignore the rest of this procedure.
3. If you want to generate the Attributes of a Model, Package, Class, Data Type, Interface or Signal in a specific order, order the Attributes as required. Tell me more...
4. Apply the «C++ Attribute» stereotype to the Attribute. For information about applying Stereotypes to an item, see Applying a Stereotype to a model item.
5. Open the Attribute's Property Pages, and then click the C++ Attribute tab.
For information about setting the tagged value of a Tag Definition, see Setting a tagged value for an applied Tag Definition.
6. If you want to specify array text for the Attribute, specify the text (including brackets) as the tagged value of the C++ Array Spec tag definition.
7. If you want to specify a CV qualifier for the Attribute, set the tagged value of the C++ CV Qualifier tag definition as required. Note that if the C++ CV Qualifier tag definition is blank and the Read Only property is set to true (Read Only check box selected on Property Pages), the const keyword is used.
8. If you want to specify indirection text for the Attribute, such as * or *const, specify the text as the tagged value of the C++ Indirection tag definition.
9. If the Attribute is scoped to a Class, Data Type, Interface or Signal and you want to specify that the Attribute is a non-member, that is, the Attribute is not a member of the owning item, but you want it to appear in the owning item's implementation file (or Interface's header file outside of the class definition), set the tagged value of the C++ Non Member tag definition to TRUE.
10. If you want to specify a storage class keyword for the Attribute, set the tagged value of the C++ Storage Class tag definition to auto, register, extern or mutable.
11. If you want to specify bitfield width text for the Attribute, specify the text as the tagged value of the C++ Bitfield tag definition.
12. If the Attribute's type is a template class, specify any text you want between the angle brackets as the tagged value of the C++ Actual Template Parameters tag definition.
13. If you want to specify that the Attribute is of type 'pointer to function', specify the function pointer return as the tagged value of the C++ Function Pointer Return tag definition and specify any function pointer parameters as the tagged value of the C++ Function Pointer Parameters tag definition. The tag definitions are generated as follows for the Attribute:
<C++ Function Pointer Return> (<C++ Indirection><derived C++ Name>)(<C++ Function Pointer Parameters>);
14. If you want the Attribute to be generated with no name, set the tagged value of the C++ Anonymous Item tag definition to TRUE.
15. If you want to specify the linkage, set the tagged value of the C++ Linkage tag definition as required, for example, extern "C".