To specify system arguments for the UML-to-C++ transformation:
| Action | System argument | Default transformation behavior |
|---|---|---|
| Display attributes and operations in the following order: Public, Protected, Private | -DVISIBILITY_ORDER=true | If you do not specify this system argument, the generated code lists attributes and operations in the following order: Private, Protected, Public. |
| Exclude relative path information in #include directives | -DEXCLUDE_PATH_FOR_INCLUDES=true | If you do not specify this system argument, the transformation generates #include directives that specify relative path information. |
| Generate the typename keyword when declaring class templates with type parameters, for example, template <typename identifier> class_declaration | -DTYPENAME_TEMPLATES=true | If you do not specify this system argument,
when you run the transformation on a model that contains a template
class with a template parameter that is of type class, the generated
declaration contains the class keyword. Consider the following example: ![]() By
default, the transformation generates the following declaration in
TemplateClass1.h:
template <class Parameter1>
class Class1
{
//Begin section for Class1
//TODO: Add attributes that you want preserved
//End section for Class1
public:
//@uml.annotationsderived_abstraction="platform:/resource/Miscellaneous%20Models/source.emx#_hFn-0GaLEdyC-b6mj80KQA"
//@generated "UML to C++ (com.ibm.xtools.transform.uml2.cpp.CPPTransformation)"
int Operation1()
{
//TODO Auto-generated method stub
return 0;
}
}; //end class Class1
</class>
If you specify -DTYPENAME_TEMPLATES=true,
the transformation generates the following declaration in TemplateClass1.h:
template <typename Parameter1>
class Class1
{
//Begin section for Class1
//TODO: Add attributes that you want preserved
//End section for Class1
public:
//@uml.annotationsderived_abstraction="platform:/resource/Miscellaneous%20Models/source.emx#_hFn-0GaLEdyC-b6mj80KQA"
//@generated "UML to C++ (com.ibm.xtools.transform.uml2.cpp.CPPTransformation)"
int Operation1()
{
//TODO Auto-generated method stub
return 0;
}
}; //end class Class1</typename>
|
| Generate inline function code in a header file | -DINLINE_HEADER=true | If you do not specify this system argument, the transformation generates the code for inline functions in the C++ body file. |
| Specify alternate file name extensions for C++ body files | -DBODY_FILE_EXTENSION=.<file name
extension> For example, to generate C++ body files that
have .cc as a file name extension, specify -DBODY_FILE_EXTENSION=.cc.
Note: If
you apply the «cpp_properties» stereotype to a source model element,
the value of the bodyFileExtension property overrides the value that
you specify in the eclipse.ini file.
|
If you do not specify this system argument, the transformation generates C++ body files that have .cpp as a file name extension. |