简体   繁体   中英

Generating C++ constructors and destructors with Eclipse UML plug-in Papyrus

Our goal is to use the C++ code generator from Papyrus. One problem is that the stereotype for C++ constructors and destructors does not exist. I saw that a Java constructor stereotype exists, is there something similar for C++? If not, how could i create one by myself?

Tl;DR: How can a C++ constructor/destructor be created in the Papyrus designer?

I used the basic C++ generator for an embedded project (AVR) which supports C++ classes.

I used a normal function which returned a primitive type called 'NoReturnType' which I had defined.

In the code, I had a
#define NoReturnType

which removes it at compile time.

Vincent

Credits to the Eclipse forums.

Papyrus designer queries whether the stereotypes "Create" and "Destroy" from the UML standard profile are applied to an operation. This profile is available via the "apply registered profile" dialog.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM