# t20034 - from_to sequence diagram test case ## Config ```yaml compilation_database_dir: .. output_directory: puml diagrams: t20034_sequence: type: sequence glob: - ../../tests/t20034/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 t20034.cc ```cpp #include 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(&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 UML diagrams ![t20034_sequence](./t20034_sequence.svg "from_to sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { "clang_uml_version": "0.3.8-27-gcdc3659", "llvm_version": "Ubuntu clang version 15.0.7", "schema_version": 1 }, "name": "t20034_sequence", "participants": [ { "id": "272777525372220260", "name": "clanguml::t20034::D", "source_location": { "column": 8, "file": "../../tests/t20034/t20034.cc", "line": 43, "translation_unit": "../../tests/t20034/t20034.cc" }, "type": "class" }, { "id": "2153793652884753477", "name": "clanguml::t20034::C", "source_location": { "column": 8, "file": "../../tests/t20034/t20034.cc", "line": 27, "translation_unit": "../../tests/t20034/t20034.cc" }, "type": "class" }, { "id": "1214895773389400008", "name": "clanguml::t20034::B", "source_location": { "column": 8, "file": "../../tests/t20034/t20034.cc", "line": 12, "translation_unit": "../../tests/t20034/t20034.cc" }, "type": "class" }, { "id": "1029414747563549012", "name": "clanguml::t20034::A", "source_location": { "column": 8, "file": "../../tests/t20034/t20034.cc", "line": 4, "translation_unit": "../../tests/t20034/t20034.cc" }, "type": "class" }, { "id": "1130194784812080848", "name": "clanguml::t20034::D::d2()::(lambda ../../tests/t20034/t20034.cc:55:18)", "source_location": { "column": 18, "file": "../../tests/t20034/t20034.cc", "line": 55, "translation_unit": "../../tests/t20034/t20034.cc" }, "type": "class" } ], "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", "activity_name": "clanguml::t20034::D::d2()", "participant_id": "272777525372220260" }, "name": "c3()", "return_type": "void", "scope": "normal", "source_location": { "column": 9, "file": "../../tests/t20034/t20034.cc", "line": 50, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "2116989777037608337", "activity_name": "clanguml::t20034::C::c3()", "participant_id": "2153793652884753477" }, "type": "message" }, { "from": { "activity_id": "2116989777037608337", "activity_name": "clanguml::t20034::C::c3()", "participant_id": "2153793652884753477" }, "name": "c2()", "return_type": "void", "scope": "normal", "source_location": { "column": 13, "file": "../../tests/t20034/t20034.cc", "line": 35, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "472904899982022039", "activity_name": "clanguml::t20034::C::c2()", "participant_id": "2153793652884753477" }, "type": "message" }, { "from": { "activity_id": "472904899982022039", "activity_name": "clanguml::t20034::C::c2()", "participant_id": "2153793652884753477" }, "name": "b2()", "return_type": "void", "scope": "normal", "source_location": { "column": 17, "file": "../../tests/t20034/t20034.cc", "line": 29, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1034410188120190919", "activity_name": "clanguml::t20034::B::b2()", "participant_id": "1214895773389400008" }, "type": "message" }, { "from": { "activity_id": "1034410188120190919", "activity_name": "clanguml::t20034::B::b2()", "participant_id": "1214895773389400008" }, "name": "a2()", "return_type": "void", "scope": "normal", "source_location": { "column": 17, "file": "../../tests/t20034/t20034.cc", "line": 18, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1307188853155365430", "activity_name": "clanguml::t20034::A::a2()", "participant_id": "1029414747563549012" }, "type": "message" } ] }, { "messages": [ { "from": { "activity_id": "1707514178726476738", "activity_name": "clanguml::t20034::D::d2()", "participant_id": "272777525372220260" }, "name": "c1()", "return_type": "void", "scope": "normal", "source_location": { "column": 9, "file": "../../tests/t20034/t20034.cc", "line": 47, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "148530508384958711", "activity_name": "clanguml::t20034::C::c1()", "participant_id": "2153793652884753477" }, "type": "message" }, { "from": { "activity_id": "148530508384958711", "activity_name": "clanguml::t20034::C::c1()", "participant_id": "2153793652884753477" }, "name": "b1()", "return_type": "void", "scope": "normal", "source_location": { "column": 17, "file": "../../tests/t20034/t20034.cc", "line": 28, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "289899516984058785", "activity_name": "clanguml::t20034::B::b1()", "participant_id": "1214895773389400008" }, "type": "message" }, { "from": { "activity_id": "289899516984058785", "activity_name": "clanguml::t20034::B::b1()", "participant_id": "1214895773389400008" }, "name": "a2()", "return_type": "void", "scope": "normal", "source_location": { "column": 9, "file": "../../tests/t20034/t20034.cc", "line": 16, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1307188853155365430", "activity_name": "clanguml::t20034::A::a2()", "participant_id": "1029414747563549012" }, "type": "message" } ] }, { "messages": [ { "from": { "activity_id": "1707514178726476738", "activity_name": "clanguml::t20034::D::d2()", "participant_id": "272777525372220260" }, "name": "c4()", "return_type": "void", "scope": "normal", "source_location": { "column": 9, "file": "../../tests/t20034/t20034.cc", "line": 53, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "395720534444062628", "activity_name": "clanguml::t20034::C::c4()", "participant_id": "2153793652884753477" }, "type": "message" }, { "from": { "activity_id": "395720534444062628", "activity_name": "clanguml::t20034::C::c4()", "participant_id": "2153793652884753477" }, "name": "b4()", "return_type": "void", "scope": "normal", "source_location": { "column": 17, "file": "../../tests/t20034/t20034.cc", "line": 38, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1774155279072101253", "activity_name": "clanguml::t20034::B::b4()", "participant_id": "1214895773389400008" }, "type": "message" }, { "from": { "activity_id": "1774155279072101253", "activity_name": "clanguml::t20034::B::b4()", "participant_id": "1214895773389400008" }, "name": "b2()", "return_type": "void", "scope": "normal", "source_location": { "column": 5, "file": "../../tests/t20034/t20034.cc", "line": 67, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1034410188120190919", "activity_name": "clanguml::t20034::B::b2()", "participant_id": "1214895773389400008" }, "type": "message" }, { "from": { "activity_id": "1034410188120190919", "activity_name": "clanguml::t20034::B::b2()", "participant_id": "1214895773389400008" }, "name": "a2()", "return_type": "void", "scope": "normal", "source_location": { "column": 17, "file": "../../tests/t20034/t20034.cc", "line": 18, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1307188853155365430", "activity_name": "clanguml::t20034::A::a2()", "participant_id": "1029414747563549012" }, "type": "message" } ] }, { "messages": [ { "from": { "activity_id": "1707514178726476738", "activity_name": "clanguml::t20034::D::d2()", "participant_id": "272777525372220260" }, "name": "a2()", "return_type": "void", "scope": "normal", "source_location": { "column": 9, "file": "../../tests/t20034/t20034.cc", "line": 48, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1307188853155365430", "activity_name": "clanguml::t20034::A::a2()", "participant_id": "1029414747563549012" }, "type": "message" } ] }, { "messages": [ { "from": { "activity_id": "1707514178726476738", "activity_name": "clanguml::t20034::D::d2()", "participant_id": "272777525372220260" }, "name": "operator()()", "return_type": "", "scope": "normal", "source_location": { "column": 9, "file": "../../tests/t20034/t20034.cc", "line": 56, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1451310025762012403", "activity_name": "clanguml::t20034::D::d2()##(lambda ../../tests/t20034/t20034.cc:55:18)::operator()()", "participant_id": "1130194784812080848" }, "type": "message" }, { "from": { "activity_id": "1451310025762012403", "activity_name": "clanguml::t20034::D::d2()::(lambda ../../tests/t20034/t20034.cc:55:18)::operator()()", "participant_id": "1130194784812080848" }, "name": "a2()", "return_type": "void", "scope": "normal", "source_location": { "column": 29, "file": "../../tests/t20034/t20034.cc", "line": 55, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1307188853155365430", "activity_name": "clanguml::t20034::A::a2()", "participant_id": "1029414747563549012" }, "type": "message" } ] }, { "messages": [ { "from": { "activity_id": "1707514178726476738", "activity_name": "clanguml::t20034::D::d2()", "participant_id": "272777525372220260" }, "name": "c2()", "return_type": "void", "scope": "normal", "source_location": { "column": 9, "file": "../../tests/t20034/t20034.cc", "line": 49, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "472904899982022039", "activity_name": "clanguml::t20034::C::c2()", "participant_id": "2153793652884753477" }, "type": "message" }, { "from": { "activity_id": "472904899982022039", "activity_name": "clanguml::t20034::C::c2()", "participant_id": "2153793652884753477" }, "name": "b2()", "return_type": "void", "scope": "normal", "source_location": { "column": 17, "file": "../../tests/t20034/t20034.cc", "line": 29, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1034410188120190919", "activity_name": "clanguml::t20034::B::b2()", "participant_id": "1214895773389400008" }, "type": "message" }, { "from": { "activity_id": "1034410188120190919", "activity_name": "clanguml::t20034::B::b2()", "participant_id": "1214895773389400008" }, "name": "a2()", "return_type": "void", "scope": "normal", "source_location": { "column": 17, "file": "../../tests/t20034/t20034.cc", "line": 18, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { "activity_id": "1307188853155365430", "activity_name": "clanguml::t20034::A::a2()", "participant_id": "1029414747563549012" }, "type": "message" } ] } ] } ], "using_namespace": "clanguml::t20034" } ```