# t20022 - Forward class declaration sequence diagram test case ## Config ```yaml compilation_database_dir: .. output_directory: diagrams diagrams: t20022_sequence: type: sequence glob: - ../../tests/t20022/t20022.cc include: namespaces: - clanguml::t20022 using_namespace: - clanguml::t20022 from: - function: "clanguml::t20022::tmain()" ``` ## Source code File t20022.cc ```cpp #include namespace clanguml { namespace t20022 { class B; class A { public: A(std::unique_ptr b); void a(); std::unique_ptr b_; }; class B { public: void b() { } }; A::A(std::unique_ptr b) : b_{std::move(b)} { } void A::a() { b_->b(); } int tmain() { A a{std::make_unique()}; a.a(); return 0; } } } ``` ## Generated PlantUML diagrams ![t20022_sequence](./t20022_sequence.svg "Forward class declaration sequence diagram test case") ## Generated Mermaid diagrams ![t20022_sequence](./t20022_sequence_mermaid.svg "Forward class declaration 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": "t20022_sequence", "participants": [ { "id": "1374011101998494743", "name": "clanguml::t20022::tmain()", "source_location": { "column": 5, "file": "../../tests/t20022/t20022.cc", "line": 28, "translation_unit": "../../tests/t20022/t20022.cc" }, "type": "function" }, { "id": "1535467498096081224", "name": "clanguml::t20022::A", "source_location": { "column": 7, "file": "../../tests/t20022/t20022.cc", "line": 7, "translation_unit": "../../tests/t20022/t20022.cc" }, "type": "class" }, { "id": "1316821731069034940", "name": "clanguml::t20022::B", "source_location": { "column": 7, "file": "../../tests/t20022/t20022.cc", "line": 16, "translation_unit": "../../tests/t20022/t20022.cc" }, "type": "class" } ], "sequences": [ { "messages": [ { "from": { "activity_id": "1374011101998494743", "activity_name": "clanguml::t20022::tmain()", "participant_id": "1374011101998494743", "participant_name": "clanguml::t20022::tmain()" }, "name": "A(std::unique_ptr)", "return_type": "void", "scope": "normal", "source_location": { "column": 7, "file": "../../tests/t20022/t20022.cc", "line": 30, "translation_unit": "../../tests/t20022/t20022.cc" }, "to": { "activity_id": "1226569306557207632", "activity_name": "clanguml::t20022::A::A(std::unique_ptr)", "participant_id": "1535467498096081224" }, "type": "message" }, { "from": { "activity_id": "1374011101998494743", "activity_name": "clanguml::t20022::tmain()", "participant_id": "1374011101998494743", "participant_name": "clanguml::t20022::tmain()" }, "name": "a()", "return_type": "void", "scope": "normal", "source_location": { "column": 5, "file": "../../tests/t20022/t20022.cc", "line": 32, "translation_unit": "../../tests/t20022/t20022.cc" }, "to": { "activity_id": "1158824701633811441", "activity_name": "clanguml::t20022::A::a()", "participant_id": "1535467498096081224" }, "type": "message" }, { "from": { "activity_id": "1158824701633811441", "activity_name": "clanguml::t20022::A::a()", "participant_id": "1535467498096081224" }, "name": "b()", "return_type": "void", "scope": "normal", "source_location": { "column": 15, "file": "../../tests/t20022/t20022.cc", "line": 26, "translation_unit": "../../tests/t20022/t20022.cc" }, "to": { "activity_id": "2114222968575993291", "activity_name": "clanguml::t20022::B::b()", "participant_id": "1316821731069034940" }, "type": "message" } ], "start_from": { "id": 1374011101998494743, "location": "clanguml::t20022::tmain()" } } ], "using_namespace": "clanguml::t20022" } ```