634 lines
14 KiB
Markdown
634 lines
14 KiB
Markdown
# t00041 - Context diagram filter test
|
|
## Config
|
|
```yaml
|
|
diagrams:
|
|
t00041_class:
|
|
type: class
|
|
generate_packages: false
|
|
glob:
|
|
- t00041.cc
|
|
using_namespace: clanguml::t00041
|
|
include:
|
|
namespaces:
|
|
- clanguml::t00041
|
|
context:
|
|
- clanguml::t00041::RR
|
|
- clanguml::t00041::Color
|
|
- clanguml::t00041::T::Direction
|
|
subclasses:
|
|
- clanguml::t00041::ns1::N
|
|
exclude:
|
|
namespaces:
|
|
- clanguml::t00041::detail
|
|
relationships:
|
|
- dependency
|
|
```
|
|
## Source code
|
|
File `tests/t00041/t00041.cc`
|
|
```cpp
|
|
namespace clanguml::t00041 {
|
|
|
|
struct B { };
|
|
|
|
struct A { };
|
|
|
|
class AA : public A { };
|
|
|
|
struct R { };
|
|
|
|
struct RR;
|
|
|
|
struct D {
|
|
RR *rr;
|
|
};
|
|
|
|
struct E { };
|
|
|
|
struct F { };
|
|
|
|
namespace detail {
|
|
struct G { };
|
|
} // namespace detail
|
|
|
|
struct H { };
|
|
|
|
struct RR : public R {
|
|
E *e;
|
|
F *f;
|
|
detail::G *g;
|
|
|
|
enum K { One, Two, Three };
|
|
|
|
K k;
|
|
|
|
void foo(H *h) { }
|
|
};
|
|
|
|
struct RRR : public RR { };
|
|
|
|
namespace ns1 {
|
|
struct N { };
|
|
|
|
struct NN : public N { };
|
|
|
|
struct NM : public N { };
|
|
}
|
|
|
|
enum class Color { Red, Green, Blue };
|
|
|
|
struct S {
|
|
Color c;
|
|
};
|
|
|
|
struct T {
|
|
enum class Direction { Left, Right };
|
|
Direction d;
|
|
};
|
|
|
|
} // namespace clanguml::t00041
|
|
|
|
```
|
|
## Generated PlantUML diagrams
|
|

|
|
## Generated Mermaid diagrams
|
|

