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 > Mapping Information > Mapping information for state diagrams > Interface mapping for C++ (C++ code)
  
Interface mapping for C++ (C++ code)
For each Interface that is not nested or non-member, ACS generates a header file (.h). Nested Interfaces are generated within the parent class declaration.
The class declaration and implementation is derived from the items it owns, properties of the Interface, and the tagged values set for Tag Definitions applied by the «C++ Class» stereotype.
Child items:
If the Interface owns Attributes, the Attributes are typically generated within the class declaration. For Attribute mapping information, see Attribute mapping for C++ (C++ code).
If a typed Part (Attribute) has an Association that has not been rolled up to the Part's type, ACS generates a nested class that is derived from the Part's type. The nested class defines the Role that is modeled against the Part.
If an Interface owns Parts (Attributes or Roles) that are connected through an Association, initialization code is generated in the constructor for the Interface.
If the Interface owns Classes, the nested Classes are generated within the class declaration, unless its C++ Non Member tag definition is set to TRUE.
If the Interface owns Data Types, the nested Data Types are generated within the class declaration, unless its C++ Non Member tag definition is set to TRUE.
If the Interface owns Dependencies, ACS typically generates #includes in the code. For Dependency mapping information, see Dependency mapping for C++ (C++ code).
If the Interface owns Generalizations that define inheritance, the Generalizations are typically generated as inheritance lists. For Generalization mapping information, see Generalization mapping for C++ (C++ code).
If the Interface owns Interfaces, the nested Interfaces are generated within the class declaration, unless its C++ Non Member tag definition is set to TRUE.
If the Interface owns Operations, the Operations are typically generated within the class declaration. ACS generates the Operations as public and pure virtual. For Operation mapping information, see Operation mapping for C++ (C++ code).
If the Interface owns Roles, the Roles are typically generated as attributes within the class declaration. For Role mapping information, see Association mapping for C++ (C++ code).
If a typed Part (Role) has an Association that has not been rolled up to the Part's type, ACS generates a nested class that is derived from the Part's type. The nested class defines the Role that is modeled against the Part.
If an Interface owns Parts (Attributes or Roles) that are connected through an Association, initialization code is generated in the constructor for the Interface.
If the Interface owns Type Definitions, the Type Definitions are typically generated within the class declaration. For Type Definition mapping information, see Definition mapping for C++ (C++ code).
Properties
If the Description property has a value, ACS generates the description as a comment on the line before the class declaration.
The Formal Template Parameters property is generated as the formal template parameters for a template class.
The Name property is generated as the name of the header and implementation files, and the name of the class in the code.
Note that ACS may modify the class name that is added to the code to make it valid for C++. You can specify the exact class name to add to the code through the CODE_GENERATION_NAME property of an Interface. Tell me more...
If the Template property is set to true (Template check box selected on Property Pages), the Interface is generated as a template class using the Formal Template Parameters that are specified. For more information about how Template Interfaces are handled, see
Tag Definitions:
If the tagged value of the C++ Anonymous Itemtag definition is set to TRUE, it means that the class is used as an anonymous type and is generated inline.
If the tagged value of the C++ Forward Declarations tag definition references any Classes, Data Types, Interfaces and Type Definitions, ACS generates forward declarations to the classes, structs, unions and enums that are generated from those Classes, Data Types, Interfaces and Type Definitions.
If the tagged value of the C++ Forward Declaration Text tag definition has been set, the value is generated as forward declarations.
If the tagged value of the C++ Friend tag definition references any Classes, Data Types and Interfaces, ACS generates friend declarations for those items.
If the tagged value of the C++ Friend Text tag definition has been set, the value is generated as friend declarations.
If the tagged value of the C++ Header File Comment tag definition has been set, the value is generated as a header file comment.
If the tagged value of the C++ Header Include tag definition has been set, the value is generated at the beginning of the header file so that you can generate your own #includes. Note that you can use Dependencies to generate #includes to Classes, Data Types and Interfaces that are modeled in the Model.
Reverser Notes: When reverse engineering header file #includes the Reverser records the #include as text in the C++ Header Include tag definition.
The C++ Implementation File Comment tag definition does not apply to Interfaces.
The C++ Implementation Include tag definition does not apply to Interfaces.
If the tagged value of the C++ Inheritance List tag definition has been set, the value is used to generate the inheritance list for the Interface. Note that when a value has been set, the Interface's Generalizations are ignored.
If the tagged value of the C++ Linkagetag definition has been set, the value is generated as the class' linkage. For example, extern "C".
If the tagged value of the C++ Non Membertag definition is set to TRUE (applies only to nested Interfaces), ACS generates the class in the code file created for the root item, but not as part of the class or struct created for the root Modeler item.
The tagged value of the C++ Specialization Parameterstag definition is ignored when generating code.
If the tagged value of the C++ Using Decls tag definition has been set, the value is generated as the using declarations for the class.
If the C++ Using Decls and C++ Using Directives tag definitions are both blank, ACS will generate a 'using namespace std' statement when necessary.
If the tagged value of the C++ Using Directives tag definition has been set, the value is generated as the using directives for the class.
If the C++ Using Directives and C++ Using Decls tag definitions are both blank, ACS will generate a 'using namespace std' statement when necessary.
Modeler uses the CPP_HDER tag definition for recording information about generated and reverse engineered header files.
The CPP_IMPL tag definition does not apply to Interfaces.
If the tagged value of the C++ Generate State Machine tag definition has been set to FALSE, ACS does not generate state machine code for the Interface's State Diagram.
The following tag definition is applied to an Interface by the «C++ Library» stereotype:
If a value has been set for the tagged value of the C++ LIB_INCLUDE tag definition, the value is generated as the #include for any classes that use the library, rather than ACS generating a #include based on the library's location in the model.