gpt4 book ai didi

c++ - 如何在 plantuml 中编写 typedef 和别名

转载 作者:行者123 更新时间:2023-11-30 02:22:55 28 4
gpt4 key购买 nike

例如我的 cpp 实现如下所示:

class B {
int value;
}

typedef MyB B;

class A {
MyB b;
}

我的 plantuml 代码:

class B {
int value;
}
class A {
MyB b;
}
A o-- B

如何在 plantuml 中表示这个别名。应该如何以正确的方式完成。我在 plantuml 教程中找不到这个。

最佳答案

别名仅在 UML 规范中与导入一起引用(尽管别名也可以在 namespace 中使用)。第 30 页给出了一个示例,它还解决了 typedef 的第二个问题:

In Figure 7.8, the ElementImport is combined with aliasing, meaning that the DataType Types::Real will be referred to by name as Double in the package Shapes.

enter image description here

我不知道 plantUML,但如果它符合 UML(应该符合),那么您可以按照上面的描述进行操作。

关于c++ - 如何在 plantuml 中编写 typedef 和别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46718471/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com