C++ Code generation help needed? [message #1266482] |
Fri, 07 March 2014 14:10 |
Joost Kraaijeveld Messages: 273 Registered: July 2009 |
Senior Member |
|
|
Hi,
Because I am interested in C++ code generation I looked at
http://wiki.eclipse.org/Codegen_description and tried the code
generator. It sort of works but needs some work. I am willing to
contribute to the development.
Who is actually working on the generator and what could I do to help?
Joost
Cheers,
Joost
|
|
|
|
|
|
|
Re: C++ Code generation help needed? [message #1271214 is a reply to message #1266511] |
Fri, 14 March 2014 14:27 |
|
There's a framework for component-oriented applications called Qompass designer. The basic idea is that the code generator only supports "basic" features. More complex ones are supported by model transformations that are executed before the code generation. The transformations already implemented include in particular (1) "connector reification": replacing UML connectors with an interaction component, (2) container extension: embedding a class into a container (composite) and add services to this container and (3) component to OO transformations: replace ports and connectors. (2) has been used to implement tracing mechanisms and a simple state machine support.
Qompass is available as Papyrus extension via the standard update-site. It comes with online-help, a cheat-sheet and some example. But the documentation is certainly far from perfect. Please contact my by private mail (firstname.lastname@cea.fr) for more information.
Ansgar (Radermacher)
|
|
|
|
|
|
|
Re: C++ Code generation help needed? [message #1274601 is a reply to message #1273928] |
Fri, 21 March 2014 17:55 |
Stephen Blackwell Messages: 138 Registered: March 2014 |
Senior Member |
|
|
My ultimate goal is to move away from Rhapsody.
My Rhapsody models contain some complicated state charts including parallel states, embedded or sub-state charts and derived state charts.
My immediate goal to to determine if Eclipse/Papyrus/Acceleo/??? can do the job.
To that end I want to start creating the simplest project I can, my "hello world" project, and run through all the steps to build and validate a model, generate, compile and build a C++ program.
Then I will slowly start to increase the complexity of the model to see what limtations and problems I run into.
As far as I can tell from what I've read, this should be possible but I have not found any useful examples or tutorials to get started.
So again, if anybody knows or any such documentation, please post a link.
The documentation that I have read for both Papyrus and Acceleo is, shall we say, obtuse.
FWIW, I would be happy to help improve the documentation.
Thanks,
Steve
|
|
|
|
Re: C++ Code generation help needed? [message #1309294 is a reply to message #1307464] |
Tue, 22 April 2014 15:59 |
|
Dear all,
Papyrus comes with a Acceleo based C++ code generator, the CDT editing feature is still experimental. It would be good to hear your feedback what works and what does not.
Although the work has been done on a Linux machine, the use of "/" instead of "\" should not impose any problems on Windows with mingw, cygwin or Visual C++. But you need eventually setup your include paths properly in the CDT project settings.
There are two different ways to use the C++ code generation. The first is the direct production of a C++ file (.cpp/.h) that belongs to the model element, the 2nd a support for component based modeling, including the generation of code from a so-called deployment plan. The idea is that a deployment plan describes instances and their allocation to hardware nodes. This approach is inspired by the CORBA Component Model (CCM).
There is a HelloWorld sample model for the 2nd way. It requires to
(1) Install Qompass designer from the Papyrus extensions
(2) Create an empty project (could be a CDT project, but does not have to be)
(3) Select the created project and choose FILE>New>Example.
(4) Select "Qompass Hello World example" from the list.
(5) Open the created example and select the deployment tab. Generate code from the deployment plan with a right click on the selected plan and then choose "Generate deployment models and code" from the context menu.
(6) The generator will produce a model for each node. Each node corresponds to a CDT project containing this model and the code generated from it.
Whereas the 2nd way to produce code is more powerful, it is also more complicated. Therefore, I will also providing a Hello World example for a simple object-oriented model soon.
|
|
|
Re: C++ Code generation help needed? [message #1310533 is a reply to message #1309294] |
Wed, 23 April 2014 08:36 |
|
If you use plain code generation (without instance based deployment), the CDT project settings must contain an include path of the form
"${workspace_loc:/<the name of your project>}"
b
Thus, all files will be found.
There are two improvements of the generation plugins that will be added soon
(1) Add an option that code generation on a single class will also generate the code on which the class depends such as the package or referenced types.
(2) Automatically configure the include path settings of the CDT project mentioned above.
|
|
|
Re: C++ Code generation help needed? [message #1352229 is a reply to message #1310533] |
Tue, 13 May 2014 11:08 |
|
The improvements are now available with M7 or the nightly builds. Code generation now
- generates into a separate CDT project, starting with a configurable prefix and the model name. This enables to have multiple models in the same project
- the created project is automatically configured for working with the code generation
- code is generated for required files as well.
- currently, the first code generation produces Acceleo errors. As a workaround, you need to reset the Acceleo driver after the first generation. Subsequent code generation will work.
There is a HelloWorld example available via the File->New->Examples (is must be placed into an existing project)
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05652 seconds