# t20026 - Virtual method call sequence diagram test case ## Config ```yaml compilation_database_dir: .. output_directory: diagrams diagrams: t20026_sequence: type: sequence glob: - ../../tests/t20026/t20026.cc include: namespaces: - clanguml::t20026 using_namespace: - clanguml::t20026 from: - function: "clanguml::t20026::tmain()" ``` ## Source code File t20026.cc ```cpp namespace clanguml { namespace t20026 { struct A { virtual void a() { } }; struct B : public A { void a() override { } }; struct C : public B { void a() override { } }; int tmain() { C *a{}; dynamic_cast(a)->a(); return 0; } } } ``` ## Generated PlantUML diagrams ![t20026_sequence](./t20026_sequence.svg "Virtual method call sequence diagram test case") ## Generated Mermaid diagrams ![t20026_sequence](./t20026_sequence_mermaid.svg "Virtual method call sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { "clang_uml_version": "0.4.0", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20026_sequence", "participants": [ { "id": "2268697350307997040", "name": "clanguml::t20026::tmain()", "source_location": { "column": 5, "file": "../../tests/t20026/t20026.cc", "line": 16, "translation_unit": "../../tests/t20026/t20026.cc" }, "type": "function" }, { "id": "1962121823853291899", "name": "clanguml::t20026::A", "source_location": { "column": 8, "file": "../../tests/t20026/t20026.cc", "line": 4, "translation_unit": "../../tests/t20026/t20026.cc" }, "type": "class" } ], "sequences": [ { "messages": [ { "from": { "activity_id": "2268697350307997040", "activity_name": "clanguml::t20026::tmain()", "participant_id": "2268697350307997040", "participant_name": "clanguml::t20026::tmain()" }, "name": "a()", "return_type": "void", "scope": "normal", "source_location": { "column": 5, "file": "../../tests/t20026/t20026.cc", "line": 20, "translation_unit": "../../tests/t20026/t20026.cc" }, "to": { "activity_id": "600590770418147864", "activity_name": "clanguml::t20026::A::a()", "participant_id": "1962121823853291899" }, "type": "message" } ], "start_from": { "id": 2268697350307997040, "location": "clanguml::t20026::tmain()" } } ], "using_namespace": "clanguml::t20026" } ```