472 lines
14 KiB
Markdown
472 lines
14 KiB
Markdown
# t20036 - Test case for rendering all call chains leading to an activity (to)
|
|
## Config
|
|
```yaml
|
|
compilation_database_dir: ..
|
|
output_directory: diagrams
|
|
diagrams:
|
|
t20036_sequence:
|
|
type: sequence
|
|
glob:
|
|
- ../../tests/t20036/t20036.cc
|
|
include:
|
|
namespaces:
|
|
- clanguml::t20036
|
|
using_namespace:
|
|
- clanguml::t20036
|
|
to:
|
|
- function: "clanguml::t20036::A::a2()"
|
|
```
|
|
## Source code
|
|
File t20036.cc
|
|
```cpp
|
|
#include <cstdint>
|
|
|
|
namespace clanguml {
|
|
namespace t20036 {
|
|
struct A {
|
|
void a1() { }
|
|
void a2() { }
|
|
void a3() { }
|
|
};
|
|
|
|
struct B {
|
|
void b1() { a.a2(); }
|
|
void b2() { a.a2(); }
|
|
void b3() { a.a3(); }
|
|
|
|
A a;
|
|
};
|
|
|
|
struct C {
|
|
void c1() { b.b1(); }
|
|
void c2() { b.b2(); }
|
|
void c3()
|
|
{
|
|
if (reinterpret_cast<uint64_t>(&b) == 0xbadc0de)
|
|
c3();
|
|
else
|
|
c2();
|
|
}
|
|
|
|
void c4() { b.b2(); }
|
|
|
|
B b;
|
|
};
|
|
|
|
struct D {
|
|
void d1() { c.c2(); }
|
|
void d2() { c.c2(); }
|
|
void d3() { a.a2(); }
|
|
|
|
A a;
|
|
C c;
|
|
};
|
|
}
|
|
}
|
|
```
|
|
## Generated PlantUML diagrams
|
|
")
|
|
## Generated Mermaid diagrams
|
|
")
|
|
## Generated JSON models
|
|
```json
|
|
{
|
|
"diagram_type": "sequence",
|
|
"metadata": {
|
|
"clang_uml_version": "0.4.0-32-g701b2c5",
|
|
"llvm_version": "Ubuntu clang version 16.0.6 (++20230710042027+7cbf1a259152-1~exp1~20230710162048.105)",
|
|
"schema_version": 1
|
|
},
|
|
"name": "t20036_sequence",
|
|
"participants": [
|
|
{
|
|
"id": "589458700000736705",
|
|
"name": "clanguml::t20036::C",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 19,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"id": "607147607288902300",
|
|
"name": "clanguml::t20036::B",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 11,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"id": "399722216848214287",
|
|
"name": "clanguml::t20036::A",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 5,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"type": "class"
|
|
},
|
|
{
|
|
"id": "847434467114564641",
|
|
"name": "clanguml::t20036::D",
|
|
"source_location": {
|
|
"column": 8,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 35,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"type": "class"
|
|
}
|
|
],
|
|
"sequences": [
|
|
{
|
|
"message_chains": [
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "1742507735898803374",
|
|
"activity_name": "clanguml::t20036::C::c1()",
|
|
"participant_id": "589458700000736705"
|
|
},
|
|
"name": "b1()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 20,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "203660950902052846",
|
|
"activity_name": "clanguml::t20036::B::b1()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "203660950902052846",
|
|
"activity_name": "clanguml::t20036::B::b1()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"name": "a2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 12,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "2124074228514438863",
|
|
"activity_name": "clanguml::t20036::A::a2()",
|
|
"participant_id": "399722216848214287"
|
|
},
|
|
"type": "message"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "701488875613014930",
|
|
"activity_name": "clanguml::t20036::D::d1()",
|
|
"participant_id": "847434467114564641"
|
|
},
|
|
"name": "c2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 36,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "128745191811378037",
|
|
"activity_name": "clanguml::t20036::C::c2()",
|
|
"participant_id": "589458700000736705"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "128745191811378037",
|
|
"activity_name": "clanguml::t20036::C::c2()",
|
|
"participant_id": "589458700000736705"
|
|
},
|
|
"name": "b2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 21,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1726094580455938498",
|
|
"activity_name": "clanguml::t20036::B::b2()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1726094580455938498",
|
|
"activity_name": "clanguml::t20036::B::b2()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"name": "a2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 13,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "2124074228514438863",
|
|
"activity_name": "clanguml::t20036::A::a2()",
|
|
"participant_id": "399722216848214287"
|
|
},
|
|
"type": "message"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "1897648539724183065",
|
|
"activity_name": "clanguml::t20036::D::d3()",
|
|
"participant_id": "847434467114564641"
|
|
},
|
|
"name": "a2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 38,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "2124074228514438863",
|
|
"activity_name": "clanguml::t20036::A::a2()",
|
|
"participant_id": "399722216848214287"
|
|
},
|
|
"type": "message"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "1735839766717973272",
|
|
"activity_name": "clanguml::t20036::C::c4()",
|
|
"participant_id": "589458700000736705"
|
|
},
|
|
"name": "b2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 30,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1726094580455938498",
|
|
"activity_name": "clanguml::t20036::B::b2()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1726094580455938498",
|
|
"activity_name": "clanguml::t20036::B::b2()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"name": "a2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 13,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "2124074228514438863",
|
|
"activity_name": "clanguml::t20036::A::a2()",
|
|
"participant_id": "399722216848214287"
|
|
},
|
|
"type": "message"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "1523531372012294984",
|
|
"activity_name": "clanguml::t20036::C::c3()",
|
|
"participant_id": "589458700000736705"
|
|
},
|
|
"name": "c2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 13,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 27,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "128745191811378037",
|
|
"activity_name": "clanguml::t20036::C::c2()",
|
|
"participant_id": "589458700000736705"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "128745191811378037",
|
|
"activity_name": "clanguml::t20036::C::c2()",
|
|
"participant_id": "589458700000736705"
|
|
},
|
|
"name": "b2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 21,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1726094580455938498",
|
|
"activity_name": "clanguml::t20036::B::b2()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1726094580455938498",
|
|
"activity_name": "clanguml::t20036::B::b2()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"name": "a2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 13,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "2124074228514438863",
|
|
"activity_name": "clanguml::t20036::A::a2()",
|
|
"participant_id": "399722216848214287"
|
|
},
|
|
"type": "message"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"messages": [
|
|
{
|
|
"from": {
|
|
"activity_id": "1534436779969087203",
|
|
"activity_name": "clanguml::t20036::D::d2()",
|
|
"participant_id": "847434467114564641"
|
|
},
|
|
"name": "c2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 37,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "128745191811378037",
|
|
"activity_name": "clanguml::t20036::C::c2()",
|
|
"participant_id": "589458700000736705"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "128745191811378037",
|
|
"activity_name": "clanguml::t20036::C::c2()",
|
|
"participant_id": "589458700000736705"
|
|
},
|
|
"name": "b2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 21,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "1726094580455938498",
|
|
"activity_name": "clanguml::t20036::B::b2()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"type": "message"
|
|
},
|
|
{
|
|
"from": {
|
|
"activity_id": "1726094580455938498",
|
|
"activity_name": "clanguml::t20036::B::b2()",
|
|
"participant_id": "607147607288902300"
|
|
},
|
|
"name": "a2()",
|
|
"return_type": "void",
|
|
"scope": "normal",
|
|
"source_location": {
|
|
"column": 17,
|
|
"file": "../../tests/t20036/t20036.cc",
|
|
"line": 13,
|
|
"translation_unit": "../../tests/t20036/t20036.cc"
|
|
},
|
|
"to": {
|
|
"activity_id": "2124074228514438863",
|
|
"activity_name": "clanguml::t20036::A::a2()",
|
|
"participant_id": "399722216848214287"
|
|
},
|
|
"type": "message"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"to": {
|
|
"id": 2124074228514438863,
|
|
"location": "clanguml::t20036::A::a2()"
|
|
}
|
|
}
|
|
],
|
|
"using_namespace": "clanguml::t20036"
|
|
}
|
|
```
|