-
Notifications
You must be signed in to change notification settings - Fork 1
CPP Code Generation
Daniel Segesdi edited this page Jun 5, 2015
·
15 revisions
Note: If you are generating CPP code from the UML model, the model elements should be in a component, because the codegeneration runs only on components.
- Open the UML diagram in papyrus
- Right click on the blank area in the editor and select Generate CPP code for selected UML model
- Use the UML-Integration to generate xtUMLrt model from UML
- Open the xtUMLrt model (with Sample Reflective Ecore Editor)
- Right click on any XTComponent and select Generate CPP code for selected XTComponent
- The code snippets for the XTClasses inside the XTComponent will be generated into an
emdw-cpp-genfolder next to the model file
- If the model is not in the workspace, a new project called
com.ericsson.emdw.cpp.generated.codeis created and the snippets are saved under a folder with the same name as the model file (e.g.model.xtuml)
- The snippets can be copied to the prepared C++ project found in
tests/Dummy_StateMachine
- Insert the content of the generated files between the
// GENERATED CODE STARTand// GENERATED CODE ENDcomments ofTEST.ccandTEST.hhinTest_FSM/Main_Package/Test_Component - Note that you will have to edit
Test_FSM.ccandTest_Package_decl.hhif your XTClass is not calledTEST
- Compile and run the code to see trace information on the standard output
You can find a simple example that contains a single TEST class here.
You can find more example models here