259 lines
6.9 KiB
Markdown
259 lines
6.9 KiB
Markdown
# t30001 - Basic package diagram test case
|
|
## Config
|
|
```yaml
|
|
diagrams:
|
|
t30001_package:
|
|
type: package
|
|
title: Basic package diagram example
|
|
glob:
|
|
- t30001.cc
|
|
include:
|
|
namespaces:
|
|
- clanguml::t30001
|
|
exclude:
|
|
namespaces:
|
|
- clanguml::t30001::detail
|
|
using_namespace: clanguml::t30001
|
|
plantuml:
|
|
before:
|
|
- "' t30001 test diagram of type {{ diagram.type }}"
|
|
after:
|
|
- 'note right of {{ alias("A::AA::AAA") }}: A AAA note...'
|
|
- '{% set e=element("A::AA") %} note top of {{ alias("A::AA") }} : {{ e.comment.formatted }}'
|
|
- '{% set e=element("B::AA") %} note top of {{ alias("B::AA") }} : {{ e.comment.formatted }}'
|
|
mermaid:
|
|
before:
|
|
- "%% t30001 test diagram of type {{ diagram.type }}"
|
|
after:
|
|
- 'N_0001(A AAA note...)'
|
|
- 'N_0001 -.- {{ alias("A::AA::AAA") }}'
|
|
- '{% set e=element("A::AA") %}N_0002({{ e.comment.formatted }})'
|
|
- '{% set e=element("B::AA") %}N_0003({{ e.comment.formatted }})'
|
|
- 'N_0002 -.- {{ alias("A::AA") }}'
|
|
- 'N_0003 -.- {{ alias("B::AA") }}'
|
|
|
|
|
|
|
|
```
|
|
## Source code
|
|
File t30001.cc
|
|
```cpp
|
|
namespace clanguml {
|
|
namespace t30001 {
|
|
namespace A {
|
|
/// This is namespace AA in namespace A
|
|
namespace AA {
|
|
namespace AAA {
|
|
} // namespace AAA
|
|
namespace BBB {
|
|
} // namespace BBB
|
|
} // namespace AA
|
|
namespace BB {
|
|
} // namespace BB
|
|
} // namespace A
|
|
namespace B {
|
|
/// This is namespace AA in namespace B
|
|
namespace AA {
|
|
namespace AAA {
|
|
} // namespace AAA
|
|
namespace BBB {
|
|
} // namespace BBB
|
|
} // namespace AA
|
|
namespace BB {
|
|
} // namespace BB
|
|
} // namespace B
|
|
} // namespace t30001
|
|
} // namespace clanguml
|
|
|
|
```
|
|
## Generated PlantUML diagrams
|
|

|
|
## Generated Mermaid diagrams
|
|

|
|
## Generated JSON models
|
|
```json
|
|
{
|
|
"diagram_type": "package",
|
|
"elements": [
|
|
{
|
|
"display_name": "clanguml",
|
|
"elements": [
|
|
{
|
|
"display_name": "clanguml::t30001",
|
|
"id": "1807513669798383046",
|
|
"is_deprecated": false,
|
|
"name": "t30001",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 2,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
}
|
|
],
|
|
"id": "2174271399507040339",
|
|
"is_deprecated": false,
|
|
"name": "clanguml",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 1,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
},
|
|
{
|
|
"display_name": "clanguml::t30001::A",
|
|
"elements": [
|
|
{
|
|
"comment": {
|
|
"formatted": "This is namespace AA in namespace A",
|
|
"raw": "/// This is namespace AA in namespace A"
|
|
},
|
|
"display_name": "clanguml::t30001::A::AA",
|
|
"elements": [
|
|
{
|
|
"display_name": "clanguml::t30001::A::AA::AAA",
|
|
"id": "274638237740249424",
|
|
"is_deprecated": false,
|
|
"name": "AAA",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 6,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
},
|
|
{
|
|
"display_name": "clanguml::t30001::A::AA::BBB",
|
|
"id": "2129154382024012563",
|
|
"is_deprecated": false,
|
|
"name": "BBB",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 8,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
}
|
|
],
|
|
"id": "1528517990989164155",
|
|
"is_deprecated": false,
|
|
"name": "AA",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 5,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
},
|
|
{
|
|
"display_name": "clanguml::t30001::A::BB",
|
|
"id": "983199564524723281",
|
|
"is_deprecated": false,
|
|
"name": "BB",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 11,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
}
|
|
],
|
|
"id": "1184614645531659789",
|
|
"is_deprecated": false,
|
|
"name": "A",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 3,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
},
|
|
{
|
|
"display_name": "clanguml::t30001::B",
|
|
"elements": [
|
|
{
|
|
"comment": {
|
|
"formatted": "This is namespace AA in namespace B",
|
|
"raw": "/// This is namespace AA in namespace B"
|
|
},
|
|
"display_name": "clanguml::t30001::B::AA",
|
|
"elements": [
|
|
{
|
|
"display_name": "clanguml::t30001::B::AA::AAA",
|
|
"id": "262162485307734028",
|
|
"is_deprecated": false,
|
|
"name": "AAA",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 17,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
},
|
|
{
|
|
"display_name": "clanguml::t30001::B::AA::BBB",
|
|
"id": "18542334992237803",
|
|
"is_deprecated": false,
|
|
"name": "BBB",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 19,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
}
|
|
],
|
|
"id": "895913707182089871",
|
|
"is_deprecated": false,
|
|
"name": "AA",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 16,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
},
|
|
{
|
|
"display_name": "clanguml::t30001::B::BB",
|
|
"id": "2230464321696304488",
|
|
"is_deprecated": false,
|
|
"name": "BB",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 22,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
}
|
|
],
|
|
"id": "1931735210112054430",
|
|
"is_deprecated": false,
|
|
"name": "B",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t30001.cc",
|
|
"line": 14,
|
|
"translation_unit": "t30001.cc"
|
|
},
|
|
"type": "namespace"
|
|
}
|
|
],
|
|
"name": "t30001_package",
|
|
"relationships": [],
|
|
"title": "Basic package diagram example",
|
|
"using_namespace": "clanguml::t30001"
|
|
}
|
|
```
|