Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Complex C++ Types(C/CPP profile stereotypes usage)
Complex C++ Types [message #1489939] Thu, 27 November 2014 20:31 Go to next message
Charles Rivet is currently offline Charles RivetFriend
Messages: 219
Registered: May 2014
Location: Canada
Senior Member

How would I define some more complex C++ types using the C/CPP profile stereotypes?

It's fairly easy for simple things (e.g., pointer), but how can I define, either as class property or as a function parameter, for example

A constant pointer to a constant integer : "int const * const"
A constant pointer to a pointer to an int: "int * * const"

I can only apply each stereotype once to a property/parameter...

I could cheat for properties, e.g., by declaring multiple properties that build on each other - although that is messy. But I can' cheat like that for parameters...

Thanks in advance!


/Charles Rivet
Re: Complex C++ Types [message #1490822 is a reply to message #1489939] Fri, 28 November 2014 13:23 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 456
Registered: March 2011
Location: Paris Saclay, France
Senior Member
The Ptr stereotype of the C++ profile has an attribute called "declaration". If undefined, it simply corresponds to a star. But you can write "**" in this attribute to obtain a double pointer (and then combine that with the Const stereotype).
You can also write "* const" in the definition part, in this case the result is "const int* const" which is not exactly the same as you wrote (not sure about C++ semantic subtleties in this context).
Re: Complex C++ Types [message #1490835 is a reply to message #1490822] Fri, 28 November 2014 13:33 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 456
Registered: March 2011
Location: Paris Saclay, France
Senior Member
I update the Papyrus wiki page accordingly: C++ profile wiki
Re: Complex C++ Types [message #1490866 is a reply to message #1490835] Fri, 28 November 2014 14:08 Go to previous message
Charles Rivet is currently offline Charles RivetFriend
Messages: 219
Registered: May 2014
Location: Canada
Senior Member

Thanks Ansgar, that's what I needed!

And thank you for updating the wiki page.

BTW, did you know about the "clockwise spiral" method of evaluating C++ declarations?

Using that method, you'll see that "const int* const" is a "constant pointer to an int constant", which is equivalent to what I had in my initial question.


/Charles Rivet
Previous Topic:Wait time actions in Papyrus
Next Topic:Customize a Papyrus Nattable
Goto Forum:
  


Current Time: Thu Mar 28 19:44:12 GMT 2024

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

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

Back to the top