|
|
## Generated JSON models
|
|
```json
|
|
{
|
|
"diagram_type": "class",
|
|
"elements": [
|
|
{
|
|
"bases": [],
|
|
"display_name": "R",
|
|
"id": "775317088453163919",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "R",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 9,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "D",
|
|
"id": "1798851434286108347",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "rr",
|
|
"source_location": {
|
|
"column": 9,
|
|
"file": "t00041.cc",
|
|
"line": 14,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "RR *"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "D",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 13,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "E",
|
|
"id": "2158730167547707264",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "E",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 17,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "F",
|
|
"id": "430600213408545846",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "F",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 19,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [
|
|
{
|
|
"access": "public",
|
|
"id": "775317088453163919",
|
|
"is_virtual": false,
|
|
"name": "clanguml::t00041::R"
|
|
}
|
|
],
|
|
"display_name": "RR",
|
|
"id": "175608867682236642",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "e",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 28,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "E *"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "f",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 29,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "F *"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "g",
|
|
"source_location": {
|
|
"column": 16,
|
|
"file": "t00041.cc",
|
|
"line": 30,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "detail::G *"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "k",
|
|
"source_location": {
|
|
"column": 7,
|
|
"file": "t00041.cc",
|
|
"line": 34,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "K"
|
|
}
|
|
],
|
|
"methods": [
|
|
{
|
|
"access": "public",
|
|
"display_name": "foo",
|
|
"is_const": false,
|
|
"is_consteval": false,
|
|
"is_constexpr": false,
|
|
"is_constructor": false,
|
|
"is_copy_assignment": false,
|
|
"is_coroutine": 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": "foo",
|
|
"parameters": [
|
|
{
|
|
"name": "h",
|
|
"type": "H *"
|
|
}
|
|
],
|
|
"source_location": {
|
|
"column": 10,
|
|
"file": "t00041.cc",
|
|
"line": 36,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "void"
|
|
}
|
|
],
|
|
"name": "RR",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 27,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"constants": [
|
|
"One",
|
|
"Two",
|
|
"Three"
|
|
],
|
|
"display_name": "RR::K",
|
|
"id": "2190267615539639714",
|
|
"is_nested": true,
|
|
"name": "RR::K",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 10,
|
|
"file": "t00041.cc",
|
|
"line": 32,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "enum"
|
|
},
|
|
{
|
|
"bases": [
|
|
{
|
|
"access": "public",
|
|
"id": "175608867682236642",
|
|
"is_virtual": false,
|
|
"name": "clanguml::t00041::RR"
|
|
}
|
|
],
|
|
"display_name": "RRR",
|
|
"id": "819254010294444715",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "RRR",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 39,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "ns1::N",
|
|
"id": "220253364661036147",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "N",
|
|
"namespace": "clanguml::t00041::ns1",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 42,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [
|
|
{
|
|
"access": "public",
|
|
"id": "220253364661036147",
|
|
"is_virtual": false,
|
|
"name": "clanguml::t00041::ns1::N"
|
|
}
|
|
],
|
|
"display_name": "ns1::NN",
|
|
"id": "618038667214398895",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "NN",
|
|
"namespace": "clanguml::t00041::ns1",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 44,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [
|
|
{
|
|
"access": "public",
|
|
"id": "220253364661036147",
|
|
"is_virtual": false,
|
|
"name": "clanguml::t00041::ns1::N"
|
|
}
|
|
],
|
|
"display_name": "ns1::NM",
|
|
"id": "1206750351408617127",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [],
|
|
"methods": [],
|
|
"name": "NM",
|
|
"namespace": "clanguml::t00041::ns1",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 46,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"constants": [
|
|
"Red",
|
|
"Green",
|
|
"Blue"
|
|
],
|
|
"display_name": "Color",
|
|
"id": "325166410992809923",
|
|
"is_nested": false,
|
|
"name": "Color",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 12,
|
|
"file": "t00041.cc",
|
|
"line": 49,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "enum"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "S",
|
|
"id": "1264379505183372317",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "c",
|
|
"source_location": {
|
|
"column": 11,
|
|
"file": "t00041.cc",
|
|
"line": 52,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "Color"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "S",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 51,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"bases": [],
|
|
"display_name": "T",
|
|
"id": "1124381863108145331",
|
|
"is_abstract": false,
|
|
"is_nested": false,
|
|
"is_struct": true,
|
|
"is_template": false,
|
|
"is_union": false,
|
|
"members": [
|
|
{
|
|
"access": "public",
|
|
"is_static": false,
|
|
"name": "d",
|
|
"source_location": {
|
|
"column": 15,
|
|
"file": "t00041.cc",
|
|
"line": 57,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "Direction"
|
|
}
|
|
],
|
|
"methods": [],
|
|
"name": "T",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "t00041.cc",
|
|
"line": 55,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"template_parameters": [],
|
|
"type": "class"
|
|
},
|
|
{
|
|
"constants": [
|
|
"Left",
|
|
"Right"
|
|
],
|
|
"display_name": "T::Direction",
|
|
"id": "666696403594452707",
|
|
"is_nested": true,
|
|
"name": "T::Direction",
|
|
"namespace": "clanguml::t00041",
|
|
"source_location": {
|
|
"column": 16,
|
|
"file": "t00041.cc",
|
|
"line": 56,
|
|
"translation_unit": "t00041.cc"
|
|
},
|
|
"type": "enum"
|
|
}
|
|
],
|
|
"name": "t00041_class",
|
|
"package_type": "namespace",
|
|
"relationships": [
|
|
{
|
|
"access": "public",
|
|
"destination": "175608867682236642",
|
|
"label": "rr",
|
|
"source": "1798851434286108347",
|
|
"type": "association"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "2158730167547707264",
|
|
"label": "e",
|
|
"source": "175608867682236642",
|
|
"type": "association"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "430600213408545846",
|
|
"label": "f",
|
|
"source": "175608867682236642",
|
|
"type": "association"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "2190267615539639714",
|
|
"label": "k",
|
|
"source": "175608867682236642",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "775317088453163919",
|
|
"source": "175608867682236642",
|
|
"type": "extension"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "175608867682236642",
|
|
"source": "2190267615539639714",
|
|
"type": "containment"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "175608867682236642",
|
|
"source": "819254010294444715",
|
|
"type": "extension"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "220253364661036147",
|
|
"source": "618038667214398895",
|
|
"type": "extension"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "220253364661036147",
|
|
"source": "1206750351408617127",
|
|
"type": "extension"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "325166410992809923",
|
|
"label": "c",
|
|
"source": "1264379505183372317",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "666696403594452707",
|
|
"label": "d",
|
|
"source": "1124381863108145331",
|
|
"type": "aggregation"
|
|
},
|
|
{
|
|
"access": "public",
|
|
"destination": "1124381863108145331",
|
|
"source": "666696403594452707",
|
|
"type": "containment"
|
|
}
|
|
],
|
|
"using_namespace": "clanguml::t00041"
|
|
}
|
|
```
|