Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » C++ code generator namespace in java format(the C++ code generator outputs namespace references in a java style package reference)
C++ code generator namespace in java format [message #1699192] Mon, 22 June 2015 12:41
vincent valvona is currently offline vincent valvonaFriend
Messages: 1
Registered: June 2015
Junior Member
I am using papyrus to generate code for an AVR microcontroller in C++.
I have solved or found workarounds for most issues and it works very well, but there are a few left.

The most annoying one is that the C++ codegenerator outputs namespace references to function call parameters and properties etc in a java style package reference:

::myApp::namespace1::subns1
::myApp::namespace2

but the compiler does not see 'myApp' as a top level namespace and expects references to be relative to the top folder:

namespace1::subns1
namespace2

I can work around this by doing a global find/replace in all the generated files to remove the prefix and it does the job, but it means that I cannot use a linked CDT editor window (using the right click option on a class diagram) because the global replacements are seen as code changes which are back annotated to the model, the model then cannot find the referenced parameter. The result is that the class properties and function call parameter types are removed as they become 'unknown', return types are replaced with 'void'; new opaque function methods are created and sent to the code.

So the only choice is to use a normal unlinked CDT editor and copy / paste any code changes back into the model. This is OK (although there are pasting issues which occasionally cause the the editor windows to lock up) but if someone knows how to change the behaviour of either the code generator so as not to add the top level prefix, or get the C++ complier to recognise it, I would be very grateful.

Previous Topic:Unable to work on Papyrus CDO from two instances of Eclipse
Next Topic:uml profile and State machines
Goto Forum:
  


Current Time: Fri Mar 29 10:32:21 GMT 2024

Powered by FUDForum. Page generated in 0.01779 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top