From 32ab85a6c4332110c169d9a93d360c38b38a144a Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 4 Feb 2025 23:43:01 +0100 Subject: [PATCH 1/5] Added support for local classes defined in function body in sequence diagrams. --- src/common/visitor/translation_unit_visitor.h | 15 +++++- .../visitor/translation_unit_visitor.cc | 44 ++++++++++++++--- .../visitor/translation_unit_visitor.h | 2 + tests/t20072/.clang-uml | 12 +++++ tests/t20072/t20072.cc | 48 +++++++++++++++++++ tests/t20072/test_case.h | 42 ++++++++++++++++ tests/test_cases.cc | 2 + tests/test_cases.yaml | 3 ++ 8 files changed, 160 insertions(+), 8 deletions(-) create mode 100644 tests/t20072/.clang-uml create mode 100644 tests/t20072/t20072.cc create mode 100644 tests/t20072/test_case.h diff --git a/src/common/visitor/translation_unit_visitor.h b/src/common/visitor/translation_unit_visitor.h index 903e6e85..a90c36a7 100644 --- a/src/common/visitor/translation_unit_visitor.h +++ b/src/common/visitor/translation_unit_visitor.h @@ -264,8 +264,19 @@ template class translation_unit_visitor { if (config().filter_mode() == config::filter_mode_t::advanced) return true; - auto should_include_namespace = diagram().should_include( - common::model::namespace_{decl->getQualifiedNameAsString()}); + auto should_include_namespace{false}; + + if (const auto *record = clang::dyn_cast(decl); + record != nullptr && record->isLocalClass() != nullptr && + diagram().type() == common::model::diagram_t::kSequence) { + should_include_namespace = + diagram().should_include(common::model::namespace_{ + record->isLocalClass()->getQualifiedNameAsString()}); + } + else { + should_include_namespace = diagram().should_include( + common::model::namespace_{decl->getQualifiedNameAsString()}); + } const auto decl_file = decl->getLocation().printToString(source_manager()); diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 4220f348..0dad952f 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -153,6 +153,19 @@ bool translation_unit_visitor::VisitObjCInterfaceDecl( return true; } +bool translation_unit_visitor::TraverseCXXRecordDecl( + clang::CXXRecordDecl *declaration) +{ + auto context_backup = context(); + + RecursiveASTVisitor::TraverseCXXRecordDecl( + declaration); + + call_expression_context_ = context_backup; + + return true; +} + bool translation_unit_visitor::VisitCXXRecordDecl( clang::CXXRecordDecl *declaration) { @@ -166,10 +179,6 @@ bool translation_unit_visitor::VisitCXXRecordDecl( return true; } - // TODO: Add support for classes defined in function/method bodies - if (declaration->isLocalClass() != nullptr) - return true; - LOG_TRACE("Visiting class declaration at {}", declaration->getBeginLoc().printToString(source_manager())); @@ -923,8 +932,6 @@ bool translation_unit_visitor::TraverseReturnStmt(clang::ReturnStmt *stmt) RecursiveASTVisitor::TraverseReturnStmt(stmt); - // translation_unit_visitor::VisitReturnStmt(stmt); - LOG_TRACE("Leaving return statement at {}", stmt->getBeginLoc().printToString(source_manager())); @@ -2505,6 +2512,31 @@ translation_unit_visitor::create_class_model(clang::CXXRecordDecl *cls) return {}; } } + else if (cls->isLocalClass() != nullptr) { + const auto *func_declaration = cls->isLocalClass(); + + eid_t func_model_id = + get_unique_id(eid_t{func_declaration->getID()}).has_value() + ? *get_unique_id(eid_t{func_declaration->getID()}) + : eid_t{func_declaration->getID()}; + + const auto &func_model = + diagram().get_participant(func_model_id); + + if (!func_model.has_value()) + return {}; + + LOG_DBG("Visiting local class declaration: {} in {}", + cls->getQualifiedNameAsString(), + func_model.value().full_name(false)); + + auto local_cls_ns = func_model.value().get_namespace(); + + c.set_name(func_model.value().full_name_no_ns() + "##" + + common::get_tag_name(*cls)); + c.set_namespace(local_cls_ns); + c.set_id(common::to_id(c.full_name(false))); + } else { c.set_name(common::get_tag_name(*cls)); c.set_namespace(ns); diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index 9c0845e3..3123961e 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -127,6 +127,8 @@ class translation_unit_visitor bool VisitCXXMethodDecl(clang::CXXMethodDecl *declaration); + bool TraverseCXXRecordDecl(clang::CXXRecordDecl *declaration); + bool VisitCXXRecordDecl(clang::CXXRecordDecl *declaration); bool VisitClassTemplateDecl(clang::ClassTemplateDecl *declaration); diff --git a/tests/t20072/.clang-uml b/tests/t20072/.clang-uml new file mode 100644 index 00000000..7d4cc79b --- /dev/null +++ b/tests/t20072/.clang-uml @@ -0,0 +1,12 @@ +diagrams: + t20072_sequence: + type: sequence + glob: + - t20072.cc + include: + namespaces: + - clanguml::t20072 + using_namespace: clanguml::t20072 + generate_return_types: true + from: + - function: "clanguml::t20072::tmain()" \ No newline at end of file diff --git a/tests/t20072/t20072.cc b/tests/t20072/t20072.cc new file mode 100644 index 00000000..71650b53 --- /dev/null +++ b/tests/t20072/t20072.cc @@ -0,0 +1,48 @@ +#include + +namespace clanguml::t20072 { + +bool validate(int v) { return v != 0; } + +auto foo(int f) +{ + class Foo { + public: + void set(int value) + { + if (validate(value)) + value_ = value; + } + + int get() const { return value_; } + + private: + int value_; + }; + + Foo result; + result.set(f); + + return result; +} + +template auto bar(const T &b, std::string msg = "two") +{ + struct Foo { + int result(int c) const { return value / c; } + + int value; + }; + + Foo foo{b.get() + 10}; + + return foo.result(msg.size()); +} + +int tmain() +{ + auto v = bar(foo(1)); + + return 0; +} +} // namespace clanguml::t20072 \ No newline at end of file diff --git a/tests/t20072/test_case.h b/tests/t20072/test_case.h new file mode 100644 index 00000000..3cf6973c --- /dev/null +++ b/tests/t20072/test_case.h @@ -0,0 +1,42 @@ +/** + * tests/t20072/test_case.h + * + * Copyright (c) 2021-2025 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +TEST_CASE("t20072") +{ + using namespace clanguml::test; + using namespace std::string_literals; + + auto [config, db, diagram, model] = + CHECK_SEQUENCE_MODEL("t20072", "t20072_sequence"); + + CHECK_SEQUENCE_DIAGRAM(*config, diagram, *model, [](const auto &src) { + REQUIRE(MessageOrder(src, + { + {"tmain()", "foo(int)", ""}, // + {"foo(int)", "foo(int)::Foo", "set(int)"}, // + {"foo(int)::Foo", "validate(int)", ""}, // + + {"tmain()", "bar(const Foo &,std::string)", ""}, // + {"bar(const Foo &,std::string)", "foo(int)::Foo", + "get() const"}, // + {"bar(const Foo &,std::string)", + "bar(const Foo &,std::string)::Foo", + "result(int) const"}, // + })); + }); +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index adcf8ec6..1bf70b4b 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -684,6 +684,8 @@ void CHECK_INCLUDE_DIAGRAM(const clanguml::config::config &config, #include "t20071/test_case.h" #endif +#include "t20072/test_case.h" + /// /// Package diagram tests /// diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index e65635c3..bc926715 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -481,6 +481,9 @@ test_cases: - name: t20071 title: Test case for sequence diagram with coroutines and combined participants description: + - name: t20072 + title: Test case for sequence diagram with local classes defined in function bodies + description: Package diagrams: - name: t30001 title: Basic package diagram test case From 66038482f5026e2de5d0d94468cfa4ddc9a313e8 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 5 Feb 2025 13:22:47 +0100 Subject: [PATCH 2/5] Updated coroutine test case with local class (#384) --- tests/t20071/t20071.cc | 25 +++++++++++++------------ tests/t20071/test_case.h | 8 ++++---- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/t20071/t20071.cc b/tests/t20071/t20071.cc index 9b11d55a..c39beb11 100644 --- a/tests/t20071/t20071.cc +++ b/tests/t20071/t20071.cc @@ -4,21 +4,22 @@ #include namespace clanguml::t20071 { -struct awaitable_on_thread { - std::thread *p_out; - bool await_ready() { return false; } - void await_suspend(std::coroutine_handle<> h) - { - auto &out = *p_out; - if (out.joinable()) - throw std::runtime_error("Output thread parameter not empty"); - out = std::thread([h] { h.resume(); }); - } - void await_resume() { } -}; auto switch_to_new_thread(std::thread &out) { + struct awaitable_on_thread { + std::thread *p_out; + bool await_ready() { return false; } + void await_suspend(std::coroutine_handle<> h) + { + auto &out = *p_out; + if (out.joinable()) + throw std::runtime_error("Output thread parameter not empty"); + out = std::thread([h] { h.resume(); }); + } + void await_resume() { } + }; + return awaitable_on_thread{&out}; } diff --git a/tests/t20071/test_case.h b/tests/t20071/test_case.h index c99c1f54..94a14bee 100644 --- a/tests/t20071/test_case.h +++ b/tests/t20071/test_case.h @@ -34,15 +34,15 @@ TEST_CASE("t20071") {"t20071.cc", "t20071.cc", "switch_to_new_thread(std::thread &)"}, // #if LLVM_VERSION_MAJOR == 14 || LLVM_VERSION_MAJOR == 15 - {"t20071.cc", "t20071.cc", - "struct clanguml::t20071::awaitable_on_thread", + {"t20071.cc", "t20071.cc", "struct awaitable_on_thread", Response{}}, // #else {"t20071.cc", "t20071.cc", "awaitable_on_thread", Response{}}, // #endif - {"t20071.cc", "awaitable_on_thread", "await_resume()", - CoAwait{}} // + {"t20071.cc", + "switch_to_new_thread(std::thread &)::awaitable_on_thread", + "await_resume()", CoAwait{}} // })); }); } From b71186734f26cd81cc3a3d3b979408f2734a31f0 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Thu, 6 Feb 2025 19:10:15 +0100 Subject: [PATCH 3/5] Extended local class sequence test case with lambda (#384) --- src/common/clang_utils.cc | 14 +++++ src/common/clang_utils.h | 2 + src/sequence_diagram/model/participant.h | 12 +++++ .../visitor/call_expression_context.cc | 13 ++++- .../visitor/call_expression_context.h | 7 +++ .../visitor/translation_unit_visitor.cc | 53 +++++++++++++++---- tests/t20072/t20072.cc | 32 ++++++++++- tests/t20072/test_case.h | 16 ++++++ 8 files changed, 137 insertions(+), 12 deletions(-) diff --git a/src/common/clang_utils.cc b/src/common/clang_utils.cc index 22a6e7cd..248b6048 100644 --- a/src/common/clang_utils.cc +++ b/src/common/clang_utils.cc @@ -1196,4 +1196,18 @@ bool is_lambda_call(const clang::Expr *expr) return false; } + +bool is_lambda_method(const clang::FunctionDecl *decl) +{ + if (decl == nullptr) + return false; + + if (const auto *method = clang::dyn_cast(decl); + method != nullptr) { + if (method->getParent() != nullptr && method->getParent()->isLambda()) + return true; + } + + return false; +} } // namespace clanguml::common diff --git a/src/common/clang_utils.h b/src/common/clang_utils.h index badc4660..5d733ad4 100644 --- a/src/common/clang_utils.h +++ b/src/common/clang_utils.h @@ -379,4 +379,6 @@ const clang::EnumDecl *get_typedef_enum_decl(const clang::TypedefDecl *decl); * @return True, if the expression points to lambda invocation */ bool is_lambda_call(const clang::Expr *callExpr); + +bool is_lambda_method(const clang::FunctionDecl *decl); } // namespace clanguml::common diff --git a/src/sequence_diagram/model/participant.h b/src/sequence_diagram/model/participant.h index 9d881d6c..17bc6d89 100644 --- a/src/sequence_diagram/model/participant.h +++ b/src/sequence_diagram/model/participant.h @@ -56,6 +56,8 @@ struct participant : public common::model::template_element, participant &operator=(const participant &) = delete; participant &operator=(participant &&) = delete; + ~participant() override = default; + /** * Get the type name of the diagram element. * @@ -85,6 +87,8 @@ struct class_ : public participant { class_ &operator=(const class_ &) = delete; class_ &operator=(class_ &&) = delete; + ~class_() override = default; + /** * Get the type name of the diagram element. * @@ -233,6 +237,8 @@ struct function : public participant { function &operator=(const function &) = delete; function &operator=(function &&) = delete; + ~function() override = default; + /** * Get the type name of the diagram element. * @@ -415,6 +421,8 @@ struct method : public function { method &operator=(const method &) = delete; method &operator=(method &&) = delete; + ~method() override = default; + /** * Get the type name of the diagram element. * @@ -550,6 +558,8 @@ struct objc_method : public function { objc_method &operator=(const objc_method &) = delete; objc_method &operator=(objc_method &&) = delete; + ~objc_method() override = default; + /** * Get the type name of the diagram element. * @@ -643,6 +653,8 @@ struct function_template : public function { function_template &operator=(const function_template &) = delete; function_template &operator=(function_template &&) = delete; + ~function_template() override = default; + /** * Get the type name of the diagram element. * diff --git a/src/sequence_diagram/visitor/call_expression_context.cc b/src/sequence_diagram/visitor/call_expression_context.cc index fedaee61..bd0d286c 100644 --- a/src/sequence_diagram/visitor/call_expression_context.cc +++ b/src/sequence_diagram/visitor/call_expression_context.cc @@ -168,12 +168,21 @@ void call_expression_context::update( eid_t call_expression_context::caller_id() const { - if (lambda_caller_id().has_value()) - return *lambda_caller_id(); // NOLINT + if (lambda_caller_id().has_value()) { + // Handle a case when local class is defined inside a lambda + if (!is_local_class()) + return *lambda_caller_id(); // NOLINT + } return current_caller_id_; } +bool call_expression_context::is_local_class() const +{ + return current_class_decl_ != nullptr && + current_class_decl_->isLocalClass() != nullptr; +} + std::optional call_expression_context::lambda_caller_id() const { if (current_lambda_caller_id_.empty()) diff --git a/src/sequence_diagram/visitor/call_expression_context.h b/src/sequence_diagram/visitor/call_expression_context.h index e04ab19d..3afefaa3 100644 --- a/src/sequence_diagram/visitor/call_expression_context.h +++ b/src/sequence_diagram/visitor/call_expression_context.h @@ -318,6 +318,13 @@ struct call_expression_context { */ void dump(); + /** + * @brief Check if current context is inside a local class + * + * @return True, if current context is inside a local class + */ + bool is_local_class() const; + clang::CXXRecordDecl *current_class_decl_{nullptr}; clang::ClassTemplateDecl *current_class_template_decl_{nullptr}; clang::ClassTemplateSpecializationDecl diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 0dad952f..5c0399fa 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -286,7 +286,6 @@ bool translation_unit_visitor::VisitClassTemplateSpecializationDecl( declaration->getQualifiedNameAsString(), declaration->getLocation().printToString(source_manager())); - // TODO: Add support for classes defined in function/method bodies if (declaration->isLocalClass() != nullptr) return true; @@ -629,6 +628,8 @@ bool translation_unit_visitor::VisitLambdaExpr(clang::LambdaExpr *expr) if (!lambda_class_model_ptr) return true; + lambda_class_model_ptr->is_lambda(true); + const auto cls_id = lambda_class_model_ptr->id(); set_unique_id(cls->getID(), cls_id); @@ -693,11 +694,15 @@ bool translation_unit_visitor::VisitLambdaExpr(clang::LambdaExpr *expr) bool translation_unit_visitor::TraverseLambdaExpr(clang::LambdaExpr *expr) { + auto context_backup = context(); + RecursiveASTVisitor::TraverseLambdaExpr(expr); // lambda context is entered inside the visitor context().leave_lambda_expression(); + call_expression_context_ = context_backup; + return true; } @@ -1725,7 +1730,17 @@ bool translation_unit_visitor::VisitReturnStmt(clang::ReturnStmt *stmt) m.set_message_name(util::condense_whitespace(message_name)); } - if (context().current_function_decl_ != nullptr) { + if (context().lambda_caller_id().has_value() && + !context().is_local_class()) { + const auto &lambda_model = get_participant( + *context().lambda_caller_id()); // NOLINT + + if (lambda_model.has_value()) { + if (lambda_model.has_value()) + m.set_return_type(lambda_model.value().return_type()); + } + } + else if (context().current_function_decl_ != nullptr) { m.set_return_type( context().current_function_decl_->getReturnType().getAsString()); } @@ -2512,16 +2527,32 @@ translation_unit_visitor::create_class_model(clang::CXXRecordDecl *cls) return {}; } } + // This is equivalent to parent != nullptr and parent->isFunctionDecl() else if (cls->isLocalClass() != nullptr) { const auto *func_declaration = cls->isLocalClass(); - eid_t func_model_id = - get_unique_id(eid_t{func_declaration->getID()}).has_value() - ? *get_unique_id(eid_t{func_declaration->getID()}) - : eid_t{func_declaration->getID()}; + eid_t local_parent_id{int64_t{}}; + + if (common::is_lambda_method(func_declaration)) { + LOG_DBG("The local class is defined in a lambda operator()"); + const auto *method_declaration = + clang::dyn_cast(func_declaration); + + if (method_declaration != nullptr && + method_declaration->getParent() != nullptr) { + local_parent_id = method_declaration->getParent()->getID(); + } + } + else { + local_parent_id = func_declaration->getID(); + } + + eid_t parent_id = get_unique_id(local_parent_id).has_value() + ? *get_unique_id(local_parent_id) // NOLINT + : local_parent_id; const auto &func_model = - diagram().get_participant(func_model_id); + diagram().get_participant(parent_id); if (!func_model.has_value()) return {}; @@ -2532,10 +2563,11 @@ translation_unit_visitor::create_class_model(clang::CXXRecordDecl *cls) auto local_cls_ns = func_model.value().get_namespace(); - c.set_name(func_model.value().full_name_no_ns() + "##" + - common::get_tag_name(*cls)); + c.set_name( + func_model.value().full_name_no_ns(), common::get_tag_name(*cls)); c.set_namespace(local_cls_ns); c.set_id(common::to_id(c.full_name(false))); + c.nested(true); } else { c.set_name(common::get_tag_name(*cls)); @@ -3173,6 +3205,9 @@ translation_unit_visitor::create_method_model(clang::CXXMethodDecl *declaration) return {}; } + LOG_DBG( + "Found method class: {}", maybe_method_class.value().full_name(false)); + const auto &method_class = maybe_method_class.value(); method_model_ptr->is_void(declaration->getReturnType()->isVoidType()); diff --git a/tests/t20072/t20072.cc b/tests/t20072/t20072.cc index 71650b53..8cb1b1fb 100644 --- a/tests/t20072/t20072.cc +++ b/tests/t20072/t20072.cc @@ -39,9 +39,39 @@ template auto bar(const T &b, std::string msg = "two") return foo.result(msg.size()); } +struct Baz { + auto baz(int b) + { + struct Buzz { + int result(int c) const { return value * c; } + + int value; + }; + + Buzz buzz{100}; + + return buzz.result(10); + } +}; + int tmain() { - auto v = bar(foo(1)); + Baz baz; + + auto v = baz.baz(bar(foo(1))); + + auto f = + [](int value) { + struct Luzz { + int result(int c) const { return value + c; } + + int value; + }; + + Luzz luzz{100}; + return luzz; + }(10) + .result(2); return 0; } diff --git a/tests/t20072/test_case.h b/tests/t20072/test_case.h index 3cf6973c..7becb3ac 100644 --- a/tests/t20072/test_case.h +++ b/tests/t20072/test_case.h @@ -37,6 +37,22 @@ TEST_CASE("t20072") {"bar(const Foo &,std::string)", "bar(const Foo &,std::string)::Foo", "result(int) const"}, // + + {"tmain()", "Baz", "baz(int)"}, // + {"Baz", "Baz::baz(int)::Buzz", "result(int) const"}, // + {"Baz::baz(int)::Buzz", "Baz", "int", Response{}}, + {"Baz", "tmain()", "int", Response{}}, // + + {"tmain()", "tmain()::(lambda t20072.cc:64:9)", + "operator()(int) const"}, // + {"tmain()::(lambda t20072.cc:64:9)", "tmain()", "Luzz", + Response{}}, // + + {"tmain()", "tmain()::(lambda t20072.cc:64:9)::Luzz", + "result(int) const"}, // + {"tmain()::(lambda t20072.cc:64:9)::Luzz", "tmain()", "int", + Response{}}, // + })); }); } \ No newline at end of file From f9dc92716f708427995c19ec36d9af89e7bfd921 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 7 Feb 2025 00:25:33 +0100 Subject: [PATCH 4/5] Fixed building on MSVC (#384) --- tests/t20071/test_case.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/t20071/test_case.h b/tests/t20071/test_case.h index 94a14bee..52540c10 100644 --- a/tests/t20071/test_case.h +++ b/tests/t20071/test_case.h @@ -21,6 +21,7 @@ TEST_CASE("t20071") using namespace clanguml::test; using namespace std::string_literals; +#ifndef _MSC_VER auto [config, db, diagram, model] = CHECK_SEQUENCE_MODEL("t20071", "t20071_sequence"); @@ -45,4 +46,5 @@ TEST_CASE("t20071") "await_resume()", CoAwait{}} // })); }); +#endif } From 590c53c2d890650fcbbd729f6415e943e4a9dc27 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 7 Feb 2025 00:29:46 +0100 Subject: [PATCH 5/5] Updated test cases docs (#384) --- docs/test_cases.md | 1 + docs/test_cases/t00002.md | 14 +- docs/test_cases/t00002_class.svg | 54 +- docs/test_cases/t00002_class_mermaid.svg | 10 +- docs/test_cases/t00004.md | 50 +- docs/test_cases/t00004_class.svg | 90 +-- docs/test_cases/t00004_class_mermaid.svg | 38 +- docs/test_cases/t20012.md | 2 +- docs/test_cases/t20029_sequence.svg | 22 +- docs/test_cases/t20044.md | 4 +- docs/test_cases/t20045.md | 12 +- docs/test_cases/t20046.md | 12 +- docs/test_cases/t20048.md | 2 +- docs/test_cases/t20060.md | 2 +- docs/test_cases/t20069.md | 4 +- docs/test_cases/t20071.md | 65 +- docs/test_cases/t20071_sequence.svg | 18 +- docs/test_cases/t20071_sequence_mermaid.svg | 24 +- docs/test_cases/t20072.md | 759 ++++++++++++++++++++ docs/test_cases/t20072_sequence.svg | 245 +++++++ docs/test_cases/t20072_sequence_mermaid.svg | 272 +++++++ docs/test_cases/t30001.md | 20 +- docs/test_cases/t30001_package.svg | 20 +- docs/test_cases/t30018.md | 16 +- docs/test_cases/t30018_package.svg | 16 +- docs/test_cases/t40002.md | 10 +- docs/test_cases/t40002_include.svg | 10 +- docs/test_cases/t40002_include_mermaid.svg | 10 +- 28 files changed, 1540 insertions(+), 262 deletions(-) create mode 100644 docs/test_cases/t20072.md create mode 100644 docs/test_cases/t20072_sequence.svg create mode 100644 docs/test_cases/t20072_sequence_mermaid.svg diff --git a/docs/test_cases.md b/docs/test_cases.md index 542d8e8f..b8ddcd24 100644 --- a/docs/test_cases.md +++ b/docs/test_cases.md @@ -167,6 +167,7 @@ * [t20069](./test_cases/t20069.md) - Test case for return messages from all branches and exitpoints * [t20070](./test_cases/t20070.md) - Test case for sequence diagram with coroutines * [t20071](./test_cases/t20071.md) - Test case for sequence diagram with coroutines and combined participants + * [t20072](./test_cases/t20072.md) - Test case for sequence diagram with local classes defined in function bodies ## Package diagrams * [t30001](./test_cases/t30001.md) - Basic package diagram test case * [t30002](./test_cases/t30002.md) - Package dependency test case diff --git a/docs/test_cases/t00002.md b/docs/test_cases/t00002.md index 4788882b..30efc65c 100644 --- a/docs/test_cases/t00002.md +++ b/docs/test_cases/t00002.md @@ -736,35 +736,35 @@ private: abstract false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00002/t00002.cc#L7 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00002/t00002.cc#L7 This is class A class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00002/t00002.cc#L16 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00002/t00002.cc#L16 This is class B class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00002/t00002.cc#L27 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00002/t00002.cc#L27 This is class C - class C has a long comment class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00002/t00002.cc#L36 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00002/t00002.cc#L36 D class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00002/t00002.cc#L61 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00002/t00002.cc#L61 E @@ -801,7 +801,7 @@ private: public - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00002/t00002.cc#L58 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00002/t00002.cc#L58 association as private @@ -815,7 +815,7 @@ private: public - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00002/t00002.cc#L83 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00002/t00002.cc#L83 association as private diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index ddfd8f0a..b148e224 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -5,7 +5,7 @@ Basic class diagram example - + @@ -13,23 +13,23 @@ A - + - + foo_a() = 0 : void - + - + foo_c() = 0 : void - + @@ -37,16 +37,16 @@ B - + - + foo_a() : void - + @@ -54,16 +54,16 @@ C - + - + foo_c() : void - + @@ -71,30 +71,30 @@ D - + - + foo_a() : void - + - + foo_c() : void - + - + as : std::vector<A *> - + @@ -102,27 +102,27 @@ E - + - + foo_a() : void - + - + foo_c() : void - + - + as : std::vector<A *> @@ -152,7 +152,7 @@ - + @@ -166,7 +166,7 @@ - + diff --git a/docs/test_cases/t00002_class_mermaid.svg b/docs/test_cases/t00002_class_mermaid.svg index b8d98136..bcfdf3e3 100644 --- a/docs/test_cases/t00002_class_mermaid.svg +++ b/docs/test_cases/t00002_class_mermaid.svg @@ -185,7 +185,7 @@ - + @@ -214,7 +214,7 @@ - + @@ -238,7 +238,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -296,7 +296,7 @@ - + diff --git a/docs/test_cases/t00004.md b/docs/test_cases/t00004.md index 87b8275b..f86bb2bd 100644 --- a/docs/test_cases/t00004.md +++ b/docs/test_cases/t00004.md @@ -820,148 +820,148 @@ public: enum - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L4 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L4 Color class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L6 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L6 B enum - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L8 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L8 B::AA enum - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L9 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L9 B::BB enum - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L10 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L10 B::CC class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L18 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L18 A class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L22 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L22 A::AA enum - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L24 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L24 A::AA::Lights class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L26 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L26 A::AA::AAA class ]]> true - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L44 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L44 C::B class ]]> true - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L34 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L34 C class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L38 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L38 C::AA class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L39 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L39 C::AA::AAA enum - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L41 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L41 C::AA::CCC class ]]> true - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L44 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L44 C::B enum - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L50 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L50 C::CC class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L54 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L54 D enum - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L56 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L56 D::AA class false - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L58 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L58 D::DD - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L12 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L12 aggregation aa public - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L13 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L13 aggregation bb public - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L14 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L14 aggregation cc public - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L15 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L15 association color public @@ -975,7 +975,7 @@ public: public - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L27 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L27 aggregation lights private @@ -985,7 +985,7 @@ public: public - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t00004/t00004.cc#L48 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t00004/t00004.cc#L48 aggregation b_int public diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index f0706e5e..d484d6a6 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -3,7 +3,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -25,36 +25,36 @@ - + - + aa : AA - + - + bb : BB - + - + cc : CC - + - + color : Color * - + @@ -67,7 +67,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -101,23 +101,23 @@ A - + - + foo() const : void - + - + foo2() const : void - + @@ -127,7 +127,7 @@ - + @@ -140,7 +140,7 @@ - + @@ -149,15 +149,15 @@ - + - + lights : Lights - + @@ -169,7 +169,7 @@ - + @@ -180,22 +180,22 @@ - + - + b_int : B<int> - + - + t : T - + @@ -205,7 +205,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -227,7 +227,7 @@ - + @@ -238,15 +238,15 @@ - + - + b : V - + @@ -258,7 +258,7 @@ - + @@ -268,7 +268,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -291,7 +291,7 @@ - + @@ -303,7 +303,7 @@ - + @@ -315,7 +315,7 @@ - + @@ -327,7 +327,7 @@ - + @@ -351,7 +351,7 @@ - + @@ -361,7 +361,7 @@ - + diff --git a/docs/test_cases/t00004_class_mermaid.svg b/docs/test_cases/t00004_class_mermaid.svg index 360b547e..ba96d980 100644 --- a/docs/test_cases/t00004_class_mermaid.svg +++ b/docs/test_cases/t00004_class_mermaid.svg @@ -299,7 +299,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -372,7 +372,7 @@ - + @@ -406,7 +406,7 @@ - + @@ -440,7 +440,7 @@ - + @@ -474,7 +474,7 @@ - + @@ -503,7 +503,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -556,7 +556,7 @@ - + @@ -580,7 +580,7 @@ - + @@ -599,7 +599,7 @@ - + @@ -628,7 +628,7 @@ - + @@ -647,7 +647,7 @@ - + @@ -666,7 +666,7 @@ - + @@ -695,7 +695,7 @@ - + @@ -719,7 +719,7 @@ - + @@ -748,7 +748,7 @@ - + @@ -767,7 +767,7 @@ - + @@ -801,7 +801,7 @@ - + diff --git a/docs/test_cases/t20012.md b/docs/test_cases/t20012.md index a8986d5c..3404fbe1 100644 --- a/docs/test_cases/t20012.md +++ b/docs/test_cases/t20012.md @@ -1045,7 +1045,7 @@ void tmain() "participant_id": "12685488174106388182" }, "name": "", - "return_type": "void", + "return_type": "auto", "scope": "normal", "source_location": { "column": 24, diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg index a2a99929..8c9b94ab 100644 --- a/docs/test_cases/t20029_sequence.svg +++ b/docs/test_cases/t20029_sequence.svg @@ -60,31 +60,31 @@ - + tmain() tmain() - + Encoder<Retrier<ConnectionPool>> Encoder<Retrier<ConnectionPool>> - + Retrier<ConnectionPool> Retrier<ConnectionPool> - + ConnectionPool ConnectionPool - + encode_b64(std::string &&) @@ -122,7 +122,7 @@ Establish connection to the remote server synchronously - + connect() @@ -137,7 +137,7 @@ alt - + [ @@ -149,14 +149,14 @@ Encode the message using Base64 encoding and pass it to the next layer - + encode(std::string &&) - + @@ -166,7 +166,7 @@ - + send(std::string &&) @@ -181,7 +181,7 @@ alt - + [ diff --git a/docs/test_cases/t20044.md b/docs/test_cases/t20044.md index 9db854a8..e1333875 100644 --- a/docs/test_cases/t20044.md +++ b/docs/test_cases/t20044.md @@ -691,7 +691,7 @@ int tmain() "participant_id": "7434526094294639429" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 37, @@ -839,7 +839,7 @@ int tmain() "participant_id": "7434526094294639429" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 37, diff --git a/docs/test_cases/t20045.md b/docs/test_cases/t20045.md index dc477625..20cfef05 100644 --- a/docs/test_cases/t20045.md +++ b/docs/test_cases/t20045.md @@ -426,7 +426,7 @@ int tmain() "participant_id": "293155873414345883" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 35, @@ -526,7 +526,7 @@ int tmain() "participant_id": "293155873414345883" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 35, @@ -626,7 +626,7 @@ int tmain() "participant_id": "12450159380580033187" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 36, @@ -726,7 +726,7 @@ int tmain() "participant_id": "12450159380580033187" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 36, @@ -826,7 +826,7 @@ int tmain() "participant_id": "1059230251449926314" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 9, @@ -926,7 +926,7 @@ int tmain() "participant_id": "1059230251449926314" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 9, diff --git a/docs/test_cases/t20046.md b/docs/test_cases/t20046.md index bb25afd9..b04fc70f 100644 --- a/docs/test_cases/t20046.md +++ b/docs/test_cases/t20046.md @@ -300,7 +300,7 @@ int tmain() "participant_id": "1307842516029171611" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 34, @@ -320,7 +320,7 @@ int tmain() "participant_id": "14945611928916456551" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 9, @@ -441,7 +441,7 @@ int tmain() "participant_id": "17423609226710801275" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 52, @@ -461,7 +461,7 @@ int tmain() "participant_id": "14668215983962849304" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 27, @@ -581,7 +581,7 @@ int tmain() "participant_id": "17423609226710801275" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 52, @@ -601,7 +601,7 @@ int tmain() "participant_id": "14668215983962849304" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 27, diff --git a/docs/test_cases/t20048.md b/docs/test_cases/t20048.md index 4f90154d..cb9734e6 100644 --- a/docs/test_cases/t20048.md +++ b/docs/test_cases/t20048.md @@ -402,7 +402,7 @@ int tmain() "participant_id": "6356005060404304996" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 26, diff --git a/docs/test_cases/t20060.md b/docs/test_cases/t20060.md index f53a3abe..8a65b3c6 100644 --- a/docs/test_cases/t20060.md +++ b/docs/test_cases/t20060.md @@ -262,7 +262,7 @@ void for_each_if(const T &collection, C &&cond, F &&func) "participant_id": "3098751609515063172" }, "name": "", - "return_type": "void", + "return_type": "auto", "scope": "normal", "source_location": { "column": 33, diff --git a/docs/test_cases/t20069.md b/docs/test_cases/t20069.md index df0d6504..337c10d6 100644 --- a/docs/test_cases/t20069.md +++ b/docs/test_cases/t20069.md @@ -354,7 +354,7 @@ int tmain() "participant_id": "5771227792840476499" }, "name": "", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 36, @@ -836,7 +836,7 @@ int tmain() "participant_id": "5771227792840476499" }, "name": "v + 1", - "return_type": "int", + "return_type": "auto", "scope": "normal", "source_location": { "column": 36, diff --git a/docs/test_cases/t20071.md b/docs/test_cases/t20071.md index 240e8b79..89642ae5 100644 --- a/docs/test_cases/t20071.md +++ b/docs/test_cases/t20071.md @@ -26,21 +26,22 @@ File `tests/t20071/t20071.cc` #include namespace clanguml::t20071 { -struct awaitable_on_thread { - std::thread *p_out; - bool await_ready() { return false; } - void await_suspend(std::coroutine_handle<> h) - { - auto &out = *p_out; - if (out.joinable()) - throw std::runtime_error("Output thread parameter not empty"); - out = std::thread([h] { h.resume(); }); - } - void await_resume() { } -}; auto switch_to_new_thread(std::thread &out) { + struct awaitable_on_thread { + std::thread *p_out; + bool await_ready() { return false; } + void await_suspend(std::coroutine_handle<> h) + { + auto &out = *p_out; + if (out.joinable()) + throw std::runtime_error("Output thread parameter not empty"); + out = std::thread([h] { h.resume(); }); + } + void await_resume() { } + }; + return awaitable_on_thread{&out}; } @@ -94,7 +95,7 @@ int tmain() "source_location": { "column": 5, "file": "t20071.cc", - "line": 45, + "line": 46, "translation_unit": "t20071.cc" }, "type": "function" @@ -109,7 +110,7 @@ int tmain() "source_location": { "column": 6, "file": "t20071.cc", - "line": 35, + "line": 36, "translation_unit": "t20071.cc" }, "type": "function" @@ -123,7 +124,7 @@ int tmain() "source_location": { "column": 6, "file": "t20071.cc", - "line": 20, + "line": 8, "translation_unit": "t20071.cc" }, "type": "function" @@ -140,28 +141,28 @@ int tmain() "activities": [ { "display_name": "await_resume()", - "full_name": "clanguml::t20071::awaitable_on_thread::await_resume()", - "id": "17085276103664051446", + "full_name": "clanguml::t20071::switch_to_new_thread(std::thread &)::awaitable_on_thread::await_resume()", + "id": "3843090677682834966", "name": "await_resume", - "namespace": "clanguml::t20071", + "namespace": "clanguml::t20071::switch_to_new_thread(std::thread &)", "source_location": { - "column": 10, + "column": 14, "file": "t20071.cc", - "line": 17, + "line": 20, "translation_unit": "t20071.cc" }, "type": "method" } ], - "display_name": "awaitable_on_thread", - "full_name": "clanguml::t20071::awaitable_on_thread", - "id": "17910232009778350338", - "name": "awaitable_on_thread", + "display_name": "switch_to_new_thread(std::thread &)::awaitable_on_thread", + "full_name": "clanguml::t20071::switch_to_new_thread(std::thread &)::awaitable_on_thread", + "id": "1837645032261779240", + "name": "switch_to_new_thread(std::thread &)##awaitable_on_thread", "namespace": "clanguml::t20071", "source_location": { - "column": 8, + "column": 12, "file": "t20071.cc", - "line": 7, + "line": 10, "translation_unit": "t20071.cc" }, "type": "class" @@ -185,7 +186,7 @@ int tmain() "source_location": { "column": 5, "file": "t20071.cc", - "line": 48, + "line": 49, "translation_unit": "t20071.cc" }, "to": { @@ -205,7 +206,7 @@ int tmain() "source_location": { "column": 14, "file": "t20071.cc", - "line": 39, + "line": 40, "translation_unit": "t20071.cc" }, "to": { @@ -225,7 +226,7 @@ int tmain() "source_location": { "column": 5, "file": "t20071.cc", - "line": 22, + "line": 23, "translation_unit": "t20071.cc" }, "to": { @@ -245,12 +246,12 @@ int tmain() "source_location": { "column": 5, "file": "t20071.cc", - "line": 39, + "line": 40, "translation_unit": "t20071.cc" }, "to": { - "activity_id": "17085276103664051446", - "participant_id": "17910232009778350338" + "activity_id": "3843090677682834966", + "participant_id": "1837645032261779240" }, "type": "co_await" } diff --git a/docs/test_cases/t20071_sequence.svg b/docs/test_cases/t20071_sequence.svg index d1d23c2a..9fa8f0bd 100644 --- a/docs/test_cases/t20071_sequence.svg +++ b/docs/test_cases/t20071_sequence.svg @@ -1,4 +1,4 @@ - + @@ -16,7 +16,7 @@ - awaitable_on_thread + switch_to_new_thread(std::thread &)::awaitable_on_thread @@ -25,18 +25,18 @@ - awaitable_on_thread + switch_to_new_thread(std::thread &)::awaitable_on_thread - + t20071.cc t20071.cc - - awaitable_on_thread - - awaitable_on_thread + + switch_to_new_thread(std::thread &)::awaitable_on_thread + + switch_to_new_thread(std::thread &)::awaitable_on_thread t20071.cc @@ -50,7 +50,7 @@ - awaitable_on_thread + switch_to_new_thread(std::thread &)::awaitable_on_thread diff --git a/docs/test_cases/t20071_sequence_mermaid.svg b/docs/test_cases/t20071_sequence_mermaid.svg index d6110918..8e8d4a51 100644 --- a/docs/test_cases/t20071_sequence_mermaid.svg +++ b/docs/test_cases/t20071_sequence_mermaid.svg @@ -1,8 +1,8 @@ - + - - - awaitable_on_thread + + + switch_to_new_thread(std::thread &)::awaitable_on_thread @@ -18,11 +18,11 @@ - + - - - awaitable_on_thread + + + switch_to_new_thread(std::thread &)::awaitable_on_thread @@ -92,7 +92,7 @@ - + tmain() @@ -103,9 +103,9 @@ awaitable_on_thread - << co_await >> - await_resume() - + << co_await >> + await_resume() + int diff --git a/docs/test_cases/t20072.md b/docs/test_cases/t20072.md new file mode 100644 index 00000000..af192dcd --- /dev/null +++ b/docs/test_cases/t20072.md @@ -0,0 +1,759 @@ +# t20072 - Test case for sequence diagram with local classes defined in function bodies +## Config +```yaml +diagrams: + t20072_sequence: + type: sequence + glob: + - t20072.cc + include: + namespaces: + - clanguml::t20072 + using_namespace: clanguml::t20072 + generate_return_types: true + from: + - function: "clanguml::t20072::tmain()" +``` +## Source code +File `tests/t20072/t20072.cc` +```cpp +#include + +namespace clanguml::t20072 { + +bool validate(int v) { return v != 0; } + +auto foo(int f) +{ + class Foo { + public: + void set(int value) + { + if (validate(value)) + value_ = value; + } + + int get() const { return value_; } + + private: + int value_; + }; + + Foo result; + result.set(f); + + return result; +} + +template auto bar(const T &b, std::string msg = "two") +{ + struct Foo { + int result(int c) const { return value / c; } + + int value; + }; + + Foo foo{b.get() + 10}; + + return foo.result(msg.size()); +} + +struct Baz { + auto baz(int b) + { + struct Buzz { + int result(int c) const { return value * c; } + + int value; + }; + + Buzz buzz{100}; + + return buzz.result(10); + } +}; + +int tmain() +{ + Baz baz; + + auto v = baz.baz(bar(foo(1))); + + auto f = + [](int value) { + struct Luzz { + int result(int c) const { return value + c; } + + int value; + }; + + Luzz luzz{100}; + return luzz; + }(10) + .result(2); + + return 0; +} +} // namespace clanguml::t20072 +``` +## Generated PlantUML diagrams +![t20072_sequence](./t20072_sequence.svg "Test case for sequence diagram with local classes defined in function bodies") +## Generated Mermaid diagrams +![t20072_sequence](./t20072_sequence_mermaid.svg "Test case for sequence diagram with local classes defined in function bodies") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20072_sequence", + "participants": [ + { + "display_name": "tmain()", + "full_name": "clanguml::t20072::tmain()", + "id": "12591197815004111245", + "name": "tmain", + "namespace": "clanguml::t20072", + "source_location": { + "column": 5, + "file": "t20072.cc", + "line": 57, + "translation_unit": "t20072.cc" + }, + "type": "function" + }, + { + "display_name": "foo(int)", + "full_name": "clanguml::t20072::foo(int)", + "id": "15901512234841805552", + "name": "foo", + "namespace": "clanguml::t20072", + "source_location": { + "column": 6, + "file": "t20072.cc", + "line": 7, + "translation_unit": "t20072.cc" + }, + "type": "function" + }, + { + "activities": [ + { + "display_name": "set(int)", + "full_name": "clanguml::t20072::foo(int)::Foo::set(int)", + "id": "7590227368248288835", + "name": "set", + "namespace": "clanguml::t20072::foo(int)", + "source_location": { + "column": 14, + "file": "t20072.cc", + "line": 11, + "translation_unit": "t20072.cc" + }, + "type": "method" + }, + { + "display_name": "get() const", + "full_name": "clanguml::t20072::foo(int)::Foo::get() const", + "id": "17355390296943913336", + "name": "get", + "namespace": "clanguml::t20072::foo(int)", + "source_location": { + "column": 13, + "file": "t20072.cc", + "line": 17, + "translation_unit": "t20072.cc" + }, + "type": "method" + } + ], + "display_name": "foo(int)::Foo", + "full_name": "clanguml::t20072::foo(int)::Foo", + "id": "18427027110482304965", + "name": "foo(int)##Foo", + "namespace": "clanguml::t20072", + "source_location": { + "column": 11, + "file": "t20072.cc", + "line": 9, + "translation_unit": "t20072.cc" + }, + "type": "class" + }, + { + "display_name": "validate(int)", + "full_name": "clanguml::t20072::validate(int)", + "id": "5385611197192077815", + "name": "validate", + "namespace": "clanguml::t20072", + "source_location": { + "column": 6, + "file": "t20072.cc", + "line": 5, + "translation_unit": "t20072.cc" + }, + "type": "function" + }, + { + "display_name": "bar(const Foo &,std::string)", + "full_name": "clanguml::t20072::bar(const Foo &,std::string)", + "id": "4794546187074870268", + "name": "bar", + "namespace": "clanguml::t20072", + "source_location": { + "column": 28, + "file": "t20072.cc", + "line": 29, + "translation_unit": "t20072.cc" + }, + "type": "function_template" + }, + { + "activities": [ + { + "display_name": "result(int) const", + "full_name": "clanguml::t20072::bar(const Foo &,std::string)::Foo::result(int) const", + "id": "6852464337472368360", + "name": "result", + "namespace": "clanguml::t20072::bar(const Foo &, std::string)", + "source_location": { + "column": 13, + "file": "t20072.cc", + "line": 32, + "translation_unit": "t20072.cc" + }, + "type": "method" + } + ], + "display_name": "bar(const Foo &,std::string)::Foo", + "full_name": "clanguml::t20072::bar(const Foo &,std::string)::Foo", + "id": "9961827986890750125", + "name": "bar(const Foo &,std::string)##Foo", + "namespace": "clanguml::t20072", + "source_location": { + "column": 12, + "file": "t20072.cc", + "line": 31, + "translation_unit": "t20072.cc" + }, + "type": "class" + }, + { + "activities": [ + { + "display_name": "baz(int)", + "full_name": "clanguml::t20072::Baz::baz(int)", + "id": "5810984896987412842", + "name": "baz", + "namespace": "clanguml::t20072", + "source_location": { + "column": 10, + "file": "t20072.cc", + "line": 43, + "translation_unit": "t20072.cc" + }, + "type": "method" + } + ], + "display_name": "Baz", + "full_name": "clanguml::t20072::Baz", + "id": "4826286430095177676", + "name": "Baz", + "namespace": "clanguml::t20072", + "source_location": { + "column": 8, + "file": "t20072.cc", + "line": 42, + "translation_unit": "t20072.cc" + }, + "type": "class" + }, + { + "activities": [ + { + "display_name": "result(int) const", + "full_name": "clanguml::t20072::Baz::baz(int)::Buzz::result(int) const", + "id": "6777946266074496792", + "name": "result", + "namespace": "clanguml::t20072::Baz::baz(int)", + "source_location": { + "column": 17, + "file": "t20072.cc", + "line": 46, + "translation_unit": "t20072.cc" + }, + "type": "method" + } + ], + "display_name": "Baz::baz(int)::Buzz", + "full_name": "clanguml::t20072::Baz::baz(int)::Buzz", + "id": "6933934019950221954", + "name": "Baz::baz(int)##Buzz", + "namespace": "clanguml::t20072", + "source_location": { + "column": 16, + "file": "t20072.cc", + "line": 45, + "translation_unit": "t20072.cc" + }, + "type": "class" + }, + { + "activities": [ + { + "display_name": "operator()(int) const", + "full_name": "clanguml::t20072::tmain()::(lambda t20072.cc:64:9)::operator()(int) const", + "id": "9324005151899507806", + "name": "operator()", + "namespace": "clanguml::t20072::tmain()", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20072.cc:64:9)", + "full_name": "clanguml::t20072::tmain()::(lambda t20072.cc:64:9)", + "id": "1206402300175125179", + "name": "tmain()##(lambda t20072.cc:64:9)", + "namespace": "clanguml::t20072", + "source_location": { + "column": 9, + "file": "t20072.cc", + "line": 64, + "translation_unit": "t20072.cc" + }, + "type": "lambda" + }, + { + "activities": [ + { + "display_name": "result(int) const", + "full_name": "clanguml::t20072::tmain()::(lambda t20072.cc:64:9)::Luzz::result(int) const", + "id": "16861379060918955417", + "name": "result", + "namespace": "clanguml::t20072::tmain()::(anonymous class)::operator()(int)", + "source_location": { + "column": 21, + "file": "t20072.cc", + "line": 66, + "translation_unit": "t20072.cc" + }, + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20072.cc:64:9)::Luzz", + "full_name": "clanguml::t20072::tmain()::(lambda t20072.cc:64:9)::Luzz", + "id": "7538269699090722315", + "name": "tmain()##(lambda t20072.cc:64:9)##Luzz", + "namespace": "clanguml::t20072", + "source_location": { + "column": 20, + "file": "t20072.cc", + "line": 65, + "translation_unit": "t20072.cc" + }, + "type": "class" + } + ], + "sequences": [ + { + "from": { + "id": "12591197815004111245", + "location": "clanguml::t20072::tmain()" + }, + "messages": [ + { + "from": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "name": "", + "return_type": "Foo", + "scope": "normal", + "source_location": { + "column": 26, + "file": "t20072.cc", + "line": 61, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "15901512234841805552", + "participant_id": "15901512234841805552" + }, + "type": "message" + }, + { + "from": { + "activity_id": "15901512234841805552", + "participant_id": "15901512234841805552" + }, + "name": "set(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 5, + "file": "t20072.cc", + "line": 24, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "7590227368248288835", + "participant_id": "18427027110482304965" + }, + "type": "message" + }, + { + "activity_id": "7590227368248288835", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "7590227368248288835", + "participant_id": "18427027110482304965" + }, + "name": "", + "return_type": "bool", + "scope": "condition", + "source_location": { + "column": 17, + "file": "t20072.cc", + "line": 13, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "5385611197192077815", + "participant_id": "5385611197192077815" + }, + "type": "message" + }, + { + "from": { + "activity_id": "5385611197192077815", + "participant_id": "5385611197192077815" + }, + "name": "_Bool", + "return_type": "_Bool", + "scope": "normal", + "source_location": { + "column": 24, + "file": "t20072.cc", + "line": 5, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "7590227368248288835", + "participant_id": "18427027110482304965" + }, + "type": "return" + } + ], + "type": "consequent" + } + ], + "name": "if", + "type": "alt" + }, + { + "from": { + "activity_id": "15901512234841805552", + "participant_id": "15901512234841805552" + }, + "name": "Foo", + "return_type": "Foo", + "scope": "normal", + "source_location": { + "column": 5, + "file": "t20072.cc", + "line": 26, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "type": "return" + }, + { + "from": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "column": 22, + "file": "t20072.cc", + "line": 61, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "4794546187074870268", + "participant_id": "4794546187074870268" + }, + "type": "message" + }, + { + "from": { + "activity_id": "4794546187074870268", + "participant_id": "4794546187074870268" + }, + "name": "get() const", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 13, + "file": "t20072.cc", + "line": 37, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "17355390296943913336", + "participant_id": "18427027110482304965" + }, + "type": "message" + }, + { + "from": { + "activity_id": "17355390296943913336", + "participant_id": "18427027110482304965" + }, + "name": "int", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 27, + "file": "t20072.cc", + "line": 17, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "4794546187074870268", + "participant_id": "4794546187074870268" + }, + "type": "return" + }, + { + "from": { + "activity_id": "4794546187074870268", + "participant_id": "4794546187074870268" + }, + "name": "result(int) const", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 12, + "file": "t20072.cc", + "line": 39, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "6852464337472368360", + "participant_id": "9961827986890750125" + }, + "type": "message" + }, + { + "from": { + "activity_id": "6852464337472368360", + "participant_id": "9961827986890750125" + }, + "name": "int", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 35, + "file": "t20072.cc", + "line": 32, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "4794546187074870268", + "participant_id": "4794546187074870268" + }, + "type": "return" + }, + { + "from": { + "activity_id": "4794546187074870268", + "participant_id": "4794546187074870268" + }, + "name": "int", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 5, + "file": "t20072.cc", + "line": 39, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "type": "return" + }, + { + "from": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "name": "baz(int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 14, + "file": "t20072.cc", + "line": 61, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "5810984896987412842", + "participant_id": "4826286430095177676" + }, + "type": "message" + }, + { + "from": { + "activity_id": "5810984896987412842", + "participant_id": "4826286430095177676" + }, + "name": "result(int) const", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 16, + "file": "t20072.cc", + "line": 53, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "6777946266074496792", + "participant_id": "6933934019950221954" + }, + "type": "message" + }, + { + "from": { + "activity_id": "6777946266074496792", + "participant_id": "6933934019950221954" + }, + "name": "int", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 39, + "file": "t20072.cc", + "line": 46, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "5810984896987412842", + "participant_id": "4826286430095177676" + }, + "type": "return" + }, + { + "from": { + "activity_id": "5810984896987412842", + "participant_id": "4826286430095177676" + }, + "name": "int", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 9, + "file": "t20072.cc", + "line": 53, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "type": "return" + }, + { + "from": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "name": "operator()(int) const", + "return_type": "Luzz", + "scope": "normal", + "source_location": { + "column": 9, + "file": "t20072.cc", + "line": 64, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "9324005151899507806", + "participant_id": "1206402300175125179" + }, + "type": "message" + }, + { + "from": { + "activity_id": "9324005151899507806", + "participant_id": "1206402300175125179" + }, + "name": "Luzz", + "return_type": "Luzz", + "scope": "normal", + "source_location": { + "column": 13, + "file": "t20072.cc", + "line": 72, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "type": "return" + }, + { + "from": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "name": "result(int) const", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 9, + "file": "t20072.cc", + "line": 64, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "16861379060918955417", + "participant_id": "7538269699090722315" + }, + "type": "message" + }, + { + "from": { + "activity_id": "16861379060918955417", + "participant_id": "7538269699090722315" + }, + "name": "int", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 43, + "file": "t20072.cc", + "line": 66, + "translation_unit": "t20072.cc" + }, + "to": { + "activity_id": "12591197815004111245", + "participant_id": "12591197815004111245" + }, + "type": "return" + } + ] + } + ], + "using_namespace": "clanguml::t20072" +} +``` +## Generated GraphML models diff --git a/docs/test_cases/t20072_sequence.svg b/docs/test_cases/t20072_sequence.svg new file mode 100644 index 00000000..85e10422 --- /dev/null +++ b/docs/test_cases/t20072_sequence.svg @@ -0,0 +1,245 @@ + + + + + + + tmain() + + + + foo(int) + + + + foo(int)::Foo + + + + foo(int)::Foo + + + + validate(int) + + + + bar<Foo>(const Foo &,std::string) + + + + bar<Foo>(const Foo &,std::string)::Foo + + + + Baz + + + + Baz::baz(int)::Buzz + + + + tmain()::(lambda t20072.cc:64:9) + + + + tmain()::(lambda t20072.cc:64:9)::Luzz + + + + + tmain() + + + + + foo(int) + + + + + foo(int)::Foo + + + + + validate(int) + + + + + bar<Foo>(const Foo &,std::string) + + + + + bar<Foo>(const Foo &,std::string)::Foo + + + + + Baz + + + + + Baz::baz(int)::Buzz + + + + + tmain()::(lambda t20072.cc:64:9) + + + + + tmain()::(lambda t20072.cc:64:9)::Luzz + + + + + tmain() + + tmain() + + foo(int) + + foo(int) + + foo(int)::Foo + + foo(int)::Foo + + validate(int) + + validate(int) + + bar<Foo>(const Foo &,std::string) + + bar<Foo>(const Foo &,std::string) + + bar<Foo>(const Foo &,std::string)::Foo + + bar<Foo>(const Foo &,std::string)::Foo + + Baz + + Baz + + Baz::baz(int)::Buzz + + Baz::baz(int)::Buzz + + tmain()::(lambda t20072.cc:64:9) + + tmain()::(lambda t20072.cc:64:9) + + tmain()::(lambda t20072.cc:64:9)::Luzz + + tmain()::(lambda t20072.cc:64:9)::Luzz + + tmain() + + + + foo(int) + + + + foo(int)::Foo + + + + foo(int)::Foo + + + + validate(int) + + + + bar<Foo>(const Foo &,std::string) + + + + bar<Foo>(const Foo &,std::string)::Foo + + + + Baz + + + + Baz::baz(int)::Buzz + + + + tmain()::(lambda t20072.cc:64:9) + + + + tmain()::(lambda t20072.cc:64:9)::Luzz + + + + + + + set(int) + + + alt + + + [ + ] + + + _Bool + + + Foo + + + + + get() const + + + int + + + result(int) const + + + int + + + int + + + baz(int) + + + result(int) const + + + int + + + int + + + operator()(int) const + + + Luzz + + + result(int) const + + + int + + diff --git a/docs/test_cases/t20072_sequence_mermaid.svg b/docs/test_cases/t20072_sequence_mermaid.svg new file mode 100644 index 00000000..badd768a --- /dev/null +++ b/docs/test_cases/t20072_sequence_mermaid.svg @@ -0,0 +1,272 @@ + + + + + tmain()::(lambda t20072.cc:64:9)::Luzz + + + + + + tmain()::(lambda t20072.cc:64:9) + + + + + + Baz::baz(int)::Buzz + + + + + + Baz + + + + + + bar<Foo>(const Foo &,std::string)::Foo + + + + + + bar<Foo>(const Foo &,std::string) + + + + + + validate(int) + + + + + + foo(int)::Foo + + + + + + foo(int) + + + + + + tmain() + + + + + + + + tmain()::(lambda t20072.cc:64:9)::Luzz + + + + + + + + + tmain()::(lambda t20072.cc:64:9) + + + + + + + + + Baz::baz(int)::Buzz + + + + + + + + + Baz + + + + + + + + + bar<Foo>(const Foo &,std::string)::Foo + + + + + + + + + bar<Foo>(const Foo &,std::string) + + + + + + + + + validate(int) + + + + + + + + + foo(int)::Foo + + + + + + + + + foo(int) + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + + + + + + + + + + + + + + + + + + + + + + + + + + + + set(int) + + [] + + _Bool + + Foo + + + + get() const + + int + + result(int) const + + int + + int + + baz(int) + + result(int) const + + int + + int + + operator()(int) const + + Luzz + + result(int) const + + int + + diff --git a/docs/test_cases/t30001.md b/docs/test_cases/t30001.md index d9d2a210..7d2058f4 100644 --- a/docs/test_cases/t30001.md +++ b/docs/test_cases/t30001.md @@ -271,26 +271,26 @@ namespace BB { A namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L3 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L3 A AA namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L5 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L5 AA AAA namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L6 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L6 AAA BBB namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L8 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L8 BBB @@ -306,7 +306,7 @@ namespace BB { BB namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L11 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L11 BB @@ -322,26 +322,26 @@ namespace BB { B namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L14 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L14 B AA namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L16 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L16 AA AAA namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L17 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L17 AAA BBB namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L19 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L19 BBB @@ -350,7 +350,7 @@ namespace BB { BB namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30001/t30001.cc#L22 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30001/t30001.cc#L22 BB diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 2196389b..3dd7af51 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -5,52 +5,52 @@ Basic package diagram example - + A - + AA - + B - + AA - + AAA - + BBB - + BB - + AAA - + BBB - + BB diff --git a/docs/test_cases/t30018.md b/docs/test_cases/t30018.md index d035ea07..6f6d4a99 100644 --- a/docs/test_cases/t30018.md +++ b/docs/test_cases/t30018.md @@ -191,49 +191,49 @@ struct FF { context namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30018/t30018.cc#L2 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30018/t30018.cc#L2 context B namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30018/t30018.cc#L9 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30018/t30018.cc#L9 B D namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30018/t30018.cc#L27 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30018/t30018.cc#L27 D E namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30018/t30018.cc#L31 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30018/t30018.cc#L31 E F namespace - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30018/t30018.cc#L38 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30018/t30018.cc#L38 F - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30018/t30018.cc#L33 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30018/t30018.cc#L33 dependency - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30018/t30018.cc#L34 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30018/t30018.cc#L34 dependency - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t30018/t30018.cc#L40 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t30018/t30018.cc#L40 dependency diff --git a/docs/test_cases/t30018_package.svg b/docs/test_cases/t30018_package.svg index 60d2bf0d..d274afa3 100644 --- a/docs/test_cases/t30018_package.svg +++ b/docs/test_cases/t30018_package.svg @@ -3,40 +3,40 @@ - + context - + B - + D - + E - + F - + - + - + diff --git a/docs/test_cases/t40002.md b/docs/test_cases/t40002.md index 484394d7..b9b6b0e8 100644 --- a/docs/test_cases/t40002.md +++ b/docs/test_cases/t40002.md @@ -357,7 +357,7 @@ int foo(); file t40002.cc source - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t40002/src/t40002.cc#L0 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t40002/src/t40002.cc#L0 t40002.cc @@ -368,7 +368,7 @@ int foo(); file lib1.cc source - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t40002/src/lib1/lib1.cc#L0 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t40002/src/lib1/lib1.cc#L0 lib1.cc @@ -381,7 +381,7 @@ int foo(); file lib2.cc source - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t40002/src/lib2/lib2.cc#L0 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t40002/src/lib2/lib2.cc#L0 lib2.cc @@ -400,7 +400,7 @@ int foo(); file lib1.h header - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t40002/include/lib1/lib1.h#L0 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t40002/include/lib1/lib1.h#L0 lib1.h @@ -413,7 +413,7 @@ int foo(); file lib2.h header - https://github.com/bkryza/clang-uml/blob/f6f3c909532bb830383a5c85caec50417ae1ec05/tests/t40002/include/lib2/lib2.h#L0 + https://github.com/bkryza/clang-uml/blob/f9dc92716f708427995c19ec36d9af89e7bfd921/tests/t40002/include/lib2/lib2.h#L0 lib2.h diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index fea819e8..1582b7c2 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -33,27 +33,27 @@ lib2 - + t40002.cc - + lib1.cc - + lib2.cc - + lib1.h - + lib2.h diff --git a/docs/test_cases/t40002_include_mermaid.svg b/docs/test_cases/t40002_include_mermaid.svg index 8be4cd96..09b45282 100644 --- a/docs/test_cases/t40002_include_mermaid.svg +++ b/docs/test_cases/t40002_include_mermaid.svg @@ -149,7 +149,7 @@ - + @@ -164,7 +164,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -194,7 +194,7 @@ - + @@ -209,7 +209,7 @@ - +