18 KiB
18 KiB
t20034 - Test case for rendering all call chains from one activity to another (from_to)
Config
diagrams:
t20034_sequence:
type: sequence
glob:
- t20034.cc
include:
namespaces:
- clanguml::t20034
using_namespace: clanguml::t20034
from_to:
- [function: "clanguml::t20034::D::d2()",
function: "clanguml::t20034::A::a2()"]
Source code
File tests/t20034/t20034.cc
#include <cstdint>
namespace clanguml {
namespace t20034 {
struct A {
void a1() { }
void a2() { }
void a3() { }
};
struct C;
struct B {
void b1()
{
a.a1();
a.a2();
}
void b2() { a.a2(); }
void b3() { a.a3(); }
void b4();
A a;
C *c;
};
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.b4(); }
B b;
};
struct D {
void d1() { c.c1(); }
void d2()
{
c.c1();
a.a2();
c.c2();
c.c3();
a.a2();
c.c4();
auto l = [this]() { a.a2(); };
l();
}
void d3() { c.c3(); }
A a;
C c;
};
void B::b4()
{
c->c4();
b2();
}
}
}
Generated PlantUML diagrams
Generated Mermaid diagrams
Generated JSON models
{
"diagram_type": "sequence",
"name": "t20034_sequence",
"participants": [
{
"activities": [
{
"display_name": "d2()",
"id": "1707514178726476738",
"name": "d2",
"namespace": "",
"source_location": {
"column": 10,
"file": "t20034.cc",
"line": 46,
"translation_unit": "t20034.cc"
},
"type": "method"
}
],
"display_name": "D",
"id": "272777525372220260",
"name": "D",
"namespace": "clanguml::t20034",
"source_location": {
"column": 8,
"file": "t20034.cc",
"line": 44,
"translation_unit": "t20034.cc"
},
"type": "class"
},
{
"activities": [
{
"display_name": "c2()",
"id": "472904899982022039",
"name": "c2",
"namespace": "",
"source_location": {
"column": 10,
"file": "t20034.cc",
"line": 30,
"translation_unit": "t20034.cc"
},
"type": "method"
},
{
"display_name": "c4()",
"id": "395720534444062628",
"name": "c4",
"namespace": "",
"source_location": {
"column": 10,
"file": "t20034.cc",
"line": 39,
"translation_unit": "t20034.cc"
},
"type": "method"
},
{
"display_name": "c1()",
"id": "148530508384958711",
"name": "c1",
"namespace": "",
"source_location": {
"column": 10,
"file": "t20034.cc",
"line": 29,
"translation_unit": "t20034.cc"
},
"type": "method"
},
{
"display_name": "c3()",
"id": "2116989777037608337",
"name": "c3",
"namespace": "",
"source_location": {
"column": 10,
"file": "t20034.cc",
"line": 31,
"translation_unit": "t20034.cc"
},
"type": "method"
}
],
"display_name": "C",
"id": "2153793652884753477",
"name": "C",
"namespace": "clanguml::t20034",
"source_location": {
"column": 8,
"file": "t20034.cc",
"line": 28,
"translation_unit": "t20034.cc"
},
"type": "class"
},
{
"activities": [
{
"display_name": "b2()",
"id": "1034410188120190919",
"name": "b2",
"namespace": "",
"source_location": {
"column": 10,
"file": "t20034.cc",
"line": 19,
"translation_unit": "t20034.cc"
},
"type": "method"
},
{
"display_name": "b4()",
"id": "1774155279072101253",
"name": "b4",
"namespace": "",
"source_location": {
"column": 9,
"file": "t20034.cc",
"line": 65,
"translation_unit": "t20034.cc"
},
"type": "method"
},
{
"display_name": "b1()",
"id": "289899516984058785",
"name": "b1",
"namespace": "",
"source_location": {
"column": 10,
"file": "t20034.cc",
"line": 14,
"translation_unit": "t20034.cc"
},
"type": "method"
}
],
"display_name": "B",
"id": "1214895773389400008",
"name": "B",
"namespace": "clanguml::t20034",
"source_location": {
"column": 8,
"file": "t20034.cc",
"line": 13,
"translation_unit": "t20034.cc"
},
"type": "class"
},
{
"activities": [
{
"display_name": "a2()",
"id": "1307188853155365430",
"name": "a2",
"namespace": "",
"source_location": {
"column": 10,
"file": "t20034.cc",
"line": 7,
"translation_unit": "t20034.cc"
},
"type": "method"
}
],
"display_name": "A",
"id": "1029414747563549012",
"name": "A",
"namespace": "clanguml::t20034",
"source_location": {
"column": 8,
"file": "t20034.cc",
"line": 5,
"translation_unit": "t20034.cc"
},
"type": "class"
},
{
"activities": [
{
"display_name": "operator()()",
"id": "1996671438591925718",
"name": "operator()",
"namespace": "",
"type": "method"
}
],
"display_name": "D::d2()::(lambda t20034.cc:56:18)",
"id": "1026588549514900751",
"name": "D::d2()::(lambda t20034.cc:56:18)",
"namespace": "clanguml::t20034",
"source_location": {
"column": 18,
"file": "t20034.cc",
"line": 56,
"translation_unit": "t20034.cc"
},
"type": "lambda"
}
],
"sequences": [
{
"from_to": {
"from": {
"id": 1707514178726476738,
"location": "clanguml::t20034::D::d2()"
},
"to": {
"id": 1307188853155365430,
"location": "clanguml::t20034::A::a2()"
}
},
"message_chains": [
{
"messages": [
{
"from": {
"activity_id": "1707514178726476738",
"participant_id": "272777525372220260"
},
"name": "c2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 9,
"file": "t20034.cc",
"line": 50,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "472904899982022039",
"participant_id": "2153793652884753477"
},
"type": "message"
},
{
"from": {
"activity_id": "472904899982022039",
"participant_id": "2153793652884753477"
},
"name": "b2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 17,
"file": "t20034.cc",
"line": 30,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1034410188120190919",
"participant_id": "1214895773389400008"
},
"type": "message"
},
{
"from": {
"activity_id": "1034410188120190919",
"participant_id": "1214895773389400008"
},
"name": "a2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 17,
"file": "t20034.cc",
"line": 19,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1307188853155365430",
"participant_id": "1029414747563549012"
},
"type": "message"
}
]
},
{
"messages": [
{
"from": {
"activity_id": "1707514178726476738",
"participant_id": "272777525372220260"
},
"name": "a2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 9,
"file": "t20034.cc",
"line": 49,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1307188853155365430",
"participant_id": "1029414747563549012"
},
"type": "message"
}
]
},
{
"messages": [
{
"from": {
"activity_id": "1707514178726476738",
"participant_id": "272777525372220260"
},
"name": "operator()()",
"return_type": "",
"scope": "normal",
"source_location": {
"column": 9,
"file": "t20034.cc",
"line": 57,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1996671438591925718",
"participant_id": "1026588549514900751"
},
"type": "message"
},
{
"from": {
"activity_id": "1996671438591925718",
"participant_id": "1026588549514900751"
},
"name": "a2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 29,
"file": "t20034.cc",
"line": 56,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1307188853155365430",
"participant_id": "1029414747563549012"
},
"type": "message"
}
]
},
{
"messages": [
{
"from": {
"activity_id": "1707514178726476738",
"participant_id": "272777525372220260"
},
"name": "c4()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 9,
"file": "t20034.cc",
"line": 54,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "395720534444062628",
"participant_id": "2153793652884753477"
},
"type": "message"
},
{
"from": {
"activity_id": "395720534444062628",
"participant_id": "2153793652884753477"
},
"name": "b4()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 17,
"file": "t20034.cc",
"line": 39,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1774155279072101253",
"participant_id": "1214895773389400008"
},
"type": "message"
},
{
"from": {
"activity_id": "1774155279072101253",
"participant_id": "1214895773389400008"
},
"name": "b2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 5,
"file": "t20034.cc",
"line": 68,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1034410188120190919",
"participant_id": "1214895773389400008"
},
"type": "message"
},
{
"from": {
"activity_id": "1034410188120190919",
"participant_id": "1214895773389400008"
},
"name": "a2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 17,
"file": "t20034.cc",
"line": 19,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1307188853155365430",
"participant_id": "1029414747563549012"
},
"type": "message"
}
]
},
{
"messages": [
{
"from": {
"activity_id": "1707514178726476738",
"participant_id": "272777525372220260"
},
"name": "c1()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 9,
"file": "t20034.cc",
"line": 48,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "148530508384958711",
"participant_id": "2153793652884753477"
},
"type": "message"
},
{
"from": {
"activity_id": "148530508384958711",
"participant_id": "2153793652884753477"
},
"name": "b1()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 17,
"file": "t20034.cc",
"line": 29,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "289899516984058785",
"participant_id": "1214895773389400008"
},
"type": "message"
},
{
"from": {
"activity_id": "289899516984058785",
"participant_id": "1214895773389400008"
},
"name": "a2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 9,
"file": "t20034.cc",
"line": 17,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1307188853155365430",
"participant_id": "1029414747563549012"
},
"type": "message"
}
]
},
{
"messages": [
{
"from": {
"activity_id": "1707514178726476738",
"participant_id": "272777525372220260"
},
"name": "c3()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 9,
"file": "t20034.cc",
"line": 51,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "2116989777037608337",
"participant_id": "2153793652884753477"
},
"type": "message"
},
{
"from": {
"activity_id": "2116989777037608337",
"participant_id": "2153793652884753477"
},
"name": "c2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 13,
"file": "t20034.cc",
"line": 36,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "472904899982022039",
"participant_id": "2153793652884753477"
},
"type": "message"
},
{
"from": {
"activity_id": "472904899982022039",
"participant_id": "2153793652884753477"
},
"name": "b2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 17,
"file": "t20034.cc",
"line": 30,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1034410188120190919",
"participant_id": "1214895773389400008"
},
"type": "message"
},
{
"from": {
"activity_id": "1034410188120190919",
"participant_id": "1214895773389400008"
},
"name": "a2()",
"return_type": "void",
"scope": "normal",
"source_location": {
"column": 17,
"file": "t20034.cc",
"line": 19,
"translation_unit": "t20034.cc"
},
"to": {
"activity_id": "1307188853155365430",
"participant_id": "1029414747563549012"
},
"type": "message"
}
]
}
]
}
],
"using_namespace": "clanguml::t20034"
}