Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » No code generated for literals?(C++ codegen question)
No code generated for literals? [message #1764704] Thu, 01 June 2017 13:47 Go to next message
Stephen Blackwell is currently offline Stephen BlackwellFriend
Messages: 117
Registered: March 2014
Senior Member
I have a model that contains a package, myPkg, and inside that package there are several classes. All these classes need to reference a constant so I added a LiteralInteger, myLitInt to the package at the same level as the classes.

myPkg
->ClassA
->ClassB
->myLitInt

I want the generated (C++) package include file to look something like this:

Pkg_myPkg.h:

namespace myPkg {

#define myLitInt 42
...

or perhaps
const int myLitInt = 42;

but the generated code makes no mention of the Literal Integer at all.

Is this a limitation of the code generator? If so, is there a workaround? I have tried adding various things to the Include profile but they end up outside the myPkg namespace.

Thanks,
Steve
Re: No code generated for literals? [message #1765132 is a reply to message #1764704] Tue, 06 June 2017 21:47 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 137
Registered: March 2011
Location: Paris Saclay, France
Senior Member
This is currently not supported. Can you please file a bug with severity = enhancement ?
The manual definitions via the <<Include>> stereotypes are outside the namespace definition since it would be problematic, if other files are included from within the namespace. This is not a problem for #defines (since they ignore the namespace), but for "real" constant definitions.
Re: No code generated for literals? [message #1766368 is a reply to message #1765132] Tue, 20 June 2017 15:36 Go to previous message
Stephen Blackwell is currently offline Stephen BlackwellFriend
Messages: 117
Registered: March 2014
Senior Member
Done.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=518522
Previous Topic:Problem Building Papyrus Source
Next Topic:UML profile and Acceleo issue
Goto Forum:
  


Current Time: Fri Jun 22 18:36:44 GMT 2018

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

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

Back to the top