The following table lists the stereotypes of the profile and their related properties and types.
| Stereotype | Applies to | Properties | Type |
|---|---|---|---|
| «cpp_assignment» | Operations | isInline | Boolean with a default value of false |
| «cpp_body_comment» | Comments that you want to appear in the source code, such as comments for functions and static variables | ||
| «cpp_constructor» | Operations | isExplicit, isInline | Boolean with a default value of false |
| memberInitializers | This string specifies
the initializer list of the constructor of a class. The list specifies
the initial values of the attributes of the class or the parent class. For example, specify the following string to generate
an initializer list for a constructor method for a class named Class1
that has an integer attribute named attribute1 and a string attribute
named name1:
Do
not enclose the string with single quotation marks. The transformation
generates the following constructor:
|
||
| «cpp_copy_constructor» | Operations | isExplicit, isInline | Boolean with a default value of false |
| memberInitializers | This string specifies
the initializer list of the constructor of a class. The list specifies
the initial values of the attributes of the class or the parent class. For example, specify the following string to generate
an initializer list for a constructor method for a class named Class1
that has an integer attribute named attribute1 and a string attribute
named name1:
Do
not enclose the string with single quotation marks. The transformation
generates the following constructor:
|
||
| «cpp_dependency» | Dependency relationships | isForwardReferenceInBody | Boolean with a default value of false;
if the value is set to true, it generates a forward declaration
of the supplier type in the .cpp file of the client class, and the
value of the isForwardReferenceInHeader property is ignored. If
you set this property to true, the transformation does not
generate a forward reference in the following situations:
|
| isForwardReferenceInHeader | Boolean with a default value of false;
if the value is set to true, it generates a forward declaration
of the supplier type in the header file of the client class. If
you set this property to true, the transformation does not
generate a forward reference in the following situations:
|
||
| isInclusionInBody | Boolean with a default value of true; if the value is set to true, it generates an #include directive in the .cpp file of the client class. | ||
| isInclusionInHeader | Boolean with a default value of false; if the value is set to true, it generates an #include directive in the header file of the client class, and the value of the isInclusionInBody property is ignored. | ||
| «cpp_destructor» | Operations | isVirtual, isInline | Boolean with a default value of false |
| «cpp_enum» | Enumerations | isAnonymousEnum | Boolean with a default value of false; if the value is set to true, the transformation generates an anonymous enumeration |
| «cpp_external_inclusion» | Classes, interfaces | includeType | Enumeration with values that specify how the transformation generates include directives when the imported class is not part of the transformation source |
| relativeToFolderInput | String; required if you specify the Generate include directives that are relative to this folder value in the includeType property | ||
| specificFileNameInput | String; required if you specify the Generate an include directive that contains the following file name value in the includeType property | ||
| «cpp_friend» | Dependency relationships | Generates an #include directive in the header file, and declares the supplier class as a friend of the client class | |
| «cpp_generalization» | Generalization relationships, InterfaceRealization relationships | GeneralizationKind | Enumeration with public, protected, private, and default values (0-public, 1-protected, 2-private, 3-default) |
| isVirtual | Boolean with a default value of false; indicates virtual inheritances | ||
| «cpp_globals» | Classes | Applying this stereotype to a class indicates that this is an empty class; the transformation does not generate a corresponding C++ class. The transformation generates only corresponding C++ global types, typically variables and methods, for each element that is specified in the stereotyped class. | |
| «cpp_internal_inclusion» | Classes, interfaces | includeType | Enumeration with values that specify how the transformation generates include directives when the importing class and the imported class are part of the transformation source |
| relativeToFolderInput | String; required if you specify the Generate include directives that are relative to this folder value in the includeType property | ||
| specificFileNameInput | String; required if you specify the Generate an include directive that contains the following file name value in the includeType property | ||
| «cpp_namespace» | Packages | NamespaceName | String |
| «cpp_operation» | Operations | isInline | Boolean with a default value of false; if the value is set to true, it generates the operation as inline and adds the operation body to the corresponding header file |
| isVirtual | Boolean with a default value of false; if the value is set to true, it generates the operation as a virtual function | ||
| isFriend | Boolean with a default value of false; if the value is set to true, it generates a friend operation | ||
| isGlobal | Boolean with a default value of false; if the value is set to true, it generates a global function and an empty class that corresponds to the UML class that contains the global function | ||
| «cpp_properties» | Classes, interfaces, enumerations | bodyFileExtension | C++ body file with the specified extension |
| headerFileExtension | C++ header file with the specified
extension For example, to generate code for a C++ template class
in a header file that has .inc as a file name extension, you can apply
this stereotype to the class, and set this property to ".inc".
Note: You
must associate the .inc file name extension to a C++ header file so
that the C/C++
Development Tools (CDT)
recognize .inc as a valid C++ file name extension.
|
||
| «cpp_specialized_template» | Classes that have a binding relationship with a template class | All classes that specify a «bind» relationship
with a template class are transformed into typedef types that reference
an instance of the base template. All formal parameters in the bind relationship must be bound. |
|
| «cpp_struct» | Classes | ||
| «cpp_type» | Properties, parameters | arrayDimensions | This string is typically used to specify
multidimensional arrays that UML 2.0 does not support. For example, use this string to specify an array for a property: [10][20]; or for a non-return type parameter: [][10] |
| InitializerKind | This enumeration has constructor and
assignment values (0-constructor). If the InitializerKind property is set to 0, the transformation generates a constructor initializer. If the InitializerKind property is set to 1, the transformation generates an assignment statement in the constructor. |
||
| isAuto, isMutable, isRegister, isVolatile | Boolean with a default value of false | ||
| qualifier | This string contains the part of a
C++ type that cannot be modeled in UML, and that appears before the
variable name and after the type, such as ** and &. For example, const
int **a[12][33] can be represented by these items:
|
||
| Attributes | isGlobal | Boolean with a default value of false; if the value is set to true, it generates a global variable and an empty class that corresponds to the UML class that contains the global variable | |
| «cpp_typedef» | Classes | arrayDimensions | String |
| ImplementationType | This string specifies the type to which
the typedef type refers; it can be a primitive type or a user-defined
type. User-defined types can be fully qualified or not. If a type name is not fully qualified, the scope of the typedef type is applied to the user-defined type. |
||
| qualifier | This string specifies pointer types,
constants, and so on. For example, the transformation generates const
int **Typedef1[12][13] for a UML element of the following
description:
|
||
| «cpp_union» | Classes | isAnonymousUnion | Boolean with a default value of false |
| UML element | Transformation output |
|---|---|
![]() |
Class1.cpp:
|