Skip to content

CPP Code Generation

Ábel Hegedüs edited this page Apr 29, 2015 · 15 revisions

Usage

  1. Use the UML-Integration to generate xtUMLrt model from UML
  2. Open the xtUMLrt model (with Sample Reflective Ecore Editor)
  3. Right click on any XTClass and select Generate CPP code for selected XTClass
  4. The code snippets for the state machine of the XTClass will be generated into an emdw-cpp-gen folder next to the model file
  • If the model is not in the workspace, a new project called com.ericsson.emdw.cpp.generated.code is created and the snippets are saved under a folder with the same name as the model file (e.g. model.xtumlrt)
  1. 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 START and // GENERATED CODE END comments of TEST.cc and TEST.hh in Test_FSM/Main_Package/Test_Component
  • Note that you will have to edit Test_FSM.cc and Test_Package_decl.hh if your XTClass is not called TEST
  1. Compile and run the code to see trace information on the standard output

Example model

You can find a simple example that contains a single TEST class here.

Clone this wiki locally