# t20006 - Class template specialization basic sequence diagram ## Config ```yaml compilation_database_dir: .. output_directory: puml diagrams: t20006_sequence: type: sequence glob: - ../../tests/t20006/t20006.cc include: namespaces: - clanguml::t20006 using_namespace: - clanguml::t20006 start_from: - function: "clanguml::t20006::tmain()" ``` ## Source code File t20006.cc ```cpp #include namespace clanguml { namespace t20006 { template struct A { T a1(T arg) { return arg; } T a2(T arg) { return arg + arg; } }; template struct B { T b(T arg) { return a_.a1(arg); } A a_; }; template <> struct B { std::string b(std::string arg) { return a_.a2(arg); } A a_; }; template struct AA { void aa1(T t) { } void aa2(T t) { } }; template struct BB { void bb1(T t, F f) { aa_.aa1(t); } void bb2(T t, F f) { aa_.aa2(t); } AA aa_; }; template struct BB { void bb1(T t, std::string f) { aa_->aa2(t); } void bb2(T t, std::string f) { aa_->aa1(t); } BB(AA *aa) : aa_{aa} { } AA *aa_; }; template struct BB { void bb1(T t, float f) { bb2(t, f); } void bb2(T t, float f) { aa_.aa2(t); } BB(AA &aa) : aa_{aa} { } AA &aa_; }; void tmain() { B bint; B bstring; bint.b(1); bstring.b("bstring"); BB bbint; AA aaint; BB bbstring{&aaint}; BB bbfloat{aaint}; bbint.bb1(1, 1); bbint.bb2(2, 2); bbstring.bb1(1, "calling aa2"); bbstring.bb2(1, "calling aa1"); bbfloat.bb1(1, 1.0f); } } } ``` ## Generated UML diagrams ![t20006_sequence](./t20006_sequence.svg "Class template specialization basic sequence diagram") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { "clang_uml_version": "0.3.5-27-g81c7ce7", "llvm_version": "Ubuntu clang version 15.0.6", "schema_version": 1 }, "name": "t20006_sequence", "participants": [ { "id": "363965584448680958", "name": "clanguml::t20006::tmain()", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 57 }, "type": "function" }, { "id": "2197760498261923035", "name": "clanguml::t20006::B", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 11 }, "type": "class" }, { "id": "596484796124829039", "name": "clanguml::t20006::A", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 6 }, "type": "class" }, { "id": "2102622661983365981", "name": "clanguml::t20006::B", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 16 }, "type": "class" }, { "id": "413459875415381273", "name": "clanguml::t20006::A", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 6 }, "type": "class" }, { "id": "264392653889863384", "name": "clanguml::t20006::BB", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 26 }, "type": "class" }, { "id": "1903567228894636312", "name": "clanguml::t20006::AA", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 21 }, "type": "class" }, { "id": "2269742833301555472", "name": "clanguml::t20006::BB", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 33 }, "type": "class" }, { "id": "1743503037360505162", "name": "clanguml::t20006::BB", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 45 }, "type": "class" } ], "sequences": [ { "messages": [ { "from": { "activity_id": "363965584448680958", "activity_name": "clanguml::t20006::tmain()", "participant_id": "363965584448680958", "participant_name": "clanguml::t20006::tmain()" }, "name": "b(int)", "return_type": "int", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 62 }, "to": { "activity_id": "250247217888843587", "activity_name": "clanguml::t20006::B::b(int)", "participant_id": "2197760498261923035" }, "type": "message" }, { "from": { "activity_id": "250247217888843587", "activity_name": "clanguml::t20006::B::b(int)", "participant_id": "2197760498261923035" }, "name": "a1(int)", "return_type": "int", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 12 }, "to": { "activity_id": "196390487987395669", "activity_name": "clanguml::t20006::A::a1(int)", "participant_id": "596484796124829039" }, "type": "message" }, { "from": { "activity_id": "363965584448680958", "activity_name": "clanguml::t20006::tmain()", "participant_id": "363965584448680958", "participant_name": "clanguml::t20006::tmain()" }, "name": "b(std::string)", "return_type": "std::string", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 63 }, "to": { "activity_id": "13049632552871157", "activity_name": "clanguml::t20006::B::b(std::string)", "participant_id": "2102622661983365981" }, "type": "message" }, { "from": { "activity_id": "13049632552871157", "activity_name": "clanguml::t20006::B::b(std::string)", "participant_id": "2102622661983365981" }, "name": "a2(std::string)", "return_type": "class std::basic_string", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 17 }, "to": { "activity_id": "11762588624112907", "activity_name": "clanguml::t20006::A::a2(std::string)", "participant_id": "413459875415381273" }, "type": "message" }, { "from": { "activity_id": "363965584448680958", "activity_name": "clanguml::t20006::tmain()", "participant_id": "363965584448680958", "participant_name": "clanguml::t20006::tmain()" }, "name": "bb1(int,int)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 70 }, "to": { "activity_id": "1213865121829347654", "activity_name": "clanguml::t20006::BB::bb1(int,int)", "participant_id": "264392653889863384" }, "type": "message" }, { "from": { "activity_id": "1213865121829347654", "activity_name": "clanguml::t20006::BB::bb1(int,int)", "participant_id": "264392653889863384" }, "name": "aa1(int)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 27 }, "to": { "activity_id": "1235428163990670191", "activity_name": "clanguml::t20006::AA::aa1(int)", "participant_id": "1903567228894636312" }, "type": "message" }, { "from": { "activity_id": "363965584448680958", "activity_name": "clanguml::t20006::tmain()", "participant_id": "363965584448680958", "participant_name": "clanguml::t20006::tmain()" }, "name": "bb2(int,int)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 71 }, "to": { "activity_id": "361650123916792854", "activity_name": "clanguml::t20006::BB::bb2(int,int)", "participant_id": "264392653889863384" }, "type": "message" }, { "from": { "activity_id": "361650123916792854", "activity_name": "clanguml::t20006::BB::bb2(int,int)", "participant_id": "264392653889863384" }, "name": "aa2(int)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 28 }, "to": { "activity_id": "582097827335267290", "activity_name": "clanguml::t20006::AA::aa2(int)", "participant_id": "1903567228894636312" }, "type": "message" }, { "from": { "activity_id": "363965584448680958", "activity_name": "clanguml::t20006::tmain()", "participant_id": "363965584448680958", "participant_name": "clanguml::t20006::tmain()" }, "name": "bb1(int,std::string)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 73 }, "to": { "activity_id": "1062874005712014125", "activity_name": "clanguml::t20006::BB::bb1(int,std::string)", "participant_id": "2269742833301555472" }, "type": "message" }, { "from": { "activity_id": "1062874005712014125", "activity_name": "clanguml::t20006::BB::bb1(int,std::string)", "participant_id": "2269742833301555472" }, "name": "aa2(int)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 34 }, "to": { "activity_id": "582097827335267290", "activity_name": "clanguml::t20006::AA::aa2(int)", "participant_id": "1903567228894636312" }, "type": "message" }, { "from": { "activity_id": "363965584448680958", "activity_name": "clanguml::t20006::tmain()", "participant_id": "363965584448680958", "participant_name": "clanguml::t20006::tmain()" }, "name": "bb2(int,std::string)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 74 }, "to": { "activity_id": "787705189994778234", "activity_name": "clanguml::t20006::BB::bb2(int,std::string)", "participant_id": "2269742833301555472" }, "type": "message" }, { "from": { "activity_id": "787705189994778234", "activity_name": "clanguml::t20006::BB::bb2(int,std::string)", "participant_id": "2269742833301555472" }, "name": "aa1(int)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 35 }, "to": { "activity_id": "1235428163990670191", "activity_name": "clanguml::t20006::AA::aa1(int)", "participant_id": "1903567228894636312" }, "type": "message" }, { "from": { "activity_id": "363965584448680958", "activity_name": "clanguml::t20006::tmain()", "participant_id": "363965584448680958", "participant_name": "clanguml::t20006::tmain()" }, "name": "bb1(int,float)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 76 }, "to": { "activity_id": "1463188845572485713", "activity_name": "clanguml::t20006::BB::bb1(int,float)", "participant_id": "1743503037360505162" }, "type": "message" }, { "from": { "activity_id": "1463188845572485713", "activity_name": "clanguml::t20006::BB::bb1(int,float)", "participant_id": "1743503037360505162" }, "name": "bb2(int,float)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 46 }, "to": { "activity_id": "732362671329401903", "activity_name": "clanguml::t20006::BB::bb2(int,float)", "participant_id": "1743503037360505162" }, "type": "message" }, { "from": { "activity_id": "732362671329401903", "activity_name": "clanguml::t20006::BB::bb2(int,float)", "participant_id": "1743503037360505162" }, "name": "aa2(int)", "return_type": "void", "scope": "normal", "source_location": { "file": "../../tests/t20006/t20006.cc", "line": 47 }, "to": { "activity_id": "582097827335267290", "activity_name": "clanguml::t20006::AA::aa2(int)", "participant_id": "1903567228894636312" }, "type": "message" } ], "start_from": { "id": 363965584448680958, "location": "clanguml::t20006::tmain()" } } ], "using_namespace": "clanguml::t20006" } ```