简体   繁体   English

使用Eclipse UML插件Papyrus生成C ++构造函数和析构函数

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

Our goal is to use the C++ code generator from Papyrus. 我们的目标是使用Papyrus的C ++代码生成器。 One problem is that the stereotype for C++ constructors and destructors does not exist. 一个问题是C ++构造函数和析构函数的构造型不存在。 I saw that a Java constructor stereotype exists, is there something similar for C++? 我看到存在Java构造函数原型,C ++是否有类似的东西? If not, how could i create one by myself? 如果没有,我该如何独自创建一个?

Tl;DR: How can a C++ constructor/destructor be created in the Papyrus designer? Tl; DR:如何在Papyrus设计器中创建C ++构造函数/析构函数?

I used the basic C++ generator for an embedded project (AVR) which supports C++ classes. 我将基本的C ++生成器用于支持C ++类的嵌入式项目(AVR)。

I used a normal function which returned a primitive type called 'NoReturnType' which I had defined. 我使用了一个普通函数,该函数返回了我定义的称为“ NoReturnType”的原始类型。

In the code, I had a 在代码中,我有一个
#define NoReturnType

which removes it at compile time. 在编译时将其删除。

Vincent 文森特

Credits to the Eclipse forums. 归功于Eclipse论坛。

Papyrus designer queries whether the stereotypes "Create" and "Destroy" from the UML standard profile are applied to an operation. Papyrus设计器查询是否将UML标准配置文件中的构造型“创建”和“销毁”应用于操作。 This profile is available via the "apply registered profile" dialog. 该配置文件可通过“应用注册的配置文件”对话框使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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