520 lines
13 KiB
Markdown
520 lines
13 KiB
Markdown
# t00028 - PlantUML note decorator test case
|
|
## Config
|
|
```yaml
|
|
compilation_database_dir: ..
|
|
output_directory: puml
|
|
diagrams:
|
|
t00028_class:
|
|
type: class
|
|
glob:
|
|
- ../../tests/t00028/t00028.cc
|
|
using_namespace:
|
|
- clanguml::t00028
|
|
include:
|
|
namespaces:
|
|
- clanguml::t00028
|
|
plantuml:
|
|
after:
|
|
- >
|
|
note left of {{ alias("R") }}::ccc
|
|
Reference to C.
|
|
end note
|
|
|
|
```
|
|
## Source code
|
|
File t00028.cc
|
|
```cpp
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace clanguml {
|
|
namespace t00028 {
|
|
|
|
/// \uml{note[top] A class note.}
|
|
class A { };
|
|
|
|
/// \uml{note[] B class note.}
|
|
class B { };
|
|
|
|
///
|
|
/// @uml{note:t00028_class[bottom] C class note.}
|
|
/// This is class C.
|
|
class C { };
|
|
|
|
/// \uml{note
|
|
/// D
|
|
/// class
|
|
/// note.}
|
|
class D { };
|
|
|
|
/// \uml{note E template class note.}
|
|
template <typename T> class E {
|
|
T param;
|
|
};
|
|
|
|
/// \uml{note:other_diagram[left] G class note.}
|
|
class G { };
|
|
|
|
/// @uml{note[ bottom ] F enum note.}
|
|
enum class F { one, two, three };
|
|
|
|
/// \uml{note[right] R class note.}
|
|
class R {
|
|
explicit R(C &c)
|
|
: ccc(c)
|
|
{
|
|
}
|
|
|
|
/// \uml{note[left] R contains an instance of A.}
|
|
A aaa;
|
|
|
|
/// \uml{note:other_diagram[right] R contains an pointer to B.}
|
|
B *bbb;
|
|
|
|
C &ccc;
|
|
|
|
std::vector<std::shared_ptr<D>> ddd;
|
|
|
|
E<int> eee;
|
|
|
|
G **ggg;
|
|
};
|
|
|
|
} // namespace t00028
|
|
} // namespace clanguml
|
|
|
|
```
|
|
## Generated UML diagrams
|
|

