例如我的 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.
我不知道 plantUML,但如果它符合 UML(应该符合),那么您可以按照上面的描述进行操作。
关于c++ - 如何在 plantuml 中编写 typedef 和别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46718471/