C++ Code generation help needed? [message #1266482] |
Fri, 07 March 2014 09:10  |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
Re: C++ Code generation help needed? [message #1274601 is a reply to message #1273928] |
Fri, 21 March 2014 13:55   |
Eclipse User |
|
|
|
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 11:59   |
Eclipse User |
|
|
|
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 #1746151 is a reply to message #1745924] |
Mon, 24 October 2016 03:02  |
Eclipse User |
|
|
|
Mia Petkovic wrote on Wed, 19 October 2016 11:29Hi everyone,
I am using Papyrus RT with its default code generator. I wanted to ask is it possible to somehow alter the code generator in such a way that I remap the data types of the generated methods. For instance, is it possible to somehow map type UMLRTOutSignal to integer?
Mia
Hi,
I am not fully sure why you would like to do this, but shouldn't it be sufficient in your specific example to get the internal id (which basically is an int) of the UMLRTOutSignal? There is a method getId() that returns the internal id of an UMLRTOutSignal.
Keep in mind that the generated code is rather coupled with the run-time system itself, and changing types like what you are asking probably means that you will have an impact on the run-time system as well (which maybe is something that you actually want, not sure from the information you provided).
If you have more question specifically related to Papyrus-RT and its code-generator (and run-time), I suggest that you ask in the Papyrus-RT forum.
/Peter Cigéhn
|
|
|
Powered by
FUDForum. Page generated in 0.30117 seconds