|
|
## Generated JSON models
|
|
```json
|
|
{
|
|
"diagram_type": "class",
|
|
"elements": [
|
|
{
|
|
"bases": [],
|
|
"comment": {
|
|
"formatted": "\\uml{note[top] A class note.}",
|
|
"raw": "/// \\uml{note[top] A class note.}"
|
|
},
|
|
"display_name": "clanguml::t00028::A",
|
|
"id": "1519850480962783588",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": false,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "A",
|
|
"namespace": "clanguml::t00028",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 8,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"comment": {
|
|
"formatted": "\\uml{note[] B class note.}",
|
|
"raw": "/// \\uml{note[] B class note.}"
|
|
},
|
|
"display_name": "clanguml::t00028::B",
|
|
"id": "1980597091567213070",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": false,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "B",
|
|
"namespace": "clanguml::t00028",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 11,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"comment": {
|
|
"formatted": "\n @uml{note:t00028_class[bottom] C class note.}\n This is class C.",
|
|
"raw": "///\n/// @uml{note:t00028_class[bottom] C class note.}\n/// This is class C."
|
|
},
|
|
"display_name": "clanguml::t00028::C",
|
|
"id": "984577258575112753",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": false,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "C",
|
|
"namespace": "clanguml::t00028",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 16,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"comment": {
|
|
"formatted": "\\uml{note\nD\nclass\nnote.}",
|
|
"raw": "/// \\uml{note\n/// D\n/// class\n/// note.}"
|
|
},
|
|
"display_name": "clanguml::t00028::D",
|
|
"id": "1263778658518784070",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": false,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "D",
|
|
"namespace": "clanguml::t00028",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 22,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"comment": {
|
|
"formatted": "\\uml{note E template class note.}",
|
|
"raw": "/// \\uml{note E template class note.}"
|
|
},
|
|
"display_name": "clanguml::t00028::E<T>",
|
|
"id": "1014136565447389473",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": false,
|
|
"is_template": true,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "private",
|
|
"is_static": false,
|
|
"name": "param",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 26,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"type": "T"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "E",
|
|
"namespace": "clanguml::t00028",
|
|
"source_location": {
|
|
"column": 29,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 25,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"template_parameters": [
|
|
{
|
|
"is_variadic": false,
|
|
"kind": "template_type",
|
|
"name": "T",
|
|
"template_parameters": []
|
|
}
|
|
],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"comment": {
|
|
"formatted": "\\uml{note:other_diagram[left] G class note.}",
|
|
"raw": "/// \\uml{note:other_diagram[left] G class note.}"
|
|
},
|
|
"display_name": "clanguml::t00028::G",
|
|
"id": "764713728396057122",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": false,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "G",
|
|
"namespace": "clanguml::t00028",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 30,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"comment": {
|
|
"formatted": "@uml{note[ bottom ] F enum note.}",
|
|
"raw": "/// @uml{note[ bottom ] F enum note.}"
|
|
},
|
|
"constants": [
|
|
"one",
|
|
"two",
|
|
"three"
|
|
],
|
|
"display_name": "clanguml::t00028::F",
|
|
"id": "589227897266388677",
|
|
"is_nested": false,
|
|
"name": "F",
|
|
"namespace": "clanguml::t00028",
|
|
"source_location": {
|
|
"column": 12,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 33,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"type": "enum"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "clanguml::t00028::E<int>",
|
|
"id": "1949673179441298667",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": false,
|
|
"is_template": true,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "E",
|
|
"namespace": "clanguml::t00028",
|
|
"source_location": {
|
|
"column": 29,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 25,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"template_parameters": [
|
|
{
|
|
"is_variadic": false,
|
|
"kind": "argument",
|
|
"template_parameters": [],
|
|
"type": "int"
|
|
}
|
|
],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"comment": {
|
|
"formatted": "\\uml{note[right] R class note.}",
|
|
"raw": "/// \\uml{note[right] R class note.}"
|
|
},
|
|
"display_name": "clanguml::t00028::R",
|
|
"id": "1189142882239313116",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": false,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "private",
|
|
"comment": {
|
|
"formatted": "\\uml{note[left] R contains an instance of A.}",
|
|
"raw": "/// \\uml{note[left] R contains an instance of A.}"
|
|
},
|
|
"is_static": false,
|
|
"name": "aaa",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 43,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"type": "A"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"comment": {
|
|
"formatted": "\\uml{note:other_diagram[right] R contains an pointer to B.}",
|
|
"raw": "/// \\uml{note:other_diagram[right] R contains an pointer to B.}"
|
|
},
|
|
"is_static": false,
|
|
"name": "bbb",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 46,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"type": "B *"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"is_static": false,
|
|
"name": "ccc",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 48,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"type": "C &"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"is_static": false,
|
|
"name": "ddd",
|
|
"source_location": {
|
|
"column": 37,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 50,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"type": "std::vector<std::shared_ptr<D>>"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"is_static": false,
|
|
"name": "eee",
|
|
"source_location": {
|
|
"column": 12,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 52,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"type": "E<int>"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"is_static": false,
|
|
"name": "ggg",
|
|
"source_location": {
|
|
"column": 9,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 54,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"type": "G **"
|
|
}
|
|
],
|
|
"methods": [
|
|
{
|
|
"access": "private",
|
|
"is_const": false,
|
|
"is_consteval": false,
|
|
"is_constexpr": false,
|
|
"is_constructor": true,
|
|
"is_copy_assignment": false,
|
|
"is_defaulted": false,
|
|
"is_deleted": false,
|
|
"is_move_assignment": false,
|
|
"is_noexcept": false,
|
|
"is_operator": false,
|
|
"is_pure_virtual": false,
|
|
"is_static": false,
|
|
"is_virtual": false,
|
|
"name": "R",
|
|
"parameters": [
|
|
{
|
|
"name": "c",
|
|
"type": "C &"
|
|
}
|
|
],
|
|
"type": "void"
|
|
}
|
|
],
|
|
"name": "R",
|
|
"namespace": "clanguml::t00028",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "../../tests/t00028/t00028.cc",
|
|
"line": 36,
|
|
"translation_unit": "../../tests/t00028/t00028.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
}
|
|
],
|
|
"metadata": {
|
|
"clang_uml_version": "0.3.7-4-g43cc5cb",
|
|
"llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)",
|
|
"schema_version": 1
|
|
},
|
|
"name": "t00028_class",
|
|
"relationships": [
|
|
{
|
|
"access": "public",
|
|
"destination": "1014136565447389473",
|
|
"source": "1949673179441298667",
|
|
"type": "instantiation"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "984577258575112753",
|
|
"source": "1189142882239313116",
|
|
"type": "dependency"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"destination": "1519850480962783588",
|
|
"label": "aaa",
|
|
"source": "1189142882239313116",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"destination": "1980597091567213070",
|
|
"label": "bbb",
|
|
"source": "1189142882239313116",
|
|
"type": "association"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"destination": "984577258575112753",
|
|
"label": "ccc",
|
|
"source": "1189142882239313116",
|
|
"type": "association"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"destination": "1263778658518784070",
|
|
"label": "ddd",
|
|
"source": "1189142882239313116",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"destination": "1949673179441298667",
|
|
"label": "eee",
|
|
"source": "1189142882239313116",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "private",
|
|
"destination": "764713728396057122",
|
|
"label": "ggg",
|
|
"source": "1189142882239313116",
|
|
"type": "association"
|
|
}
|
|
],
|
|
"using_namespace": "clanguml::t00028"
|
|
}
|
|
```
|