# t20016 - Template method specialization sequence diagram test case ## Config ```yaml compilation_database_dir: .. output_directory: puml diagrams: t20016_sequence: type: sequence glob: - ../../tests/t20016/t20016.cc include: namespaces: - clanguml::t20016 using_namespace: - clanguml::t20016 start_from: - function: "clanguml::t20016::tmain()" ``` ## Source code File t20016.cc ```cpp namespace clanguml { namespace t20016 { struct A { void a1(int a) { } template T a2(const T &a) { return a; } }; template struct B { void b1(T b) { a_.a1(1); } template F b2(T t) { return a_.a2(t); } A a_; }; void tmain() { B b; b.b1(1); b.b2(2); } } } ``` ## Generated UML diagrams ![t20016_sequence](./t20016_sequence.svg "Template method specialization sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { "clang_uml_version": "0.3.8-13-g2e1013c", "llvm_version": "Ubuntu clang version 15.0.7", "schema_version": 1 }, "name": "t20016_sequence", "participants": [ { "id": "1912662358651926712", "name": "clanguml::t20016::tmain()", "source_location": { "column": 6, "file": "../../tests/t20016/t20016.cc", "line": 16, "translation_unit": "../../tests/t20016/t20016.cc" }, "type": "function" }, { "id": "1688340912643326666", "name": "clanguml::t20016::B", "source_location": { "column": 30, "file": "../../tests/t20016/t20016.cc", "line": 8, "translation_unit": "../../tests/t20016/t20016.cc" }, "type": "class" }, { "id": "1351242594275053195", "name": "clanguml::t20016::A", "source_location": { "column": 8, "file": "../../tests/t20016/t20016.cc", "line": 3, "translation_unit": "../../tests/t20016/t20016.cc" }, "type": "class" } ], "sequences": [ { "messages": [ { "from": { "activity_id": "1912662358651926712", "activity_name": "clanguml::t20016::tmain()", "participant_id": "1912662358651926712", "participant_name": "clanguml::t20016::tmain()" }, "name": "b1(long)", "return_type": "void", "scope": "normal", "source_location": { "column": 5, "file": "../../tests/t20016/t20016.cc", "line": 20, "translation_unit": "../../tests/t20016/t20016.cc" }, "to": { "activity_id": "2064264710178722261", "activity_name": "clanguml::t20016::B::b1(long)", "participant_id": "1688340912643326666" }, "type": "message" }, { "from": { "activity_id": "2064264710178722261", "activity_name": "clanguml::t20016::B::b1(long)", "participant_id": "1688340912643326666" }, "name": "a1(int)", "return_type": "void", "scope": "normal", "source_location": { "column": 20, "file": "../../tests/t20016/t20016.cc", "line": 9, "translation_unit": "../../tests/t20016/t20016.cc" }, "to": { "activity_id": "1198371121423942542", "activity_name": "clanguml::t20016::A::a1(int)", "participant_id": "1351242594275053195" }, "type": "message" }, { "from": { "activity_id": "1912662358651926712", "activity_name": "clanguml::t20016::tmain()", "participant_id": "1912662358651926712", "participant_name": "clanguml::t20016::tmain()" }, "name": "b2(long)", "return_type": "F", "scope": "normal", "source_location": { "column": 5, "file": "../../tests/t20016/t20016.cc", "line": 22, "translation_unit": "../../tests/t20016/t20016.cc" }, "to": { "activity_id": "203381140188081853", "activity_name": "clanguml::t20016::B::b2(long)", "participant_id": "1688340912643326666" }, "type": "message" }, { "from": { "activity_id": "203381140188081853", "activity_name": "clanguml::t20016::B::b2(long)", "participant_id": "1688340912643326666" }, "name": "a2(const long &)", "return_type": "long", "scope": "normal", "source_location": { "column": 46, "file": "../../tests/t20016/t20016.cc", "line": 11, "translation_unit": "../../tests/t20016/t20016.cc" }, "to": { "activity_id": "1208784669530380166", "activity_name": "clanguml::t20016::A::a2(const long &)", "participant_id": "1351242594275053195" }, "type": "message" } ], "start_from": { "id": 1912662358651926712, "location": "clanguml::t20016::tmain()" } } ], "using_namespace": "clanguml::t20016" } ```