From d7c13edbf9b5f1bcf56e4f5ac9f021bd906e7cc0 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Mon, 12 Dec 2022 21:07:28 +0100 Subject: [PATCH 01/19] Added highlight of calls within condition statements of if/else blocks --- src/common/clang_utils.cc | 16 ++++++++++++++++ src/common/clang_utils.h | 2 ++ src/common/model/enums.h | 8 ++++++++ .../plantuml/sequence_diagram_generator.cc | 17 ++++++++++++++--- src/sequence_diagram/model/message.cc | 7 +++++++ src/sequence_diagram/model/message.h | 6 ++++++ .../visitor/translation_unit_visitor.cc | 15 +++++++++++++++ tests/t20020/t20020.cc | 11 ++++++++--- tests/t20020/test_case.h | 9 +++++++-- tests/test_cases.h | 11 ++++++++++- 10 files changed, 93 insertions(+), 9 deletions(-) diff --git a/src/common/clang_utils.cc b/src/common/clang_utils.cc index c5fec542..34c511f7 100644 --- a/src/common/clang_utils.cc +++ b/src/common/clang_utils.cc @@ -164,6 +164,22 @@ std::string get_source_text( return get_source_text_raw(printable_range, sm); } +bool is_subexpr_of(const clang::Stmt *parent_stmt, const clang::Stmt *sub_stmt) +{ + if (parent_stmt == nullptr || sub_stmt == nullptr) + return false; + + if (parent_stmt == sub_stmt) + return true; + + for (const auto *e : parent_stmt->children()) { + if (is_subexpr_of(e, sub_stmt)) + return true; + } + + return false; +} + template <> id_t to_id(const std::string &full_name) { return std::hash{}(full_name) >> 3; diff --git a/src/common/clang_utils.h b/src/common/clang_utils.h index b3860a59..c332dd10 100644 --- a/src/common/clang_utils.h +++ b/src/common/clang_utils.h @@ -68,6 +68,8 @@ std::string get_source_text_raw( std::string get_source_text( clang::SourceRange range, const clang::SourceManager &sm); +bool is_subexpr_of(const clang::Stmt *parent_stmt, const clang::Stmt *sub_stmt); + template id_t to_id(const T &declaration); template <> id_t to_id(const std::string &full_name); diff --git a/src/common/model/enums.h b/src/common/model/enums.h index fbec4a55..6ef22218 100644 --- a/src/common/model/enums.h +++ b/src/common/model/enums.h @@ -39,6 +39,7 @@ enum class relationship_t { kDependency }; +/// Types of sequence diagram activity elements enum class message_t { kCall, kReturn, @@ -55,6 +56,13 @@ enum class message_t { kNone }; +/// The scope of the call expression represented in the sequence diagram +enum class message_scope_t { + kNormal, // This is a regular call expression + kCondition // This is a call expression from within a control condition + // e.g if(a->is_valid()) { ... } +}; + std::string to_string(relationship_t r); std::string to_string(access_t r); diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc index 2c6668ef..c2ebe161 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -79,14 +79,25 @@ void generator::generate_call(const message &m, std::ostream &ostr) const const std::string to_alias = generate_alias(to.value()); ostr << from_alias << " " - << common::generators::plantuml::to_plantuml(message_t::kCall) << " " - << to_alias; + << common::generators::plantuml::to_plantuml(message_t::kCall) << " "; + + ostr << to_alias; if (m_config.generate_links) { common_generator::generate_link(ostr, m); } - ostr << " : " << message << std::endl; + ostr << " : "; + + if (m.message_scope() == common::model::message_scope_t::kCondition) + ostr << "**[**"; + + ostr << message; + + if (m.message_scope() == common::model::message_scope_t::kCondition) + ostr << "**]**"; + + ostr << '\n'; LOG_DBG("Generated call '{}' from {} [{}] to {} [{}]", message, from, m.from(), to, m.to()); diff --git a/src/sequence_diagram/model/message.cc b/src/sequence_diagram/model/message.cc index 93f23937..19a7fb21 100644 --- a/src/sequence_diagram/model/message.cc +++ b/src/sequence_diagram/model/message.cc @@ -50,4 +50,11 @@ void message::set_return_type(std::string t) { return_type_ = std::move(t); } const std::string &message::return_type() const { return return_type_; } +void message::set_message_scope(common::model::message_scope_t scope) +{ + scope_ = scope; +} + +common::model::message_scope_t message::message_scope() const { return scope_; } + } diff --git a/src/sequence_diagram/model/message.h b/src/sequence_diagram/model/message.h index 48c6ca0a..c25c0f2d 100644 --- a/src/sequence_diagram/model/message.h +++ b/src/sequence_diagram/model/message.h @@ -47,6 +47,9 @@ public: void set_return_type(std::string t); const std::string &return_type() const; + void set_message_scope(common::model::message_scope_t scope); + common::model::message_scope_t message_scope() const; + private: common::model::message_t type_{common::model::message_t::kNone}; @@ -54,6 +57,9 @@ private: common::model::diagram_element::id_t to_{}; + common::model::message_scope_t scope_{ + common::model::message_scope_t::kNormal}; + // This is only for better verbose messages, we cannot rely on this // always std::string message_name_{}; diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 79f7eaf0..68f92860 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -732,6 +732,7 @@ bool translation_unit_visitor::TraverseCXXForRangeStmt( bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) { + using clanguml::common::model::message_scope_t; using clanguml::common::model::message_t; using clanguml::common::model::namespace_; using clanguml::sequence_diagram::model::activity; @@ -774,6 +775,20 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) } } + if (context().current_ifstmt()) { + if (common::is_subexpr_of( + context().current_ifstmt()->getCond(), expr)) { + m.set_message_scope(common::model::message_scope_t::kCondition); + } + } + + if (context().current_elseifstmt()) { + if (common::is_subexpr_of( + context().current_elseifstmt()->getCond(), expr)) { + m.set_message_scope(common::model::message_scope_t::kCondition); + } + } + if (const auto *operator_call_expr = clang::dyn_cast_or_null(expr); operator_call_expr != nullptr) { diff --git a/tests/t20020/t20020.cc b/tests/t20020/t20020.cc index 498ded67..7ed55e85 100644 --- a/tests/t20020/t20020.cc +++ b/tests/t20020/t20020.cc @@ -7,6 +7,7 @@ struct A { int a1() { return 0; } int a2() { return 1; } int a3() { return 2; } + int a4() { return 3; } }; struct B { @@ -26,6 +27,8 @@ struct C { } bool c2() const { return true; } + + int c3(int x) { return x * 2; } }; template struct D { @@ -46,13 +49,15 @@ int tmain() result = a.a1(); } else if (reinterpret_cast(&a) % 64 == 0ULL) { - if (a.a2() > 2) + if (c.c3(a.a2()) > 2) result = b.b1(); - else + else if (a.a3() % 2) result = b.b2(); + else + result = 0; } else { - result = a.a3(); + result = a.a4(); } b.log(); diff --git a/tests/t20020/test_case.h b/tests/t20020/test_case.h index 8bcb57d4..3fd1aaec 100644 --- a/tests/t20020/test_case.h +++ b/tests/t20020/test_case.h @@ -36,14 +36,19 @@ TEST_CASE("t20020", "[test-case][sequence]") // Check if all calls exist REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a1()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a3()")); + REQUIRE_THAT( + puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); + REQUIRE_THAT( + puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a3()")); REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b1()")); REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b2()")); REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "log()")); REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("C"), "c1()")); + REQUIRE_THAT(puml, HasCallInControlCondition(_A("C"), _A("C"), "c2()")); + REQUIRE_THAT( + puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c3(int)")); save_puml( "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); diff --git a/tests/test_cases.h b/tests/test_cases.h index 1bfe9dd8..5930191c 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -132,8 +132,10 @@ public: , m_message{message} { util::replace_all(m_message, "(", "\\("); - util::replace_all(m_message, "*", "\\*"); util::replace_all(m_message, ")", "\\)"); + util::replace_all(m_message, "*", "\\*"); + util::replace_all(m_message, "[", "\\["); + util::replace_all(m_message, "]", "\\]"); } bool match(T const &in) const override @@ -169,6 +171,13 @@ auto HasCall(std::string const &from, std::string const &to, return HasCallMatcher(from, to, message); } +auto HasCallInControlCondition(std::string const &from, std::string const &to, + std::string const &message, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return HasCallMatcher(from, to, fmt::format("**[**{}**]**", message)); +} + auto HasCall(std::string const &from, std::string const &message, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { From 91a9aa861d18bba0cbaeed4b7cad9cba681c2c34 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Mon, 12 Dec 2022 22:55:24 +0100 Subject: [PATCH 02/19] Added highlight of calls within condition statements in loops --- .../visitor/call_expression_context.cc | 115 ++++++++++++++++++ .../visitor/call_expression_context.h | 66 ++-------- .../visitor/translation_unit_visitor.cc | 17 +-- tests/t20021/t20021.cc | 23 +++- tests/t20021/test_case.h | 17 ++- 5 files changed, 168 insertions(+), 70 deletions(-) diff --git a/src/sequence_diagram/visitor/call_expression_context.cc b/src/sequence_diagram/visitor/call_expression_context.cc index cd75d268..14699a1f 100644 --- a/src/sequence_diagram/visitor/call_expression_context.cc +++ b/src/sequence_diagram/visitor/call_expression_context.cc @@ -186,4 +186,119 @@ void call_expression_context::leave_lambda_expression() current_lambda_caller_id_.pop(); } +clang::IfStmt *call_expression_context::current_ifstmt() const +{ + if (if_stmt_stack_.empty()) + return nullptr; + + return if_stmt_stack_.top(); +} + +void call_expression_context::enter_ifstmt(clang::IfStmt *stmt) +{ + return if_stmt_stack_.push(stmt); +} + +void call_expression_context::leave_ifstmt() +{ + if (!if_stmt_stack_.empty()) { + if_stmt_stack_.pop(); + std::stack{}.swap(elseif_stmt_stack_); + } +} + +void call_expression_context::enter_elseifstmt(clang::IfStmt *stmt) +{ + return elseif_stmt_stack_.push(stmt); +} + +void call_expression_context::leave_elseifstmt() +{ + if (elseif_stmt_stack_.empty()) + return elseif_stmt_stack_.pop(); +} + +clang::IfStmt *call_expression_context::current_elseifstmt() const +{ + if (elseif_stmt_stack_.empty()) + return nullptr; + + return elseif_stmt_stack_.top(); +} + +clang::Stmt *call_expression_context::current_loopstmt() const +{ + if (loop_stmt_stack_.empty()) + return nullptr; + + return loop_stmt_stack_.top(); +} + +void call_expression_context::enter_loopstmt(clang::Stmt *stmt) +{ + return loop_stmt_stack_.push(stmt); +} + +void call_expression_context::leave_loopstmt() +{ + if (loop_stmt_stack_.empty()) + return loop_stmt_stack_.pop(); +} + +bool call_expression_context::is_expr_in_current_control_statement_condition( + const clang::Stmt *stmt) const +{ + if (current_ifstmt()) { + if (common::is_subexpr_of(current_ifstmt()->getCond(), stmt)) { + return true; + } + } + + if (current_elseifstmt()) { + if (common::is_subexpr_of(current_elseifstmt()->getCond(), stmt)) { + return true; + } + } + + if (const auto *loop_stmt = current_loopstmt(); loop_stmt != nullptr) { + if (const auto *for_stmt = clang::dyn_cast(loop_stmt); + for_stmt != nullptr) { + if (common::is_subexpr_of(for_stmt->getCond(), stmt)) { + return true; + } + if (common::is_subexpr_of(for_stmt->getInit(), stmt)) { + return true; + } + if (common::is_subexpr_of(for_stmt->getInc(), stmt)) { + return true; + } + } + + if (const auto *range_for_stmt = + clang::dyn_cast(loop_stmt); + range_for_stmt != nullptr) { + if (common::is_subexpr_of(range_for_stmt->getRangeInit(), stmt)) { + return true; + } + } + + if (const auto *while_stmt = + clang::dyn_cast(loop_stmt); + while_stmt != nullptr) { + if (common::is_subexpr_of(while_stmt->getCond(), stmt)) { + return true; + } + } + + if (const auto *do_stmt = clang::dyn_cast(loop_stmt); + do_stmt != nullptr) { + if (common::is_subexpr_of(do_stmt->getCond(), stmt)) { + return true; + } + } + } + + return false; +} + } \ No newline at end of file diff --git a/src/sequence_diagram/visitor/call_expression_context.h b/src/sequence_diagram/visitor/call_expression_context.h index cab68e9d..7e4e54b9 100644 --- a/src/sequence_diagram/visitor/call_expression_context.h +++ b/src/sequence_diagram/visitor/call_expression_context.h @@ -16,11 +16,8 @@ * limitations under the License. */ #pragma once -// -//#include "common/visitor/translation_unit_visitor.h" -//#include "config/config.h" -//#include "sequence_diagram/model/diagram.h" +#include "common/clang_utils.h" #include "util/util.h" #include @@ -70,61 +67,22 @@ struct call_expression_context { void leave_lambda_expression(); - clang::IfStmt *current_ifstmt() const - { - if (if_stmt_stack_.empty()) - return nullptr; + clang::IfStmt *current_ifstmt() const; - return if_stmt_stack_.top(); - } + void enter_ifstmt(clang::IfStmt *stmt); + void leave_ifstmt(); - void enter_ifstmt(clang::IfStmt *stmt) { return if_stmt_stack_.push(stmt); } + void enter_elseifstmt(clang::IfStmt *stmt); + void leave_elseifstmt(); - void leave_ifstmt() - { - if (!if_stmt_stack_.empty()) { - if_stmt_stack_.pop(); - std::stack{}.swap(elseif_stmt_stack_); - } - } + clang::IfStmt *current_elseifstmt() const; + clang::Stmt *current_loopstmt() const; - void enter_elseifstmt(clang::IfStmt *stmt) - { - return elseif_stmt_stack_.push(stmt); - } + void enter_loopstmt(clang::Stmt *stmt); + void leave_loopstmt(); - void leave_elseifstmt() - { - if (elseif_stmt_stack_.empty()) - return elseif_stmt_stack_.pop(); - } - - clang::IfStmt *current_elseifstmt() const - { - if (elseif_stmt_stack_.empty()) - return nullptr; - - return elseif_stmt_stack_.top(); - } - - clang::Stmt *current_loopstmt() const - { - if (loop_stmt_stack_.empty()) - return nullptr; - - return loop_stmt_stack_.top(); - } - - void enter_loopstmt(clang::Stmt *stmt) - { - return loop_stmt_stack_.push(stmt); - } - - void leave_loopstmt() - { - if (loop_stmt_stack_.empty()) - return loop_stmt_stack_.pop(); - } + bool is_expr_in_current_control_statement_condition( + const clang::Stmt *stmt) const; clang::CXXRecordDecl *current_class_decl_; clang::ClassTemplateDecl *current_class_template_decl_; diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 68f92860..061046cb 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -775,20 +775,13 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) } } - if (context().current_ifstmt()) { - if (common::is_subexpr_of( - context().current_ifstmt()->getCond(), expr)) { - m.set_message_scope(common::model::message_scope_t::kCondition); - } - } - - if (context().current_elseifstmt()) { - if (common::is_subexpr_of( - context().current_elseifstmt()->getCond(), expr)) { - m.set_message_scope(common::model::message_scope_t::kCondition); - } + if (context().is_expr_in_current_control_statement_condition(expr)) { + m.set_message_scope(common::model::message_scope_t::kCondition); } + // + // Call to an overloaded operator + // if (const auto *operator_call_expr = clang::dyn_cast_or_null(expr); operator_call_expr != nullptr) { diff --git a/tests/t20021/t20021.cc b/tests/t20021/t20021.cc index 5fe5e19f..4f3210ef 100644 --- a/tests/t20021/t20021.cc +++ b/tests/t20021/t20021.cc @@ -15,18 +15,31 @@ struct B { int b2() const { return 4; } }; +struct C { + int c1() { return 1; } + int c2() { return 2; } + int c3() { return 3; } + int c4() { return c5(); } + int c5() { return 5; } + + std::vector &contents() { return contents_; } + + std::vector contents_; +}; + int tmain() { A a; std::vector b; + C c; int i = 10; - while (i--) { + while (i -= c.c4()) { int j = a.a3(); do { - for (int l = a.a2(); l > 0; l--) + for (int l = a.a2(); l > c.c1(); l -= c.c2()) a.a1(); - } while (j--); + } while (j -= c.c3()); } int result = 0; @@ -34,6 +47,10 @@ int tmain() result += bi.b2(); } + for (const auto &ci : c.contents()) { + result += ci; + } + return b.front().b2() + result; } } diff --git a/tests/t20021/test_case.h b/tests/t20021/test_case.h index 5868931e..f6e57132 100644 --- a/tests/t20021/test_case.h +++ b/tests/t20021/test_case.h @@ -36,12 +36,27 @@ TEST_CASE("t20021", "[test-case][sequence]") // Check if all calls exist REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a1()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a2()")); + REQUIRE_THAT( + puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a3()")); REQUIRE_THAT(puml, !HasCall(_A("tmain()"), _A("B"), "b1()")); REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b2()")); + REQUIRE_THAT( + puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c1()")); + REQUIRE_THAT( + puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c2()")); + + // TODO: Why is this not working? + // REQUIRE_THAT( + // puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c3()")); + REQUIRE_THAT( + puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c4()")); + REQUIRE_THAT(puml, HasCall(_A("C"), _A("C"), "c5()")); + REQUIRE_THAT( + puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "contents()")); + save_puml( "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); } \ No newline at end of file From 3020ffd69fcb05f15ecd95ec7a873d79f459467e Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 13 Dec 2022 00:29:52 +0100 Subject: [PATCH 03/19] Added support for try/catch statements in sequence diagrams --- src/common/model/enums.cc | 6 +++ src/common/model/enums.h | 3 ++ .../plantuml/sequence_diagram_generator.cc | 9 ++++ src/sequence_diagram/model/diagram.cc | 54 +++++++++++++++++-- src/sequence_diagram/model/diagram.h | 7 +++ .../visitor/call_expression_context.cc | 27 ++++++++-- .../visitor/call_expression_context.h | 8 ++- .../visitor/translation_unit_visitor.cc | 47 ++++++++++++++++ .../visitor/translation_unit_visitor.h | 4 ++ tests/t20023/.clang-uml | 14 +++++ tests/t20023/t20023.cc | 40 ++++++++++++++ tests/t20023/test_case.h | 46 ++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 ++ 14 files changed, 260 insertions(+), 9 deletions(-) create mode 100644 tests/t20023/.clang-uml create mode 100644 tests/t20023/t20023.cc create mode 100644 tests/t20023/test_case.h diff --git a/src/common/model/enums.cc b/src/common/model/enums.cc index ea40af08..9aaf3b33 100644 --- a/src/common/model/enums.cc +++ b/src/common/model/enums.cc @@ -94,6 +94,12 @@ std::string to_string(message_t r) return "for"; case message_t::kForEnd: return "end for"; + case message_t::kTry: + return "try"; + case message_t::kCatch: + return "catch"; + case message_t::kTryEnd: + return "end try"; default: assert(false); return ""; diff --git a/src/common/model/enums.h b/src/common/model/enums.h index 6ef22218..66c93249 100644 --- a/src/common/model/enums.h +++ b/src/common/model/enums.h @@ -53,6 +53,9 @@ enum class message_t { kDoEnd, kFor, kForEnd, + kTry, + kCatch, + kTryEnd, kNone }; diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc index c2ebe161..c72d99ae 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -190,6 +190,15 @@ void generator::generate_activity(const activity &a, std::ostream &ostr, else if (m.type() == message_t::kDoEnd) { ostr << "end\n"; } + else if (m.type() == message_t::kTry) { + ostr << "group try\n"; + } + else if (m.type() == message_t::kCatch) { + ostr << "else " << m.message_name() << '\n'; + } + else if (m.type() == message_t::kTryEnd) { + ostr << "end\n"; + } } } diff --git a/src/sequence_diagram/model/diagram.cc b/src/sequence_diagram/model/diagram.cc index 99091e9d..e9a4bdf1 100644 --- a/src/sequence_diagram/model/diagram.cc +++ b/src/sequence_diagram/model/diagram.cc @@ -224,6 +224,55 @@ void diagram::end_if_stmt( } } +void diagram::add_try_stmt( + const common::model::diagram_element::id_t current_caller_id) +{ + using clanguml::common::model::message_t; + + if (sequences_.find(current_caller_id) == sequences_.end()) { + activity a{current_caller_id}; + sequences_.insert({current_caller_id, std::move(a)}); + } + + get_activity(current_caller_id) + .add_message({message_t::kTry, current_caller_id}); +} + +void diagram::end_try_stmt( + const common::model::diagram_element::id_t current_caller_id) +{ + using clanguml::common::model::message_t; + + message m{message_t::kTryEnd, current_caller_id}; + + if (sequences_.find(current_caller_id) != sequences_.end()) { + auto ¤t_messages = get_activity(current_caller_id).messages(); + + if (current_messages.back().type() == message_t::kTry) { + current_messages.pop_back(); + } + else { + current_messages.emplace_back(std::move(m)); + } + } +} + +void diagram::add_catch_stmt( + const int64_t current_caller_id, std::string caught_type) +{ + using clanguml::common::model::message_t; + + if (sequences_.find(current_caller_id) == sequences_.end()) { + activity a{current_caller_id}; + sequences_.insert({current_caller_id, std::move(a)}); + } + + message m{message_t::kCatch, current_caller_id}; + m.set_message_name(std::move(caught_type)); + + get_activity(current_caller_id).add_message(std::move(m)); +} + bool diagram::started() const { return started_; } void diagram::started(bool s) { started_ = s; } @@ -255,13 +304,13 @@ diagram::participants() const std::set &diagram::active_participants() { return active_participants_; -}; +} const std::set & diagram::active_participants() const { return active_participants_; -}; +} void diagram::print() const { @@ -305,7 +354,6 @@ void diagram::print() const } } } - } namespace clanguml::common::model { diff --git a/src/sequence_diagram/model/diagram.h b/src/sequence_diagram/model/diagram.h index 2b530f49..b51b1128 100644 --- a/src/sequence_diagram/model/diagram.h +++ b/src/sequence_diagram/model/diagram.h @@ -85,6 +85,9 @@ public: void end_if_stmt(common::model::diagram_element::id_t current_caller_id, common::model::message_t type); + void add_try_stmt(common::model::diagram_element::id_t current_caller_id); + void end_try_stmt(common::model::diagram_element::id_t current_caller_id); + void add_loop_stmt(common::model::diagram_element::id_t current_caller_id, common::model::message_t type); void end_loop_stmt(common::model::diagram_element::id_t current_caller_id, @@ -119,6 +122,10 @@ public: const std::set & active_participants() const; + void add_catch_stmt( + const common::model::diagram_element::id_t current_caller_id, + std::string caught_type); + private: bool started_{false}; diff --git a/src/sequence_diagram/visitor/call_expression_context.cc b/src/sequence_diagram/visitor/call_expression_context.cc index 14699a1f..97611c38 100644 --- a/src/sequence_diagram/visitor/call_expression_context.cc +++ b/src/sequence_diagram/visitor/call_expression_context.cc @@ -196,7 +196,7 @@ clang::IfStmt *call_expression_context::current_ifstmt() const void call_expression_context::enter_ifstmt(clang::IfStmt *stmt) { - return if_stmt_stack_.push(stmt); + if_stmt_stack_.push(stmt); } void call_expression_context::leave_ifstmt() @@ -209,13 +209,13 @@ void call_expression_context::leave_ifstmt() void call_expression_context::enter_elseifstmt(clang::IfStmt *stmt) { - return elseif_stmt_stack_.push(stmt); + elseif_stmt_stack_.push(stmt); } void call_expression_context::leave_elseifstmt() { if (elseif_stmt_stack_.empty()) - return elseif_stmt_stack_.pop(); + elseif_stmt_stack_.pop(); } clang::IfStmt *call_expression_context::current_elseifstmt() const @@ -236,7 +236,7 @@ clang::Stmt *call_expression_context::current_loopstmt() const void call_expression_context::enter_loopstmt(clang::Stmt *stmt) { - return loop_stmt_stack_.push(stmt); + loop_stmt_stack_.push(stmt); } void call_expression_context::leave_loopstmt() @@ -245,6 +245,25 @@ void call_expression_context::leave_loopstmt() return loop_stmt_stack_.pop(); } +clang::Stmt *call_expression_context::current_trystmt() const +{ + if (try_stmt_stack_.empty()) + return nullptr; + + return try_stmt_stack_.top(); +} + +void call_expression_context::enter_trystmt(clang::Stmt *stmt) +{ + try_stmt_stack_.push(stmt); +} + +void call_expression_context::leave_trystmt() +{ + if (try_stmt_stack_.empty()) + try_stmt_stack_.pop(); +} + bool call_expression_context::is_expr_in_current_control_statement_condition( const clang::Stmt *stmt) const { diff --git a/src/sequence_diagram/visitor/call_expression_context.h b/src/sequence_diagram/visitor/call_expression_context.h index 7e4e54b9..891bcc7d 100644 --- a/src/sequence_diagram/visitor/call_expression_context.h +++ b/src/sequence_diagram/visitor/call_expression_context.h @@ -74,13 +74,16 @@ struct call_expression_context { void enter_elseifstmt(clang::IfStmt *stmt); void leave_elseifstmt(); - clang::IfStmt *current_elseifstmt() const; - clang::Stmt *current_loopstmt() const; + clang::Stmt *current_loopstmt() const; void enter_loopstmt(clang::Stmt *stmt); void leave_loopstmt(); + clang::Stmt *current_trystmt() const; + void enter_trystmt(clang::Stmt *stmt); + void leave_trystmt(); + bool is_expr_in_current_control_statement_condition( const clang::Stmt *stmt) const; @@ -101,6 +104,7 @@ private: std::stack elseif_stmt_stack_; std::stack loop_stmt_stack_; + std::stack try_stmt_stack_; }; } \ No newline at end of file diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 061046cb..31fab119 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -705,6 +705,53 @@ bool translation_unit_visitor::TraverseForStmt(clang::ForStmt *stmt) return true; } +bool translation_unit_visitor::TraverseCXXTryStmt(clang::CXXTryStmt *stmt) +{ + using clanguml::common::model::message_t; + using clanguml::sequence_diagram::model::activity; + using clanguml::sequence_diagram::model::message; + + const auto current_caller_id = context().caller_id(); + + if (current_caller_id) { + context().enter_trystmt(stmt); + diagram().add_try_stmt(current_caller_id); + } + + RecursiveASTVisitor::TraverseCXXTryStmt(stmt); + + if (current_caller_id) { + context().leave_trystmt(); + diagram().end_try_stmt(current_caller_id); + } + + return true; +} + +bool translation_unit_visitor::TraverseCXXCatchStmt(clang::CXXCatchStmt *stmt) +{ + using clanguml::common::model::message_t; + using clanguml::sequence_diagram::model::activity; + using clanguml::sequence_diagram::model::message; + + const auto current_caller_id = context().caller_id(); + + if (current_caller_id && context().current_trystmt()) { + std::string caught_type; + if (stmt->getCaughtType().isNull()) + caught_type = "..."; + else + caught_type = common::to_string( + stmt->getCaughtType(), *context().get_ast_context()); + + diagram().add_catch_stmt(current_caller_id, std::move(caught_type)); + } + + RecursiveASTVisitor::TraverseCXXCatchStmt(stmt); + + return true; +} + bool translation_unit_visitor::TraverseCXXForRangeStmt( clang::CXXForRangeStmt *stmt) { diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index 83eb4dbc..8dcbbfa2 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -76,6 +76,10 @@ public: bool TraverseCXXForRangeStmt(clang::CXXForRangeStmt *stmt); + bool TraverseCXXTryStmt(clang::CXXTryStmt *stmt); + + bool TraverseCXXCatchStmt(clang::CXXCatchStmt *stmt); + clanguml::sequence_diagram::model::diagram &diagram(); const clanguml::sequence_diagram::model::diagram &diagram() const; diff --git a/tests/t20023/.clang-uml b/tests/t20023/.clang-uml new file mode 100644 index 00000000..086afe9d --- /dev/null +++ b/tests/t20023/.clang-uml @@ -0,0 +1,14 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t20023_sequence: + type: sequence + glob: + - ../../tests/t20023/t20023.cc + include: + namespaces: + - clanguml::t20023 + using_namespace: + - clanguml::t20023 + start_from: + - function: "clanguml::t20023::tmain()" \ No newline at end of file diff --git a/tests/t20023/t20023.cc b/tests/t20023/t20023.cc new file mode 100644 index 00000000..ff0f8f73 --- /dev/null +++ b/tests/t20023/t20023.cc @@ -0,0 +1,40 @@ +#include + +namespace clanguml { +namespace t20023 { + +struct A { + int a1() { return 1; } + int a2() { return 2; } + int a3() { return 3; } + int a4() { return 3; } + + int a() + { + try { + return a1(); + } + catch (std::runtime_error &) { + return a2(); + } + catch (std::logic_error &) { + return a3(); + } + catch (...) { + return a4(); + } + } +}; + +int tmain() +{ + A a; + + int result{}; + + result = a.a(); + + return result; +} +} +} \ No newline at end of file diff --git a/tests/t20023/test_case.h b/tests/t20023/test_case.h new file mode 100644 index 00000000..b381887b --- /dev/null +++ b/tests/t20023/test_case.h @@ -0,0 +1,46 @@ +/** + * tests/t20023/test_case.h + * + * Copyright (c) 2021-2022 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("t20023", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20023"); + + auto diagram = config.diagrams["t20023_sequence"]; + + REQUIRE(diagram->name == "t20023_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20023_sequence"); + + auto puml = generate_sequence_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a1()")); + REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a2()")); + REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a3()")); + REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a4()")); + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 3a9b7b6a..20a8fa44 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -269,6 +269,7 @@ using namespace clanguml::test::matchers; #include "t20020/test_case.h" #include "t20021/test_case.h" #include "t20022/test_case.h" +#include "t20023/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 37fd33cb..1c670f81 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -214,6 +214,9 @@ test_cases: - name: t20022 title: Forward class declaration sequence diagram test case description: + - name: t20023 + title: Try/catch statement sequence diagram test case + description: Package diagrams: - name: t30001 title: Basic package diagram test case From 2d72d982340e87faf029d7ab75afe1f042c0a0ea Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 13 Dec 2022 00:34:23 +0100 Subject: [PATCH 04/19] Updated test case documentation --- docs/test_cases.md | 1 + docs/test_cases/t00002_class.svg | 36 ++-- docs/test_cases/t00003_class.svg | 46 ++--- docs/test_cases/t00004_class.svg | 76 ++++---- docs/test_cases/t00005_class.svg | 110 +++++------ docs/test_cases/t00006_class.svg | 132 ++++++------- docs/test_cases/t00007_class.svg | 30 +-- docs/test_cases/t00008_class.svg | 56 +++--- docs/test_cases/t00009_class.svg | 32 ++-- docs/test_cases/t00010_class.svg | 34 ++-- docs/test_cases/t00011_class.svg | 22 +-- docs/test_cases/t00012_class.svg | 66 +++---- docs/test_cases/t00013_class.svg | 82 ++++---- docs/test_cases/t00014_class.svg | 116 ++++++------ docs/test_cases/t00015_class.svg | 22 +-- docs/test_cases/t00016_class.svg | 30 +-- docs/test_cases/t00017_class.svg | 66 +++---- docs/test_cases/t00018_class.svg | 18 +- docs/test_cases/t00019_class.svg | 40 ++-- docs/test_cases/t00020_class.svg | 38 ++-- docs/test_cases/t00021_class.svg | 30 +-- docs/test_cases/t00022_class.svg | 14 +- docs/test_cases/t00023_class.svg | 26 +-- docs/test_cases/t00024_class.svg | 22 +-- docs/test_cases/t00025_class.svg | 34 ++-- docs/test_cases/t00026_class.svg | 42 ++--- docs/test_cases/t00027_class.svg | 58 +++--- docs/test_cases/t00028_class.svg | 78 ++++---- docs/test_cases/t00029_class.svg | 50 ++--- docs/test_cases/t00030_class.svg | 46 ++--- docs/test_cases/t00031_class.svg | 50 ++--- docs/test_cases/t00032_class.svg | 40 ++-- docs/test_cases/t00033_class.svg | 48 ++--- docs/test_cases/t00034_class.svg | 46 ++--- docs/test_cases/t00035_class.svg | 22 +-- docs/test_cases/t00036_class.svg | 38 ++-- docs/test_cases/t00037_class.svg | 54 +++--- docs/test_cases/t00038_class.svg | 58 +++--- docs/test_cases/t00039_class.svg | 78 ++++---- docs/test_cases/t00040_class.svg | 26 +-- docs/test_cases/t00041_class.svg | 54 +++--- docs/test_cases/t00042_class.svg | 36 ++-- docs/test_cases/t00043_class.svg | 50 ++--- docs/test_cases/t00044_class.svg | 36 ++-- docs/test_cases/t00045_class.svg | 70 +++---- docs/test_cases/t00046_class.svg | 64 +++---- docs/test_cases/t00047_class.svg | 22 +-- docs/test_cases/t00048_class.svg | 50 ++--- docs/test_cases/t00049_class.svg | 32 ++-- docs/test_cases/t00050_class.svg | 70 +++---- docs/test_cases/t20001_sequence.svg | 62 +++--- docs/test_cases/t20002_sequence.svg | 48 ++--- docs/test_cases/t20003_sequence.svg | 48 ++--- docs/test_cases/t20004_sequence.svg | 120 ++++++------ docs/test_cases/t20005_sequence.svg | 36 ++-- docs/test_cases/t20006_sequence.svg | 150 +++++++-------- docs/test_cases/t20007_sequence.svg | 48 ++--- docs/test_cases/t20008_sequence.svg | 84 ++++----- docs/test_cases/t20009_sequence.svg | 84 ++++----- docs/test_cases/t20010_sequence.svg | 72 +++---- docs/test_cases/t20011_sequence.svg | 72 +++---- docs/test_cases/t20012_sequence.svg | 204 ++++++++++---------- docs/test_cases/t20013_sequence.svg | 60 +++--- docs/test_cases/t20014_sequence.svg | 72 +++---- docs/test_cases/t20015_sequence.svg | 24 +-- docs/test_cases/t20016_sequence.svg | 48 ++--- docs/test_cases/t20017_sequence.svg | 48 ++--- docs/test_cases/t20018_sequence.svg | 96 +++++----- docs/test_cases/t20019_sequence.svg | 84 ++++----- docs/test_cases/t20020.md | 11 +- docs/test_cases/t20020_sequence.svg | 282 +++++++++++++++------------- docs/test_cases/t20021.md | 23 ++- docs/test_cases/t20021_sequence.svg | 229 ++++++++++++++-------- docs/test_cases/t20022_sequence.svg | 36 ++-- docs/test_cases/t20023.md | 64 +++++++ docs/test_cases/t20023_sequence.svg | 103 ++++++++++ docs/test_cases/t30001_package.svg | 48 ++--- docs/test_cases/t30002_package.svg | 90 ++++----- docs/test_cases/t30003_package.svg | 26 +-- docs/test_cases/t30004_package.svg | 30 +-- docs/test_cases/t30005_package.svg | 38 ++-- docs/test_cases/t30006_package.svg | 16 +- docs/test_cases/t30007_package.svg | 20 +- docs/test_cases/t30008_package.svg | 34 ++-- docs/test_cases/t40001_include.svg | 30 +-- docs/test_cases/t40002_include.svg | 34 ++-- docs/test_cases/t40003_include.svg | 50 ++--- 87 files changed, 2658 insertions(+), 2363 deletions(-) create mode 100644 docs/test_cases/t20023.md create mode 100644 docs/test_cases/t20023_sequence.svg diff --git a/docs/test_cases.md b/docs/test_cases.md index cc9f1167..5a79d5a5 100644 --- a/docs/test_cases.md +++ b/docs/test_cases.md @@ -72,6 +72,7 @@ * [t20020](./test_cases/t20020.md) - If statement sequence diagram test case * [t20021](./test_cases/t20021.md) - Loop statements sequence diagram test case * [t20022](./test_cases/t20022.md) - Forward class declaration sequence diagram test case + * [t20023](./test_cases/t20023.md) - Try/catch statement sequence diagram test case ## 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_class.svg b/docs/test_cases/t00002_class.svg index 9c2ce178..613be62f 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ foo_c() = 0 : void - - + + B @@ -31,8 +31,8 @@ foo_a() : void - - + + C @@ -41,18 +41,18 @@ foo_c() : void - - + + D - + - + as : std::vector<A *> @@ -60,18 +60,18 @@ foo_a() : void foo_c() : void - - + + E - + - + as : std::vector<A *> @@ -79,13 +79,13 @@ foo_a() : void foo_c() : void - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index ab9f861a..acc33b13 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - + + A - + - + public_member : int - + - + protected_member : int - + - + private_member : int - + - + a_ : int - + - + b_ : int - + - + c_ : int - + - + static_int : int - + - + static_const_int : const int - + - + auto_member : const unsigned long @@ -112,11 +112,11 @@ protected_method() : void private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index 3402db3a..fa9ffe9c 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + B::AA @@ -28,8 +28,8 @@ AA_3 - - + + A @@ -40,16 +40,16 @@ foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -59,15 +59,15 @@ Red - - + + A::AA::AAA - + C::B @@ -75,8 +75,8 @@ int - - + + C @@ -84,39 +84,39 @@ T - + - + t : T - + - + b_int : B<int> - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -125,8 +125,8 @@ CCC_2 - - + + C::B @@ -134,16 +134,16 @@ V - + - + b : V - - + + C::CC @@ -152,16 +152,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -171,8 +171,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index 90580ecc..f12defe8 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,204 +9,204 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & - + - + a : A - + - + b : B * - + - + c : C & - + - + d : const D * - + - + e : const E & - + - + f : F && - + - + g : G ** - + - + h : H *** - + - + i : I *& - + - + j : volatile J * - + - + k : K * diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index 34d305dd..7bedd26b 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,102 +162,102 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B *> - + - + c : std::map<int,C> - + - + d : std::map<int,D *> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G *>> - + - + h : std::array<H,10> - + - + i : std::array<I *,5> - + - + j : J[10] - + - + k : K *[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 2e8e3413..ea8f76ff 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index 127c6642..a97bcccf 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P,CMP,int N - + - + value : T - + - + pointer : T * - + - + reference : T & - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,16 +70,16 @@ T - + - + values : std::vector<T> - - + + B @@ -87,15 +87,15 @@ T,C<> - + - + template_template : C<T> - + B @@ -103,18 +103,18 @@ int,Vector - - + + D - + - + ints : B<int,Vector> diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 97c3cf94..8b881652 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,32 +50,32 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 56fe165f..126b25af 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,18 +66,18 @@ int - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 9e510a1d..81a94d72 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,16 +18,16 @@ T - + - + value : T - - + + A @@ -36,18 +36,18 @@ foo() : void - - + + B - + - + m_a : A * diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index fa0424c4..e5ef6390 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T,Ts... - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,50 +107,50 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index b36f70ac..c374df2b 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,15 +18,15 @@ T - + - + f : T - + ABCD::F @@ -34,70 +34,70 @@ int - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int print(R * r) : void - - + + E @@ -105,16 +105,16 @@ T - + - + e : T - - + + G @@ -122,22 +122,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -145,7 +145,7 @@ int - + G @@ -153,7 +153,7 @@ int,float,std::string - + E @@ -161,25 +161,25 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index 53800b54..8e2a78fa 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,U - + A @@ -96,7 +96,7 @@ long,bool - + A @@ -104,7 +104,7 @@ double,bool - + A @@ -112,7 +112,7 @@ long,float - + A @@ -120,7 +120,7 @@ double,float - + A @@ -128,7 +128,7 @@ bool,std::string - + A @@ -136,7 +136,7 @@ float,std::unique_ptr<std::string> - + A @@ -144,7 +144,7 @@ int,std::string - + A @@ -152,7 +152,7 @@ std::string,std::string - + A @@ -160,7 +160,7 @@ char,std::string - + A @@ -168,116 +168,116 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index d16e1ce3..67fe8166 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index fdaeb1cd..9a7cb7e9 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -29,8 +29,8 @@ value : enum - - + + is_numeric @@ -41,8 +41,8 @@ value : enum - - + + is_numeric @@ -53,8 +53,8 @@ value : enum - - + + is_numeric @@ -65,8 +65,8 @@ value : enum - - + + is_numeric @@ -77,8 +77,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index a0a92932..80c75b24 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,127 +9,127 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index a0ebe9bc..80533a0e 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,18 +9,18 @@ - - + + impl::widget - + - + n : int @@ -30,18 +30,18 @@ draw(const widget & w) : void widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 928330d1..64906e43 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Base @@ -25,8 +25,8 @@ m2() : std::string - - + + Layer1 @@ -39,8 +39,8 @@ m2() : std::string - - + + Layer2 @@ -51,8 +51,8 @@ all_calls_count() const : int - - + + Layer3 @@ -60,18 +60,18 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int @@ -83,7 +83,7 @@ m1_calls() const : int m2_calls() const : int - + Layer3 @@ -91,7 +91,7 @@ Base - + Layer2 @@ -99,7 +99,7 @@ Layer3<Base> - + Layer1 @@ -107,18 +107,18 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index 1807f957..284e36c0 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ProductA @@ -21,8 +21,8 @@ sell(int price) const = 0 : bool - - + + ProductA1 @@ -31,8 +31,8 @@ sell(int price) const : bool - - + + ProductA2 @@ -41,8 +41,8 @@ sell(int price) const : bool - - + + ProductB @@ -53,8 +53,8 @@ buy(int price) const = 0 : bool - - + + ProductB1 @@ -63,8 +63,8 @@ buy(int price) const : bool - - + + ProductB2 @@ -73,8 +73,8 @@ buy(int price) const : bool - - + + AbstractFactory @@ -85,8 +85,8 @@ make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 @@ -97,8 +97,8 @@ make_b() const : std::unique_ptr<ProductB> - - + + Factory2 diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 20ad9ec6..7950406b 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Visitor @@ -23,8 +23,8 @@ visit_B(const B & item) const = 0 : void - - + + Visitor1 @@ -35,8 +35,8 @@ visit_B(const B & item) const : void - - + + Visitor2 @@ -47,8 +47,8 @@ visit_B(const B & item) const : void - - + + Visitor3 @@ -59,8 +59,8 @@ visit_B(const B & item) const : void - - + + Item @@ -71,8 +71,8 @@ accept(const Visitor & visitor) const = 0 : void - - + + A @@ -81,8 +81,8 @@ accept(const Visitor & visitor) const : void - - + + B diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index cf9fe7d9..201f37a4 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -23,8 +23,8 @@ method2() = 0 : void - - + + A1 @@ -35,8 +35,8 @@ method2() : void - - + + A2 diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index e7a45e26..a1d10c5a 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Strategy @@ -21,8 +21,8 @@ algorithm() = 0 : void - - + + StrategyA @@ -31,8 +31,8 @@ algorithm() : void - - + + StrategyB @@ -41,8 +41,8 @@ algorithm() : void - - + + StrategyC @@ -51,18 +51,18 @@ algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index fb73378e..4c148da4 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target @@ -23,8 +23,8 @@ m2() = 0 : void - - + + Target1 @@ -35,8 +35,8 @@ m2() : void - - + + Target2 @@ -47,18 +47,18 @@ m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index d19e7f69..e6573d42 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target1 @@ -21,8 +21,8 @@ m2() : void - - + + Target2 @@ -33,8 +33,8 @@ m2() : void - - + + Proxy @@ -42,11 +42,11 @@ T - + - + m_target : std::shared_ptr<T> @@ -56,7 +56,7 @@ m1() : void m2() : void - + Proxy @@ -64,7 +64,7 @@ Target1 - + Proxy @@ -72,25 +72,25 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index 066745e3..61eb19a9 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,11 +18,11 @@ T - + - + m_value : T @@ -30,8 +30,8 @@ Memento<T>(T && v) : void value() const : T - - + + Originator @@ -39,11 +39,11 @@ T - + - + m_value : T @@ -57,8 +57,8 @@ print() const : void set(T && v) : void - - + + Caretaker @@ -66,11 +66,11 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> @@ -78,7 +78,7 @@ state(const std::string & n) : Memento<T> & set_state(const std::string & s, Memento<T> && m) : void - + Caretaker @@ -86,7 +86,7 @@ std::string - + Originator @@ -94,25 +94,25 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index 0fdb1f8c..1aa8b630 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Shape @@ -21,14 +21,14 @@ ~Shape() = default : void - + Line - - + + Line @@ -39,14 +39,14 @@ display() : void - + Text - - + + Text @@ -57,8 +57,8 @@ display() : void - - + + ShapeDecorator @@ -67,8 +67,8 @@ display() = 0 : void - - + + Color @@ -79,8 +79,8 @@ display() : void - - + + Weight @@ -91,7 +91,7 @@ display() : void - + Line @@ -99,7 +99,7 @@ Color,Weight - + Line @@ -107,7 +107,7 @@ Color - + Text @@ -115,7 +115,7 @@ Color,Weight - + Text @@ -123,39 +123,39 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index 208355dd..1a8b4dd3 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - + A class note. - - + + B - + B class note. - - + + C - + C class note. - - + + D - + D class note. - - + + E @@ -64,27 +64,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,10 +94,10 @@ three - + F enum note. - + E @@ -105,59 +105,59 @@ int - - + + R - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** R(C & c) : void - + R class note. diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index b2dbc496..d7666360 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,64 +45,64 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index 4b355df3..10b5566e 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,86 +9,86 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + - + eee : E * diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index f52e2137..db5f4b08 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,39 +71,39 @@ int - - + + R - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index 4e3e60b0..021c1663 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - + + Base - - + + TBase - - + + A @@ -35,8 +35,8 @@ operator()() : void - - + + B @@ -45,8 +45,8 @@ operator()() : void - - + + C @@ -55,8 +55,8 @@ operator()() : void - - + + Overload @@ -64,15 +64,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -80,18 +80,18 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index 9f91eeab..85451eea 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,18 +99,18 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index 8456b303..e5f39a01 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Void @@ -21,8 +21,8 @@ operator!=(const Void & ) const : bool - - + + lift_void @@ -31,16 +31,16 @@ - - + + lift_void - - + + lift_void @@ -49,8 +49,8 @@ - - + + drop_void @@ -59,16 +59,16 @@ - - + + drop_void - - + + drop_void @@ -77,33 +77,33 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 9aa89966..42a268da 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index 94611d59..3dc39512 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,23 +59,23 @@ int - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 15145200..ce064e03 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,98 +9,98 @@ - - + + ST - + - + dimensions : ST::(anonymous_620) - + - + units : ST::(anonymous_739) - - + + ST::(dimensions) - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + ST::(units) - + - + c : double - + - + h : double - - + + A - + - + st : ST diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index a3645f4e..d208669c 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,16 +88,16 @@ - - + + map - - + + map @@ -106,8 +106,8 @@ - - + + map @@ -116,8 +116,8 @@ - - + + map @@ -126,8 +126,8 @@ - - + + map diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index f7aaa5cc..6cbf8dbb 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B * - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T * - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M * - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M * - - + + ns3::FFF @@ -156,11 +156,11 @@ T,M,N - + - + n : N * diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index 49a51f25..cf994c58 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - + + A - + - + ii_ : int get_a() : int - - + + AA - - + + AAA - + - + b : B * get_aaa() : int - - + + R diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index 335ec522..80598cba 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,100 +9,100 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + e : E * - + - + f : F * - + - + g : detail::G * - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index cbdbcd54..038586b2 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + A @@ -35,16 +35,16 @@ void - + - + a : void * - - + + B @@ -52,22 +52,22 @@ T,K - + - + b : T - + - + bb : K - + A @@ -75,7 +75,7 @@ double - + A @@ -83,7 +83,7 @@ std::string - + B diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index 13141926..2065c0c8 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - + dependants - + dependencies - - + + A - - + + B @@ -33,8 +33,8 @@ b(dependants::A * a) : void - - + + BB @@ -43,8 +43,8 @@ bb(dependants::A * a) : void - - + + C @@ -53,8 +53,8 @@ c(dependants::B * b) : void - - + + D @@ -65,8 +65,8 @@ dd(dependants::BB * bb) : void - - + + E @@ -75,24 +75,24 @@ e(dependants::D * d) : void - - + + G - - + + GG - - + + H @@ -103,8 +103,8 @@ hh(dependencies::GG * gg) : void - - + + I @@ -113,8 +113,8 @@ i(dependencies::H * h) : void - - + + J diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index b6ba8e41..c25edcbc 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,7 +9,7 @@ - + signal_handler @@ -17,8 +17,8 @@ ,A - - + + sink @@ -27,15 +27,15 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + sink @@ -46,23 +46,23 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + signal_handler - - + + signal_handler @@ -71,8 +71,8 @@ - - + + signal_handler @@ -81,8 +81,8 @@ - - + + sink diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index 82f48d40..f7fd6dec 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - + + A - - + + AA - - + + AAA - - + + AAAA @@ -42,103 +42,103 @@ T - + - + t : T - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::AAA - - + + ns1::ns2::R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index c327b0fb..c24421c8 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - + ns1 - + ns2 - + __gnu_cxx - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - + - + i : std::vector<std::uint8_t> foo(AA & aa) : void - - + + A - - + + AA diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index 34a19237..d9c3a32f 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + conditional_t - - + + conditional_t @@ -27,8 +27,8 @@ - - + + conditional_t @@ -37,8 +37,8 @@ - - + + conditional_t @@ -47,8 +47,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index 48b3d53d..81bb6b39 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + Base - + - + base : int foo() = 0 : void - - + + BaseTemplate @@ -35,35 +35,35 @@ T - + - + base : T foo() = 0 : void - - + + B - + - + b : int foo() : void - - + + BTemplate @@ -71,35 +71,35 @@ T - + - + b : T foo() : void - - + + A - + - + a : int foo() : void - - + + ATemplate @@ -107,11 +107,11 @@ T - + - + a : T diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index 1467c05b..f2776219 100644 --- a/docs/test_cases/t00049_class.svg +++ b/docs/test_cases/t00049_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,17 +18,17 @@ T - + - + a : T get_a() : T & - + A @@ -36,7 +36,7 @@ intmap - + A @@ -44,7 +44,7 @@ thestring - + A @@ -52,32 +52,32 @@ std::vector<thestring> - - + + R - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> - + - + a_int_map : A<intmap> diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index 09c91c9a..a34fb8c1 100644 --- a/docs/test_cases/t00050_class.svg +++ b/docs/test_cases/t00050_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + utils::D - - + + E @@ -52,8 +52,8 @@ E3 - - + + F @@ -61,44 +61,44 @@ T,V,int N - + - + t : T[N] - + - + v : V - - + + G - - + + NoComment - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula class ultricies mollis dictumst, aenean non a in donec nulla. @@ -125,50 +125,50 @@ imperdiet praesent magnis ridiculus congue gravida curabitur dictum sagittis, enim et magna sit inceptos sodales parturient pharetra mollis, aenean vel nostra tellus commodo pretium sapien sociosqu. - + This is a short description of class G. - + This is an intermediate description of class G. - + This is a long description of class G. - + Lorem ipsum - + TODO 1. Write meaningful comment - + TODO 2. Write tests - + TODO 3. Implement - + Long comment example - + TODO Implement... - + Simple array wrapper. - + Template parameters diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index f28a6cf3..f8a8126e 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,59 +9,59 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - + + + + + + + + add(int,int) - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -72,7 +72,7 @@ - + @@ -81,14 +81,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index 3e43826b..c280397c 100644 --- a/docs/test_cases/t20002_sequence.svg +++ b/docs/test_cases/t20002_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1() - + m1() - - + + m2() - + m2() - - + + m3() - + m3() - - + + m4() - + m4() - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20003_sequence.svg b/docs/test_cases/t20003_sequence.svg index d0dbe2ec..3c2c1d34 100644 --- a/docs/test_cases/t20003_sequence.svg +++ b/docs/test_cases/t20003_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1<T>(T) - + m1<T>(T) - - + + m2<T>(T) - + m2<T>(T) - - + + m3<T>(T) - + m3<T>(T) - - + + m4<T>(T) - + m4<T>(T) - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20004_sequence.svg b/docs/test_cases/t20004_sequence.svg index c1c43de4..c3f0fc8c 100644 --- a/docs/test_cases/t20004_sequence.svg +++ b/docs/test_cases/t20004_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -29,87 +29,87 @@ - - + + main() - + main() - - + + m1<float>(float) - + m1<float>(float) - - + + m1<unsigned long>(unsigned long) - + m1<unsigned long>(unsigned long) - - + + m4<unsigned long>(unsigned long) - + m4<unsigned long>(unsigned long) - - + + m1<std::string>(std::string) - + m1<std::string>(std::string) - - + + m2<std::string>(std::string) - + m2<std::string>(std::string) - - + + m1<int>(int) - + m1<int>(int) - - + + m2<int>(int) - + m2<int>(int) - - + + m3<int>(int) - + m3<int>(int) - - + + m4<int>(int) - + m4<int>(int) - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -117,11 +117,11 @@ - + - + @@ -129,19 +129,19 @@ - + - + - + - + diff --git a/docs/test_cases/t20005_sequence.svg b/docs/test_cases/t20005_sequence.svg index bc341a89..1eb5e6f9 100644 --- a/docs/test_cases/t20005_sequence.svg +++ b/docs/test_cases/t20005_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - + + + - - + + C<T> - + C<T> - - + + B<T> - + B<T> - - + + A<T> - + A<T> - - - + + + c(T) - + b(T) - + a(T) diff --git a/docs/test_cases/t20006_sequence.svg b/docs/test_cases/t20006_sequence.svg index b6a69bb2..6a79231c 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -34,82 +34,82 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -118,12 +118,12 @@ - + b(std::string) - + a2(std::string) @@ -132,59 +132,59 @@ - + bb1(int,int) - + aa1(int) - + bb2(int,int) - + aa2(int) - + bb1(int,std::string) - + aa2(int) - + bb2(int,std::string) - + aa1(int) - + bb1(int,float) - + bb2(int,float) - + aa2(int) diff --git a/docs/test_cases/t20007_sequence.svg b/docs/test_cases/t20007_sequence.svg index 30adc106..49d3e383 100644 --- a/docs/test_cases/t20007_sequence.svg +++ b/docs/test_cases/t20007_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + Adder<int,int> - + Adder<int,int> - - + + Adder<int,float,double> - + Adder<int,float,double> - - + + Adder<std::string,std::string,std::string> - + Adder<std::string,std::string,std::string> - - - - - + + + + + add(int &&,int &&) - + add(int &&,float &&,double &&) - + add(std::string &&,std::string &&,std::string &&) diff --git a/docs/test_cases/t20008_sequence.svg b/docs/test_cases/t20008_sequence.svg index 107697aa..2805cb25 100644 --- a/docs/test_cases/t20008_sequence.svg +++ b/docs/test_cases/t20008_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<const char *> - + B<const char *> - - + + A<const char *> - + A<const char *> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - - - - - - - + + + + + + + + b(int) - + a1(int) - + b(const char *) - + a2(const char *) - + b(std::string) - + a3(std::string) diff --git a/docs/test_cases/t20009_sequence.svg b/docs/test_cases/t20009_sequence.svg index f2ec6655..1f6dfbb6 100644 --- a/docs/test_cases/t20009_sequence.svg +++ b/docs/test_cases/t20009_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<float> - + B<float> - - + + A<float> - + A<float> - - - - - - - - + + + + + + + + b(std::string) - + a(std::string) - + b(int) - + a(int) - + b(float) - + a(float) diff --git a/docs/test_cases/t20010_sequence.svg b/docs/test_cases/t20010_sequence.svg index 9f17be94..88749f93 100644 --- a/docs/test_cases/t20010_sequence.svg +++ b/docs/test_cases/t20010_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A - + A - - - - - - - - - - + + + + + + + + + + b1() - + a1() - + b2() - + a2() - + b3() - + a3() - + b4() - + a4() diff --git a/docs/test_cases/t20011_sequence.svg b/docs/test_cases/t20011_sequence.svg index 0358d213..d18be928 100644 --- a/docs/test_cases/t20011_sequence.svg +++ b/docs/test_cases/t20011_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - + + + + + + + + + + a(int) @@ -52,26 +52,26 @@ alt - + a(int) - + b(int) - + c(int) - + @@ -81,14 +81,14 @@ alt - + b(int) - + @@ -98,7 +98,7 @@ alt - + diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index 07d7aed2..5a2ffd48 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,122 +43,122 @@ - - + + tmain() - + tmain() - - + + tmain()::(lambda t20012.cc:66:20) - + tmain()::(lambda t20012.cc:66:20) - - + + A - + A - - + + B - + B - - + + tmain()::(lambda t20012.cc:79:20) - + tmain()::(lambda t20012.cc:79:20) - - + + C - + C - - + + R<R::(lambda t20012.cc:85:9)> - + R<R::(lambda t20012.cc:85:9)> - - + + tmain()::(lambda t20012.cc:85:9) - + tmain()::(lambda t20012.cc:85:9) - - + + D - + D - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -167,67 +167,67 @@ - + operator()() - + c() - + cc() - + ccc() - + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -238,29 +238,29 @@ - + r() - + operator()() - + c() - + cc() - + @@ -269,7 +269,7 @@ - + add5(int) diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index 354c6cdb..8ac9c469 100644 --- a/docs/test_cases/t20013_sequence.svg +++ b/docs/test_cases/t20013_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -58,12 +58,12 @@ - + b(double) - + a2(double) @@ -72,12 +72,12 @@ - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20014_sequence.svg b/docs/test_cases/t20014_sequence.svg index 98e6b209..fd65ccbd 100644 --- a/docs/test_cases/t20014_sequence.svg +++ b/docs/test_cases/t20014_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - - - - - - - + + + + + + + + - - + + tmain() - + tmain() - - + + B - + B - - + + A - + A - - + + C<B,int> - + C<B,int> - - - - - - - - - + + + + + + + + + b1(int,int) - + a1(int,int) @@ -67,12 +67,12 @@ - + b2(int,int) - + a2(int,int) @@ -81,17 +81,17 @@ - + c1(int,int) - + b1(int,int) - + a1(int,int) diff --git a/docs/test_cases/t20015_sequence.svg b/docs/test_cases/t20015_sequence.svg index 0c16fb7b..7bea4365 100644 --- a/docs/test_cases/t20015_sequence.svg +++ b/docs/test_cases/t20015_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + B - + B - - - + + + setup_a(std::shared_ptr<detail::A> &) diff --git a/docs/test_cases/t20016_sequence.svg b/docs/test_cases/t20016_sequence.svg index eca94d50..b25d199d 100644 --- a/docs/test_cases/t20016_sequence.svg +++ b/docs/test_cases/t20016_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + B<long> - + B<long> - - + + A - + A - - - - - - + + + + + + b1(long) - + a1(int) - + b2(long) - + a2(const long &) diff --git a/docs/test_cases/t20017_sequence.svg b/docs/test_cases/t20017_sequence.svg index 589d6843..50cafe24 100644 --- a/docs/test_cases/t20017_sequence.svg +++ b/docs/test_cases/t20017_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,65 +9,65 @@ - - - - - - + + + + + + - + t20017.cc - + t20017.cc - + include/t20017_b.h - + include/t20017_b.h - + include/t20017_a.h - + include/t20017_a.h - - - - - - + + + + + + tmain() - + b2<int>(int,int) - + a1(int,int) - + a2(int,int) - + a3(int,int) - + b1(int,int) diff --git a/docs/test_cases/t20018_sequence.svg b/docs/test_cases/t20018_sequence.svg index 7b159bbd..96e078a7 100644 --- a/docs/test_cases/t20018_sequence.svg +++ b/docs/test_cases/t20018_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + @@ -25,93 +25,93 @@ - - + + tmain() - + tmain() - - + + Answer<Factorial<5>,120> - + Answer<Factorial<5>,120> - - + + Factorial<5> - + Factorial<5> - - + + Factorial<4> - + Factorial<4> - - + + Factorial<3> - + Factorial<3> - - + + Factorial<2> - + Factorial<2> - - + + Factorial<1> - + Factorial<1> - - + + Factorial<0> - + Factorial<0> - - - - - - - - - + + + + + + + + + print() - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) diff --git a/docs/test_cases/t20019_sequence.svg b/docs/test_cases/t20019_sequence.svg index 854edb38..afaa9ad0 100644 --- a/docs/test_cases/t20019_sequence.svg +++ b/docs/test_cases/t20019_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + Base<D1> - + Base<D1> - - + + D1 - + D1 - - + + Base<D2> - + Base<D2> - - + + D2 - + D2 - - - - - - - - - - + + + + + + + + + + name() - + impl() - + name() - + impl() - + name() - + impl() - + name() - + impl() diff --git a/docs/test_cases/t20020.md b/docs/test_cases/t20020.md index 6ba3e37e..0e8eed4c 100644 --- a/docs/test_cases/t20020.md +++ b/docs/test_cases/t20020.md @@ -28,6 +28,7 @@ struct A { int a1() { return 0; } int a2() { return 1; } int a3() { return 2; } + int a4() { return 3; } }; struct B { @@ -47,6 +48,8 @@ struct C { } bool c2() const { return true; } + + int c3(int x) { return x * 2; } }; template struct D { @@ -67,13 +70,15 @@ int tmain() result = a.a1(); } else if (reinterpret_cast(&a) % 64 == 0ULL) { - if (a.a2() > 2) + if (c.c3(a.a2()) > 2) result = b.b1(); - else + else if (a.a3() % 2) result = b.b2(); + else + result = 0; } else { - result = a.a3(); + result = a.a4(); } b.log(); diff --git a/docs/test_cases/t20020_sequence.svg b/docs/test_cases/t20020_sequence.svg index 48225848..a21591a9 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + - + @@ -9,156 +9,182 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() - - tmain() + + tmain() - - - A - - A + + + A + + A - - - B - - B + + + C + + C - - - C - - C + + + B + + B - - - D<int> - - D<int> + + + D<int> + + D<int> - - - - - - - - - - - + + + + + + + + + + + + + - + alt - - - + + + a1() - - + + - + alt - - - - a2() + + + + [ + c3(int) + ] - - - - - b1() + + + + + [ + a2() + ] - - - - - b2() + + + + + b1() - - - - - - a3() + + + + + + [ + a3() + ] - - - - - - log() + + + + + + b2() - - - alt - - - - c1() + + + + + + a4() - - - alt - - - - - - c2() + + + + + + log() - - - - - - - - - - log() + + + alt + + + + c1() - - - alt - - - - d1(int,int) + + + alt + + + + + + [ + c2() + ] - - + + + + + + + + + + log() + + + + alt + + + + d1(int,int) + + + diff --git a/docs/test_cases/t20021.md b/docs/test_cases/t20021.md index 448d852b..a1080295 100644 --- a/docs/test_cases/t20021.md +++ b/docs/test_cases/t20021.md @@ -36,18 +36,31 @@ struct B { int b2() const { return 4; } }; +struct C { + int c1() { return 1; } + int c2() { return 2; } + int c3() { return 3; } + int c4() { return c5(); } + int c5() { return 5; } + + std::vector &contents() { return contents_; } + + std::vector contents_; +}; + int tmain() { A a; std::vector b; + C c; int i = 10; - while (i--) { + while (i -= c.c4()) { int j = a.a3(); do { - for (int l = a.a2(); l > 0; l--) + for (int l = a.a2(); l > c.c1(); l -= c.c2()) a.a1(); - } while (j--); + } while (j -= c.c3()); } int result = 0; @@ -55,6 +68,10 @@ int tmain() result += bi.b2(); } + for (const auto &ci : c.contents()) { + result += ci; + } + return b.front().b2() + result; } } diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index f3d766f2..6619f3d9 100644 --- a/docs/test_cases/t20021_sequence.svg +++ b/docs/test_cases/t20021_sequence.svg @@ -1,6 +1,6 @@ - + - + @@ -9,89 +9,168 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + tmain() - - tmain() + + tmain() - - - A - - A + + + C + + C - - - B - - B + + + A + + A - - - - - - + + + B + + B + + + + + + + + + + + + + - + loop - - - - a3() + + + + [ + c4() + ] - - - - - loop - - - loop - - - - a2() + + + + + + c5() - - - - - - a1() + + + + + + + + + + a3() - - - - - loop - - - - b2() + + + + + loop + + + loop + + + + [ + a2() + ] - - - - - - b2() + + + + + + [ + c1() + ] - - + + + + + + [ + c2() + ] + + + + + + + a1() + + + + + + + c3() + + + + + + loop + + + + b2() + + + + + + loop + + + + [ + contents() + ] + + + + + + + b2() + + + diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index a2f1c265..a86df828 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - + + + + a() - + b() diff --git a/docs/test_cases/t20023.md b/docs/test_cases/t20023.md new file mode 100644 index 00000000..e88c8048 --- /dev/null +++ b/docs/test_cases/t20023.md @@ -0,0 +1,64 @@ +# t20023 - Try/catch statement sequence diagram test case +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t20023_sequence: + type: sequence + glob: + - ../../tests/t20023/t20023.cc + include: + namespaces: + - clanguml::t20023 + using_namespace: + - clanguml::t20023 + start_from: + - function: "clanguml::t20023::tmain()" +``` +## Source code +File t20023.cc +```cpp +#include + +namespace clanguml { +namespace t20023 { + +struct A { + int a1() { return 1; } + int a2() { return 2; } + int a3() { return 3; } + int a4() { return 3; } + + int a() + { + try { + return a1(); + } + catch (std::runtime_error &) { + return a2(); + } + catch (std::logic_error &) { + return a3(); + } + catch (...) { + return a4(); + } + } +}; + +int tmain() +{ + A a; + + int result{}; + + result = a.a(); + + return result; +} +} +} +``` +## Generated UML diagrams +![t20023_sequence](./t20023_sequence.svg "Try/catch statement sequence diagram test case") diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg new file mode 100644 index 00000000..bc7d9ec3 --- /dev/null +++ b/docs/test_cases/t20023_sequence.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + A + + A + + + + + + + + + + + a() + + + + try + + + + + + a1() + + + + + + + [std::runtime_error &] + + + + + + a2() + + + + + + + [std::logic_error &] + + + + + + a3() + + + + + + + [...] + + + + + + a4() + + + + + + + + + diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index bec22d11..35256129 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,63 +9,63 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index 0cbefe24..2667be0e 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,113 +9,113 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + BBB diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index 0da4fff2..f69f7b66 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,35 +9,35 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index 74aee223..0a865f6d 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index a0b57541..9ee117f0 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,48 +9,48 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index a8dfe383..e51949f4 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - + + B - - + + A - - + + C - + Top A note. diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index b7f81ee3..896b82de 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,27 +9,27 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index d31552cb..40fcfde5 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index 9e5f1dff..b7a5da51 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + yaml-cpp/yaml.h - + This is a lib1 include dir - + This is a t40001_include1.h include file diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 2d466344..5f188590 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index 70e34409..315e41cc 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - + include - + dependants - + dependencies - + src - + dependants - + dependencies - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h - - + + t1.cc - - + + t2.cc From bd61a1540eccbf0ab53e956b78532cf60e65ce20 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 13 Dec 2022 21:09:00 +0100 Subject: [PATCH 05/19] Added support for switch statements in sequence diagrams --- src/common/clang_utils.cc | 45 +++++++++++ src/common/clang_utils.h | 6 ++ src/common/model/enums.cc | 6 ++ src/common/model/enums.h | 3 + .../plantuml/sequence_diagram_generator.cc | 9 +++ src/sequence_diagram/model/diagram.cc | 75 ++++++++++++++++++ src/sequence_diagram/model/diagram.h | 22 ++++-- .../visitor/call_expression_context.cc | 19 +++++ .../visitor/call_expression_context.h | 5 ++ .../visitor/translation_unit_visitor.cc | 76 ++++++++++++------- .../visitor/translation_unit_visitor.h | 6 ++ tests/t20024/.clang-uml | 14 ++++ tests/t20024/t20024.cc | 65 ++++++++++++++++ tests/t20024/test_case.h | 51 +++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 + 16 files changed, 373 insertions(+), 33 deletions(-) create mode 100644 tests/t20024/.clang-uml create mode 100644 tests/t20024/t20024.cc create mode 100644 tests/t20024/test_case.h diff --git a/src/common/clang_utils.cc b/src/common/clang_utils.cc index 34c511f7..45c95493 100644 --- a/src/common/clang_utils.cc +++ b/src/common/clang_utils.cc @@ -144,6 +144,51 @@ std::string to_string(const clang::RecordType &type, return to_string(type.desugar(), ctx, try_canonical); } +std::string to_string(const clang::Expr *expr) +{ + clang::LangOptions lang_options; + std::string result; + llvm::raw_string_ostream ostream(result); + expr->printPretty(ostream, NULL, clang::PrintingPolicy(lang_options)); + + return result; +} + +std::string to_string(const clang::Stmt *stmt) +{ + clang::LangOptions lang_options; + std::string result; + llvm::raw_string_ostream ostream(result); + stmt->printPretty(ostream, NULL, clang::PrintingPolicy(lang_options)); + + return result; +} + +std::string to_string(const clang::FunctionTemplateDecl *decl) +{ + std::vector template_parameters; + // Handle template function + for (const auto *parameter : *decl->getTemplateParameters()) { + if (clang::dyn_cast_or_null(parameter)) { + const auto *template_type_parameter = + clang::dyn_cast_or_null(parameter); + + std::string template_parameter{ + template_type_parameter->getNameAsString()}; + + if (template_type_parameter->isParameterPack()) + template_parameter += "..."; + + template_parameters.emplace_back(std::move(template_parameter)); + } + else { + // TODO + } + } + return fmt::format("{}<{}>({})", decl->getQualifiedNameAsString(), + fmt::join(template_parameters, ","), ""); +} + std::string get_source_text_raw( clang::SourceRange range, const clang::SourceManager &sm) { diff --git a/src/common/clang_utils.h b/src/common/clang_utils.h index c332dd10..09441e3c 100644 --- a/src/common/clang_utils.h +++ b/src/common/clang_utils.h @@ -62,6 +62,12 @@ std::string to_string(const clang::QualType &type, const clang::ASTContext &ctx, std::string to_string(const clang::RecordType &type, const clang::ASTContext &ctx, bool try_canonical = true); +std::string to_string(const clang::Expr *expr); + +std::string to_string(const clang::Stmt *stmt); + +std::string to_string(const clang::FunctionTemplateDecl *decl); + std::string get_source_text_raw( clang::SourceRange range, const clang::SourceManager &sm); diff --git a/src/common/model/enums.cc b/src/common/model/enums.cc index 9aaf3b33..cb1685a2 100644 --- a/src/common/model/enums.cc +++ b/src/common/model/enums.cc @@ -100,6 +100,12 @@ std::string to_string(message_t r) return "catch"; case message_t::kTryEnd: return "end try"; + case message_t::kSwitch: + return "switch"; + case message_t::kCase: + return "case"; + case message_t::kSwitchEnd: + return "end switch"; default: assert(false); return ""; diff --git a/src/common/model/enums.h b/src/common/model/enums.h index 66c93249..463ec56d 100644 --- a/src/common/model/enums.h +++ b/src/common/model/enums.h @@ -56,6 +56,9 @@ enum class message_t { kTry, kCatch, kTryEnd, + kSwitch, + kCase, + kSwitchEnd, kNone }; diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc index c72d99ae..15dc5e3e 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -199,6 +199,15 @@ void generator::generate_activity(const activity &a, std::ostream &ostr, else if (m.type() == message_t::kTryEnd) { ostr << "end\n"; } + else if (m.type() == message_t::kSwitch) { + ostr << "group switch\n"; + } + else if (m.type() == message_t::kCase) { + ostr << "else " << m.message_name() << '\n'; + } + else if (m.type() == message_t::kSwitchEnd) { + ostr << "end\n"; + } } } diff --git a/src/sequence_diagram/model/diagram.cc b/src/sequence_diagram/model/diagram.cc index e9a4bdf1..28067a7b 100644 --- a/src/sequence_diagram/model/diagram.cc +++ b/src/sequence_diagram/model/diagram.cc @@ -273,6 +273,81 @@ void diagram::add_catch_stmt( get_activity(current_caller_id).add_message(std::move(m)); } +void diagram::add_switch_stmt( + common::model::diagram_element::id_t current_caller_id) +{ + using clanguml::common::model::message_t; + + if (sequences_.find(current_caller_id) == sequences_.end()) { + activity a{current_caller_id}; + sequences_.insert({current_caller_id, std::move(a)}); + } + + message m{message_t::kSwitch, current_caller_id}; + + get_activity(current_caller_id).add_message(std::move(m)); +} + +void diagram::end_switch_stmt( + common::model::diagram_element::id_t current_caller_id) +{ + using clanguml::common::model::message_t; + + message m{message_t::kTryEnd, current_caller_id}; + + if (sequences_.find(current_caller_id) != sequences_.end()) { + auto ¤t_messages = get_activity(current_caller_id).messages(); + + if (current_messages.back().type() == message_t::kSwitch) { + current_messages.pop_back(); + } + else { + current_messages.emplace_back(std::move(m)); + } + } +} + +void diagram::add_case_stmt( + common::model::diagram_element::id_t current_caller_id, + const std::string &case_label) +{ + using clanguml::common::model::message_t; + + message m{message_t::kCase, current_caller_id}; + m.set_message_name(case_label); + + if (sequences_.find(current_caller_id) != sequences_.end()) { + auto ¤t_messages = get_activity(current_caller_id).messages(); + + if (current_messages.back().type() == message_t::kCase) { + // Do nothing - fallthroughs not supported yet... + } + else { + current_messages.emplace_back(std::move(m)); + } + } +} + +void diagram::add_default_stmt( + common::model::diagram_element::id_t current_caller_id) +{ + using clanguml::common::model::message_t; + + message m{message_t::kCase, current_caller_id}; + m.set_message_name("default"); + + if (sequences_.find(current_caller_id) != sequences_.end()) { + auto ¤t_messages = get_activity(current_caller_id).messages(); + + if (current_messages.back().type() == message_t::kCase) { + current_messages.pop_back(); + } + else { + current_messages.emplace_back(std::move(m)); + } + } +} + bool diagram::started() const { return started_; } void diagram::started(bool s) { started_ = s; } diff --git a/src/sequence_diagram/model/diagram.h b/src/sequence_diagram/model/diagram.h index b51b1128..70c065f4 100644 --- a/src/sequence_diagram/model/diagram.h +++ b/src/sequence_diagram/model/diagram.h @@ -93,14 +93,24 @@ public: void end_loop_stmt(common::model::diagram_element::id_t current_caller_id, common::model::message_t type); - void add_while_stmt(common::model::diagram_element::id_t i); - void end_while_stmt(common::model::diagram_element::id_t i); + void add_while_stmt(common::model::diagram_element::id_t current_caller_id); + void end_while_stmt(common::model::diagram_element::id_t current_caller_id); - void add_do_stmt(common::model::diagram_element::id_t i); - void end_do_stmt(common::model::diagram_element::id_t i); + void add_do_stmt(common::model::diagram_element::id_t current_caller_id); + void end_do_stmt(common::model::diagram_element::id_t current_caller_id); - void add_for_stmt(common::model::diagram_element::id_t i); - void end_for_stmt(common::model::diagram_element::id_t i); + void add_for_stmt(common::model::diagram_element::id_t current_caller_id); + void end_for_stmt(common::model::diagram_element::id_t current_caller_id); + + void add_switch_stmt( + common::model::diagram_element::id_t current_caller_id); + void end_switch_stmt( + common::model::diagram_element::id_t current_caller_id); + void add_case_stmt(common::model::diagram_element::id_t current_caller_id); + void add_case_stmt(common::model::diagram_element::id_t current_caller_id, + const std::string &case_label); + void add_default_stmt( + common::model::diagram_element::id_t current_caller_id); bool started() const; void started(bool s); diff --git a/src/sequence_diagram/visitor/call_expression_context.cc b/src/sequence_diagram/visitor/call_expression_context.cc index 97611c38..67f73a65 100644 --- a/src/sequence_diagram/visitor/call_expression_context.cc +++ b/src/sequence_diagram/visitor/call_expression_context.cc @@ -264,6 +264,25 @@ void call_expression_context::leave_trystmt() try_stmt_stack_.pop(); } +clang::SwitchStmt *call_expression_context::current_switchstmt() const +{ + if (switch_stmt_stack_.empty()) + return nullptr; + + return switch_stmt_stack_.top(); +} + +void call_expression_context::enter_switchstmt(clang::SwitchStmt *stmt) +{ + switch_stmt_stack_.push(stmt); +} + +void call_expression_context::leave_switchstmt() +{ + if (switch_stmt_stack_.empty()) + switch_stmt_stack_.pop(); +} + bool call_expression_context::is_expr_in_current_control_statement_condition( const clang::Stmt *stmt) const { diff --git a/src/sequence_diagram/visitor/call_expression_context.h b/src/sequence_diagram/visitor/call_expression_context.h index 891bcc7d..913b0e7a 100644 --- a/src/sequence_diagram/visitor/call_expression_context.h +++ b/src/sequence_diagram/visitor/call_expression_context.h @@ -84,6 +84,10 @@ struct call_expression_context { void enter_trystmt(clang::Stmt *stmt); void leave_trystmt(); + clang::SwitchStmt *current_switchstmt() const; + void enter_switchstmt(clang::SwitchStmt *stmt); + void leave_switchstmt(); + bool is_expr_in_current_control_statement_condition( const clang::Stmt *stmt) const; @@ -105,6 +109,7 @@ private: std::stack loop_stmt_stack_; std::stack try_stmt_stack_; + std::stack switch_stmt_stack_; }; } \ No newline at end of file diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 31fab119..7dc5b9e4 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -23,31 +23,6 @@ namespace clanguml::sequence_diagram::visitor { -std::string to_string(const clang::FunctionTemplateDecl *decl) -{ - std::vector template_parameters; - // Handle template function - for (const auto *parameter : *decl->getTemplateParameters()) { - if (clang::dyn_cast_or_null(parameter)) { - const auto *template_type_parameter = - clang::dyn_cast_or_null(parameter); - - std::string template_parameter{ - template_type_parameter->getNameAsString()}; - - if (template_type_parameter->isParameterPack()) - template_parameter += "..."; - - template_parameters.emplace_back(std::move(template_parameter)); - } - else { - // TODO - } - } - return fmt::format("{}<{}>({})", decl->getQualifiedNameAsString(), - fmt::join(template_parameters, ","), ""); -} - translation_unit_visitor::translation_unit_visitor(clang::SourceManager &sm, clanguml::sequence_diagram::model::diagram &diagram, const clanguml::config::sequence_diagram &config) @@ -318,8 +293,9 @@ bool translation_unit_visitor::VisitCXXMethodDecl(clang::CXXMethodDecl *m) m_ptr->is_static(m->isStatic()); for (const auto *param : m->parameters()) { - m_ptr->add_parameter(simplify_system_template( - common::to_string(param->getType(), m->getASTContext(), false))); + m_ptr->add_parameter(config().using_namespace().relative( + simplify_system_template(common::to_string( + param->getType(), m->getASTContext(), false)))); } set_source_location(*m, *m_ptr); @@ -777,6 +753,52 @@ bool translation_unit_visitor::TraverseCXXForRangeStmt( return true; } +bool translation_unit_visitor::TraverseSwitchStmt(clang::SwitchStmt *stmt) +{ + const auto current_caller_id = context().caller_id(); + + if (current_caller_id) { + context().enter_switchstmt(stmt); + diagram().add_switch_stmt(current_caller_id); + } + + RecursiveASTVisitor::TraverseSwitchStmt(stmt); + + if (current_caller_id) { + context().leave_switchstmt(); + diagram().end_switch_stmt(current_caller_id); + } + + return true; +} + +bool translation_unit_visitor::TraverseCaseStmt(clang::CaseStmt *stmt) +{ + const auto current_caller_id = context().caller_id(); + + if (current_caller_id) { + diagram().add_case_stmt( + current_caller_id, common::to_string(stmt->getLHS())); + } + + RecursiveASTVisitor::TraverseCaseStmt(stmt); + + return true; +} + +bool translation_unit_visitor::TraverseDefaultStmt(clang::DefaultStmt *stmt) +{ + const auto current_caller_id = context().caller_id(); + + if (current_caller_id) { + diagram().add_default_stmt(current_caller_id); + } + + RecursiveASTVisitor::TraverseDefaultStmt(stmt); + + return true; +} + bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) { using clanguml::common::model::message_scope_t; diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index 8dcbbfa2..f068cd76 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -80,6 +80,12 @@ public: bool TraverseCXXCatchStmt(clang::CXXCatchStmt *stmt); + bool TraverseSwitchStmt(clang::SwitchStmt *stmt); + + bool TraverseCaseStmt(clang::CaseStmt *stmt); + + bool TraverseDefaultStmt(clang::DefaultStmt *stmt); + clanguml::sequence_diagram::model::diagram &diagram(); const clanguml::sequence_diagram::model::diagram &diagram() const; diff --git a/tests/t20024/.clang-uml b/tests/t20024/.clang-uml new file mode 100644 index 00000000..fde4258a --- /dev/null +++ b/tests/t20024/.clang-uml @@ -0,0 +1,14 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t20024_sequence: + type: sequence + glob: + - ../../tests/t20024/t20024.cc + include: + namespaces: + - clanguml::t20024 + using_namespace: + - clanguml::t20024 + start_from: + - function: "clanguml::t20024::tmain()" \ No newline at end of file diff --git a/tests/t20024/t20024.cc b/tests/t20024/t20024.cc new file mode 100644 index 00000000..f253f225 --- /dev/null +++ b/tests/t20024/t20024.cc @@ -0,0 +1,65 @@ +namespace clanguml { +namespace t20024 { + +enum enum_a { zero = 0, one = 1, two = 2, three = 3 }; + +enum class colors { red, orange, green }; + +struct A { + int select(enum_a v) + { + switch (v) { + case zero: + return a0(); + case one: + return a1(); + case two: + return a2(); + default: + return a3(); + } + } + + int a0() { return 0; } + int a1() { return 1; } + int a2() { return 2; } + int a3() { return 3; } +}; + +struct B { + void select(colors c) + { + switch (c) { + case colors::red: + red(); + break; + case colors::orange: + orange(); + break; + case colors::green: + green(); + break; + default: + grey(); + } + } + + void red() { } + void orange() { } + void green() { } + void grey() { } +}; + +int tmain() +{ + A a; + B b; + + a.select(enum_a::two); + + b.select(colors::green); + + return 0; +} +} +} \ No newline at end of file diff --git a/tests/t20024/test_case.h b/tests/t20024/test_case.h new file mode 100644 index 00000000..b91bbf48 --- /dev/null +++ b/tests/t20024/test_case.h @@ -0,0 +1,51 @@ +/** + * tests/t20024/test_case.h + * + * Copyright (c) 2021-2022 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("t20024", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20024"); + + auto diagram = config.diagrams["t20024_sequence"]; + + REQUIRE(diagram->name == "t20024_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20024_sequence"); + + auto puml = generate_sequence_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "select(enum_a)")); + REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a0()")); + REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a1()")); + REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a2()")); + REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a3()")); + + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "select(colors)")); + REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "red()")); + REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "orange()")); + REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "green()")); + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 20a8fa44..ce6cf013 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -270,6 +270,7 @@ using namespace clanguml::test::matchers; #include "t20021/test_case.h" #include "t20022/test_case.h" #include "t20023/test_case.h" +#include "t20024/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 1c670f81..8b328373 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -217,6 +217,9 @@ test_cases: - name: t20023 title: Try/catch statement sequence diagram test case description: + - name: t20024 + title: Switch statement sequence diagram test case + description: Package diagrams: - name: t30001 title: Basic package diagram test case From d4258804628c071a3998dffc8c7da36ffa560963 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 13 Dec 2022 21:17:40 +0100 Subject: [PATCH 06/19] Updated changelog and readme --- CHANGELOG.md | 2 ++ README.md | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f527a52a..a5f8c979 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # CHANGELOG + * Added support for sequence diagrams with template code + ### 0.2.2 * Added structured comment parsing (#32) * Fixed namespace exclusive filtering diff --git a/README.md b/README.md index e9075db0..fee3b699 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,12 @@ Main features supported so far include: * Optional package generation from namespaces * Interactive links to online code to classes, methods and class fields in SVG diagrams * **Sequence diagram generation** - * Generation of sequence diagram from one code location to another (currently only for non-template code) + * Generation of sequence diagram from specific method or function + * Generation of loop and conditional statements + * Generation of switch statements + * Generation of try/catch blocks + * Handling of template code including constexpr conditionals + * Handling of lambda expressions * **Package diagram generation** * Generation of package diagram based on C++ namespaces * Interactive links to online code to packages From d7c8c14cdad08c6eb3b235bffcb462fa542accb4 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 13 Dec 2022 23:18:37 +0100 Subject: [PATCH 07/19] Added initial support for skip decorator in sequence diagrams --- .../plantuml/sequence_diagram_generator.cc | 2 +- .../visitor/translation_unit_visitor.cc | 11 ++++- tests/t20025/.clang-uml | 14 ++++++ tests/t20025/t20025.cc | 45 ++++++++++++++++++ tests/t20025/test_case.h | 46 +++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 ++ 7 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 tests/t20025/.clang-uml create mode 100644 tests/t20025/t20025.cc create mode 100644 tests/t20025/test_case.h diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc index 15dc5e3e..ba6938f2 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -127,7 +127,7 @@ void generator::generate_activity(const activity &a, std::ostream &ostr, if (m.type() == message_t::kCall) { const auto &to = m_model.get_participant(m.to()); - if (!to) + if (!to || to.value().skip()) continue; visited.push_back(m.from()); diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 7dc5b9e4..3a3747e2 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -298,6 +298,8 @@ bool translation_unit_visitor::VisitCXXMethodDecl(clang::CXXMethodDecl *m) param->getType(), m->getASTContext(), false)))); } + process_comment(*m, *m_ptr); + set_source_location(*m, *m_ptr); const auto method_full_name = m_ptr->full_name(false); @@ -368,6 +370,8 @@ bool translation_unit_visitor::VisitFunctionDecl(clang::FunctionDecl *f) } set_unique_id(f->getID(), f_ptr->id()); + process_comment(*f, *f_ptr); + set_source_location(*f, *f_ptr); // TODO: Handle overloaded functions with different arguments @@ -400,6 +404,8 @@ bool translation_unit_visitor::VisitFunctionDecl(clang::FunctionDecl *f) } set_unique_id(f->getID(), f_ptr->id()); + process_comment(*f, *f_ptr); + set_source_location(*f, *f_ptr); // TODO: Handle overloaded functions with different arguments @@ -441,6 +447,8 @@ bool translation_unit_visitor::VisitFunctionTemplateDecl( f_ptr->is_void( function_template->getAsFunction()->getReturnType()->isVoidType()); + process_comment(*function_template, *f_ptr); + set_source_location(*function_template, *f_ptr); context().update(function_template); @@ -811,8 +819,7 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) return true; // Skip casts, moves and such - if (expr->isCallToStdMove()) - return true; + if (expr->isCallToStdMove()) return true; if (expr->isImplicitCXXThis()) return true; diff --git a/tests/t20025/.clang-uml b/tests/t20025/.clang-uml new file mode 100644 index 00000000..1598fcf3 --- /dev/null +++ b/tests/t20025/.clang-uml @@ -0,0 +1,14 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t20025_sequence: + type: sequence + glob: + - ../../tests/t20025/t20025.cc + include: + namespaces: + - clanguml::t20025 + using_namespace: + - clanguml::t20025 + start_from: + - function: "clanguml::t20025::tmain()" \ No newline at end of file diff --git a/tests/t20025/t20025.cc b/tests/t20025/t20025.cc new file mode 100644 index 00000000..6764e123 --- /dev/null +++ b/tests/t20025/t20025.cc @@ -0,0 +1,45 @@ +namespace clanguml { +namespace t20025 { + +int add(int x, int y) { return x + y; } + +/// Add 2 numbers +/// +/// \param x +/// \param y +/// \return +/// \uml{skip} +int add2(int x, int y) { return x + x + y + y; } + +struct A { + int a() + { + /// TODO: this doesn't work yet... + /// \uml{skip} + a2(); + + return a1(); + } + + /// \uml{skip} + int a1() { return 1; } + + void a2() { } +}; + +int tmain() +{ + A a; + + int result{}; + + result = a.a(); + + result += add(1, 2); + + result += add2(2, 4); + + return result; +} +} +} \ No newline at end of file diff --git a/tests/t20025/test_case.h b/tests/t20025/test_case.h new file mode 100644 index 00000000..2d6c55f7 --- /dev/null +++ b/tests/t20025/test_case.h @@ -0,0 +1,46 @@ +/** + * tests/t20025/test_case.h + * + * Copyright (c) 2021-2022 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("t20025", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20025"); + + auto diagram = config.diagrams["t20025_sequence"]; + + REQUIRE(diagram->name == "t20025_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20025_sequence"); + + auto puml = generate_sequence_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "a1()")); + // REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "a2()")); + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("add(int,int)"), "")); + REQUIRE_THAT(puml, !HasCall(_A("tmain()"), _A("add2(int,int)"), "")); + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index ce6cf013..539291ed 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -271,6 +271,7 @@ using namespace clanguml::test::matchers; #include "t20022/test_case.h" #include "t20023/test_case.h" #include "t20024/test_case.h" +#include "t20025/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 8b328373..60d2ea5b 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -220,6 +220,9 @@ test_cases: - name: t20024 title: Switch statement sequence diagram test case description: + - name: t20025 + title: Skip decorator sequence diagram test case + description: Package diagrams: - name: t30001 title: Basic package diagram test case From ed2b3e188b932f731072084a45cfd066b6145719 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 13 Dec 2022 23:47:04 +0100 Subject: [PATCH 08/19] Added virtual method call test case --- .../visitor/translation_unit_visitor.cc | 3 +- tests/t20025/t20025.cc | 2 +- tests/t20026/.clang-uml | 14 +++++++ tests/t20026/t20026.cc | 25 +++++++++++ tests/t20026/test_case.h | 42 +++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 ++ 7 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 tests/t20026/.clang-uml create mode 100644 tests/t20026/t20026.cc create mode 100644 tests/t20026/test_case.h diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 3a3747e2..c5d34d77 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -819,7 +819,8 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) return true; // Skip casts, moves and such - if (expr->isCallToStdMove()) return true; + if (expr->isCallToStdMove()) + return true; if (expr->isImplicitCXXThis()) return true; diff --git a/tests/t20025/t20025.cc b/tests/t20025/t20025.cc index 6764e123..9ddaf9c5 100644 --- a/tests/t20025/t20025.cc +++ b/tests/t20025/t20025.cc @@ -36,7 +36,7 @@ int tmain() result = a.a(); result += add(1, 2); - + result += add2(2, 4); return result; diff --git a/tests/t20026/.clang-uml b/tests/t20026/.clang-uml new file mode 100644 index 00000000..083b47ec --- /dev/null +++ b/tests/t20026/.clang-uml @@ -0,0 +1,14 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t20026_sequence: + type: sequence + glob: + - ../../tests/t20026/t20026.cc + include: + namespaces: + - clanguml::t20026 + using_namespace: + - clanguml::t20026 + start_from: + - function: "clanguml::t20026::tmain()" \ No newline at end of file diff --git a/tests/t20026/t20026.cc b/tests/t20026/t20026.cc new file mode 100644 index 00000000..7cb8f606 --- /dev/null +++ b/tests/t20026/t20026.cc @@ -0,0 +1,25 @@ +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; +} +} +} \ No newline at end of file diff --git a/tests/t20026/test_case.h b/tests/t20026/test_case.h new file mode 100644 index 00000000..e3298fcf --- /dev/null +++ b/tests/t20026/test_case.h @@ -0,0 +1,42 @@ +/** + * tests/t20026/test_case.h + * + * Copyright (c) 2021-2022 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("t20026", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20026"); + + auto diagram = config.diagrams["t20026_sequence"]; + + REQUIRE(diagram->name == "t20026_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20026_sequence"); + + auto puml = generate_sequence_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 539291ed..e3492193 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -272,6 +272,7 @@ using namespace clanguml::test::matchers; #include "t20023/test_case.h" #include "t20024/test_case.h" #include "t20025/test_case.h" +#include "t20026/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 60d2ea5b..f660db17 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -223,6 +223,9 @@ test_cases: - name: t20025 title: Skip decorator sequence diagram test case description: + - name: t20026 + title: Virtual method call sequence diagram test case + description: Package diagrams: - name: t30001 title: Basic package diagram test case From fe9aa5d99aae2b1449ba994305fd1fc06bf11927 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 14 Dec 2022 00:04:34 +0100 Subject: [PATCH 09/19] Updated test case documentation --- docs/test_cases.md | 3 + docs/test_cases/t00002_class.svg | 36 ++--- docs/test_cases/t00003_class.svg | 46 +++---- docs/test_cases/t00004_class.svg | 76 +++++------ docs/test_cases/t00005_class.svg | 110 +++++++-------- docs/test_cases/t00006_class.svg | 134 +++++++++--------- docs/test_cases/t00007_class.svg | 30 ++-- docs/test_cases/t00008_class.svg | 56 ++++---- docs/test_cases/t00009_class.svg | 32 ++--- docs/test_cases/t00010_class.svg | 34 ++--- docs/test_cases/t00011_class.svg | 22 +-- docs/test_cases/t00012_class.svg | 66 ++++----- docs/test_cases/t00013_class.svg | 82 +++++------ docs/test_cases/t00014_class.svg | 124 ++++++++--------- docs/test_cases/t00015_class.svg | 22 +-- docs/test_cases/t00016_class.svg | 30 ++-- docs/test_cases/t00017_class.svg | 66 ++++----- docs/test_cases/t00018_class.svg | 18 +-- docs/test_cases/t00019_class.svg | 40 +++--- docs/test_cases/t00020_class.svg | 38 +++--- docs/test_cases/t00021_class.svg | 30 ++-- docs/test_cases/t00022_class.svg | 14 +- docs/test_cases/t00023_class.svg | 26 ++-- docs/test_cases/t00024_class.svg | 22 +-- docs/test_cases/t00025_class.svg | 34 ++--- docs/test_cases/t00026_class.svg | 42 +++--- docs/test_cases/t00027_class.svg | 58 ++++---- docs/test_cases/t00028_class.svg | 78 +++++------ docs/test_cases/t00029_class.svg | 50 +++---- docs/test_cases/t00030_class.svg | 46 +++---- docs/test_cases/t00031_class.svg | 50 +++---- docs/test_cases/t00032_class.svg | 40 +++--- docs/test_cases/t00033_class.svg | 48 +++---- docs/test_cases/t00034_class.svg | 46 +++---- docs/test_cases/t00035_class.svg | 22 +-- docs/test_cases/t00036_class.svg | 38 +++--- docs/test_cases/t00037_class.svg | 178 ++++++++++++------------ docs/test_cases/t00038_class.svg | 58 ++++---- docs/test_cases/t00039_class.svg | 78 +++++------ docs/test_cases/t00040_class.svg | 26 ++-- docs/test_cases/t00041_class.svg | 54 ++++---- docs/test_cases/t00042_class.svg | 36 ++--- docs/test_cases/t00043_class.svg | 50 +++---- docs/test_cases/t00044_class.svg | 36 ++--- docs/test_cases/t00045_class.svg | 70 +++++----- docs/test_cases/t00046_class.svg | 64 ++++----- docs/test_cases/t00047_class.svg | 22 +-- docs/test_cases/t00048_class.svg | 50 +++---- docs/test_cases/t00049_class.svg | 32 ++--- docs/test_cases/t00050_class.svg | 72 +++++----- docs/test_cases/t20001_sequence.svg | 62 ++++----- docs/test_cases/t20002_sequence.svg | 48 +++---- docs/test_cases/t20003_sequence.svg | 48 +++---- docs/test_cases/t20004_sequence.svg | 120 ++++++++-------- docs/test_cases/t20005_sequence.svg | 36 ++--- docs/test_cases/t20006_sequence.svg | 150 ++++++++++---------- docs/test_cases/t20007_sequence.svg | 48 +++---- docs/test_cases/t20008_sequence.svg | 84 ++++++------ docs/test_cases/t20009_sequence.svg | 84 ++++++------ docs/test_cases/t20010_sequence.svg | 72 +++++----- docs/test_cases/t20011_sequence.svg | 72 +++++----- docs/test_cases/t20012_sequence.svg | 204 ++++++++++++++-------------- docs/test_cases/t20013_sequence.svg | 60 ++++---- docs/test_cases/t20014_sequence.svg | 72 +++++----- docs/test_cases/t20015_sequence.svg | 24 ++-- docs/test_cases/t20016_sequence.svg | 48 +++---- docs/test_cases/t20017_sequence.svg | 48 +++---- docs/test_cases/t20018_sequence.svg | 96 ++++++------- docs/test_cases/t20019_sequence.svg | 84 ++++++------ docs/test_cases/t20020_sequence.svg | 118 ++++++++-------- docs/test_cases/t20021_sequence.svg | 106 +++++++-------- docs/test_cases/t20022_sequence.svg | 36 ++--- docs/test_cases/t20023_sequence.svg | 50 +++---- docs/test_cases/t20024.md | 89 ++++++++++++ docs/test_cases/t20024_sequence.svg | 172 +++++++++++++++++++++++ docs/test_cases/t20025.md | 69 ++++++++++ docs/test_cases/t20025_sequence.svg | 62 +++++++++ docs/test_cases/t20026.md | 49 +++++++ docs/test_cases/t20026_sequence.svg | 36 +++++ docs/test_cases/t30001_package.svg | 48 +++---- docs/test_cases/t30002_package.svg | 90 ++++++------ docs/test_cases/t30003_package.svg | 26 ++-- docs/test_cases/t30004_package.svg | 30 ++-- docs/test_cases/t30005_package.svg | 38 +++--- docs/test_cases/t30006_package.svg | 16 +-- docs/test_cases/t30007_package.svg | 20 +-- docs/test_cases/t30008_package.svg | 34 ++--- docs/test_cases/t40001_include.svg | 30 ++-- docs/test_cases/t40002_include.svg | 34 ++--- docs/test_cases/t40003_include.svg | 50 +++---- 90 files changed, 2839 insertions(+), 2359 deletions(-) create mode 100644 docs/test_cases/t20024.md create mode 100644 docs/test_cases/t20024_sequence.svg create mode 100644 docs/test_cases/t20025.md create mode 100644 docs/test_cases/t20025_sequence.svg create mode 100644 docs/test_cases/t20026.md create mode 100644 docs/test_cases/t20026_sequence.svg diff --git a/docs/test_cases.md b/docs/test_cases.md index 5a79d5a5..4eef86ab 100644 --- a/docs/test_cases.md +++ b/docs/test_cases.md @@ -73,6 +73,9 @@ * [t20021](./test_cases/t20021.md) - Loop statements sequence diagram test case * [t20022](./test_cases/t20022.md) - Forward class declaration sequence diagram test case * [t20023](./test_cases/t20023.md) - Try/catch statement sequence diagram test case + * [t20024](./test_cases/t20024.md) - Switch statement sequence diagram test case + * [t20025](./test_cases/t20025.md) - Skip decorator sequence diagram test case + * [t20026](./test_cases/t20026.md) - Virtual method call sequence diagram test case ## 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_class.svg b/docs/test_cases/t00002_class.svg index 613be62f..582fb14d 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ foo_c() = 0 : void - - + + B @@ -31,8 +31,8 @@ foo_a() : void - - + + C @@ -41,18 +41,18 @@ foo_c() : void - - + + D - + - + as : std::vector<A *> @@ -60,18 +60,18 @@ foo_a() : void foo_c() : void - - + + E - + - + as : std::vector<A *> @@ -79,13 +79,13 @@ foo_a() : void foo_c() : void - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index acc33b13..2ba67b73 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - + + A - + - + public_member : int - + - + protected_member : int - + - + private_member : int - + - + a_ : int - + - + b_ : int - + - + c_ : int - + - + static_int : int - + - + static_const_int : const int - + - + auto_member : const unsigned long @@ -112,11 +112,11 @@ protected_method() : void private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index fa9ffe9c..88b26a2b 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + B::AA @@ -28,8 +28,8 @@ AA_3 - - + + A @@ -40,16 +40,16 @@ foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -59,15 +59,15 @@ Red - - + + A::AA::AAA - + C::B @@ -75,8 +75,8 @@ int - - + + C @@ -84,39 +84,39 @@ T - + - + t : T - + - + b_int : B<int> - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -125,8 +125,8 @@ CCC_2 - - + + C::B @@ -134,16 +134,16 @@ V - + - + b : V - - + + C::CC @@ -152,16 +152,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -171,8 +171,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index f12defe8..52143048 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,204 +9,204 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & - + - + a : A - + - + b : B * - + - + c : C & - + - + d : const D * - + - + e : const E & - + - + f : F && - + - + g : G ** - + - + h : H *** - + - + i : I *& - + - + j : volatile J * - + - + k : K * diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index 7bedd26b..dec1f703 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,102 +162,102 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B *> - + - + c : std::map<int,C> - + - + d : std::map<int,D *> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G *>> - + - + h : std::array<H,10> - + - + i : std::array<I *,5> - + - - j : J[10] + + j : J [10] - + - + k : K *[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index ea8f76ff..e0ae1890 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index a97bcccf..d2a1346d 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P,CMP,int N - + - + value : T - + - + pointer : T * - + - + reference : T & - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,16 +70,16 @@ T - + - + values : std::vector<T> - - + + B @@ -87,15 +87,15 @@ T,C<> - + - + template_template : C<T> - + B @@ -103,18 +103,18 @@ int,Vector - - + + D - + - + ints : B<int,Vector> diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 8b881652..86df8539 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,32 +50,32 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 126b25af..98c2f1a8 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,18 +66,18 @@ int - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 81a94d72..ede1360f 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,16 +18,16 @@ T - + - + value : T - - + + A @@ -36,18 +36,18 @@ foo() : void - - + + B - + - + m_a : A * diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index e5ef6390..9e97661f 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T,Ts... - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,50 +107,50 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index c374df2b..7f2dc8a4 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,15 +18,15 @@ T - + - + f : T - + ABCD::F @@ -34,70 +34,70 @@ int - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int print(R * r) : void - - + + E @@ -105,16 +105,16 @@ T - + - + e : T - - + + G @@ -122,22 +122,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -145,7 +145,7 @@ int - + G @@ -153,7 +153,7 @@ int,float,std::string - + E @@ -161,25 +161,25 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index 8e2a78fa..d306bf0b 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,U - + A @@ -96,7 +96,7 @@ long,bool - + A @@ -104,7 +104,7 @@ double,bool - + A @@ -112,7 +112,7 @@ long,float - + A @@ -120,7 +120,7 @@ double,float - + A @@ -128,7 +128,7 @@ bool,std::string - + A @@ -136,7 +136,7 @@ float,std::unique_ptr<std::string> - + A @@ -144,7 +144,7 @@ int,std::string - + A @@ -152,7 +152,7 @@ std::string,std::string - + A @@ -160,7 +160,7 @@ char,std::string - + A @@ -168,116 +168,116 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> @@ -307,9 +307,9 @@ - + - + @@ -375,9 +375,9 @@ bstringstring - + - + diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index 67fe8166..8ef93f48 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index 9a7cb7e9..fd073814 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -29,8 +29,8 @@ value : enum - - + + is_numeric @@ -41,8 +41,8 @@ value : enum - - + + is_numeric @@ -53,8 +53,8 @@ value : enum - - + + is_numeric @@ -65,8 +65,8 @@ value : enum - - + + is_numeric @@ -77,8 +77,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 80c75b24..e0425b5f 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,127 +9,127 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index 80533a0e..d2bc545c 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,18 +9,18 @@ - - + + impl::widget - + - + n : int @@ -30,18 +30,18 @@ draw(const widget & w) : void widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 64906e43..133f349b 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Base @@ -25,8 +25,8 @@ m2() : std::string - - + + Layer1 @@ -39,8 +39,8 @@ m2() : std::string - - + + Layer2 @@ -51,8 +51,8 @@ all_calls_count() const : int - - + + Layer3 @@ -60,18 +60,18 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int @@ -83,7 +83,7 @@ m1_calls() const : int m2_calls() const : int - + Layer3 @@ -91,7 +91,7 @@ Base - + Layer2 @@ -99,7 +99,7 @@ Layer3<Base> - + Layer1 @@ -107,18 +107,18 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index 284e36c0..500735c2 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ProductA @@ -21,8 +21,8 @@ sell(int price) const = 0 : bool - - + + ProductA1 @@ -31,8 +31,8 @@ sell(int price) const : bool - - + + ProductA2 @@ -41,8 +41,8 @@ sell(int price) const : bool - - + + ProductB @@ -53,8 +53,8 @@ buy(int price) const = 0 : bool - - + + ProductB1 @@ -63,8 +63,8 @@ buy(int price) const : bool - - + + ProductB2 @@ -73,8 +73,8 @@ buy(int price) const : bool - - + + AbstractFactory @@ -85,8 +85,8 @@ make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 @@ -97,8 +97,8 @@ make_b() const : std::unique_ptr<ProductB> - - + + Factory2 diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 7950406b..59d6fea5 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Visitor @@ -23,8 +23,8 @@ visit_B(const B & item) const = 0 : void - - + + Visitor1 @@ -35,8 +35,8 @@ visit_B(const B & item) const : void - - + + Visitor2 @@ -47,8 +47,8 @@ visit_B(const B & item) const : void - - + + Visitor3 @@ -59,8 +59,8 @@ visit_B(const B & item) const : void - - + + Item @@ -71,8 +71,8 @@ accept(const Visitor & visitor) const = 0 : void - - + + A @@ -81,8 +81,8 @@ accept(const Visitor & visitor) const : void - - + + B diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index 201f37a4..9de0d842 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -23,8 +23,8 @@ method2() = 0 : void - - + + A1 @@ -35,8 +35,8 @@ method2() : void - - + + A2 diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index a1d10c5a..27736482 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Strategy @@ -21,8 +21,8 @@ algorithm() = 0 : void - - + + StrategyA @@ -31,8 +31,8 @@ algorithm() : void - - + + StrategyB @@ -41,8 +41,8 @@ algorithm() : void - - + + StrategyC @@ -51,18 +51,18 @@ algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 4c148da4..7a99d5a4 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target @@ -23,8 +23,8 @@ m2() = 0 : void - - + + Target1 @@ -35,8 +35,8 @@ m2() : void - - + + Target2 @@ -47,18 +47,18 @@ m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index e6573d42..bf636fc7 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target1 @@ -21,8 +21,8 @@ m2() : void - - + + Target2 @@ -33,8 +33,8 @@ m2() : void - - + + Proxy @@ -42,11 +42,11 @@ T - + - + m_target : std::shared_ptr<T> @@ -56,7 +56,7 @@ m1() : void m2() : void - + Proxy @@ -64,7 +64,7 @@ Target1 - + Proxy @@ -72,25 +72,25 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index 61eb19a9..332b024b 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,11 +18,11 @@ T - + - + m_value : T @@ -30,8 +30,8 @@ Memento<T>(T && v) : void value() const : T - - + + Originator @@ -39,11 +39,11 @@ T - + - + m_value : T @@ -57,8 +57,8 @@ print() const : void set(T && v) : void - - + + Caretaker @@ -66,11 +66,11 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> @@ -78,7 +78,7 @@ state(const std::string & n) : Memento<T> & set_state(const std::string & s, Memento<T> && m) : void - + Caretaker @@ -86,7 +86,7 @@ std::string - + Originator @@ -94,25 +94,25 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index 1aa8b630..ac5046fb 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Shape @@ -21,14 +21,14 @@ ~Shape() = default : void - + Line - - + + Line @@ -39,14 +39,14 @@ display() : void - + Text - - + + Text @@ -57,8 +57,8 @@ display() : void - - + + ShapeDecorator @@ -67,8 +67,8 @@ display() = 0 : void - - + + Color @@ -79,8 +79,8 @@ display() : void - - + + Weight @@ -91,7 +91,7 @@ display() : void - + Line @@ -99,7 +99,7 @@ Color,Weight - + Line @@ -107,7 +107,7 @@ Color - + Text @@ -115,7 +115,7 @@ Color,Weight - + Text @@ -123,39 +123,39 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index 1a8b4dd3..a4bd4195 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - + A class note. - - + + B - + B class note. - - + + C - + C class note. - - + + D - + D class note. - - + + E @@ -64,27 +64,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,10 +94,10 @@ three - + F enum note. - + E @@ -105,59 +105,59 @@ int - - + + R - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** R(C & c) : void - + R class note. diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index d7666360..f93be796 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,64 +45,64 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index 10b5566e..77bd5b54 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,86 +9,86 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + - + eee : E * diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index db5f4b08..f939782c 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,39 +71,39 @@ int - - + + R - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index 021c1663..3dbc28e1 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - + + Base - - + + TBase - - + + A @@ -35,8 +35,8 @@ operator()() : void - - + + B @@ -45,8 +45,8 @@ operator()() : void - - + + C @@ -55,8 +55,8 @@ operator()() : void - - + + Overload @@ -64,15 +64,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -80,18 +80,18 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index 85451eea..191acd79 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,18 +99,18 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index e5f39a01..91042970 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Void @@ -21,8 +21,8 @@ operator!=(const Void & ) const : bool - - + + lift_void @@ -31,16 +31,16 @@ - - + + lift_void - - + + lift_void @@ -49,8 +49,8 @@ - - + + drop_void @@ -59,16 +59,16 @@ - - + + drop_void - - + + drop_void @@ -77,33 +77,33 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 42a268da..d0ecfd98 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index 3dc39512..3c7cd294 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,23 +59,23 @@ int - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index ce064e03..1614ec38 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + - + @@ -9,114 +9,114 @@ - - - - - ST - - + + + + + ST + + - - - + + + - - dimensions : ST::(anonymous_620) + + dimensions : struct (anonymous struct at /home/bartek/devel/clang-uml-libtooling/tests/t00037/t00037.cc:6:5) - - - + + + - - units : ST::(anonymous_739) + + units : struct (anonymous struct at /home/bartek/devel/clang-uml-libtooling/tests/t00037/t00037.cc:14:5) - - - - - ST::(dimensions) - + + + + + ST::(dimensions) + - - - + + + - - t : double + + t : double - - - + + + - - x : double + + x : double - - - + + + - - y : double + + y : double - - - + + + - - z : double + + z : double - - - - - - ST::(units) - + + + + + + ST::(units) + - - - + + + - - c : double + + c : double - - - + + + - - h : double + + h : double - - - - - - A - + + + + + + A + - - - + + + - - st : ST + + st : ST - - - A() : void - - - - dimensions - - - - units - - - - st + + + A() : void + + + + dimensions + + + + units + + + + st diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index d208669c..f85704ef 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,16 +88,16 @@ - - + + map - - + + map @@ -106,8 +106,8 @@ - - + + map @@ -116,8 +116,8 @@ - - + + map @@ -126,8 +126,8 @@ - - + + map diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index 6cbf8dbb..0639fb45 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B * - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T * - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M * - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M * - - + + ns3::FFF @@ -156,11 +156,11 @@ T,M,N - + - + n : N * diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index cf994c58..cc095716 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - + + A - + - + ii_ : int get_a() : int - - + + AA - - + + AAA - + - + b : B * get_aaa() : int - - + + R diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index 80598cba..3f065d72 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,100 +9,100 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + e : E * - + - + f : F * - + - + g : detail::G * - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index 038586b2..049f841e 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + A @@ -35,16 +35,16 @@ void - + - + a : void * - - + + B @@ -52,22 +52,22 @@ T,K - + - + b : T - + - + bb : K - + A @@ -75,7 +75,7 @@ double - + A @@ -83,7 +83,7 @@ std::string - + B diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index 2065c0c8..f9f24de5 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - + dependants - + dependencies - - + + A - - + + B @@ -33,8 +33,8 @@ b(dependants::A * a) : void - - + + BB @@ -43,8 +43,8 @@ bb(dependants::A * a) : void - - + + C @@ -53,8 +53,8 @@ c(dependants::B * b) : void - - + + D @@ -65,8 +65,8 @@ dd(dependants::BB * bb) : void - - + + E @@ -75,24 +75,24 @@ e(dependants::D * d) : void - - + + G - - + + GG - - + + H @@ -103,8 +103,8 @@ hh(dependencies::GG * gg) : void - - + + I @@ -113,8 +113,8 @@ i(dependencies::H * h) : void - - + + J diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index c25edcbc..f1cc682e 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,7 +9,7 @@ - + signal_handler @@ -17,8 +17,8 @@ ,A - - + + sink @@ -27,15 +27,15 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + sink @@ -46,23 +46,23 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + signal_handler - - + + signal_handler @@ -71,8 +71,8 @@ - - + + signal_handler @@ -81,8 +81,8 @@ - - + + sink diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index f7fd6dec..259f32c1 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - + + A - - + + AA - - + + AAA - - + + AAAA @@ -42,103 +42,103 @@ T - + - + t : T - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::AAA - - + + ns1::ns2::R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index c24421c8..19cb5ee0 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - + ns1 - + ns2 - + __gnu_cxx - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - + - + i : std::vector<std::uint8_t> foo(AA & aa) : void - - + + A - - + + AA diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index d9c3a32f..e237ad5d 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + conditional_t - - + + conditional_t @@ -27,8 +27,8 @@ - - + + conditional_t @@ -37,8 +37,8 @@ - - + + conditional_t @@ -47,8 +47,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index 81bb6b39..dbd8ce2c 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + Base - + - + base : int foo() = 0 : void - - + + BaseTemplate @@ -35,35 +35,35 @@ T - + - + base : T foo() = 0 : void - - + + B - + - + b : int foo() : void - - + + BTemplate @@ -71,35 +71,35 @@ T - + - + b : T foo() : void - - + + A - + - + a : int foo() : void - - + + ATemplate @@ -107,11 +107,11 @@ T - + - + a : T diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index f2776219..737756b1 100644 --- a/docs/test_cases/t00049_class.svg +++ b/docs/test_cases/t00049_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,17 +18,17 @@ T - + - + a : T get_a() : T & - + A @@ -36,7 +36,7 @@ intmap - + A @@ -44,7 +44,7 @@ thestring - + A @@ -52,32 +52,32 @@ std::vector<thestring> - - + + R - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> - + - + a_int_map : A<intmap> diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index a34fb8c1..5eb61587 100644 --- a/docs/test_cases/t00050_class.svg +++ b/docs/test_cases/t00050_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + utils::D - - + + E @@ -52,8 +52,8 @@ E3 - - + + F @@ -61,44 +61,44 @@ T,V,int N - + - - t : T[N] + + t : T [N] - + - + v : V - - + + G - - + + NoComment - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula class ultricies mollis dictumst, aenean non a in donec nulla. @@ -125,50 +125,50 @@ imperdiet praesent magnis ridiculus congue gravida curabitur dictum sagittis, enim et magna sit inceptos sodales parturient pharetra mollis, aenean vel nostra tellus commodo pretium sapien sociosqu. - + This is a short description of class G. - + This is an intermediate description of class G. - + This is a long description of class G. - + Lorem ipsum - + TODO 1. Write meaningful comment - + TODO 2. Write tests - + TODO 3. Implement - + Long comment example - + TODO Implement... - + Simple array wrapper. - + Template parameters diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index f8a8126e..b494d5cb 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,59 +9,59 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - + + + + + + + + add(int,int) - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -72,7 +72,7 @@ - + @@ -81,14 +81,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index c280397c..b83b058e 100644 --- a/docs/test_cases/t20002_sequence.svg +++ b/docs/test_cases/t20002_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1() - + m1() - - + + m2() - + m2() - - + + m3() - + m3() - - + + m4() - + m4() - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20003_sequence.svg b/docs/test_cases/t20003_sequence.svg index 3c2c1d34..dc8be19f 100644 --- a/docs/test_cases/t20003_sequence.svg +++ b/docs/test_cases/t20003_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1<T>(T) - + m1<T>(T) - - + + m2<T>(T) - + m2<T>(T) - - + + m3<T>(T) - + m3<T>(T) - - + + m4<T>(T) - + m4<T>(T) - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20004_sequence.svg b/docs/test_cases/t20004_sequence.svg index c3f0fc8c..e8c17620 100644 --- a/docs/test_cases/t20004_sequence.svg +++ b/docs/test_cases/t20004_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -29,87 +29,87 @@ - - + + main() - + main() - - + + m1<float>(float) - + m1<float>(float) - - + + m1<unsigned long>(unsigned long) - + m1<unsigned long>(unsigned long) - - + + m4<unsigned long>(unsigned long) - + m4<unsigned long>(unsigned long) - - + + m1<std::string>(std::string) - + m1<std::string>(std::string) - - + + m2<std::string>(std::string) - + m2<std::string>(std::string) - - + + m1<int>(int) - + m1<int>(int) - - + + m2<int>(int) - + m2<int>(int) - - + + m3<int>(int) - + m3<int>(int) - - + + m4<int>(int) - + m4<int>(int) - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -117,11 +117,11 @@ - + - + @@ -129,19 +129,19 @@ - + - + - + - + diff --git a/docs/test_cases/t20005_sequence.svg b/docs/test_cases/t20005_sequence.svg index 1eb5e6f9..dc23c7c8 100644 --- a/docs/test_cases/t20005_sequence.svg +++ b/docs/test_cases/t20005_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - + + + - - + + C<T> - + C<T> - - + + B<T> - + B<T> - - + + A<T> - + A<T> - - - + + + c(T) - + b(T) - + a(T) diff --git a/docs/test_cases/t20006_sequence.svg b/docs/test_cases/t20006_sequence.svg index 6a79231c..21b9641d 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -34,82 +34,82 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -118,12 +118,12 @@ - + b(std::string) - + a2(std::string) @@ -132,59 +132,59 @@ - + bb1(int,int) - + aa1(int) - + bb2(int,int) - + aa2(int) - + bb1(int,std::string) - + aa2(int) - + bb2(int,std::string) - + aa1(int) - + bb1(int,float) - + bb2(int,float) - + aa2(int) diff --git a/docs/test_cases/t20007_sequence.svg b/docs/test_cases/t20007_sequence.svg index 49d3e383..552e8df6 100644 --- a/docs/test_cases/t20007_sequence.svg +++ b/docs/test_cases/t20007_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + Adder<int,int> - + Adder<int,int> - - + + Adder<int,float,double> - + Adder<int,float,double> - - + + Adder<std::string,std::string,std::string> - + Adder<std::string,std::string,std::string> - - - - - + + + + + add(int &&,int &&) - + add(int &&,float &&,double &&) - + add(std::string &&,std::string &&,std::string &&) diff --git a/docs/test_cases/t20008_sequence.svg b/docs/test_cases/t20008_sequence.svg index 2805cb25..59aa592c 100644 --- a/docs/test_cases/t20008_sequence.svg +++ b/docs/test_cases/t20008_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<const char *> - + B<const char *> - - + + A<const char *> - + A<const char *> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - - - - - - - + + + + + + + + b(int) - + a1(int) - + b(const char *) - + a2(const char *) - + b(std::string) - + a3(std::string) diff --git a/docs/test_cases/t20009_sequence.svg b/docs/test_cases/t20009_sequence.svg index 1f6dfbb6..4cf2bfdc 100644 --- a/docs/test_cases/t20009_sequence.svg +++ b/docs/test_cases/t20009_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<float> - + B<float> - - + + A<float> - + A<float> - - - - - - - - + + + + + + + + b(std::string) - + a(std::string) - + b(int) - + a(int) - + b(float) - + a(float) diff --git a/docs/test_cases/t20010_sequence.svg b/docs/test_cases/t20010_sequence.svg index 88749f93..bc854834 100644 --- a/docs/test_cases/t20010_sequence.svg +++ b/docs/test_cases/t20010_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A - + A - - - - - - - - - - + + + + + + + + + + b1() - + a1() - + b2() - + a2() - + b3() - + a3() - + b4() - + a4() diff --git a/docs/test_cases/t20011_sequence.svg b/docs/test_cases/t20011_sequence.svg index d18be928..555e6ef7 100644 --- a/docs/test_cases/t20011_sequence.svg +++ b/docs/test_cases/t20011_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - + + + + + + + + + + a(int) @@ -52,26 +52,26 @@ alt - + a(int) - + b(int) - + c(int) - + @@ -81,14 +81,14 @@ alt - + b(int) - + @@ -98,7 +98,7 @@ alt - + diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index 5a2ffd48..7dabd992 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,122 +43,122 @@ - - + + tmain() - + tmain() - - + + tmain()::(lambda t20012.cc:66:20) - + tmain()::(lambda t20012.cc:66:20) - - + + A - + A - - + + B - + B - - + + tmain()::(lambda t20012.cc:79:20) - + tmain()::(lambda t20012.cc:79:20) - - + + C - + C - - + + R<R::(lambda t20012.cc:85:9)> - + R<R::(lambda t20012.cc:85:9)> - - + + tmain()::(lambda t20012.cc:85:9) - + tmain()::(lambda t20012.cc:85:9) - - + + D - + D - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -167,67 +167,67 @@ - + operator()() - + c() - + cc() - + ccc() - + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -238,29 +238,29 @@ - + r() - + operator()() - + c() - + cc() - + @@ -269,7 +269,7 @@ - + add5(int) diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index 8ac9c469..b516177f 100644 --- a/docs/test_cases/t20013_sequence.svg +++ b/docs/test_cases/t20013_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -58,12 +58,12 @@ - + b(double) - + a2(double) @@ -72,12 +72,12 @@ - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20014_sequence.svg b/docs/test_cases/t20014_sequence.svg index fd65ccbd..b3c3a70d 100644 --- a/docs/test_cases/t20014_sequence.svg +++ b/docs/test_cases/t20014_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - - - - - - - + + + + + + + + - - + + tmain() - + tmain() - - + + B - + B - - + + A - + A - - + + C<B,int> - + C<B,int> - - - - - - - - - + + + + + + + + + b1(int,int) - + a1(int,int) @@ -67,12 +67,12 @@ - + b2(int,int) - + a2(int,int) @@ -81,17 +81,17 @@ - + c1(int,int) - + b1(int,int) - + a1(int,int) diff --git a/docs/test_cases/t20015_sequence.svg b/docs/test_cases/t20015_sequence.svg index 7bea4365..fbfcfbc5 100644 --- a/docs/test_cases/t20015_sequence.svg +++ b/docs/test_cases/t20015_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + B - + B - - - + + + setup_a(std::shared_ptr<detail::A> &) diff --git a/docs/test_cases/t20016_sequence.svg b/docs/test_cases/t20016_sequence.svg index b25d199d..0ba06d55 100644 --- a/docs/test_cases/t20016_sequence.svg +++ b/docs/test_cases/t20016_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + B<long> - + B<long> - - + + A - + A - - - - - - + + + + + + b1(long) - + a1(int) - + b2(long) - + a2(const long &) diff --git a/docs/test_cases/t20017_sequence.svg b/docs/test_cases/t20017_sequence.svg index 50cafe24..bdb675d5 100644 --- a/docs/test_cases/t20017_sequence.svg +++ b/docs/test_cases/t20017_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,65 +9,65 @@ - - - - - - + + + + + + - + t20017.cc - + t20017.cc - + include/t20017_b.h - + include/t20017_b.h - + include/t20017_a.h - + include/t20017_a.h - - - - - - + + + + + + tmain() - + b2<int>(int,int) - + a1(int,int) - + a2(int,int) - + a3(int,int) - + b1(int,int) diff --git a/docs/test_cases/t20018_sequence.svg b/docs/test_cases/t20018_sequence.svg index 96e078a7..0bcd232c 100644 --- a/docs/test_cases/t20018_sequence.svg +++ b/docs/test_cases/t20018_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + @@ -25,93 +25,93 @@ - - + + tmain() - + tmain() - - + + Answer<Factorial<5>,120> - + Answer<Factorial<5>,120> - - + + Factorial<5> - + Factorial<5> - - + + Factorial<4> - + Factorial<4> - - + + Factorial<3> - + Factorial<3> - - + + Factorial<2> - + Factorial<2> - - + + Factorial<1> - + Factorial<1> - - + + Factorial<0> - + Factorial<0> - - - - - - - - - + + + + + + + + + print() - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) diff --git a/docs/test_cases/t20019_sequence.svg b/docs/test_cases/t20019_sequence.svg index afaa9ad0..74dbc7a2 100644 --- a/docs/test_cases/t20019_sequence.svg +++ b/docs/test_cases/t20019_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + Base<D1> - + Base<D1> - - + + D1 - + D1 - - + + Base<D2> - + Base<D2> - - + + D2 - + D2 - - - - - - - - - - + + + + + + + + + + name() - + impl() - + name() - + impl() - + name() - + impl() - + name() - + impl() diff --git a/docs/test_cases/t20020_sequence.svg b/docs/test_cases/t20020_sequence.svg index a21591a9..29eae3e2 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,78 +9,78 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + C - + C - - + + B - + B - - + + D<int> - + D<int> - - - - - - - - - - - - - + + + + + + + + + + + + + alt - + a1() @@ -91,7 +91,7 @@ alt - + [ @@ -100,7 +100,7 @@ - + [ @@ -109,7 +109,7 @@ - + b1() @@ -117,7 +117,7 @@ - + [ @@ -126,21 +126,21 @@ - + b2() - + a4() - + log() @@ -148,7 +148,7 @@ alt - + c1() @@ -156,7 +156,7 @@ alt - + @@ -169,7 +169,7 @@ - + @@ -179,7 +179,7 @@ alt - + d1(int,int) diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index 6619f3d9..7d5d9967 100644 --- a/docs/test_cases/t20021_sequence.svg +++ b/docs/test_cases/t20021_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + C - + C - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + loop - + [ c4() ] - + @@ -89,7 +89,7 @@ - + a3() @@ -102,7 +102,7 @@ loop - + [ @@ -111,7 +111,7 @@ - + [ @@ -120,7 +120,7 @@ - + [ @@ -129,14 +129,14 @@ - + a1() - + c3() @@ -146,7 +146,7 @@ loop - + b2() @@ -156,7 +156,7 @@ loop - + [ @@ -165,7 +165,7 @@ - + b2() diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index a86df828..2f23e62e 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - + + + + a() - + b() diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg index bc7d9ec3..a65ee414 100644 --- a/docs/test_cases/t20023_sequence.svg +++ b/docs/test_cases/t20023_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,37 +9,37 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - + + + + + + + a() @@ -47,7 +47,7 @@ try - + @@ -60,7 +60,7 @@ [std::runtime_error &] - + @@ -73,7 +73,7 @@ [std::logic_error &] - + @@ -86,7 +86,7 @@ [...] - + diff --git a/docs/test_cases/t20024.md b/docs/test_cases/t20024.md new file mode 100644 index 00000000..5e439a97 --- /dev/null +++ b/docs/test_cases/t20024.md @@ -0,0 +1,89 @@ +# t20024 - Switch statement sequence diagram test case +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t20024_sequence: + type: sequence + glob: + - ../../tests/t20024/t20024.cc + include: + namespaces: + - clanguml::t20024 + using_namespace: + - clanguml::t20024 + start_from: + - function: "clanguml::t20024::tmain()" +``` +## Source code +File t20024.cc +```cpp +namespace clanguml { +namespace t20024 { + +enum enum_a { zero = 0, one = 1, two = 2, three = 3 }; + +enum class colors { red, orange, green }; + +struct A { + int select(enum_a v) + { + switch (v) { + case zero: + return a0(); + case one: + return a1(); + case two: + return a2(); + default: + return a3(); + } + } + + int a0() { return 0; } + int a1() { return 1; } + int a2() { return 2; } + int a3() { return 3; } +}; + +struct B { + void select(colors c) + { + switch (c) { + case colors::red: + red(); + break; + case colors::orange: + orange(); + break; + case colors::green: + green(); + break; + default: + grey(); + } + } + + void red() { } + void orange() { } + void green() { } + void grey() { } +}; + +int tmain() +{ + A a; + B b; + + a.select(enum_a::two); + + b.select(colors::green); + + return 0; +} +} +} +``` +## Generated UML diagrams +![t20024_sequence](./t20024_sequence.svg "Switch statement sequence diagram test case") diff --git a/docs/test_cases/t20024_sequence.svg b/docs/test_cases/t20024_sequence.svg new file mode 100644 index 00000000..278fc654 --- /dev/null +++ b/docs/test_cases/t20024_sequence.svg @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + A + + A + + + + B + + B + + + + + + + + + + + + + + + + select(enum_a) + + + + switch + + [zero] + + + + + + a0() + + + + + + + [one] + + + + + + a1() + + + + + + + [two] + + + + + + a2() + + + + + + + [default] + + + + + + a3() + + + + + + + + + + + select(colors) + + + + switch + + [enum colors::red] + + + + + + red() + + + [enum colors::orange] + + + + + + orange() + + + [enum colors::green] + + + + + + green() + + + [default] + + + + + + grey() + + + diff --git a/docs/test_cases/t20025.md b/docs/test_cases/t20025.md new file mode 100644 index 00000000..f5e9601a --- /dev/null +++ b/docs/test_cases/t20025.md @@ -0,0 +1,69 @@ +# t20025 - Skip decorator sequence diagram test case +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t20025_sequence: + type: sequence + glob: + - ../../tests/t20025/t20025.cc + include: + namespaces: + - clanguml::t20025 + using_namespace: + - clanguml::t20025 + start_from: + - function: "clanguml::t20025::tmain()" +``` +## Source code +File t20025.cc +```cpp +namespace clanguml { +namespace t20025 { + +int add(int x, int y) { return x + y; } + +/// Add 2 numbers +/// +/// \param x +/// \param y +/// \return +/// \uml{skip} +int add2(int x, int y) { return x + x + y + y; } + +struct A { + int a() + { + /// TODO: this doesn't work yet... + /// \uml{skip} + a2(); + + return a1(); + } + + /// \uml{skip} + int a1() { return 1; } + + void a2() { } +}; + +int tmain() +{ + A a; + + int result{}; + + result = a.a(); + + result += add(1, 2); + + result += add2(2, 4); + + return result; +} +} +} +``` +## Generated UML diagrams +![t20025_sequence](./t20025_sequence.svg "Skip decorator sequence diagram test case") diff --git a/docs/test_cases/t20025_sequence.svg b/docs/test_cases/t20025_sequence.svg new file mode 100644 index 00000000..3d7383d1 --- /dev/null +++ b/docs/test_cases/t20025_sequence.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + A + + A + + + + add(int,int) + + add(int,int) + + + + + + + + + a() + + + + + + + a2() + + + + + + + + + + + diff --git a/docs/test_cases/t20026.md b/docs/test_cases/t20026.md new file mode 100644 index 00000000..6bba6e41 --- /dev/null +++ b/docs/test_cases/t20026.md @@ -0,0 +1,49 @@ +# t20026 - Virtual method call sequence diagram test case +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t20026_sequence: + type: sequence + glob: + - ../../tests/t20026/t20026.cc + include: + namespaces: + - clanguml::t20026 + using_namespace: + - clanguml::t20026 + start_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 UML diagrams +![t20026_sequence](./t20026_sequence.svg "Virtual method call sequence diagram test case") diff --git a/docs/test_cases/t20026_sequence.svg b/docs/test_cases/t20026_sequence.svg new file mode 100644 index 00000000..50a6d35b --- /dev/null +++ b/docs/test_cases/t20026_sequence.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + A + + A + + + + + + + a() + + + diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 35256129..b386e989 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,63 +9,63 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index 2667be0e..5ca9e897 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,113 +9,113 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + BBB diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index f69f7b66..8564a197 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,35 +9,35 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index 0a865f6d..3b208b5c 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index 9ee117f0..a68f1136 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,48 +9,48 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index e51949f4..e898c8fd 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - + + B - - + + A - - + + C - + Top A note. diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index 896b82de..92b73f0a 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,27 +9,27 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index 40fcfde5..da372e64 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index b7a5da51..119c9d66 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + yaml-cpp/yaml.h - + This is a lib1 include dir - + This is a t40001_include1.h include file diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 5f188590..6461ed7b 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index 315e41cc..a4a20d6f 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - + include - + dependants - + dependencies - + src - + dependants - + dependencies - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h - - + + t1.cc - - + + t2.cc From 0d15d09de29c8cce5e77ccc170147d7349005a34 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 14 Dec 2022 22:00:27 +0100 Subject: [PATCH 10/19] Added test case for filtering methods based on access specifier in sequence diagrams --- .../visitor/translation_unit_visitor.cc | 38 ++++------------ src/common/clang_utils.cc | 21 +++++++++ src/common/clang_utils.h | 3 ++ .../visitor/translation_unit_visitor.cc | 4 ++ tests/t20027/.clang-uml | 16 +++++++ tests/t20027/t20027.cc | 22 ++++++++++ tests/t20027/test_case.h | 44 +++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 ++ 9 files changed, 122 insertions(+), 30 deletions(-) create mode 100644 tests/t20027/.clang-uml create mode 100644 tests/t20027/t20027.cc create mode 100644 tests/t20027/test_case.h diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index 3aff1883..59cefb23 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -41,28 +41,6 @@ using clanguml::common::model::namespace_; using clanguml::common::model::relationship; using clanguml::common::model::relationship_t; -namespace detail { -access_t access_specifier_to_access_t(clang::AccessSpecifier access_specifier) -{ - auto access = access_t::kPublic; - switch (access_specifier) { - case clang::AccessSpecifier::AS_public: - access = access_t::kPublic; - break; - case clang::AccessSpecifier::AS_private: - access = access_t::kPrivate; - break; - case clang::AccessSpecifier::AS_protected: - access = access_t::kProtected; - break; - default: - break; - } - - return access; -} -} - translation_unit_visitor::translation_unit_visitor(clang::SourceManager &sm, clanguml::class_diagram::model::diagram &diagram, const clanguml::config::class_diagram &config) @@ -668,7 +646,7 @@ void translation_unit_visitor::process_class_bases( cp.is_virtual(base.isVirtual()); cp.set_access( - detail::access_specifier_to_access_t(base.getAccessSpecifier())); + common::access_specifier_to_access_t(base.getAccessSpecifier())); LOG_DBG("Found base class {} [{}] for class {}", cp.name(), cp.id(), c.name()); @@ -725,7 +703,7 @@ void translation_unit_visitor::process_template_specialization_children( if (enum_decl->getNameAsString().empty()) { for (const auto *enum_const : enum_decl->enumerators()) { - class_member m{detail::access_specifier_to_access_t( + class_member m{common::access_specifier_to_access_t( enum_decl->getAccess()), enum_const->getNameAsString(), "enum"}; c.add_member(std::move(m)); @@ -787,7 +765,7 @@ void translation_unit_visitor::process_class_children( if (enum_decl->getNameAsString().empty()) { for (const auto *enum_const : enum_decl->enumerators()) { - class_member m{detail::access_specifier_to_access_t( + class_member m{common::access_specifier_to_access_t( enum_decl->getAccess()), enum_const->getNameAsString(), "enum"}; c.add_member(std::move(m)); @@ -818,7 +796,7 @@ void translation_unit_visitor::process_friend( if (diagram().should_include(friend_type_name)) { relationship r{relationship_t::kFriendship, common::to_id(*friend_type->getAsRecordDecl()), - detail::access_specifier_to_access_t(f.getAccess()), + common::access_specifier_to_access_t(f.getAccess()), "<>"}; c.add_relationship(std::move(r)); @@ -835,7 +813,7 @@ void translation_unit_visitor::process_method( if (mf.isDefaulted() && !mf.isExplicitlyDefaulted()) return; - class_method method{detail::access_specifier_to_access_t(mf.getAccess()), + class_method method{common::access_specifier_to_access_t(mf.getAccess()), util::trim(mf.getNameAsString()), common::to_string(mf.getReturnType(), mf.getASTContext())}; @@ -869,7 +847,7 @@ void translation_unit_visitor::process_template_method( !mf.getTemplatedDecl()->isExplicitlyDefaulted()) return; - class_method method{detail::access_specifier_to_access_t(mf.getAccess()), + class_method method{common::access_specifier_to_access_t(mf.getAccess()), util::trim(mf.getNameAsString()), mf.getTemplatedDecl()->getReturnType().getAsString()}; @@ -1133,7 +1111,7 @@ void translation_unit_visitor::process_static_field( type_name = "<>"; class_member field{ - detail::access_specifier_to_access_t(field_declaration.getAccess()), + common::access_specifier_to_access_t(field_declaration.getAccess()), field_declaration.getNameAsString(), type_name}; field.is_static(true); @@ -1981,7 +1959,7 @@ void translation_unit_visitor::process_field( const auto field_name = field_declaration.getNameAsString(); class_member field{ - detail::access_specifier_to_access_t(field_declaration.getAccess()), + common::access_specifier_to_access_t(field_declaration.getAccess()), field_name, common::to_string( field_type, field_declaration.getASTContext(), false)}; diff --git a/src/common/clang_utils.cc b/src/common/clang_utils.cc index 45c95493..c8f93d50 100644 --- a/src/common/clang_utils.cc +++ b/src/common/clang_utils.cc @@ -22,6 +22,27 @@ namespace clanguml::common { +model::access_t access_specifier_to_access_t( + clang::AccessSpecifier access_specifier) +{ + auto access = model::access_t::kPublic; + switch (access_specifier) { + case clang::AccessSpecifier::AS_public: + access = model::access_t::kPublic; + break; + case clang::AccessSpecifier::AS_private: + access = model::access_t::kPrivate; + break; + case clang::AccessSpecifier::AS_protected: + access = model::access_t::kProtected; + break; + default: + break; + } + + return access; +} + std::optional get_enclosing_namespace( const clang::DeclContext *decl) { diff --git a/src/common/clang_utils.h b/src/common/clang_utils.h index 09441e3c..5007bf9a 100644 --- a/src/common/clang_utils.h +++ b/src/common/clang_utils.h @@ -31,6 +31,9 @@ class NamespaceDecl; } namespace clanguml::common { +model::access_t access_specifier_to_access_t( + clang::AccessSpecifier access_specifier); + std::string get_tag_name(const clang::TagDecl &declaration); template std::string get_qualified_name(const T &declaration) diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index c5d34d77..3081677a 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -991,6 +991,10 @@ bool translation_unit_visitor::process_class_method_call_expression( diagram().should_include(callee_decl->getQualifiedNameAsString()))) return false; + if (!diagram().should_include( + common::access_specifier_to_access_t(method_decl->getAccess()))) + return false; + m.set_to(method_decl->getID()); m.set_message_name(method_decl->getNameAsString()); m.set_return_type( diff --git a/tests/t20027/.clang-uml b/tests/t20027/.clang-uml new file mode 100644 index 00000000..a107bba2 --- /dev/null +++ b/tests/t20027/.clang-uml @@ -0,0 +1,16 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t20027_sequence: + type: sequence + glob: + - ../../tests/t20027/t20027.cc + include: + namespaces: + - clanguml::t20027 + access: + - public + using_namespace: + - clanguml::t20027 + start_from: + - function: "clanguml::t20027::tmain()" \ No newline at end of file diff --git a/tests/t20027/t20027.cc b/tests/t20027/t20027.cc new file mode 100644 index 00000000..e3ac5375 --- /dev/null +++ b/tests/t20027/t20027.cc @@ -0,0 +1,22 @@ +namespace clanguml { +namespace t20027 { + +class A { +public: + void a() { aa(); } + +protected: + void aa() { aaa(); } + +private: + void aaa() { } +}; + +void tmain() +{ + A a; + + a.a(); +} +} +} \ No newline at end of file diff --git a/tests/t20027/test_case.h b/tests/t20027/test_case.h new file mode 100644 index 00000000..70c54825 --- /dev/null +++ b/tests/t20027/test_case.h @@ -0,0 +1,44 @@ +/** + * tests/t20027/test_case.h + * + * Copyright (c) 2021-2022 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("t20027", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20027"); + + auto diagram = config.diagrams["t20027_sequence"]; + + REQUIRE(diagram->name == "t20027_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20027_sequence"); + + auto puml = generate_sequence_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "aa()")); + REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "aaa()")); + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index e3492193..b4fca775 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -273,6 +273,7 @@ using namespace clanguml::test::matchers; #include "t20024/test_case.h" #include "t20025/test_case.h" #include "t20026/test_case.h" +#include "t20027/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index f660db17..0c59ebca 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -226,6 +226,9 @@ test_cases: - name: t20026 title: Virtual method call sequence diagram test case description: + - name: t20027 + title: Filter call expressions based on access test case + description: Package diagrams: - name: t30001 title: Basic package diagram test case From 1a82e46d7dda2dc3525be0a1d9ea5b86a322c77c Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 14 Dec 2022 23:58:38 +0100 Subject: [PATCH 11/19] Added support for ternary conditional operator in sequence diagrams --- src/common/model/enums.cc | 4 ++ src/common/model/enums.h | 2 + .../plantuml/sequence_diagram_generator.cc | 9 ++++ src/sequence_diagram/model/diagram.cc | 46 +++++++++++++++++++ src/sequence_diagram/model/diagram.h | 7 +++ .../visitor/call_expression_context.cc | 28 +++++++++++ .../visitor/call_expression_context.h | 5 ++ .../visitor/translation_unit_visitor.cc | 31 +++++++++++++ .../visitor/translation_unit_visitor.h | 2 + tests/t20028/.clang-uml | 17 +++++++ tests/t20028/t20028.cc | 31 +++++++++++++ tests/t20028/test_case.h | 46 +++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 ++ 14 files changed, 232 insertions(+) create mode 100644 tests/t20028/.clang-uml create mode 100644 tests/t20028/t20028.cc create mode 100644 tests/t20028/test_case.h diff --git a/src/common/model/enums.cc b/src/common/model/enums.cc index cb1685a2..b984f26a 100644 --- a/src/common/model/enums.cc +++ b/src/common/model/enums.cc @@ -106,6 +106,10 @@ std::string to_string(message_t r) return "case"; case message_t::kSwitchEnd: return "end switch"; + case message_t::kConditional: + return "conditional"; + case message_t::kConditionalEnd: + return "end conditional"; default: assert(false); return ""; diff --git a/src/common/model/enums.h b/src/common/model/enums.h index 463ec56d..e73d92e6 100644 --- a/src/common/model/enums.h +++ b/src/common/model/enums.h @@ -59,6 +59,8 @@ enum class message_t { kSwitch, kCase, kSwitchEnd, + kConditional, + kConditionalEnd, kNone }; diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc index ba6938f2..a88ee3b1 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -208,6 +208,15 @@ void generator::generate_activity(const activity &a, std::ostream &ostr, else if (m.type() == message_t::kSwitchEnd) { ostr << "end\n"; } + else if (m.type() == message_t::kConditional) { + ostr << "alt\n"; + } + else if (m.type() == message_t::kElse) { + ostr << "else\n"; + } + else if (m.type() == message_t::kConditionalEnd) { + ostr << "end\n"; + } } } diff --git a/src/sequence_diagram/model/diagram.cc b/src/sequence_diagram/model/diagram.cc index 28067a7b..de7b7980 100644 --- a/src/sequence_diagram/model/diagram.cc +++ b/src/sequence_diagram/model/diagram.cc @@ -348,6 +348,52 @@ void diagram::add_default_stmt( } } +void diagram::add_conditional_stmt( + const common::model::diagram_element::id_t current_caller_id) +{ + using clanguml::common::model::message_t; + + if (sequences_.find(current_caller_id) == sequences_.end()) { + activity a{current_caller_id}; + sequences_.insert({current_caller_id, std::move(a)}); + } + + get_activity(current_caller_id) + .add_message({message_t::kConditional, current_caller_id}); +} + +void diagram::add_conditional_elsestmt( + const common::model::diagram_element::id_t current_caller_id) +{ + using clanguml::common::model::message_t; + + get_activity(current_caller_id) + .add_message({message_t::kElse, current_caller_id}); +} + +void diagram::end_conditional_stmt( + const common::model::diagram_element::id_t current_caller_id) +{ + using clanguml::common::model::message_t; + + message m{message_t::kConditionalEnd, current_caller_id}; + + if (sequences_.find(current_caller_id) != sequences_.end()) { + auto ¤t_messages = get_activity(current_caller_id).messages(); + + if (current_messages.at(current_messages.size() - 1).type() == + message_t::kElse && + current_messages.at(current_messages.size() - 2).type() == + message_t::kConditional) { + current_messages.pop_back(); + current_messages.pop_back(); + } + else { + current_messages.emplace_back(std::move(m)); + } + } +} + bool diagram::started() const { return started_; } void diagram::started(bool s) { started_ = s; } diff --git a/src/sequence_diagram/model/diagram.h b/src/sequence_diagram/model/diagram.h index 70c065f4..439bea41 100644 --- a/src/sequence_diagram/model/diagram.h +++ b/src/sequence_diagram/model/diagram.h @@ -112,6 +112,13 @@ public: void add_default_stmt( common::model::diagram_element::id_t current_caller_id); + void add_conditional_stmt( + common::model::diagram_element::id_t current_caller_id); + void add_conditional_elsestmt( + common::model::diagram_element::id_t current_caller_id); + void end_conditional_stmt( + common::model::diagram_element::id_t current_caller_id); + bool started() const; void started(bool s); diff --git a/src/sequence_diagram/visitor/call_expression_context.cc b/src/sequence_diagram/visitor/call_expression_context.cc index 67f73a65..10990308 100644 --- a/src/sequence_diagram/visitor/call_expression_context.cc +++ b/src/sequence_diagram/visitor/call_expression_context.cc @@ -283,6 +283,27 @@ void call_expression_context::leave_switchstmt() switch_stmt_stack_.pop(); } +clang::ConditionalOperator * +call_expression_context::current_conditionaloperator() const +{ + if (conditional_operator_stack_.empty()) + return nullptr; + + return conditional_operator_stack_.top(); +} + +void call_expression_context::enter_conditionaloperator( + clang::ConditionalOperator *stmt) +{ + conditional_operator_stack_.push(stmt); +} + +void call_expression_context::leave_conditionaloperator() +{ + if (conditional_operator_stack_.empty()) + conditional_operator_stack_.pop(); +} + bool call_expression_context::is_expr_in_current_control_statement_condition( const clang::Stmt *stmt) const { @@ -334,6 +355,13 @@ bool call_expression_context::is_expr_in_current_control_statement_condition( return true; } } + + if (current_conditionaloperator()) { + if (common::is_subexpr_of( + current_conditionaloperator()->getCond(), stmt)) { + return true; + } + } } return false; diff --git a/src/sequence_diagram/visitor/call_expression_context.h b/src/sequence_diagram/visitor/call_expression_context.h index 913b0e7a..a1c247a2 100644 --- a/src/sequence_diagram/visitor/call_expression_context.h +++ b/src/sequence_diagram/visitor/call_expression_context.h @@ -88,6 +88,10 @@ struct call_expression_context { void enter_switchstmt(clang::SwitchStmt *stmt); void leave_switchstmt(); + clang::ConditionalOperator *current_conditionaloperator() const; + void enter_conditionaloperator(clang::ConditionalOperator *stmt); + void leave_conditionaloperator(); + bool is_expr_in_current_control_statement_condition( const clang::Stmt *stmt) const; @@ -110,6 +114,7 @@ private: std::stack loop_stmt_stack_; std::stack try_stmt_stack_; std::stack switch_stmt_stack_; + std::stack conditional_operator_stack_; }; } \ No newline at end of file diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 3081677a..af73c10e 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -807,6 +807,37 @@ bool translation_unit_visitor::TraverseDefaultStmt(clang::DefaultStmt *stmt) return true; } +bool translation_unit_visitor::TraverseConditionalOperator( + clang::ConditionalOperator *stmt) +{ + const auto current_caller_id = context().caller_id(); + + if (current_caller_id) { + context().enter_conditionaloperator(stmt); + diagram().add_conditional_stmt(current_caller_id); + } + + RecursiveASTVisitor::TraverseStmt( + stmt->getCond()); + + RecursiveASTVisitor::TraverseStmt( + stmt->getTrueExpr()); + + if (current_caller_id) { + diagram().add_conditional_elsestmt(current_caller_id); + } + + RecursiveASTVisitor::TraverseStmt( + stmt->getFalseExpr()); + + if (current_caller_id) { + context().leave_conditionaloperator(); + diagram().end_conditional_stmt(current_caller_id); + } + + return true; +} + bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) { using clanguml::common::model::message_scope_t; diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index f068cd76..8748a670 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -86,6 +86,8 @@ public: bool TraverseDefaultStmt(clang::DefaultStmt *stmt); + bool TraverseConditionalOperator(clang::ConditionalOperator *stmt); + clanguml::sequence_diagram::model::diagram &diagram(); const clanguml::sequence_diagram::model::diagram &diagram() const; diff --git a/tests/t20028/.clang-uml b/tests/t20028/.clang-uml new file mode 100644 index 00000000..c20559fc --- /dev/null +++ b/tests/t20028/.clang-uml @@ -0,0 +1,17 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t20028_sequence: + type: sequence + glob: + - ../../tests/t20028/t20028.cc + include: + namespaces: + - clanguml::t20028 + exclude: + namespaces: + - clanguml::t20028::detail + using_namespace: + - clanguml::t20028 + start_from: + - function: "clanguml::t20028::tmain()" \ No newline at end of file diff --git a/tests/t20028/t20028.cc b/tests/t20028/t20028.cc new file mode 100644 index 00000000..a6f9ded4 --- /dev/null +++ b/tests/t20028/t20028.cc @@ -0,0 +1,31 @@ +namespace clanguml { +namespace t20028 { + +struct A { + int a() { return 0; } + int b() { return 1; } + int c() { return 2; } + int d() { return 3; } +}; + +namespace detail { +struct B { + int e() { return 4; } +}; +} // namespace detail + +int tmain() +{ + A a; + detail::B b; + + int result{}; + + result = b.e() ? b.e() : 12; + + result += a.a() ? a.b() + a.c() : a.d(); + + return result; +} +} +} \ No newline at end of file diff --git a/tests/t20028/test_case.h b/tests/t20028/test_case.h new file mode 100644 index 00000000..ecee16ef --- /dev/null +++ b/tests/t20028/test_case.h @@ -0,0 +1,46 @@ +/** + * tests/t20028/test_case.h + * + * Copyright (c) 2021-2022 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("t20028", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20028"); + + auto diagram = config.diagrams["t20028_sequence"]; + + REQUIRE(diagram->name == "t20028_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20028_sequence"); + + auto puml = generate_sequence_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "b()")); + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "c()")); + REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "d()")); + REQUIRE_THAT(puml, !HasCall(_A("tmain()"), _A("B"), "e()")); + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index b4fca775..1b15e9b7 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -274,6 +274,7 @@ using namespace clanguml::test::matchers; #include "t20025/test_case.h" #include "t20026/test_case.h" #include "t20027/test_case.h" +#include "t20028/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 0c59ebca..09d41fea 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -229,6 +229,9 @@ test_cases: - name: t20027 title: Filter call expressions based on access test case description: + - name: t20028 + title: Conditional (ternary) '?:' operator test case + description: Package diagrams: - name: t30001 title: Basic package diagram test case From 8e4b670d9944a83acf8f86846f55fb7520809759 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Thu, 15 Dec 2022 00:56:55 +0100 Subject: [PATCH 12/19] Added combined feature sequence diagram test case --- tests/t20029/.clang-uml | 17 +++++++++ tests/t20029/t20029.cc | 75 ++++++++++++++++++++++++++++++++++++++++ tests/t20029/test_case.h | 61 ++++++++++++++++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 ++ 5 files changed, 157 insertions(+) create mode 100644 tests/t20029/.clang-uml create mode 100644 tests/t20029/t20029.cc create mode 100644 tests/t20029/test_case.h diff --git a/tests/t20029/.clang-uml b/tests/t20029/.clang-uml new file mode 100644 index 00000000..6f1d0df7 --- /dev/null +++ b/tests/t20029/.clang-uml @@ -0,0 +1,17 @@ +compilation_database_dir: .. +output_directory: puml +diagrams: + t20029_sequence: + type: sequence + glob: + - ../../tests/t20029/t20029.cc + include: + namespaces: + - clanguml::t20029 + exclude: + access: + - private + using_namespace: + - clanguml::t20029 + start_from: + - function: "clanguml::t20029::tmain()" \ No newline at end of file diff --git a/tests/t20029/t20029.cc b/tests/t20029/t20029.cc new file mode 100644 index 00000000..e61a0ce5 --- /dev/null +++ b/tests/t20029/t20029.cc @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include + +namespace clanguml { +namespace t20029 { +using encoder_function_t = std::function; + +std::string encode_b64(std::string &&content) { return std::move(content); } + +template class Encoder : public T { +public: + bool send(std::string &&msg) + { + auto encoded = encode(std::move(msg)); + return T::send(std::move(encoded)); + } + +protected: + std::string encode(std::string &&msg) { return encode_b64(std::move(msg)); } + +private: + encoder_function_t f_; +}; + +template class Retrier : public T { +public: + bool send(std::string &&msg) + { + std::string buffer{std::move(msg)}; + + int retryCount = 5; + + while (retryCount--) { + if (T::send(buffer)) + return true; + } + + return false; + } +}; + +class ConnectionPool { +public: + void connect() + { + if (!is_connected_.load()) + connect_impl(); + } + + bool send(const std::string &msg) { return true; } + +private: + void connect_impl() { is_connected_ = true; } + + std::atomic is_connected_; +}; + +int tmain() +{ + auto pool = std::make_shared>>(); + + pool->connect(); + + for (std::string line; std::getline(std::cin, line);) { + if (!pool->send(std::move(line))) + break; + } + + return 0; +} +} +} \ No newline at end of file diff --git a/tests/t20029/test_case.h b/tests/t20029/test_case.h new file mode 100644 index 00000000..346ce8ce --- /dev/null +++ b/tests/t20029/test_case.h @@ -0,0 +1,61 @@ +/** + * tests/t20029/test_case.h + * + * Copyright (c) 2021-2022 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("t20029", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20029"); + + auto diagram = config.diagrams["t20029_sequence"]; + + REQUIRE(diagram->name == "t20029_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20029_sequence"); + + auto puml = generate_sequence_puml(diagram, *model); + AliasMatcher _A(puml); + + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT( + puml, HasCall(_A("tmain()"), _A("ConnectionPool"), "connect()")); + REQUIRE_THAT(puml, + HasCallInControlCondition(_A("tmain()"), + _A("Encoder>"), "send(std::string &&)")); + + REQUIRE_THAT(puml, + HasCall(_A("Encoder>"), + _A("Encoder>"), "encode(std::string &&)")); + + REQUIRE_THAT(puml, + HasCall(_A("Encoder>"), + _A("encode_b64(std::string &&)"), "")); + + REQUIRE_THAT(puml, + HasCallInControlCondition(_A("Retrier"), + _A("ConnectionPool"), "send(const std::string &)")); + + REQUIRE_THAT(puml, + !HasCall(_A("ConnectionPool"), _A("ConnectionPool"), "connect_impl()")); + + save_puml( + "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 1b15e9b7..11c74630 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -275,6 +275,7 @@ using namespace clanguml::test::matchers; #include "t20026/test_case.h" #include "t20027/test_case.h" #include "t20028/test_case.h" +#include "t20029/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 09d41fea..880825fd 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -232,6 +232,9 @@ test_cases: - name: t20028 title: Conditional (ternary) '?:' operator test case description: + - name: t20029 + title: Combined feature sequence diagram test case + description: Package diagrams: - name: t30001 title: Basic package diagram test case From 9a20aae0307d152bb4bc898b51be0c39164dd112 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Thu, 15 Dec 2022 01:14:01 +0100 Subject: [PATCH 13/19] Updated test case documentation --- docs/test_cases.md | 3 + docs/test_cases/t00002_class.svg | 36 ++--- docs/test_cases/t00003_class.svg | 46 +++---- docs/test_cases/t00004_class.svg | 76 +++++------ docs/test_cases/t00005_class.svg | 110 +++++++-------- docs/test_cases/t00006_class.svg | 132 +++++++++--------- docs/test_cases/t00007_class.svg | 30 ++-- docs/test_cases/t00008_class.svg | 56 ++++---- docs/test_cases/t00009_class.svg | 32 ++--- docs/test_cases/t00010_class.svg | 34 ++--- docs/test_cases/t00011_class.svg | 22 +-- docs/test_cases/t00012_class.svg | 66 ++++----- docs/test_cases/t00013_class.svg | 82 +++++------ docs/test_cases/t00014_class.svg | 116 ++++++++-------- docs/test_cases/t00015_class.svg | 22 +-- docs/test_cases/t00016_class.svg | 30 ++-- docs/test_cases/t00017_class.svg | 66 ++++----- docs/test_cases/t00018_class.svg | 18 +-- docs/test_cases/t00019_class.svg | 40 +++--- docs/test_cases/t00020_class.svg | 38 +++--- docs/test_cases/t00021_class.svg | 30 ++-- docs/test_cases/t00022_class.svg | 14 +- docs/test_cases/t00023_class.svg | 26 ++-- docs/test_cases/t00024_class.svg | 22 +-- docs/test_cases/t00025_class.svg | 34 ++--- docs/test_cases/t00026_class.svg | 42 +++--- docs/test_cases/t00027_class.svg | 58 ++++---- docs/test_cases/t00028_class.svg | 78 +++++------ docs/test_cases/t00029_class.svg | 50 +++---- docs/test_cases/t00030_class.svg | 46 +++---- docs/test_cases/t00031_class.svg | 50 +++---- docs/test_cases/t00032_class.svg | 40 +++--- docs/test_cases/t00033_class.svg | 48 +++---- docs/test_cases/t00034_class.svg | 46 +++---- docs/test_cases/t00035_class.svg | 22 +-- docs/test_cases/t00036_class.svg | 38 +++--- docs/test_cases/t00037_class.svg | 54 ++++---- docs/test_cases/t00038_class.svg | 58 ++++---- docs/test_cases/t00039_class.svg | 78 +++++------ docs/test_cases/t00040_class.svg | 26 ++-- docs/test_cases/t00041_class.svg | 54 ++++---- docs/test_cases/t00042_class.svg | 36 ++--- docs/test_cases/t00043_class.svg | 50 +++---- docs/test_cases/t00044_class.svg | 36 ++--- docs/test_cases/t00045_class.svg | 70 +++++----- docs/test_cases/t00046_class.svg | 64 ++++----- docs/test_cases/t00047_class.svg | 22 +-- docs/test_cases/t00048_class.svg | 50 +++---- docs/test_cases/t00049_class.svg | 32 ++--- docs/test_cases/t00050_class.svg | 70 +++++----- docs/test_cases/t20001_sequence.svg | 62 ++++----- docs/test_cases/t20002_sequence.svg | 48 +++---- docs/test_cases/t20003_sequence.svg | 48 +++---- docs/test_cases/t20004_sequence.svg | 120 ++++++++-------- docs/test_cases/t20005_sequence.svg | 36 ++--- docs/test_cases/t20006_sequence.svg | 150 ++++++++++---------- docs/test_cases/t20007_sequence.svg | 48 +++---- docs/test_cases/t20008_sequence.svg | 84 ++++++------ docs/test_cases/t20009_sequence.svg | 84 ++++++------ docs/test_cases/t20010_sequence.svg | 72 +++++----- docs/test_cases/t20011_sequence.svg | 72 +++++----- docs/test_cases/t20012_sequence.svg | 204 ++++++++++++++-------------- docs/test_cases/t20013_sequence.svg | 60 ++++---- docs/test_cases/t20014_sequence.svg | 72 +++++----- docs/test_cases/t20015_sequence.svg | 24 ++-- docs/test_cases/t20016_sequence.svg | 48 +++---- docs/test_cases/t20017_sequence.svg | 48 +++---- docs/test_cases/t20018_sequence.svg | 96 ++++++------- docs/test_cases/t20019_sequence.svg | 84 ++++++------ docs/test_cases/t20020_sequence.svg | 118 ++++++++-------- docs/test_cases/t20021_sequence.svg | 106 +++++++-------- docs/test_cases/t20022_sequence.svg | 36 ++--- docs/test_cases/t20023_sequence.svg | 50 +++---- docs/test_cases/t20024_sequence.svg | 88 ++++++------ docs/test_cases/t20025_sequence.svg | 42 +++--- docs/test_cases/t20026_sequence.svg | 24 ++-- docs/test_cases/t20027.md | 48 +++++++ docs/test_cases/t20027_sequence.svg | 36 +++++ docs/test_cases/t20028.md | 58 ++++++++ docs/test_cases/t20028_sequence.svg | 71 ++++++++++ docs/test_cases/t20029.md | 102 ++++++++++++++ docs/test_cases/t20029_sequence.svg | 125 +++++++++++++++++ docs/test_cases/t30001_package.svg | 48 +++---- docs/test_cases/t30002_package.svg | 90 ++++++------ docs/test_cases/t30003_package.svg | 26 ++-- docs/test_cases/t30004_package.svg | 30 ++-- docs/test_cases/t30005_package.svg | 38 +++--- docs/test_cases/t30006_package.svg | 16 +-- docs/test_cases/t30007_package.svg | 20 +-- docs/test_cases/t30008_package.svg | 34 ++--- docs/test_cases/t40001_include.svg | 30 ++-- docs/test_cases/t40002_include.svg | 34 ++--- docs/test_cases/t40003_include.svg | 50 +++---- 93 files changed, 2811 insertions(+), 2368 deletions(-) create mode 100644 docs/test_cases/t20027.md create mode 100644 docs/test_cases/t20027_sequence.svg create mode 100644 docs/test_cases/t20028.md create mode 100644 docs/test_cases/t20028_sequence.svg create mode 100644 docs/test_cases/t20029.md create mode 100644 docs/test_cases/t20029_sequence.svg diff --git a/docs/test_cases.md b/docs/test_cases.md index 4eef86ab..d736eb99 100644 --- a/docs/test_cases.md +++ b/docs/test_cases.md @@ -76,6 +76,9 @@ * [t20024](./test_cases/t20024.md) - Switch statement sequence diagram test case * [t20025](./test_cases/t20025.md) - Skip decorator sequence diagram test case * [t20026](./test_cases/t20026.md) - Virtual method call sequence diagram test case + * [t20027](./test_cases/t20027.md) - Filter call expressions based on access test case + * [t20028](./test_cases/t20028.md) - Conditional (ternary) '?:' operator test case + * [t20029](./test_cases/t20029.md) - Combined feature sequence diagram test case ## 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_class.svg b/docs/test_cases/t00002_class.svg index 582fb14d..6c141f54 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ foo_c() = 0 : void - - + + B @@ -31,8 +31,8 @@ foo_a() : void - - + + C @@ -41,18 +41,18 @@ foo_c() : void - - + + D - + - + as : std::vector<A *> @@ -60,18 +60,18 @@ foo_a() : void foo_c() : void - - + + E - + - + as : std::vector<A *> @@ -79,13 +79,13 @@ foo_a() : void foo_c() : void - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index 2ba67b73..fa1aafcf 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - + + A - + - + public_member : int - + - + protected_member : int - + - + private_member : int - + - + a_ : int - + - + b_ : int - + - + c_ : int - + - + static_int : int - + - + static_const_int : const int - + - + auto_member : const unsigned long @@ -112,11 +112,11 @@ protected_method() : void private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index 88b26a2b..74b2d4a2 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + B::AA @@ -28,8 +28,8 @@ AA_3 - - + + A @@ -40,16 +40,16 @@ foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -59,15 +59,15 @@ Red - - + + A::AA::AAA - + C::B @@ -75,8 +75,8 @@ int - - + + C @@ -84,39 +84,39 @@ T - + - + t : T - + - + b_int : B<int> - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -125,8 +125,8 @@ CCC_2 - - + + C::B @@ -134,16 +134,16 @@ V - + - + b : V - - + + C::CC @@ -152,16 +152,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -171,8 +171,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index 52143048..d14de8e2 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,204 +9,204 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & - + - + a : A - + - + b : B * - + - + c : C & - + - + d : const D * - + - + e : const E & - + - + f : F && - + - + g : G ** - + - + h : H *** - + - + i : I *& - + - + j : volatile J * - + - + k : K * diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index dec1f703..fe309ee2 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,102 +162,102 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B *> - + - + c : std::map<int,C> - + - + d : std::map<int,D *> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G *>> - + - + h : std::array<H,10> - + - + i : std::array<I *,5> - + - + j : J [10] - + - + k : K *[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index e0ae1890..385024ce 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index d2a1346d..b70e97f9 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P,CMP,int N - + - + value : T - + - + pointer : T * - + - + reference : T & - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,16 +70,16 @@ T - + - + values : std::vector<T> - - + + B @@ -87,15 +87,15 @@ T,C<> - + - + template_template : C<T> - + B @@ -103,18 +103,18 @@ int,Vector - - + + D - + - + ints : B<int,Vector> diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 86df8539..2d3e27e6 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,32 +50,32 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 98c2f1a8..926f6b64 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,18 +66,18 @@ int - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index ede1360f..9d1fe682 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,16 +18,16 @@ T - + - + value : T - - + + A @@ -36,18 +36,18 @@ foo() : void - - + + B - + - + m_a : A * diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index 9e97661f..01965ec7 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T,Ts... - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,50 +107,50 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index 7f2dc8a4..dbd0b582 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,15 +18,15 @@ T - + - + f : T - + ABCD::F @@ -34,70 +34,70 @@ int - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int print(R * r) : void - - + + E @@ -105,16 +105,16 @@ T - + - + e : T - - + + G @@ -122,22 +122,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -145,7 +145,7 @@ int - + G @@ -153,7 +153,7 @@ int,float,std::string - + E @@ -161,25 +161,25 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index d306bf0b..621ce9fc 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,U - + A @@ -96,7 +96,7 @@ long,bool - + A @@ -104,7 +104,7 @@ double,bool - + A @@ -112,7 +112,7 @@ long,float - + A @@ -120,7 +120,7 @@ double,float - + A @@ -128,7 +128,7 @@ bool,std::string - + A @@ -136,7 +136,7 @@ float,std::unique_ptr<std::string> - + A @@ -144,7 +144,7 @@ int,std::string - + A @@ -152,7 +152,7 @@ std::string,std::string - + A @@ -160,7 +160,7 @@ char,std::string - + A @@ -168,116 +168,116 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index 8ef93f48..698a090e 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index fd073814..07f87718 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -29,8 +29,8 @@ value : enum - - + + is_numeric @@ -41,8 +41,8 @@ value : enum - - + + is_numeric @@ -53,8 +53,8 @@ value : enum - - + + is_numeric @@ -65,8 +65,8 @@ value : enum - - + + is_numeric @@ -77,8 +77,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index e0425b5f..666b370d 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,127 +9,127 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index d2bc545c..65c9743d 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,18 +9,18 @@ - - + + impl::widget - + - + n : int @@ -30,18 +30,18 @@ draw(const widget & w) : void widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 133f349b..d6798a17 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Base @@ -25,8 +25,8 @@ m2() : std::string - - + + Layer1 @@ -39,8 +39,8 @@ m2() : std::string - - + + Layer2 @@ -51,8 +51,8 @@ all_calls_count() const : int - - + + Layer3 @@ -60,18 +60,18 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int @@ -83,7 +83,7 @@ m1_calls() const : int m2_calls() const : int - + Layer3 @@ -91,7 +91,7 @@ Base - + Layer2 @@ -99,7 +99,7 @@ Layer3<Base> - + Layer1 @@ -107,18 +107,18 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index 500735c2..731d6a08 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ProductA @@ -21,8 +21,8 @@ sell(int price) const = 0 : bool - - + + ProductA1 @@ -31,8 +31,8 @@ sell(int price) const : bool - - + + ProductA2 @@ -41,8 +41,8 @@ sell(int price) const : bool - - + + ProductB @@ -53,8 +53,8 @@ buy(int price) const = 0 : bool - - + + ProductB1 @@ -63,8 +63,8 @@ buy(int price) const : bool - - + + ProductB2 @@ -73,8 +73,8 @@ buy(int price) const : bool - - + + AbstractFactory @@ -85,8 +85,8 @@ make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 @@ -97,8 +97,8 @@ make_b() const : std::unique_ptr<ProductB> - - + + Factory2 diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 59d6fea5..4ff7e1fb 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Visitor @@ -23,8 +23,8 @@ visit_B(const B & item) const = 0 : void - - + + Visitor1 @@ -35,8 +35,8 @@ visit_B(const B & item) const : void - - + + Visitor2 @@ -47,8 +47,8 @@ visit_B(const B & item) const : void - - + + Visitor3 @@ -59,8 +59,8 @@ visit_B(const B & item) const : void - - + + Item @@ -71,8 +71,8 @@ accept(const Visitor & visitor) const = 0 : void - - + + A @@ -81,8 +81,8 @@ accept(const Visitor & visitor) const : void - - + + B diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index 9de0d842..bcd585c0 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -23,8 +23,8 @@ method2() = 0 : void - - + + A1 @@ -35,8 +35,8 @@ method2() : void - - + + A2 diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index 27736482..76081a45 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Strategy @@ -21,8 +21,8 @@ algorithm() = 0 : void - - + + StrategyA @@ -31,8 +31,8 @@ algorithm() : void - - + + StrategyB @@ -41,8 +41,8 @@ algorithm() : void - - + + StrategyC @@ -51,18 +51,18 @@ algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 7a99d5a4..8b5d1f50 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target @@ -23,8 +23,8 @@ m2() = 0 : void - - + + Target1 @@ -35,8 +35,8 @@ m2() : void - - + + Target2 @@ -47,18 +47,18 @@ m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index bf636fc7..66f73203 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target1 @@ -21,8 +21,8 @@ m2() : void - - + + Target2 @@ -33,8 +33,8 @@ m2() : void - - + + Proxy @@ -42,11 +42,11 @@ T - + - + m_target : std::shared_ptr<T> @@ -56,7 +56,7 @@ m1() : void m2() : void - + Proxy @@ -64,7 +64,7 @@ Target1 - + Proxy @@ -72,25 +72,25 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index 332b024b..fe63b802 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,11 +18,11 @@ T - + - + m_value : T @@ -30,8 +30,8 @@ Memento<T>(T && v) : void value() const : T - - + + Originator @@ -39,11 +39,11 @@ T - + - + m_value : T @@ -57,8 +57,8 @@ print() const : void set(T && v) : void - - + + Caretaker @@ -66,11 +66,11 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> @@ -78,7 +78,7 @@ state(const std::string & n) : Memento<T> & set_state(const std::string & s, Memento<T> && m) : void - + Caretaker @@ -86,7 +86,7 @@ std::string - + Originator @@ -94,25 +94,25 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index ac5046fb..93568c42 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Shape @@ -21,14 +21,14 @@ ~Shape() = default : void - + Line - - + + Line @@ -39,14 +39,14 @@ display() : void - + Text - - + + Text @@ -57,8 +57,8 @@ display() : void - - + + ShapeDecorator @@ -67,8 +67,8 @@ display() = 0 : void - - + + Color @@ -79,8 +79,8 @@ display() : void - - + + Weight @@ -91,7 +91,7 @@ display() : void - + Line @@ -99,7 +99,7 @@ Color,Weight - + Line @@ -107,7 +107,7 @@ Color - + Text @@ -115,7 +115,7 @@ Color,Weight - + Text @@ -123,39 +123,39 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index a4bd4195..971fe3cc 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - + A class note. - - + + B - + B class note. - - + + C - + C class note. - - + + D - + D class note. - - + + E @@ -64,27 +64,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,10 +94,10 @@ three - + F enum note. - + E @@ -105,59 +105,59 @@ int - - + + R - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** R(C & c) : void - + R class note. diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index f93be796..fc3791d6 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,64 +45,64 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index 77bd5b54..cb6ef895 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,86 +9,86 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + - + eee : E * diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index f939782c..3b7f3e13 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,39 +71,39 @@ int - - + + R - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index 3dbc28e1..e388ed61 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - + + Base - - + + TBase - - + + A @@ -35,8 +35,8 @@ operator()() : void - - + + B @@ -45,8 +45,8 @@ operator()() : void - - + + C @@ -55,8 +55,8 @@ operator()() : void - - + + Overload @@ -64,15 +64,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -80,18 +80,18 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index 191acd79..c6bd405a 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,18 +99,18 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index 91042970..1c560df4 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Void @@ -21,8 +21,8 @@ operator!=(const Void & ) const : bool - - + + lift_void @@ -31,16 +31,16 @@ - - + + lift_void - - + + lift_void @@ -49,8 +49,8 @@ - - + + drop_void @@ -59,16 +59,16 @@ - - + + drop_void - - + + drop_void @@ -77,33 +77,33 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index d0ecfd98..0b547ff1 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index 3c7cd294..4cf84a3d 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,23 +59,23 @@ int - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 1614ec38..ffdda81d 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,98 +9,98 @@ - - + + ST - + - + dimensions : struct (anonymous struct at /home/bartek/devel/clang-uml-libtooling/tests/t00037/t00037.cc:6:5) - + - + units : struct (anonymous struct at /home/bartek/devel/clang-uml-libtooling/tests/t00037/t00037.cc:14:5) - - + + ST::(dimensions) - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + ST::(units) - + - + c : double - + - + h : double - - + + A - + - + st : ST diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index f85704ef..2949a684 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,16 +88,16 @@ - - + + map - - + + map @@ -106,8 +106,8 @@ - - + + map @@ -116,8 +116,8 @@ - - + + map @@ -126,8 +126,8 @@ - - + + map diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index 0639fb45..1e0fd88e 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B * - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T * - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M * - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M * - - + + ns3::FFF @@ -156,11 +156,11 @@ T,M,N - + - + n : N * diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index cc095716..c04ea907 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - + + A - + - + ii_ : int get_a() : int - - + + AA - - + + AAA - + - + b : B * get_aaa() : int - - + + R diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index 3f065d72..d3a7e77f 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,100 +9,100 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + e : E * - + - + f : F * - + - + g : detail::G * - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index 049f841e..cdd77258 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + A @@ -35,16 +35,16 @@ void - + - + a : void * - - + + B @@ -52,22 +52,22 @@ T,K - + - + b : T - + - + bb : K - + A @@ -75,7 +75,7 @@ double - + A @@ -83,7 +83,7 @@ std::string - + B diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index f9f24de5..dd7ab104 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - + dependants - + dependencies - - + + A - - + + B @@ -33,8 +33,8 @@ b(dependants::A * a) : void - - + + BB @@ -43,8 +43,8 @@ bb(dependants::A * a) : void - - + + C @@ -53,8 +53,8 @@ c(dependants::B * b) : void - - + + D @@ -65,8 +65,8 @@ dd(dependants::BB * bb) : void - - + + E @@ -75,24 +75,24 @@ e(dependants::D * d) : void - - + + G - - + + GG - - + + H @@ -103,8 +103,8 @@ hh(dependencies::GG * gg) : void - - + + I @@ -113,8 +113,8 @@ i(dependencies::H * h) : void - - + + J diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index f1cc682e..4c43762b 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,7 +9,7 @@ - + signal_handler @@ -17,8 +17,8 @@ ,A - - + + sink @@ -27,15 +27,15 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + sink @@ -46,23 +46,23 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + signal_handler - - + + signal_handler @@ -71,8 +71,8 @@ - - + + signal_handler @@ -81,8 +81,8 @@ - - + + sink diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index 259f32c1..bb7f42a3 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - + + A - - + + AA - - + + AAA - - + + AAAA @@ -42,103 +42,103 @@ T - + - + t : T - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::AAA - - + + ns1::ns2::R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index 19cb5ee0..c4ba2dfa 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - + ns1 - + ns2 - + __gnu_cxx - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - + - + i : std::vector<std::uint8_t> foo(AA & aa) : void - - + + A - - + + AA diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index e237ad5d..aeeaa7db 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + conditional_t - - + + conditional_t @@ -27,8 +27,8 @@ - - + + conditional_t @@ -37,8 +37,8 @@ - - + + conditional_t @@ -47,8 +47,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index dbd8ce2c..0ca46b63 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + Base - + - + base : int foo() = 0 : void - - + + BaseTemplate @@ -35,35 +35,35 @@ T - + - + base : T foo() = 0 : void - - + + B - + - + b : int foo() : void - - + + BTemplate @@ -71,35 +71,35 @@ T - + - + b : T foo() : void - - + + A - + - + a : int foo() : void - - + + ATemplate @@ -107,11 +107,11 @@ T - + - + a : T diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index 737756b1..aae224ec 100644 --- a/docs/test_cases/t00049_class.svg +++ b/docs/test_cases/t00049_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,17 +18,17 @@ T - + - + a : T get_a() : T & - + A @@ -36,7 +36,7 @@ intmap - + A @@ -44,7 +44,7 @@ thestring - + A @@ -52,32 +52,32 @@ std::vector<thestring> - - + + R - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> - + - + a_int_map : A<intmap> diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index 5eb61587..4d0a66e4 100644 --- a/docs/test_cases/t00050_class.svg +++ b/docs/test_cases/t00050_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + utils::D - - + + E @@ -52,8 +52,8 @@ E3 - - + + F @@ -61,44 +61,44 @@ T,V,int N - + - + t : T [N] - + - + v : V - - + + G - - + + NoComment - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula class ultricies mollis dictumst, aenean non a in donec nulla. @@ -125,50 +125,50 @@ imperdiet praesent magnis ridiculus congue gravida curabitur dictum sagittis, enim et magna sit inceptos sodales parturient pharetra mollis, aenean vel nostra tellus commodo pretium sapien sociosqu. - + This is a short description of class G. - + This is an intermediate description of class G. - + This is a long description of class G. - + Lorem ipsum - + TODO 1. Write meaningful comment - + TODO 2. Write tests - + TODO 3. Implement - + Long comment example - + TODO Implement... - + Simple array wrapper. - + Template parameters diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index b494d5cb..a80644fc 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,59 +9,59 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - + + + + + + + + add(int,int) - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -72,7 +72,7 @@ - + @@ -81,14 +81,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index b83b058e..971601fc 100644 --- a/docs/test_cases/t20002_sequence.svg +++ b/docs/test_cases/t20002_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1() - + m1() - - + + m2() - + m2() - - + + m3() - + m3() - - + + m4() - + m4() - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20003_sequence.svg b/docs/test_cases/t20003_sequence.svg index dc8be19f..04ec0aac 100644 --- a/docs/test_cases/t20003_sequence.svg +++ b/docs/test_cases/t20003_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1<T>(T) - + m1<T>(T) - - + + m2<T>(T) - + m2<T>(T) - - + + m3<T>(T) - + m3<T>(T) - - + + m4<T>(T) - + m4<T>(T) - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20004_sequence.svg b/docs/test_cases/t20004_sequence.svg index e8c17620..3ce3b085 100644 --- a/docs/test_cases/t20004_sequence.svg +++ b/docs/test_cases/t20004_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -29,87 +29,87 @@ - - + + main() - + main() - - + + m1<float>(float) - + m1<float>(float) - - + + m1<unsigned long>(unsigned long) - + m1<unsigned long>(unsigned long) - - + + m4<unsigned long>(unsigned long) - + m4<unsigned long>(unsigned long) - - + + m1<std::string>(std::string) - + m1<std::string>(std::string) - - + + m2<std::string>(std::string) - + m2<std::string>(std::string) - - + + m1<int>(int) - + m1<int>(int) - - + + m2<int>(int) - + m2<int>(int) - - + + m3<int>(int) - + m3<int>(int) - - + + m4<int>(int) - + m4<int>(int) - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -117,11 +117,11 @@ - + - + @@ -129,19 +129,19 @@ - + - + - + - + diff --git a/docs/test_cases/t20005_sequence.svg b/docs/test_cases/t20005_sequence.svg index dc23c7c8..33a9128b 100644 --- a/docs/test_cases/t20005_sequence.svg +++ b/docs/test_cases/t20005_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - + + + - - + + C<T> - + C<T> - - + + B<T> - + B<T> - - + + A<T> - + A<T> - - - + + + c(T) - + b(T) - + a(T) diff --git a/docs/test_cases/t20006_sequence.svg b/docs/test_cases/t20006_sequence.svg index 21b9641d..80d0419e 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -34,82 +34,82 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -118,12 +118,12 @@ - + b(std::string) - + a2(std::string) @@ -132,59 +132,59 @@ - + bb1(int,int) - + aa1(int) - + bb2(int,int) - + aa2(int) - + bb1(int,std::string) - + aa2(int) - + bb2(int,std::string) - + aa1(int) - + bb1(int,float) - + bb2(int,float) - + aa2(int) diff --git a/docs/test_cases/t20007_sequence.svg b/docs/test_cases/t20007_sequence.svg index 552e8df6..8eb70549 100644 --- a/docs/test_cases/t20007_sequence.svg +++ b/docs/test_cases/t20007_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + Adder<int,int> - + Adder<int,int> - - + + Adder<int,float,double> - + Adder<int,float,double> - - + + Adder<std::string,std::string,std::string> - + Adder<std::string,std::string,std::string> - - - - - + + + + + add(int &&,int &&) - + add(int &&,float &&,double &&) - + add(std::string &&,std::string &&,std::string &&) diff --git a/docs/test_cases/t20008_sequence.svg b/docs/test_cases/t20008_sequence.svg index 59aa592c..b6976ca2 100644 --- a/docs/test_cases/t20008_sequence.svg +++ b/docs/test_cases/t20008_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<const char *> - + B<const char *> - - + + A<const char *> - + A<const char *> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - - - - - - - + + + + + + + + b(int) - + a1(int) - + b(const char *) - + a2(const char *) - + b(std::string) - + a3(std::string) diff --git a/docs/test_cases/t20009_sequence.svg b/docs/test_cases/t20009_sequence.svg index 4cf2bfdc..ddf3695c 100644 --- a/docs/test_cases/t20009_sequence.svg +++ b/docs/test_cases/t20009_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<float> - + B<float> - - + + A<float> - + A<float> - - - - - - - - + + + + + + + + b(std::string) - + a(std::string) - + b(int) - + a(int) - + b(float) - + a(float) diff --git a/docs/test_cases/t20010_sequence.svg b/docs/test_cases/t20010_sequence.svg index bc854834..4461f436 100644 --- a/docs/test_cases/t20010_sequence.svg +++ b/docs/test_cases/t20010_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A - + A - - - - - - - - - - + + + + + + + + + + b1() - + a1() - + b2() - + a2() - + b3() - + a3() - + b4() - + a4() diff --git a/docs/test_cases/t20011_sequence.svg b/docs/test_cases/t20011_sequence.svg index 555e6ef7..1d3321ea 100644 --- a/docs/test_cases/t20011_sequence.svg +++ b/docs/test_cases/t20011_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - + + + + + + + + + + a(int) @@ -52,26 +52,26 @@ alt - + a(int) - + b(int) - + c(int) - + @@ -81,14 +81,14 @@ alt - + b(int) - + @@ -98,7 +98,7 @@ alt - + diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index 7dabd992..bcba7a73 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,122 +43,122 @@ - - + + tmain() - + tmain() - - + + tmain()::(lambda t20012.cc:66:20) - + tmain()::(lambda t20012.cc:66:20) - - + + A - + A - - + + B - + B - - + + tmain()::(lambda t20012.cc:79:20) - + tmain()::(lambda t20012.cc:79:20) - - + + C - + C - - + + R<R::(lambda t20012.cc:85:9)> - + R<R::(lambda t20012.cc:85:9)> - - + + tmain()::(lambda t20012.cc:85:9) - + tmain()::(lambda t20012.cc:85:9) - - + + D - + D - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -167,67 +167,67 @@ - + operator()() - + c() - + cc() - + ccc() - + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -238,29 +238,29 @@ - + r() - + operator()() - + c() - + cc() - + @@ -269,7 +269,7 @@ - + add5(int) diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index b516177f..ba2196ed 100644 --- a/docs/test_cases/t20013_sequence.svg +++ b/docs/test_cases/t20013_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -58,12 +58,12 @@ - + b(double) - + a2(double) @@ -72,12 +72,12 @@ - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20014_sequence.svg b/docs/test_cases/t20014_sequence.svg index b3c3a70d..19a79a3b 100644 --- a/docs/test_cases/t20014_sequence.svg +++ b/docs/test_cases/t20014_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - - - - - - - + + + + + + + + - - + + tmain() - + tmain() - - + + B - + B - - + + A - + A - - + + C<B,int> - + C<B,int> - - - - - - - - - + + + + + + + + + b1(int,int) - + a1(int,int) @@ -67,12 +67,12 @@ - + b2(int,int) - + a2(int,int) @@ -81,17 +81,17 @@ - + c1(int,int) - + b1(int,int) - + a1(int,int) diff --git a/docs/test_cases/t20015_sequence.svg b/docs/test_cases/t20015_sequence.svg index fbfcfbc5..ae6bf776 100644 --- a/docs/test_cases/t20015_sequence.svg +++ b/docs/test_cases/t20015_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + B - + B - - - + + + setup_a(std::shared_ptr<detail::A> &) diff --git a/docs/test_cases/t20016_sequence.svg b/docs/test_cases/t20016_sequence.svg index 0ba06d55..92ca1a80 100644 --- a/docs/test_cases/t20016_sequence.svg +++ b/docs/test_cases/t20016_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + B<long> - + B<long> - - + + A - + A - - - - - - + + + + + + b1(long) - + a1(int) - + b2(long) - + a2(const long &) diff --git a/docs/test_cases/t20017_sequence.svg b/docs/test_cases/t20017_sequence.svg index bdb675d5..05730099 100644 --- a/docs/test_cases/t20017_sequence.svg +++ b/docs/test_cases/t20017_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,65 +9,65 @@ - - - - - - + + + + + + - + t20017.cc - + t20017.cc - + include/t20017_b.h - + include/t20017_b.h - + include/t20017_a.h - + include/t20017_a.h - - - - - - + + + + + + tmain() - + b2<int>(int,int) - + a1(int,int) - + a2(int,int) - + a3(int,int) - + b1(int,int) diff --git a/docs/test_cases/t20018_sequence.svg b/docs/test_cases/t20018_sequence.svg index 0bcd232c..c7993dc9 100644 --- a/docs/test_cases/t20018_sequence.svg +++ b/docs/test_cases/t20018_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + @@ -25,93 +25,93 @@ - - + + tmain() - + tmain() - - + + Answer<Factorial<5>,120> - + Answer<Factorial<5>,120> - - + + Factorial<5> - + Factorial<5> - - + + Factorial<4> - + Factorial<4> - - + + Factorial<3> - + Factorial<3> - - + + Factorial<2> - + Factorial<2> - - + + Factorial<1> - + Factorial<1> - - + + Factorial<0> - + Factorial<0> - - - - - - - - - + + + + + + + + + print() - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) diff --git a/docs/test_cases/t20019_sequence.svg b/docs/test_cases/t20019_sequence.svg index 74dbc7a2..42f5e019 100644 --- a/docs/test_cases/t20019_sequence.svg +++ b/docs/test_cases/t20019_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + Base<D1> - + Base<D1> - - + + D1 - + D1 - - + + Base<D2> - + Base<D2> - - + + D2 - + D2 - - - - - - - - - - + + + + + + + + + + name() - + impl() - + name() - + impl() - + name() - + impl() - + name() - + impl() diff --git a/docs/test_cases/t20020_sequence.svg b/docs/test_cases/t20020_sequence.svg index 29eae3e2..04ecea57 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,78 +9,78 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + C - + C - - + + B - + B - - + + D<int> - + D<int> - - - - - - - - - - - - - + + + + + + + + + + + + + alt - + a1() @@ -91,7 +91,7 @@ alt - + [ @@ -100,7 +100,7 @@ - + [ @@ -109,7 +109,7 @@ - + b1() @@ -117,7 +117,7 @@ - + [ @@ -126,21 +126,21 @@ - + b2() - + a4() - + log() @@ -148,7 +148,7 @@ alt - + c1() @@ -156,7 +156,7 @@ alt - + @@ -169,7 +169,7 @@ - + @@ -179,7 +179,7 @@ alt - + d1(int,int) diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index 7d5d9967..2567a4da 100644 --- a/docs/test_cases/t20021_sequence.svg +++ b/docs/test_cases/t20021_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + C - + C - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + loop - + [ c4() ] - + @@ -89,7 +89,7 @@ - + a3() @@ -102,7 +102,7 @@ loop - + [ @@ -111,7 +111,7 @@ - + [ @@ -120,7 +120,7 @@ - + [ @@ -129,14 +129,14 @@ - + a1() - + c3() @@ -146,7 +146,7 @@ loop - + b2() @@ -156,7 +156,7 @@ loop - + [ @@ -165,7 +165,7 @@ - + b2() diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index 2f23e62e..2b35952a 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - + + + + a() - + b() diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg index a65ee414..cd9cfa17 100644 --- a/docs/test_cases/t20023_sequence.svg +++ b/docs/test_cases/t20023_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,37 +9,37 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - + + + + + + + a() @@ -47,7 +47,7 @@ try - + @@ -60,7 +60,7 @@ [std::runtime_error &] - + @@ -73,7 +73,7 @@ [std::logic_error &] - + @@ -86,7 +86,7 @@ [...] - + diff --git a/docs/test_cases/t20024_sequence.svg b/docs/test_cases/t20024_sequence.svg index 278fc654..f28ab772 100644 --- a/docs/test_cases/t20024_sequence.svg +++ b/docs/test_cases/t20024_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -33,36 +33,36 @@ - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + select(enum_a) @@ -72,7 +72,7 @@ switch [zero] - + @@ -85,7 +85,7 @@ [one] - + @@ -98,7 +98,7 @@ [two] - + @@ -111,7 +111,7 @@ [default] - + @@ -124,7 +124,7 @@ - + select(colors) @@ -134,7 +134,7 @@ switch [enum colors::red] - + @@ -143,7 +143,7 @@ [enum colors::orange] - + @@ -152,7 +152,7 @@ [enum colors::green] - + @@ -161,7 +161,7 @@ [default] - + diff --git a/docs/test_cases/t20025_sequence.svg b/docs/test_cases/t20025_sequence.svg index 3d7383d1..5087facf 100644 --- a/docs/test_cases/t20025_sequence.svg +++ b/docs/test_cases/t20025_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,41 +9,41 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + add(int,int) - + add(int,int) - - - - - + + + + + a() - + @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t20026_sequence.svg b/docs/test_cases/t20026_sequence.svg index 50a6d35b..65ec124c 100644 --- a/docs/test_cases/t20026_sequence.svg +++ b/docs/test_cases/t20026_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20027.md b/docs/test_cases/t20027.md new file mode 100644 index 00000000..d1adac47 --- /dev/null +++ b/docs/test_cases/t20027.md @@ -0,0 +1,48 @@ +# t20027 - Filter call expressions based on access test case +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t20027_sequence: + type: sequence + glob: + - ../../tests/t20027/t20027.cc + include: + namespaces: + - clanguml::t20027 + access: + - public + using_namespace: + - clanguml::t20027 + start_from: + - function: "clanguml::t20027::tmain()" +``` +## Source code +File t20027.cc +```cpp +namespace clanguml { +namespace t20027 { + +class A { +public: + void a() { aa(); } + +protected: + void aa() { aaa(); } + +private: + void aaa() { } +}; + +void tmain() +{ + A a; + + a.a(); +} +} +} +``` +## Generated UML diagrams +![t20027_sequence](./t20027_sequence.svg "Filter call expressions based on access test case") diff --git a/docs/test_cases/t20027_sequence.svg b/docs/test_cases/t20027_sequence.svg new file mode 100644 index 00000000..7d8a55ac --- /dev/null +++ b/docs/test_cases/t20027_sequence.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + A + + A + + + + + + + a() + + + diff --git a/docs/test_cases/t20028.md b/docs/test_cases/t20028.md new file mode 100644 index 00000000..b603b9fb --- /dev/null +++ b/docs/test_cases/t20028.md @@ -0,0 +1,58 @@ +# t20028 - Conditional (ternary) '?:' operator test case +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t20028_sequence: + type: sequence + glob: + - ../../tests/t20028/t20028.cc + include: + namespaces: + - clanguml::t20028 + exclude: + namespaces: + - clanguml::t20028::detail + using_namespace: + - clanguml::t20028 + start_from: + - function: "clanguml::t20028::tmain()" +``` +## Source code +File t20028.cc +```cpp +namespace clanguml { +namespace t20028 { + +struct A { + int a() { return 0; } + int b() { return 1; } + int c() { return 2; } + int d() { return 3; } +}; + +namespace detail { +struct B { + int e() { return 4; } +}; +} // namespace detail + +int tmain() +{ + A a; + detail::B b; + + int result{}; + + result = b.e() ? b.e() : 12; + + result += a.a() ? a.b() + a.c() : a.d(); + + return result; +} +} +} +``` +## Generated UML diagrams +![t20028_sequence](./t20028_sequence.svg "Conditional (ternary) '?:' operator test case") diff --git a/docs/test_cases/t20028_sequence.svg b/docs/test_cases/t20028_sequence.svg new file mode 100644 index 00000000..1bb06467 --- /dev/null +++ b/docs/test_cases/t20028_sequence.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + A + + A + + + + + + + + + alt + + + + a() + + + + + + + b() + + + + + + + c() + + + + + + + + d() + + + + + diff --git a/docs/test_cases/t20029.md b/docs/test_cases/t20029.md new file mode 100644 index 00000000..1d87be03 --- /dev/null +++ b/docs/test_cases/t20029.md @@ -0,0 +1,102 @@ +# t20029 - Combined feature sequence diagram test case +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t20029_sequence: + type: sequence + glob: + - ../../tests/t20029/t20029.cc + include: + namespaces: + - clanguml::t20029 + exclude: + access: + - private + using_namespace: + - clanguml::t20029 + start_from: + - function: "clanguml::t20029::tmain()" +``` +## Source code +File t20029.cc +```cpp +#include +#include +#include +#include +#include + +namespace clanguml { +namespace t20029 { +using encoder_function_t = std::function; + +std::string encode_b64(std::string &&content) { return std::move(content); } + +template class Encoder : public T { +public: + bool send(std::string &&msg) + { + auto encoded = encode(std::move(msg)); + return T::send(std::move(encoded)); + } + +protected: + std::string encode(std::string &&msg) { return encode_b64(std::move(msg)); } + +private: + encoder_function_t f_; +}; + +template class Retrier : public T { +public: + bool send(std::string &&msg) + { + std::string buffer{std::move(msg)}; + + int retryCount = 5; + + while (retryCount--) { + if (T::send(buffer)) + return true; + } + + return false; + } +}; + +class ConnectionPool { +public: + void connect() + { + if (!is_connected_.load()) + connect_impl(); + } + + bool send(const std::string &msg) { return true; } + +private: + void connect_impl() { is_connected_ = true; } + + std::atomic is_connected_; +}; + +int tmain() +{ + auto pool = std::make_shared>>(); + + pool->connect(); + + for (std::string line; std::getline(std::cin, line);) { + if (!pool->send(std::move(line))) + break; + } + + return 0; +} +} +} +``` +## Generated UML diagrams +![t20029_sequence](./t20029_sequence.svg "Combined feature sequence diagram test case") diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg new file mode 100644 index 00000000..f3989c46 --- /dev/null +++ b/docs/test_cases/t20029_sequence.svg @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + ConnectionPool + + ConnectionPool + + + + Encoder<Retrier<ConnectionPool>> + + Encoder<Retrier<ConnectionPool>> + + + + encode_b64(std::string &&) + + encode_b64(std::string &&) + + + + Retrier<ConnectionPool> + + Retrier<ConnectionPool> + + + + + + + + + + + + connect() + + + + loop + + + alt + + + + [ + send(std::string &&) + ] + + + + + + + encode(std::string &&) + + + + + + + + + + + + + + + send(std::string &&) + + + + loop + + + alt + + + + [ + send(const std::string &) + ] + + + + + + + + + diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index b386e989..2d6ea8af 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,63 +9,63 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index 5ca9e897..e8e7a652 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,113 +9,113 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + BBB diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index 8564a197..6ed5c88c 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,35 +9,35 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index 3b208b5c..aed06f20 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index a68f1136..059a1b17 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,48 +9,48 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index e898c8fd..b22798b6 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - + + B - - + + A - - + + C - + Top A note. diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index 92b73f0a..7e7d8019 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,27 +9,27 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index da372e64..e6081340 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index 119c9d66..af48bfc7 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + yaml-cpp/yaml.h - + This is a lib1 include dir - + This is a t40001_include1.h include file diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 6461ed7b..eacc6919 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index a4a20d6f..f6074b60 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - + include - + dependants - + dependencies - + src - + dependants - + dependencies - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h - - + + t1.cc - - + + t2.cc From 4f95f426f1c2420fb165d18f52e1a19aa6aa28f4 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Thu, 15 Dec 2022 01:15:37 +0100 Subject: [PATCH 14/19] Updated sequence diagram example in readme --- README.md | 95 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index fee3b699..959b2972 100644 --- a/README.md +++ b/README.md @@ -244,73 +244,78 @@ generates the following diagram (via PlantUML): The following C++ code: ```cpp -#include -#include -#include +#include +#include +#include +#include +#include namespace clanguml { -namespace t20001 { +namespace t20029 { +using encoder_function_t = std::function; -namespace detail { -struct C { - auto add(int x, int y) { return x + y; } -}; -} +std::string encode_b64(std::string &&content) { return std::move(content); } -class A { +template class Encoder : public T { public: - A() {} - - int add(int x, int y) { return m_c.add(x, y); } - - int add3(int x, int y, int z) + bool send(std::string &&msg) { - std::vector v; - v.push_back(x); - v.push_back(y); - v.push_back(z); - auto res = add(v[0], v[1]) + v[2]; - log_result(res); - return res; + auto encoded = encode(std::move(msg)); + return T::send(std::move(encoded)); } - void log_result(int r) {} +protected: + std::string encode(std::string &&msg) { return encode_b64(std::move(msg)); } private: - detail::C m_c{}; + encoder_function_t f_; }; -class B { +template class Retrier : public T { public: - B(A &a) - : m_a{a} + bool send(std::string &&msg) { + std::string buffer{std::move(msg)}; + + int retryCount = 5; + + while (retryCount--) { + if (T::send(buffer)) + return true; + } + + return false; + } +}; + +class ConnectionPool { +public: + void connect() + { + if (!is_connected_.load()) + connect_impl(); } - int wrap_add(int x, int y) - { - auto res = m_a.add(x, y); - m_a.log_result(res); - return res; - } - - int wrap_add3(int x, int y, int z) - { - auto res = m_a.add3(x, y, z); - m_a.log_result(res); - return res; - } + bool send(const std::string &msg) { return true; } private: - A &m_a; + void connect_impl() { is_connected_ = true; } + + std::atomic is_connected_; }; int tmain() { - A a; - B b(a); + auto pool = std::make_shared>>(); - return b.wrap_add3(1, 2, 3); + pool->connect(); + + for (std::string line; std::getline(std::cin, line);) { + if (!pool->send(std::move(line))) + break; + } + + return 0; } } } @@ -318,7 +323,7 @@ int tmain() generates the following diagram (via PlantUML): -![sequence_diagram_example](docs/test_cases/t20001_sequence.svg) +![sequence_diagram_example](docs/test_cases/t20029_sequence.svg) ### Package diagrams From 35554a2ec0da1380cd66dfb4fec9ca941ff6b481 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 16 Dec 2022 21:16:14 +0100 Subject: [PATCH 15/19] Fixed nested call expressions order in sequence diagrams --- .../visitor/call_expression_context.cc | 26 ++++++++- .../visitor/call_expression_context.h | 9 ++- .../visitor/translation_unit_visitor.cc | 55 +++++++++++++++++-- .../visitor/translation_unit_visitor.h | 17 ++++++ tests/t20029/t20029.cc | 8 +-- tests/test_cases.cc | 2 +- 6 files changed, 100 insertions(+), 17 deletions(-) diff --git a/src/sequence_diagram/visitor/call_expression_context.cc b/src/sequence_diagram/visitor/call_expression_context.cc index 10990308..dc8afcc2 100644 --- a/src/sequence_diagram/visitor/call_expression_context.cc +++ b/src/sequence_diagram/visitor/call_expression_context.cc @@ -214,7 +214,7 @@ void call_expression_context::enter_elseifstmt(clang::IfStmt *stmt) void call_expression_context::leave_elseifstmt() { - if (elseif_stmt_stack_.empty()) + if (!elseif_stmt_stack_.empty()) elseif_stmt_stack_.pop(); } @@ -241,10 +241,30 @@ void call_expression_context::enter_loopstmt(clang::Stmt *stmt) void call_expression_context::leave_loopstmt() { - if (loop_stmt_stack_.empty()) + if (!loop_stmt_stack_.empty()) return loop_stmt_stack_.pop(); } +clang::CallExpr *call_expression_context::current_callexpr() const +{ + if (call_expr_stack_.empty()) + return nullptr; + + return call_expr_stack_.top(); +} + +void call_expression_context::enter_callexpr(clang::CallExpr *expr) +{ + call_expr_stack_.push(expr); +} + +void call_expression_context::leave_callexpr() +{ + if (!call_expr_stack_.empty()) { + return call_expr_stack_.pop(); + } +} + clang::Stmt *call_expression_context::current_trystmt() const { if (try_stmt_stack_.empty()) @@ -300,7 +320,7 @@ void call_expression_context::enter_conditionaloperator( void call_expression_context::leave_conditionaloperator() { - if (conditional_operator_stack_.empty()) + if (!conditional_operator_stack_.empty()) conditional_operator_stack_.pop(); } diff --git a/src/sequence_diagram/visitor/call_expression_context.h b/src/sequence_diagram/visitor/call_expression_context.h index a1c247a2..cde69033 100644 --- a/src/sequence_diagram/visitor/call_expression_context.h +++ b/src/sequence_diagram/visitor/call_expression_context.h @@ -92,6 +92,10 @@ struct call_expression_context { void enter_conditionaloperator(clang::ConditionalOperator *stmt); void leave_conditionaloperator(); + clang::CallExpr *current_callexpr() const; + void enter_callexpr(clang::CallExpr *expr); + void leave_callexpr(); + bool is_expr_in_current_control_statement_condition( const clang::Stmt *stmt) const; @@ -103,11 +107,12 @@ struct call_expression_context { clang::FunctionDecl *current_function_decl_; clang::FunctionTemplateDecl *current_function_template_decl_; - clang::CallExpr *current_function_call_expr_{nullptr}; - private: std::int64_t current_caller_id_; std::stack current_lambda_caller_id_; + + std::stack call_expr_stack_; + std::stack if_stmt_stack_; std::stack elseif_stmt_stack_; diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index af73c10e..b0691110 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -528,11 +528,35 @@ bool translation_unit_visitor::TraverseLambdaExpr(clang::LambdaExpr *expr) bool translation_unit_visitor::TraverseCallExpr(clang::CallExpr *expr) { - context().current_function_call_expr_ = expr; + context().enter_callexpr(expr); RecursiveASTVisitor::TraverseCallExpr(expr); - context().current_function_call_expr_ = nullptr; + context().leave_callexpr(); + + pop_message_to_diagram(expr); + + return true; +} + +bool translation_unit_visitor::TraverseCXXMemberCallExpr( + clang::CXXMemberCallExpr *expr) +{ + RecursiveASTVisitor::TraverseCXXMemberCallExpr( + expr); + + pop_message_to_diagram(expr); + + return true; +} + +bool translation_unit_visitor::TraverseCXXOperatorCallExpr( + clang::CXXOperatorCallExpr *expr) +{ + RecursiveASTVisitor::TraverseCXXOperatorCallExpr( + expr); + + pop_message_to_diagram(expr); return true; } @@ -874,7 +898,7 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) // message source rather then enclosing context // Unless the lambda is declared in a function or method call if (context().lambda_caller_id() != 0) { - if (context().current_function_call_expr_ == nullptr) { + if (context().current_callexpr() == nullptr) { m.set_from(context().lambda_caller_id()); } else { @@ -969,7 +993,7 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) LOG_DBG("Found call {} from {} [{}] to {} [{}] ", m.message_name(), m.from(), m.from(), m.to(), m.to()); - diagram().get_activity(m.from()).add_message(std::move(m)); + push_message(expr, std::move(m)); } return true; @@ -2090,6 +2114,29 @@ std::string translation_unit_visitor::make_lambda_name( return result; } +void translation_unit_visitor::push_message( + clang::CallExpr *expr, model::message &&m) +{ + call_expr_message_map_.emplace(expr, std::move(m)); +} + +void translation_unit_visitor::pop_message_to_diagram(clang::CallExpr *expr) +{ + assert(expr != nullptr); + + // Skip if no message was generated from this expr + if (call_expr_message_map_.find(expr) == call_expr_message_map_.end()) { + return; + } + + auto msg = std::move(call_expr_message_map_.at(expr)); + + auto caller_id = msg.from(); + diagram().get_activity(caller_id).add_message(std::move(msg)); + + call_expr_message_map_.erase(expr); +} + void translation_unit_visitor::finalize() { std::set active_participants_unique; diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index 8748a670..8fb09c45 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -46,6 +46,13 @@ public: bool TraverseCallExpr(clang::CallExpr *expr); + bool TraverseCXXMemberCallExpr(clang::CXXMemberCallExpr *expr); + + bool TraverseCXXOperatorCallExpr(clang::CXXOperatorCallExpr *expr); + + // TODO + // bool TraverseCXXConstructExpr(clang::CXXConstructExpr *expr); + bool VisitLambdaExpr(clang::LambdaExpr *expr); bool TraverseLambdaExpr(clang::LambdaExpr *expr); @@ -245,6 +252,10 @@ private: bool process_unresolved_lookup_call_expression( model::message &m, const clang::CallExpr *expr); + void push_message(clang::CallExpr *expr, model::message &&m); + + void pop_message_to_diagram(clang::CallExpr *expr); + // Reference to the output diagram model clanguml::sequence_diagram::model::diagram &diagram_; @@ -253,6 +264,12 @@ private: call_expression_context call_expression_context_; + /// This is used to generate messages in proper order in case of + /// nested call expressions (e.g. a(b(c(), d())), as they need to + /// be added to the diagram sequence after the visitor leaves the + /// call expression AST node + std::map call_expr_message_map_; + std::map> forward_declarations_; diff --git a/tests/t20029/t20029.cc b/tests/t20029/t20029.cc index e61a0ce5..3c89144e 100644 --- a/tests/t20029/t20029.cc +++ b/tests/t20029/t20029.cc @@ -6,23 +6,17 @@ namespace clanguml { namespace t20029 { -using encoder_function_t = std::function; - std::string encode_b64(std::string &&content) { return std::move(content); } template class Encoder : public T { public: bool send(std::string &&msg) { - auto encoded = encode(std::move(msg)); - return T::send(std::move(encoded)); + return T::send(std::move(encode(std::move(msg)))); } protected: std::string encode(std::string &&msg) { return encode_b64(std::move(msg)); } - -private: - encoder_function_t f_; }; template class Retrier : public T { diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 11c74630..ce863832 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -319,7 +319,7 @@ int main(int argc, char *argv[]) if (returnCode != 0) return returnCode; - clanguml::util::setup_logging(debug_log); + clanguml::util::setup_logging(debug_log ? 3 : 1); return session.run(); } \ No newline at end of file From 3f314e0cf3f65c2d470c21e532fd1d249e21f1f9 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 16 Dec 2022 23:30:03 +0100 Subject: [PATCH 16/19] Improved translation unit glob matching in configuration files (#62) --- src/config/config.cc | 3 +- src/main.cc | 160 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 128 insertions(+), 35 deletions(-) diff --git a/src/config/config.cc b/src/config/config.cc index 8349746b..deb5d458 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -125,7 +125,8 @@ std::vector diagram::get_translation_units( for (const auto &g : glob()) { const auto matches = glob::glob(g, root_directory); for (const auto &match : matches) { - const auto path = root_directory / match; + const auto path = + std::filesystem::canonical(root_directory / match); translation_units.emplace_back(path.string()); } } diff --git a/src/main.cc b/src/main.cc index d08d0f82..da418888 100644 --- a/src/main.cc +++ b/src/main.cc @@ -39,17 +39,85 @@ using namespace clanguml; using config::config; +/// +/// Print the program version and basic information +/// void print_version(); +//// +/// Print list of diagrams available in the configuration file +/// +/// \param cfg Configuration instance loaded from configuration file +/// void print_diagrams_list(const clanguml::config::config &cfg); -bool check_output_directory(const std::string &dir); +/// +/// Check if diagram output directory exists, if not create it +/// +/// \param dir Path to the output directory +/// \return True if directory exists or has been created +/// +bool ensure_output_directory_exists(const std::string &dir); +/// +/// Generate specific diagram identified by name +/// +/// \param od Diagram output directory +/// \param name Name of the diagram as specified in the config file +/// \param diagram Diagram model instance +/// \param db Compilation database +/// \param translation_units List of translation units to be used for this +/// diagram +/// \param verbose Logging level +/// void generate_diagram(const std::string &od, const std::string &name, std::shared_ptr diagram, const clang::tooling::CompilationDatabase &db, const std::vector &translation_units, bool verbose); +/// +/// Find translation units for diagrams. +/// +/// For each diagram to be generated, this function selects translation units +/// to be used for this diagram. The diagrams are selected as an intersection +/// between all translation units found in the compilation database and the +/// `glob` patterns specified for each diagram in the configuration file. +/// +/// \param diagram_names List of diagram names to be generated +/// \param config Configuration instance +/// \param compilation_database_files All translation units in compilation +/// database +/// \param translation_units_map The output map containing translation +/// units for each diagram by name +/// +void find_translation_units_for_diagrams( + const std::vector &diagram_names, + clanguml::config::config &config, + const std::vector &compilation_database_files, + std::map> &translation_units_map); + +/// +/// Generate diagrams. +/// +/// This function generates all diagrams specified in the configuration file +/// and in the command line. +/// +/// \param diagram_names List of diagram names to be generated +/// \param config Configuration instance +/// \param od Output directory where diagrams should be written +/// \param db Compilation database instance +/// \param verbose Verbosity level +/// \param thread_count Number of diagrams to be generated in parallel +/// \param translation_units_map List of translation units to be used for each +/// diagram +/// +void generate_diagrams(const std::vector &diagram_names, + clanguml::config::config &config, const std::string &od, + const std::unique_ptr &db, + const int verbose, const unsigned int thread_count, + const std::map> + &translation_units_map); + int main(int argc, const char *argv[]) { CLI::App app{"Clang-based PlantUML diagram generator for C++"}; @@ -110,12 +178,9 @@ int main(int argc, const char *argv[]) if (output_directory) od = output_directory.value(); - if (!check_output_directory(od)) + if (!ensure_output_directory_exists(od)) return 1; - util::thread_pool_executor generator_executor{thread_count}; - std::vector> futs; - std::string err{}; auto db = clang::tooling::CompilationDatabase::autoDetectFromDirectory( config.compilation_database_dir(), err); @@ -128,8 +193,6 @@ int main(int argc, const char *argv[]) const auto compilation_database_files = db->getAllFiles(); - const auto current_directory = std::filesystem::current_path(); - std::map /*translation units*/> translation_units_map; @@ -137,29 +200,24 @@ int main(int argc, const char *argv[]) // We have to generate the translation units list for each diagram before // scheduling tasks, because std::filesystem::current_path cannot be trusted // with multiple threads - for (const auto &[name, diagram] : config.diagrams) { - // If there are any specific diagram names provided on the command line, - // and this diagram is not in that list - skip it - if (!diagram_names.empty() && !util::contains(diagram_names, name)) - continue; + find_translation_units_for_diagrams(diagram_names, config, + compilation_database_files, translation_units_map); - // Get all translation units matching the glob from diagram - // configuration - std::vector translation_units = - diagram->get_translation_units(current_directory); + generate_diagrams(diagram_names, config, od, db, verbose, thread_count, + translation_units_map); - std::vector valid_translation_units{}; - std::copy_if(compilation_database_files.begin(), - compilation_database_files.end(), - std::back_inserter(valid_translation_units), - [&translation_units](const auto &tu) { - return std::find(translation_units.begin(), - translation_units.end(), - tu) != translation_units.end(); - }); + return 0; +} - translation_units_map[name] = std::move(valid_translation_units); - } +void generate_diagrams(const std::vector &diagram_names, + clanguml::config::config &config, const std::string &od, + const std::unique_ptr &db, + const int verbose, const unsigned int thread_count, + const std::map> + &translation_units_map) +{ + util::thread_pool_executor generator_executor{thread_count}; + std::vector> futs; for (const auto &[name, diagram] : config.diagrams) { // If there are any specific diagram names provided on the command line, @@ -167,7 +225,7 @@ int main(int argc, const char *argv[]) if (!diagram_names.empty() && !util::contains(diagram_names, name)) continue; - const auto &valid_translation_units = translation_units_map[name]; + const auto &valid_translation_units = translation_units_map.at(name); if (valid_translation_units.empty()) { LOG_ERROR( @@ -177,10 +235,8 @@ int main(int argc, const char *argv[]) } futs.emplace_back(generator_executor.add( - [&od, &name = name, &diagram = diagram, &config = config, - db = std::ref(*db), - translation_units = std::move(valid_translation_units), - verbose]() { + [&od, &name = name, &diagram = diagram, db = std::ref(*db), + translation_units = valid_translation_units, verbose]() { try { generate_diagram( od, name, diagram, db, translation_units, verbose); @@ -194,8 +250,44 @@ int main(int argc, const char *argv[]) for (auto &fut : futs) { fut.get(); } +} - return 0; +void find_translation_units_for_diagrams( + const std::vector &diagram_names, + clanguml::config::config &config, + const std::vector &compilation_database_files, + std::map> &translation_units_map) +{ + const auto current_directory = std::filesystem::current_path(); + + for (const auto &[name, diagram] : config.diagrams) { + // If there are any specific diagram names provided on the command line, + // and this diagram is not in that list - skip it + if (!diagram_names.empty() && !util::contains(diagram_names, name)) + continue; + + // If glob is not defined use all translation units from the + // compilation database + if (!diagram->glob.has_value) { + translation_units_map[name] = compilation_database_files; + } + // Otherwise, get all translation units matching the glob from diagram + // configuration + else { + const std::vector translation_units = + diagram->get_translation_units(current_directory); + + std::vector valid_translation_units{}; + std::copy_if(compilation_database_files.begin(), + compilation_database_files.end(), + std::back_inserter(valid_translation_units), + [&translation_units](const auto &tu) { + return util::contains(translation_units, tu); + }); + + translation_units_map[name] = std::move(valid_translation_units); + } + } } void generate_diagram(const std::string &od, const std::string &name, @@ -280,7 +372,7 @@ void generate_diagram(const std::string &od, const std::string &name, ofs.close(); } -bool check_output_directory(const std::string &dir) +bool ensure_output_directory_exists(const std::string &dir) { namespace fs = std::filesystem; using std::cout; From 6454604595338d29298eddf20bc31a2c8e18bcf7 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 16 Dec 2022 23:32:42 +0100 Subject: [PATCH 17/19] Updated test case documentation --- docs/test_cases/t00002_class.svg | 36 ++--- docs/test_cases/t00003_class.svg | 46 +++---- docs/test_cases/t00004_class.svg | 76 +++++------ docs/test_cases/t00005_class.svg | 110 +++++++-------- docs/test_cases/t00006_class.svg | 132 +++++++++--------- docs/test_cases/t00007_class.svg | 30 ++-- docs/test_cases/t00008_class.svg | 56 ++++---- docs/test_cases/t00009_class.svg | 32 ++--- docs/test_cases/t00010_class.svg | 34 ++--- docs/test_cases/t00011_class.svg | 22 +-- docs/test_cases/t00012_class.svg | 66 ++++----- docs/test_cases/t00013_class.svg | 82 +++++------ docs/test_cases/t00014_class.svg | 116 ++++++++-------- docs/test_cases/t00015_class.svg | 22 +-- docs/test_cases/t00016_class.svg | 30 ++-- docs/test_cases/t00017_class.svg | 66 ++++----- docs/test_cases/t00018_class.svg | 18 +-- docs/test_cases/t00019_class.svg | 40 +++--- docs/test_cases/t00020_class.svg | 38 +++--- docs/test_cases/t00021_class.svg | 30 ++-- docs/test_cases/t00022_class.svg | 14 +- docs/test_cases/t00023_class.svg | 26 ++-- docs/test_cases/t00024_class.svg | 22 +-- docs/test_cases/t00025_class.svg | 34 ++--- docs/test_cases/t00026_class.svg | 42 +++--- docs/test_cases/t00027_class.svg | 58 ++++---- docs/test_cases/t00028_class.svg | 78 +++++------ docs/test_cases/t00029_class.svg | 50 +++---- docs/test_cases/t00030_class.svg | 46 +++---- docs/test_cases/t00031_class.svg | 50 +++---- docs/test_cases/t00032_class.svg | 40 +++--- docs/test_cases/t00033_class.svg | 48 +++---- docs/test_cases/t00034_class.svg | 46 +++---- docs/test_cases/t00035_class.svg | 22 +-- docs/test_cases/t00036_class.svg | 38 +++--- docs/test_cases/t00037_class.svg | 54 ++++---- docs/test_cases/t00038_class.svg | 58 ++++---- docs/test_cases/t00039_class.svg | 78 +++++------ docs/test_cases/t00040_class.svg | 26 ++-- docs/test_cases/t00041_class.svg | 54 ++++---- docs/test_cases/t00042_class.svg | 36 ++--- docs/test_cases/t00043_class.svg | 50 +++---- docs/test_cases/t00044_class.svg | 36 ++--- docs/test_cases/t00045_class.svg | 70 +++++----- docs/test_cases/t00046_class.svg | 64 ++++----- docs/test_cases/t00047_class.svg | 22 +-- docs/test_cases/t00048_class.svg | 50 +++---- docs/test_cases/t00049_class.svg | 32 ++--- docs/test_cases/t00050_class.svg | 70 +++++----- docs/test_cases/t20001_sequence.svg | 62 ++++----- docs/test_cases/t20002_sequence.svg | 48 +++---- docs/test_cases/t20003_sequence.svg | 48 +++---- docs/test_cases/t20004_sequence.svg | 120 ++++++++-------- docs/test_cases/t20005_sequence.svg | 36 ++--- docs/test_cases/t20006_sequence.svg | 150 ++++++++++---------- docs/test_cases/t20007_sequence.svg | 48 +++---- docs/test_cases/t20008_sequence.svg | 84 ++++++------ docs/test_cases/t20009_sequence.svg | 84 ++++++------ docs/test_cases/t20010_sequence.svg | 72 +++++----- docs/test_cases/t20011_sequence.svg | 72 +++++----- docs/test_cases/t20012_sequence.svg | 204 ++++++++++++++-------------- docs/test_cases/t20013_sequence.svg | 60 ++++---- docs/test_cases/t20014_sequence.svg | 72 +++++----- docs/test_cases/t20015_sequence.svg | 24 ++-- docs/test_cases/t20016_sequence.svg | 48 +++---- docs/test_cases/t20017_sequence.svg | 96 ++++++------- docs/test_cases/t20018_sequence.svg | 96 ++++++------- docs/test_cases/t20019_sequence.svg | 84 ++++++------ docs/test_cases/t20020_sequence.svg | 138 +++++++++---------- docs/test_cases/t20021_sequence.svg | 110 +++++++-------- docs/test_cases/t20022_sequence.svg | 36 ++--- docs/test_cases/t20023_sequence.svg | 50 +++---- docs/test_cases/t20024_sequence.svg | 88 ++++++------ docs/test_cases/t20025_sequence.svg | 42 +++--- docs/test_cases/t20026_sequence.svg | 24 ++-- docs/test_cases/t20027_sequence.svg | 24 ++-- docs/test_cases/t20028_sequence.svg | 44 +++--- docs/test_cases/t20029.md | 8 +- docs/test_cases/t20029_sequence.svg | 80 +++++------ docs/test_cases/t30001_package.svg | 48 +++---- docs/test_cases/t30002_package.svg | 90 ++++++------ docs/test_cases/t30003_package.svg | 26 ++-- docs/test_cases/t30004_package.svg | 30 ++-- docs/test_cases/t30005_package.svg | 38 +++--- docs/test_cases/t30006_package.svg | 16 +-- docs/test_cases/t30007_package.svg | 20 +-- docs/test_cases/t30008_package.svg | 34 ++--- docs/test_cases/t40001_include.svg | 30 ++-- docs/test_cases/t40002_include.svg | 34 ++--- docs/test_cases/t40003_include.svg | 50 +++---- 90 files changed, 2480 insertions(+), 2484 deletions(-) diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index 6c141f54..1abdd558 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ foo_c() = 0 : void - - + + B @@ -31,8 +31,8 @@ foo_a() : void - - + + C @@ -41,18 +41,18 @@ foo_c() : void - - + + D - + - + as : std::vector<A *> @@ -60,18 +60,18 @@ foo_a() : void foo_c() : void - - + + E - + - + as : std::vector<A *> @@ -79,13 +79,13 @@ foo_a() : void foo_c() : void - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index fa1aafcf..48aba120 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - + + A - + - + public_member : int - + - + protected_member : int - + - + private_member : int - + - + a_ : int - + - + b_ : int - + - + c_ : int - + - + static_int : int - + - + static_const_int : const int - + - + auto_member : const unsigned long @@ -112,11 +112,11 @@ protected_method() : void private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index 74b2d4a2..fd4f647d 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + B::AA @@ -28,8 +28,8 @@ AA_3 - - + + A @@ -40,16 +40,16 @@ foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -59,15 +59,15 @@ Red - - + + A::AA::AAA - + C::B @@ -75,8 +75,8 @@ int - - + + C @@ -84,39 +84,39 @@ T - + - + t : T - + - + b_int : B<int> - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -125,8 +125,8 @@ CCC_2 - - + + C::B @@ -134,16 +134,16 @@ V - + - + b : V - - + + C::CC @@ -152,16 +152,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -171,8 +171,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index d14de8e2..f6575944 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,204 +9,204 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & - + - + a : A - + - + b : B * - + - + c : C & - + - + d : const D * - + - + e : const E & - + - + f : F && - + - + g : G ** - + - + h : H *** - + - + i : I *& - + - + j : volatile J * - + - + k : K * diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index fe309ee2..498428d0 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,102 +162,102 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B *> - + - + c : std::map<int,C> - + - + d : std::map<int,D *> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G *>> - + - + h : std::array<H,10> - + - + i : std::array<I *,5> - + - + j : J [10] - + - + k : K *[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 385024ce..8a1ade04 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index b70e97f9..4ea112ce 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P,CMP,int N - + - + value : T - + - + pointer : T * - + - + reference : T & - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,16 +70,16 @@ T - + - + values : std::vector<T> - - + + B @@ -87,15 +87,15 @@ T,C<> - + - + template_template : C<T> - + B @@ -103,18 +103,18 @@ int,Vector - - + + D - + - + ints : B<int,Vector> diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 2d3e27e6..d84425f2 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,32 +50,32 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 926f6b64..74d6b03e 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,18 +66,18 @@ int - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 9d1fe682..3809e363 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,16 +18,16 @@ T - + - + value : T - - + + A @@ -36,18 +36,18 @@ foo() : void - - + + B - + - + m_a : A * diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index 01965ec7..5e3c41bc 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T,Ts... - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,50 +107,50 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index dbd0b582..a0b4dca7 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,15 +18,15 @@ T - + - + f : T - + ABCD::F @@ -34,70 +34,70 @@ int - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int print(R * r) : void - - + + E @@ -105,16 +105,16 @@ T - + - + e : T - - + + G @@ -122,22 +122,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -145,7 +145,7 @@ int - + G @@ -153,7 +153,7 @@ int,float,std::string - + E @@ -161,25 +161,25 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index 621ce9fc..9440a33d 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,U - + A @@ -96,7 +96,7 @@ long,bool - + A @@ -104,7 +104,7 @@ double,bool - + A @@ -112,7 +112,7 @@ long,float - + A @@ -120,7 +120,7 @@ double,float - + A @@ -128,7 +128,7 @@ bool,std::string - + A @@ -136,7 +136,7 @@ float,std::unique_ptr<std::string> - + A @@ -144,7 +144,7 @@ int,std::string - + A @@ -152,7 +152,7 @@ std::string,std::string - + A @@ -160,7 +160,7 @@ char,std::string - + A @@ -168,116 +168,116 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index 698a090e..deb3740f 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index 07f87718..375f581f 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -29,8 +29,8 @@ value : enum - - + + is_numeric @@ -41,8 +41,8 @@ value : enum - - + + is_numeric @@ -53,8 +53,8 @@ value : enum - - + + is_numeric @@ -65,8 +65,8 @@ value : enum - - + + is_numeric @@ -77,8 +77,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 666b370d..5889b689 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,127 +9,127 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index 65c9743d..7f1d5a3f 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,18 +9,18 @@ - - + + impl::widget - + - + n : int @@ -30,18 +30,18 @@ draw(const widget & w) : void widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index d6798a17..34155d49 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Base @@ -25,8 +25,8 @@ m2() : std::string - - + + Layer1 @@ -39,8 +39,8 @@ m2() : std::string - - + + Layer2 @@ -51,8 +51,8 @@ all_calls_count() const : int - - + + Layer3 @@ -60,18 +60,18 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int @@ -83,7 +83,7 @@ m1_calls() const : int m2_calls() const : int - + Layer3 @@ -91,7 +91,7 @@ Base - + Layer2 @@ -99,7 +99,7 @@ Layer3<Base> - + Layer1 @@ -107,18 +107,18 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index 731d6a08..ce402834 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ProductA @@ -21,8 +21,8 @@ sell(int price) const = 0 : bool - - + + ProductA1 @@ -31,8 +31,8 @@ sell(int price) const : bool - - + + ProductA2 @@ -41,8 +41,8 @@ sell(int price) const : bool - - + + ProductB @@ -53,8 +53,8 @@ buy(int price) const = 0 : bool - - + + ProductB1 @@ -63,8 +63,8 @@ buy(int price) const : bool - - + + ProductB2 @@ -73,8 +73,8 @@ buy(int price) const : bool - - + + AbstractFactory @@ -85,8 +85,8 @@ make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 @@ -97,8 +97,8 @@ make_b() const : std::unique_ptr<ProductB> - - + + Factory2 diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 4ff7e1fb..de2ad203 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Visitor @@ -23,8 +23,8 @@ visit_B(const B & item) const = 0 : void - - + + Visitor1 @@ -35,8 +35,8 @@ visit_B(const B & item) const : void - - + + Visitor2 @@ -47,8 +47,8 @@ visit_B(const B & item) const : void - - + + Visitor3 @@ -59,8 +59,8 @@ visit_B(const B & item) const : void - - + + Item @@ -71,8 +71,8 @@ accept(const Visitor & visitor) const = 0 : void - - + + A @@ -81,8 +81,8 @@ accept(const Visitor & visitor) const : void - - + + B diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index bcd585c0..333fb302 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -23,8 +23,8 @@ method2() = 0 : void - - + + A1 @@ -35,8 +35,8 @@ method2() : void - - + + A2 diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index 76081a45..c5fea584 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Strategy @@ -21,8 +21,8 @@ algorithm() = 0 : void - - + + StrategyA @@ -31,8 +31,8 @@ algorithm() : void - - + + StrategyB @@ -41,8 +41,8 @@ algorithm() : void - - + + StrategyC @@ -51,18 +51,18 @@ algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 8b5d1f50..892c91a2 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target @@ -23,8 +23,8 @@ m2() = 0 : void - - + + Target1 @@ -35,8 +35,8 @@ m2() : void - - + + Target2 @@ -47,18 +47,18 @@ m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index 66f73203..fce67bff 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target1 @@ -21,8 +21,8 @@ m2() : void - - + + Target2 @@ -33,8 +33,8 @@ m2() : void - - + + Proxy @@ -42,11 +42,11 @@ T - + - + m_target : std::shared_ptr<T> @@ -56,7 +56,7 @@ m1() : void m2() : void - + Proxy @@ -64,7 +64,7 @@ Target1 - + Proxy @@ -72,25 +72,25 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index fe63b802..4f2e600d 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,11 +18,11 @@ T - + - + m_value : T @@ -30,8 +30,8 @@ Memento<T>(T && v) : void value() const : T - - + + Originator @@ -39,11 +39,11 @@ T - + - + m_value : T @@ -57,8 +57,8 @@ print() const : void set(T && v) : void - - + + Caretaker @@ -66,11 +66,11 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> @@ -78,7 +78,7 @@ state(const std::string & n) : Memento<T> & set_state(const std::string & s, Memento<T> && m) : void - + Caretaker @@ -86,7 +86,7 @@ std::string - + Originator @@ -94,25 +94,25 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index 93568c42..f6d4459f 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Shape @@ -21,14 +21,14 @@ ~Shape() = default : void - + Line - - + + Line @@ -39,14 +39,14 @@ display() : void - + Text - - + + Text @@ -57,8 +57,8 @@ display() : void - - + + ShapeDecorator @@ -67,8 +67,8 @@ display() = 0 : void - - + + Color @@ -79,8 +79,8 @@ display() : void - - + + Weight @@ -91,7 +91,7 @@ display() : void - + Line @@ -99,7 +99,7 @@ Color,Weight - + Line @@ -107,7 +107,7 @@ Color - + Text @@ -115,7 +115,7 @@ Color,Weight - + Text @@ -123,39 +123,39 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index 971fe3cc..675dd8ba 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - + A class note. - - + + B - + B class note. - - + + C - + C class note. - - + + D - + D class note. - - + + E @@ -64,27 +64,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,10 +94,10 @@ three - + F enum note. - + E @@ -105,59 +105,59 @@ int - - + + R - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** R(C & c) : void - + R class note. diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index fc3791d6..7ade2fe3 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,64 +45,64 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index cb6ef895..3da1d48c 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,86 +9,86 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + - + eee : E * diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index 3b7f3e13..ccc9050f 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,39 +71,39 @@ int - - + + R - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index e388ed61..e66f314a 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - + + Base - - + + TBase - - + + A @@ -35,8 +35,8 @@ operator()() : void - - + + B @@ -45,8 +45,8 @@ operator()() : void - - + + C @@ -55,8 +55,8 @@ operator()() : void - - + + Overload @@ -64,15 +64,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -80,18 +80,18 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index c6bd405a..d149011a 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,18 +99,18 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index 1c560df4..fa8afbcf 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Void @@ -21,8 +21,8 @@ operator!=(const Void & ) const : bool - - + + lift_void @@ -31,16 +31,16 @@ - - + + lift_void - - + + lift_void @@ -49,8 +49,8 @@ - - + + drop_void @@ -59,16 +59,16 @@ - - + + drop_void - - + + drop_void @@ -77,33 +77,33 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 0b547ff1..24660861 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index 4cf84a3d..35a253d1 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,23 +59,23 @@ int - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index ffdda81d..3000d968 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,98 +9,98 @@ - - + + ST - + - + dimensions : struct (anonymous struct at /home/bartek/devel/clang-uml-libtooling/tests/t00037/t00037.cc:6:5) - + - + units : struct (anonymous struct at /home/bartek/devel/clang-uml-libtooling/tests/t00037/t00037.cc:14:5) - - + + ST::(dimensions) - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + ST::(units) - + - + c : double - + - + h : double - - + + A - + - + st : ST diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index 2949a684..2267501e 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,16 +88,16 @@ - - + + map - - + + map @@ -106,8 +106,8 @@ - - + + map @@ -116,8 +116,8 @@ - - + + map @@ -126,8 +126,8 @@ - - + + map diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index 1e0fd88e..b6320fb3 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B * - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T * - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M * - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M * - - + + ns3::FFF @@ -156,11 +156,11 @@ T,M,N - + - + n : N * diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index c04ea907..0eca83bf 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - + + A - + - + ii_ : int get_a() : int - - + + AA - - + + AAA - + - + b : B * get_aaa() : int - - + + R diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index d3a7e77f..886a14f2 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,100 +9,100 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + e : E * - + - + f : F * - + - + g : detail::G * - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index cdd77258..309b2316 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + A @@ -35,16 +35,16 @@ void - + - + a : void * - - + + B @@ -52,22 +52,22 @@ T,K - + - + b : T - + - + bb : K - + A @@ -75,7 +75,7 @@ double - + A @@ -83,7 +83,7 @@ std::string - + B diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index dd7ab104..c02bc777 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - + dependants - + dependencies - - + + A - - + + B @@ -33,8 +33,8 @@ b(dependants::A * a) : void - - + + BB @@ -43,8 +43,8 @@ bb(dependants::A * a) : void - - + + C @@ -53,8 +53,8 @@ c(dependants::B * b) : void - - + + D @@ -65,8 +65,8 @@ dd(dependants::BB * bb) : void - - + + E @@ -75,24 +75,24 @@ e(dependants::D * d) : void - - + + G - - + + GG - - + + H @@ -103,8 +103,8 @@ hh(dependencies::GG * gg) : void - - + + I @@ -113,8 +113,8 @@ i(dependencies::H * h) : void - - + + J diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index 4c43762b..dc4fb06b 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,7 +9,7 @@ - + signal_handler @@ -17,8 +17,8 @@ ,A - - + + sink @@ -27,15 +27,15 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + sink @@ -46,23 +46,23 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + signal_handler - - + + signal_handler @@ -71,8 +71,8 @@ - - + + signal_handler @@ -81,8 +81,8 @@ - - + + sink diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index bb7f42a3..17c3e456 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - + + A - - + + AA - - + + AAA - - + + AAAA @@ -42,103 +42,103 @@ T - + - + t : T - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::AAA - - + + ns1::ns2::R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index c4ba2dfa..7743b02a 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - + ns1 - + ns2 - + __gnu_cxx - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - + - + i : std::vector<std::uint8_t> foo(AA & aa) : void - - + + A - - + + AA diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index aeeaa7db..4ff0ab88 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + conditional_t - - + + conditional_t @@ -27,8 +27,8 @@ - - + + conditional_t @@ -37,8 +37,8 @@ - - + + conditional_t @@ -47,8 +47,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index 0ca46b63..012e3b9e 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + Base - + - + base : int foo() = 0 : void - - + + BaseTemplate @@ -35,35 +35,35 @@ T - + - + base : T foo() = 0 : void - - + + B - + - + b : int foo() : void - - + + BTemplate @@ -71,35 +71,35 @@ T - + - + b : T foo() : void - - + + A - + - + a : int foo() : void - - + + ATemplate @@ -107,11 +107,11 @@ T - + - + a : T diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index aae224ec..098be1d4 100644 --- a/docs/test_cases/t00049_class.svg +++ b/docs/test_cases/t00049_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,17 +18,17 @@ T - + - + a : T get_a() : T & - + A @@ -36,7 +36,7 @@ intmap - + A @@ -44,7 +44,7 @@ thestring - + A @@ -52,32 +52,32 @@ std::vector<thestring> - - + + R - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> - + - + a_int_map : A<intmap> diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index 4d0a66e4..ddad9aef 100644 --- a/docs/test_cases/t00050_class.svg +++ b/docs/test_cases/t00050_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + utils::D - - + + E @@ -52,8 +52,8 @@ E3 - - + + F @@ -61,44 +61,44 @@ T,V,int N - + - + t : T [N] - + - + v : V - - + + G - - + + NoComment - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula class ultricies mollis dictumst, aenean non a in donec nulla. @@ -125,50 +125,50 @@ imperdiet praesent magnis ridiculus congue gravida curabitur dictum sagittis, enim et magna sit inceptos sodales parturient pharetra mollis, aenean vel nostra tellus commodo pretium sapien sociosqu. - + This is a short description of class G. - + This is an intermediate description of class G. - + This is a long description of class G. - + Lorem ipsum - + TODO 1. Write meaningful comment - + TODO 2. Write tests - + TODO 3. Implement - + Long comment example - + TODO Implement... - + Simple array wrapper. - + Template parameters diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index a80644fc..46e81e20 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,59 +9,59 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - + + + + + + + + add(int,int) - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -72,7 +72,7 @@ - + @@ -81,14 +81,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index 971601fc..0ff3568b 100644 --- a/docs/test_cases/t20002_sequence.svg +++ b/docs/test_cases/t20002_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1() - + m1() - - + + m2() - + m2() - - + + m3() - + m3() - - + + m4() - + m4() - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20003_sequence.svg b/docs/test_cases/t20003_sequence.svg index 04ec0aac..623c3507 100644 --- a/docs/test_cases/t20003_sequence.svg +++ b/docs/test_cases/t20003_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1<T>(T) - + m1<T>(T) - - + + m2<T>(T) - + m2<T>(T) - - + + m3<T>(T) - + m3<T>(T) - - + + m4<T>(T) - + m4<T>(T) - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20004_sequence.svg b/docs/test_cases/t20004_sequence.svg index 3ce3b085..d9c7a933 100644 --- a/docs/test_cases/t20004_sequence.svg +++ b/docs/test_cases/t20004_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -29,87 +29,87 @@ - - + + main() - + main() - - + + m1<float>(float) - + m1<float>(float) - - + + m1<unsigned long>(unsigned long) - + m1<unsigned long>(unsigned long) - - + + m4<unsigned long>(unsigned long) - + m4<unsigned long>(unsigned long) - - + + m1<std::string>(std::string) - + m1<std::string>(std::string) - - + + m2<std::string>(std::string) - + m2<std::string>(std::string) - - + + m1<int>(int) - + m1<int>(int) - - + + m2<int>(int) - + m2<int>(int) - - + + m3<int>(int) - + m3<int>(int) - - + + m4<int>(int) - + m4<int>(int) - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -117,11 +117,11 @@ - + - + @@ -129,19 +129,19 @@ - + - + - + - + diff --git a/docs/test_cases/t20005_sequence.svg b/docs/test_cases/t20005_sequence.svg index 33a9128b..762f87e9 100644 --- a/docs/test_cases/t20005_sequence.svg +++ b/docs/test_cases/t20005_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - + + + - - + + C<T> - + C<T> - - + + B<T> - + B<T> - - + + A<T> - + A<T> - - - + + + c(T) - + b(T) - + a(T) diff --git a/docs/test_cases/t20006_sequence.svg b/docs/test_cases/t20006_sequence.svg index 80d0419e..5756ba83 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -34,82 +34,82 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -118,12 +118,12 @@ - + b(std::string) - + a2(std::string) @@ -132,59 +132,59 @@ - + bb1(int,int) - + aa1(int) - + bb2(int,int) - + aa2(int) - + bb1(int,std::string) - + aa2(int) - + bb2(int,std::string) - + aa1(int) - + bb1(int,float) - + bb2(int,float) - + aa2(int) diff --git a/docs/test_cases/t20007_sequence.svg b/docs/test_cases/t20007_sequence.svg index 8eb70549..44235090 100644 --- a/docs/test_cases/t20007_sequence.svg +++ b/docs/test_cases/t20007_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + Adder<int,int> - + Adder<int,int> - - + + Adder<int,float,double> - + Adder<int,float,double> - - + + Adder<std::string,std::string,std::string> - + Adder<std::string,std::string,std::string> - - - - - + + + + + add(int &&,int &&) - + add(int &&,float &&,double &&) - + add(std::string &&,std::string &&,std::string &&) diff --git a/docs/test_cases/t20008_sequence.svg b/docs/test_cases/t20008_sequence.svg index b6976ca2..79f9024b 100644 --- a/docs/test_cases/t20008_sequence.svg +++ b/docs/test_cases/t20008_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<const char *> - + B<const char *> - - + + A<const char *> - + A<const char *> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - - - - - - - + + + + + + + + b(int) - + a1(int) - + b(const char *) - + a2(const char *) - + b(std::string) - + a3(std::string) diff --git a/docs/test_cases/t20009_sequence.svg b/docs/test_cases/t20009_sequence.svg index ddf3695c..f9c0a5f3 100644 --- a/docs/test_cases/t20009_sequence.svg +++ b/docs/test_cases/t20009_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<float> - + B<float> - - + + A<float> - + A<float> - - - - - - - - + + + + + + + + b(std::string) - + a(std::string) - + b(int) - + a(int) - + b(float) - + a(float) diff --git a/docs/test_cases/t20010_sequence.svg b/docs/test_cases/t20010_sequence.svg index 4461f436..93354da2 100644 --- a/docs/test_cases/t20010_sequence.svg +++ b/docs/test_cases/t20010_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A - + A - - - - - - - - - - + + + + + + + + + + b1() - + a1() - + b2() - + a2() - + b3() - + a3() - + b4() - + a4() diff --git a/docs/test_cases/t20011_sequence.svg b/docs/test_cases/t20011_sequence.svg index 1d3321ea..e29f8e4d 100644 --- a/docs/test_cases/t20011_sequence.svg +++ b/docs/test_cases/t20011_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - + + + + + + + + + + a(int) @@ -52,26 +52,26 @@ alt - + a(int) - + b(int) - + c(int) - + @@ -81,14 +81,14 @@ alt - + b(int) - + @@ -98,7 +98,7 @@ alt - + diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index bcba7a73..2e505b9f 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,122 +43,122 @@ - - + + tmain() - + tmain() - - + + tmain()::(lambda t20012.cc:66:20) - + tmain()::(lambda t20012.cc:66:20) - - + + A - + A - - + + B - + B - - + + tmain()::(lambda t20012.cc:79:20) - + tmain()::(lambda t20012.cc:79:20) - - + + C - + C - - + + R<R::(lambda t20012.cc:85:9)> - + R<R::(lambda t20012.cc:85:9)> - - + + tmain()::(lambda t20012.cc:85:9) - + tmain()::(lambda t20012.cc:85:9) - - + + D - + D - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -167,67 +167,67 @@ - + operator()() - + c() - + cc() - + ccc() - + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -238,29 +238,29 @@ - + r() - + operator()() - + c() - + cc() - + @@ -269,7 +269,7 @@ - + add5(int) diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index ba2196ed..18b9dbee 100644 --- a/docs/test_cases/t20013_sequence.svg +++ b/docs/test_cases/t20013_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -58,12 +58,12 @@ - + b(double) - + a2(double) @@ -72,12 +72,12 @@ - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20014_sequence.svg b/docs/test_cases/t20014_sequence.svg index 19a79a3b..564095d6 100644 --- a/docs/test_cases/t20014_sequence.svg +++ b/docs/test_cases/t20014_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - - - - - - - + + + + + + + + - - + + tmain() - + tmain() - - + + B - + B - - + + A - + A - - + + C<B,int> - + C<B,int> - - - - - - - - - + + + + + + + + + b1(int,int) - + a1(int,int) @@ -67,12 +67,12 @@ - + b2(int,int) - + a2(int,int) @@ -81,17 +81,17 @@ - + c1(int,int) - + b1(int,int) - + a1(int,int) diff --git a/docs/test_cases/t20015_sequence.svg b/docs/test_cases/t20015_sequence.svg index ae6bf776..ab56bfb8 100644 --- a/docs/test_cases/t20015_sequence.svg +++ b/docs/test_cases/t20015_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + B - + B - - - + + + setup_a(std::shared_ptr<detail::A> &) diff --git a/docs/test_cases/t20016_sequence.svg b/docs/test_cases/t20016_sequence.svg index 92ca1a80..27334cd1 100644 --- a/docs/test_cases/t20016_sequence.svg +++ b/docs/test_cases/t20016_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + B<long> - + B<long> - - + + A - + A - - - - - - + + + + + + b1(long) - + a1(int) - + b2(long) - + a2(const long &) diff --git a/docs/test_cases/t20017_sequence.svg b/docs/test_cases/t20017_sequence.svg index 05730099..f7e131cd 100644 --- a/docs/test_cases/t20017_sequence.svg +++ b/docs/test_cases/t20017_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,71 +9,71 @@ - - - - - - + + + + + + - + - + t20017.cc - + t20017.cc - - include/t20017_b.h - - include/t20017_b.h - - include/t20017_a.h - - include/t20017_a.h - - - - - - + + include/t20017_a.h + + include/t20017_a.h + + include/t20017_b.h + + include/t20017_b.h + + + + + + tmain() - - - - b2<int>(int,int) + + + + a3(int,int) - - - - - a1(int,int) + + + + + b1(int,int) - - - - + + + + a2(int,int) - - - - - a3(int,int) + + + + + a1(int,int) - - - - - b1(int,int) + + + + + b2<int>(int,int) - + diff --git a/docs/test_cases/t20018_sequence.svg b/docs/test_cases/t20018_sequence.svg index c7993dc9..73a2734f 100644 --- a/docs/test_cases/t20018_sequence.svg +++ b/docs/test_cases/t20018_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + @@ -25,93 +25,93 @@ - - + + tmain() - + tmain() - - + + Answer<Factorial<5>,120> - + Answer<Factorial<5>,120> - - + + Factorial<5> - + Factorial<5> - - + + Factorial<4> - + Factorial<4> - - + + Factorial<3> - + Factorial<3> - - + + Factorial<2> - + Factorial<2> - - + + Factorial<1> - + Factorial<1> - - + + Factorial<0> - + Factorial<0> - - - - - - - - - + + + + + + + + + print() - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) diff --git a/docs/test_cases/t20019_sequence.svg b/docs/test_cases/t20019_sequence.svg index 42f5e019..ec6d1916 100644 --- a/docs/test_cases/t20019_sequence.svg +++ b/docs/test_cases/t20019_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + Base<D1> - + Base<D1> - - + + D1 - + D1 - - + + Base<D2> - + Base<D2> - - + + D2 - + D2 - - - - - - - - - - + + + + + + + + + + name() - + impl() - + name() - + impl() - + name() - + impl() - + name() - + impl() diff --git a/docs/test_cases/t20020_sequence.svg b/docs/test_cases/t20020_sequence.svg index 04ecea57..8f4f3920 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,78 +9,78 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + C - + C - - + + B - + B - - + + D<int> - + D<int> - - - - - - - - - - - - - + + + + + + + + + + + + + alt - + a1() @@ -91,25 +91,25 @@ alt - - - + + + [ - c3(int) - ] + a2() + ] - - - - + + + + [ - a2() - ] + c3(int) + ] - - + + b1() @@ -117,7 +117,7 @@ - + [ @@ -126,21 +126,21 @@ - + b2() - + a4() - + log() @@ -148,7 +148,7 @@ alt - + c1() @@ -156,7 +156,7 @@ alt - + @@ -169,7 +169,7 @@ - + @@ -179,7 +179,7 @@ alt - + d1(int,int) diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index 2567a4da..92174676 100644 --- a/docs/test_cases/t20021_sequence.svg +++ b/docs/test_cases/t20021_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + C - + C - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + loop - + [ c4() ] - + @@ -89,7 +89,7 @@ - + a3() @@ -102,7 +102,7 @@ loop - + [ @@ -111,7 +111,7 @@ - + [ @@ -120,7 +120,7 @@ - + [ @@ -129,24 +129,26 @@ - + a1() - + - c3() + [ + c3() + ] loop - + b2() @@ -156,7 +158,7 @@ loop - + [ @@ -165,7 +167,7 @@ - + b2() diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index 2b35952a..54841538 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - + + + + a() - + b() diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg index cd9cfa17..7fb37b9b 100644 --- a/docs/test_cases/t20023_sequence.svg +++ b/docs/test_cases/t20023_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,37 +9,37 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - + + + + + + + a() @@ -47,7 +47,7 @@ try - + @@ -60,7 +60,7 @@ [std::runtime_error &] - + @@ -73,7 +73,7 @@ [std::logic_error &] - + @@ -86,7 +86,7 @@ [...] - + diff --git a/docs/test_cases/t20024_sequence.svg b/docs/test_cases/t20024_sequence.svg index f28ab772..04d29c5e 100644 --- a/docs/test_cases/t20024_sequence.svg +++ b/docs/test_cases/t20024_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -33,36 +33,36 @@ - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + select(enum_a) @@ -72,7 +72,7 @@ switch [zero] - + @@ -85,7 +85,7 @@ [one] - + @@ -98,7 +98,7 @@ [two] - + @@ -111,7 +111,7 @@ [default] - + @@ -124,7 +124,7 @@ - + select(colors) @@ -134,7 +134,7 @@ switch [enum colors::red] - + @@ -143,7 +143,7 @@ [enum colors::orange] - + @@ -152,7 +152,7 @@ [enum colors::green] - + @@ -161,7 +161,7 @@ [default] - + diff --git a/docs/test_cases/t20025_sequence.svg b/docs/test_cases/t20025_sequence.svg index 5087facf..3e265ad3 100644 --- a/docs/test_cases/t20025_sequence.svg +++ b/docs/test_cases/t20025_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,41 +9,41 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + add(int,int) - + add(int,int) - - - - - + + + + + a() - + @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t20026_sequence.svg b/docs/test_cases/t20026_sequence.svg index 65ec124c..dc0e6555 100644 --- a/docs/test_cases/t20026_sequence.svg +++ b/docs/test_cases/t20026_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20027_sequence.svg b/docs/test_cases/t20027_sequence.svg index 7d8a55ac..bd7e66fa 100644 --- a/docs/test_cases/t20027_sequence.svg +++ b/docs/test_cases/t20027_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20028_sequence.svg b/docs/test_cases/t20028_sequence.svg index 1bb06467..2d3e26ce 100644 --- a/docs/test_cases/t20028_sequence.svg +++ b/docs/test_cases/t20028_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - - - - - + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - + + + + + alt - + a() - + b() - + c() @@ -60,7 +60,7 @@ - + d() diff --git a/docs/test_cases/t20029.md b/docs/test_cases/t20029.md index 1d87be03..e415ab81 100644 --- a/docs/test_cases/t20029.md +++ b/docs/test_cases/t20029.md @@ -30,23 +30,17 @@ File t20029.cc namespace clanguml { namespace t20029 { -using encoder_function_t = std::function; - std::string encode_b64(std::string &&content) { return std::move(content); } template class Encoder : public T { public: bool send(std::string &&msg) { - auto encoded = encode(std::move(msg)); - return T::send(std::move(encoded)); + return T::send(std::move(encode(std::move(msg)))); } protected: std::string encode(std::string &&msg) { return encode_b64(std::move(msg)); } - -private: - encoder_function_t f_; }; template class Retrier : public T { diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg index f3989c46..4796c891 100644 --- a/docs/test_cases/t20029_sequence.svg +++ b/docs/test_cases/t20029_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,60 +9,60 @@ - - - - - - - - - - - + + + + + + + + + + + - - + + tmain() - + tmain() - - + + ConnectionPool - + ConnectionPool - - + + Encoder<Retrier<ConnectionPool>> - + Encoder<Retrier<ConnectionPool>> - - + + encode_b64(std::string &&) - + encode_b64(std::string &&) - - + + Retrier<ConnectionPool> - + Retrier<ConnectionPool> - - - - - - - - + + + + + + + + connect() @@ -73,21 +73,21 @@ alt - + [ send(std::string &&) ] - + encode(std::string &&) - + @@ -97,7 +97,7 @@ - + send(std::string &&) @@ -108,7 +108,7 @@ alt - + [ diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 2d6ea8af..a789d1d9 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,63 +9,63 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index e8e7a652..84b3f16c 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,113 +9,113 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + BBB diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index 6ed5c88c..fcc24b1e 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,35 +9,35 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index aed06f20..52edef7c 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index 059a1b17..cf102651 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,48 +9,48 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index b22798b6..f4858ae0 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - + + B - - + + A - - + + C - + Top A note. diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index 7e7d8019..41034159 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,27 +9,27 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index e6081340..0a4e7b76 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index af48bfc7..456adb5d 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + yaml-cpp/yaml.h - + This is a lib1 include dir - + This is a t40001_include1.h include file diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index eacc6919..253d0551 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index f6074b60..ec0c4e94 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - + include - + dependants - + dependencies - + src - + dependants - + dependencies - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h - - + + t1.cc - - + + t2.cc From 5d4dfbb4b1893d70d25d14d51c3ed91ec1723d18 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 17 Dec 2022 00:42:15 +0100 Subject: [PATCH 18/19] Added sequence diagram option participants_order --- README.md | 8 +- src/config/config.cc | 1 + src/config/config.h | 1 + src/main.cc | 2 +- .../plantuml/sequence_diagram_generator.cc | 200 ++++++++++-------- .../plantuml/sequence_diagram_generator.h | 6 +- tests/t20029/.clang-uml | 8 +- 7 files changed, 132 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index 959b2972..c23c67cf 100644 --- a/README.md +++ b/README.md @@ -252,23 +252,17 @@ The following C++ code: namespace clanguml { namespace t20029 { -using encoder_function_t = std::function; - std::string encode_b64(std::string &&content) { return std::move(content); } template class Encoder : public T { public: bool send(std::string &&msg) { - auto encoded = encode(std::move(msg)); - return T::send(std::move(encoded)); + return T::send(std::move(encode(std::move(msg)))); } protected: std::string encode(std::string &&msg) { return encode_b64(std::move(msg)); } - -private: - encoder_function_t f_; }; template class Retrier : public T { diff --git a/src/config/config.cc b/src/config/config.cc index deb5d458..7891b2f5 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -594,6 +594,7 @@ template <> struct convert { get_option(node, rhs.start_from); get_option(node, rhs.combine_free_functions_into_file_participants); get_option(node, rhs.relative_to); + get_option(node, rhs.participants_order); rhs.initialize_type_aliases(); diff --git a/src/config/config.h b/src/config/config.h index 77e18787..94fda926 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -144,6 +144,7 @@ struct inheritable_diagram_options { "comment_parser", comment_parser_t::plain}; option combine_free_functions_into_file_participants{ "combine_free_functions_into_file_participants", false}; + option> participants_order{"participants_order"}; void inherit(const inheritable_diagram_options &parent); diff --git a/src/main.cc b/src/main.cc index da418888..efe97439 100644 --- a/src/main.cc +++ b/src/main.cc @@ -79,7 +79,7 @@ void generate_diagram(const std::string &od, const std::string &name, /// Find translation units for diagrams. /// /// For each diagram to be generated, this function selects translation units -/// to be used for this diagram. The diagrams are selected as an intersection +/// to be used for this diagram. The files are selected as an intersection /// between all translation units found in the compilation database and the /// `glob` patterns specified for each diagram in the configuration file. /// diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc index a88ee3b1..8e285299 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -220,93 +220,119 @@ void generator::generate_activity(const activity &a, std::ostream &ostr, } } -void generator::generate_participant(std::ostream &ostr, common::id_t id) const +void generator::generate_participant( + std::ostream &ostr, const std::string &name) const { - for (const auto participant_id : m_model.active_participants()) { - if (participant_id != id) - continue; - - if (is_participant_generated(participant_id)) - return; - - const auto &participant = - m_model.get_participant(participant_id).value(); - - if (participant.type_name() == "method") { - const auto class_id = - m_model.get_participant(participant_id) - .value() - .class_id(); - - if (is_participant_generated(class_id)) - return; - - const auto &class_participant = - m_model.get_participant(class_id).value(); - - ostr << "participant \"" - << render_name(m_config.using_namespace().relative( - class_participant.full_name(false))) - << "\" as " << class_participant.alias(); - - if (m_config.generate_links) { - common_generator::generate_link( - ostr, class_participant); - } - - ostr << '\n'; - - generated_participants_.emplace(class_id); - } - else if ((participant.type_name() == "function" || - participant.type_name() == "function_template") && - m_config.combine_free_functions_into_file_participants()) { - // Create a single participant for all functions declared in a - // single file - const auto &file_path = - m_model.get_participant(participant_id) - .value() - .file(); - - assert(!file_path.empty()); - - const auto file_id = common::to_id(file_path); - - if (is_participant_generated(file_id)) - return; - - [[maybe_unused]] const auto &relative_to = - std::filesystem::canonical(m_config.relative_to()); - - auto participant_name = std::filesystem::relative( - std::filesystem::path{file_path}, relative_to) - .string(); - - ostr << "participant \"" << render_name(participant_name) - << "\" as " << fmt::format("C_{:022}", file_id); - - ostr << '\n'; - - generated_participants_.emplace(file_id); - } - else { - ostr << "participant \"" - << m_config.using_namespace().relative( - participant.full_name(false)) - << "\" as " << participant.alias(); - - if (m_config.generate_links) { - common_generator::generate_link( - ostr, participant); - } - - ostr << '\n'; - - generated_participants_.emplace(participant_id); - } + auto p = m_model.get(name); + if (!p.has_value()) { + LOG_WARN("Cannot find participant {} from `participants_order` option", + name); return; } + + generate_participant(ostr, p.value().id(), true); +} + +void generator::generate_participant( + std::ostream &ostr, common::id_t id, bool force) const +{ + common::id_t participant_id{0}; + + if (!force) { + for (const auto pid : m_model.active_participants()) { + if (pid == id) { + participant_id = pid; + break; + } + } + } + else + participant_id = id; + + if (participant_id == 0) + return; + + if (is_participant_generated(participant_id)) + return; + + const auto &participant = + m_model.get_participant(participant_id).value(); + + if (participant.type_name() == "method") { + const auto class_id = + m_model.get_participant(participant_id) + .value() + .class_id(); + + if (is_participant_generated(class_id)) + return; + + const auto &class_participant = + m_model.get_participant(class_id).value(); + + ostr << "participant \"" + << render_name(m_config.using_namespace().relative( + class_participant.full_name(false))) + << "\" as " << class_participant.alias(); + + if (m_config.generate_links) { + common_generator::generate_link( + ostr, class_participant); + } + + ostr << '\n'; + + generated_participants_.emplace(class_id); + } + else if ((participant.type_name() == "function" || + participant.type_name() == "function_template") && + m_config.combine_free_functions_into_file_participants()) { + // Create a single participant for all functions declared in a + // single file + const auto &file_path = + m_model.get_participant(participant_id) + .value() + .file(); + + assert(!file_path.empty()); + + const auto file_id = common::to_id(file_path); + + if (is_participant_generated(file_id)) + return; + + [[maybe_unused]] const auto &relative_to = + std::filesystem::canonical(m_config.relative_to()); + + auto participant_name = std::filesystem::relative( + std::filesystem::path{file_path}, relative_to) + .string(); + + ostr << "participant \"" << render_name(participant_name) << "\" as " + << fmt::format("C_{:022}", file_id); + + ostr << '\n'; + + generated_participants_.emplace(file_id); + } + else { + ostr << "participant \"" + << m_config.using_namespace().relative( + participant.full_name(false)) + << "\" as " << participant.alias(); + + if (m_config.generate_links) { + common_generator::generate_link( + ostr, participant); + } + + ostr << '\n'; + + generated_participants_.emplace(participant_id); + } + + return; } bool generator::is_participant_generated(common::id_t id) const @@ -324,6 +350,13 @@ void generator::generate(std::ostream &ostr) const generate_plantuml_directives(ostr, m_config.puml().before); + if (m_config.participants_order.has_value) { + for (const auto &p : m_config.participants_order()) { + LOG_DBG("Pregenerating participant {}", p); + generate_participant(ostr, p); + } + } + for (const auto &sf : m_config.start_from()) { if (sf.location_type == source_location::location_t::function) { common::model::diagram_element::id_t start_from; @@ -404,5 +437,4 @@ std::string generator::generate_alias( return participant.alias(); } - } diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.h b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.h index 23a4cbe7..07e99c3c 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.h +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.h @@ -52,7 +52,11 @@ public: void generate_return(const clanguml::sequence_diagram::model::message &m, std::ostream &ostr) const; - void generate_participant(std::ostream &ostr, common::id_t id) const; + void generate_participant( + std::ostream &ostr, common::id_t id, bool force = false) const; + + void generate_participant( + std::ostream &ostr, const std::string &name) const; void generate_activity(const clanguml::sequence_diagram::model::activity &a, std::ostream &ostr, diff --git a/tests/t20029/.clang-uml b/tests/t20029/.clang-uml index 6f1d0df7..8308648f 100644 --- a/tests/t20029/.clang-uml +++ b/tests/t20029/.clang-uml @@ -14,4 +14,10 @@ diagrams: using_namespace: - clanguml::t20029 start_from: - - function: "clanguml::t20029::tmain()" \ No newline at end of file + - function: clanguml::t20029::tmain() + participants_order: + - clanguml::t20029::tmain() + - clanguml::t20029::Encoder> + - clanguml::t20029::Retrier + - clanguml::t20029::ConnectionPool + - clanguml::t20029::encode_b64(std::string &&) \ No newline at end of file From ae20cb4230bd2a97bb990fe832bc7b22d9ade62e Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 17 Dec 2022 00:44:07 +0100 Subject: [PATCH 19/19] Updated test case documentation --- docs/test_cases/t00002_class.svg | 36 ++--- docs/test_cases/t00003_class.svg | 46 +++---- docs/test_cases/t00004_class.svg | 76 +++++------ docs/test_cases/t00005_class.svg | 110 +++++++-------- docs/test_cases/t00006_class.svg | 132 +++++++++--------- docs/test_cases/t00007_class.svg | 30 ++-- docs/test_cases/t00008_class.svg | 56 ++++---- docs/test_cases/t00009_class.svg | 32 ++--- docs/test_cases/t00010_class.svg | 34 ++--- docs/test_cases/t00011_class.svg | 22 +-- docs/test_cases/t00012_class.svg | 66 ++++----- docs/test_cases/t00013_class.svg | 82 +++++------ docs/test_cases/t00014_class.svg | 116 ++++++++-------- docs/test_cases/t00015_class.svg | 22 +-- docs/test_cases/t00016_class.svg | 30 ++-- docs/test_cases/t00017_class.svg | 66 ++++----- docs/test_cases/t00018_class.svg | 18 +-- docs/test_cases/t00019_class.svg | 40 +++--- docs/test_cases/t00020_class.svg | 38 +++--- docs/test_cases/t00021_class.svg | 30 ++-- docs/test_cases/t00022_class.svg | 14 +- docs/test_cases/t00023_class.svg | 26 ++-- docs/test_cases/t00024_class.svg | 22 +-- docs/test_cases/t00025_class.svg | 34 ++--- docs/test_cases/t00026_class.svg | 42 +++--- docs/test_cases/t00027_class.svg | 58 ++++---- docs/test_cases/t00028_class.svg | 78 +++++------ docs/test_cases/t00029_class.svg | 50 +++---- docs/test_cases/t00030_class.svg | 46 +++---- docs/test_cases/t00031_class.svg | 50 +++---- docs/test_cases/t00032_class.svg | 40 +++--- docs/test_cases/t00033_class.svg | 48 +++---- docs/test_cases/t00034_class.svg | 46 +++---- docs/test_cases/t00035_class.svg | 22 +-- docs/test_cases/t00036_class.svg | 38 +++--- docs/test_cases/t00037_class.svg | 54 ++++---- docs/test_cases/t00038_class.svg | 58 ++++---- docs/test_cases/t00039_class.svg | 78 +++++------ docs/test_cases/t00040_class.svg | 26 ++-- docs/test_cases/t00041_class.svg | 54 ++++---- docs/test_cases/t00042_class.svg | 36 ++--- docs/test_cases/t00043_class.svg | 50 +++---- docs/test_cases/t00044_class.svg | 36 ++--- docs/test_cases/t00045_class.svg | 70 +++++----- docs/test_cases/t00046_class.svg | 64 ++++----- docs/test_cases/t00047_class.svg | 22 +-- docs/test_cases/t00048_class.svg | 50 +++---- docs/test_cases/t00049_class.svg | 32 ++--- docs/test_cases/t00050_class.svg | 70 +++++----- docs/test_cases/t20001_sequence.svg | 62 ++++----- docs/test_cases/t20002_sequence.svg | 48 +++---- docs/test_cases/t20003_sequence.svg | 48 +++---- docs/test_cases/t20004_sequence.svg | 120 ++++++++-------- docs/test_cases/t20005_sequence.svg | 36 ++--- docs/test_cases/t20006_sequence.svg | 150 ++++++++++---------- docs/test_cases/t20007_sequence.svg | 48 +++---- docs/test_cases/t20008_sequence.svg | 84 ++++++------ docs/test_cases/t20009_sequence.svg | 84 ++++++------ docs/test_cases/t20010_sequence.svg | 72 +++++----- docs/test_cases/t20011_sequence.svg | 72 +++++----- docs/test_cases/t20012_sequence.svg | 204 ++++++++++++++-------------- docs/test_cases/t20013_sequence.svg | 60 ++++---- docs/test_cases/t20014_sequence.svg | 72 +++++----- docs/test_cases/t20015_sequence.svg | 24 ++-- docs/test_cases/t20016_sequence.svg | 48 +++---- docs/test_cases/t20017_sequence.svg | 48 +++---- docs/test_cases/t20018_sequence.svg | 96 ++++++------- docs/test_cases/t20019_sequence.svg | 84 ++++++------ docs/test_cases/t20020_sequence.svg | 118 ++++++++-------- docs/test_cases/t20021_sequence.svg | 106 +++++++-------- docs/test_cases/t20022_sequence.svg | 36 ++--- docs/test_cases/t20023_sequence.svg | 50 +++---- docs/test_cases/t20024_sequence.svg | 88 ++++++------ docs/test_cases/t20025_sequence.svg | 42 +++--- docs/test_cases/t20026_sequence.svg | 24 ++-- docs/test_cases/t20027_sequence.svg | 24 ++-- docs/test_cases/t20028_sequence.svg | 44 +++--- docs/test_cases/t20029.md | 8 +- docs/test_cases/t20029_sequence.svg | 182 ++++++++++++------------- docs/test_cases/t30001_package.svg | 48 +++---- docs/test_cases/t30002_package.svg | 90 ++++++------ docs/test_cases/t30003_package.svg | 26 ++-- docs/test_cases/t30004_package.svg | 30 ++-- docs/test_cases/t30005_package.svg | 38 +++--- docs/test_cases/t30006_package.svg | 16 +-- docs/test_cases/t30007_package.svg | 20 +-- docs/test_cases/t30008_package.svg | 34 ++--- docs/test_cases/t40001_include.svg | 30 ++-- docs/test_cases/t40002_include.svg | 34 ++--- docs/test_cases/t40003_include.svg | 50 +++---- 90 files changed, 2500 insertions(+), 2494 deletions(-) diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index 1abdd558..315f931f 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ foo_c() = 0 : void - - + + B @@ -31,8 +31,8 @@ foo_a() : void - - + + C @@ -41,18 +41,18 @@ foo_c() : void - - + + D - + - + as : std::vector<A *> @@ -60,18 +60,18 @@ foo_a() : void foo_c() : void - - + + E - + - + as : std::vector<A *> @@ -79,13 +79,13 @@ foo_a() : void foo_c() : void - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index 48aba120..8255329e 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - + + A - + - + public_member : int - + - + protected_member : int - + - + private_member : int - + - + a_ : int - + - + b_ : int - + - + c_ : int - + - + static_int : int - + - + static_const_int : const int - + - + auto_member : const unsigned long @@ -112,11 +112,11 @@ protected_method() : void private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index fd4f647d..69f22dc2 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + B::AA @@ -28,8 +28,8 @@ AA_3 - - + + A @@ -40,16 +40,16 @@ foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -59,15 +59,15 @@ Red - - + + A::AA::AAA - + C::B @@ -75,8 +75,8 @@ int - - + + C @@ -84,39 +84,39 @@ T - + - + t : T - + - + b_int : B<int> - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -125,8 +125,8 @@ CCC_2 - - + + C::B @@ -134,16 +134,16 @@ V - + - + b : V - - + + C::CC @@ -152,16 +152,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -171,8 +171,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index f6575944..19019e03 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,204 +9,204 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & - + - + a : A - + - + b : B * - + - + c : C & - + - + d : const D * - + - + e : const E & - + - + f : F && - + - + g : G ** - + - + h : H *** - + - + i : I *& - + - + j : volatile J * - + - + k : K * diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index 498428d0..32733464 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,102 +162,102 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B *> - + - + c : std::map<int,C> - + - + d : std::map<int,D *> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G *>> - + - + h : std::array<H,10> - + - + i : std::array<I *,5> - + - + j : J [10] - + - + k : K *[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 8a1ade04..03b5db76 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index 4ea112ce..39e9add7 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P,CMP,int N - + - + value : T - + - + pointer : T * - + - + reference : T & - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,16 +70,16 @@ T - + - + values : std::vector<T> - - + + B @@ -87,15 +87,15 @@ T,C<> - + - + template_template : C<T> - + B @@ -103,18 +103,18 @@ int,Vector - - + + D - + - + ints : B<int,Vector> diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index d84425f2..bc138a31 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,32 +50,32 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 74d6b03e..bdbb5fae 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,18 +66,18 @@ int - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 3809e363..2193ba1f 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,16 +18,16 @@ T - + - + value : T - - + + A @@ -36,18 +36,18 @@ foo() : void - - + + B - + - + m_a : A * diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index 5e3c41bc..ad23298b 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T,Ts... - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,50 +107,50 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index a0b4dca7..a96caa91 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,15 +18,15 @@ T - + - + f : T - + ABCD::F @@ -34,70 +34,70 @@ int - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int print(R * r) : void - - + + E @@ -105,16 +105,16 @@ T - + - + e : T - - + + G @@ -122,22 +122,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -145,7 +145,7 @@ int - + G @@ -153,7 +153,7 @@ int,float,std::string - + E @@ -161,25 +161,25 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index 9440a33d..dc96eb98 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,U - + A @@ -96,7 +96,7 @@ long,bool - + A @@ -104,7 +104,7 @@ double,bool - + A @@ -112,7 +112,7 @@ long,float - + A @@ -120,7 +120,7 @@ double,float - + A @@ -128,7 +128,7 @@ bool,std::string - + A @@ -136,7 +136,7 @@ float,std::unique_ptr<std::string> - + A @@ -144,7 +144,7 @@ int,std::string - + A @@ -152,7 +152,7 @@ std::string,std::string - + A @@ -160,7 +160,7 @@ char,std::string - + A @@ -168,116 +168,116 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index deb3740f..cc224b49 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index 375f581f..232edc16 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -29,8 +29,8 @@ value : enum - - + + is_numeric @@ -41,8 +41,8 @@ value : enum - - + + is_numeric @@ -53,8 +53,8 @@ value : enum - - + + is_numeric @@ -65,8 +65,8 @@ value : enum - - + + is_numeric @@ -77,8 +77,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 5889b689..135a3ef1 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,127 +9,127 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index 7f1d5a3f..eb37d88f 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,18 +9,18 @@ - - + + impl::widget - + - + n : int @@ -30,18 +30,18 @@ draw(const widget & w) : void widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 34155d49..7e16eebd 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Base @@ -25,8 +25,8 @@ m2() : std::string - - + + Layer1 @@ -39,8 +39,8 @@ m2() : std::string - - + + Layer2 @@ -51,8 +51,8 @@ all_calls_count() const : int - - + + Layer3 @@ -60,18 +60,18 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int @@ -83,7 +83,7 @@ m1_calls() const : int m2_calls() const : int - + Layer3 @@ -91,7 +91,7 @@ Base - + Layer2 @@ -99,7 +99,7 @@ Layer3<Base> - + Layer1 @@ -107,18 +107,18 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index ce402834..acf87791 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ProductA @@ -21,8 +21,8 @@ sell(int price) const = 0 : bool - - + + ProductA1 @@ -31,8 +31,8 @@ sell(int price) const : bool - - + + ProductA2 @@ -41,8 +41,8 @@ sell(int price) const : bool - - + + ProductB @@ -53,8 +53,8 @@ buy(int price) const = 0 : bool - - + + ProductB1 @@ -63,8 +63,8 @@ buy(int price) const : bool - - + + ProductB2 @@ -73,8 +73,8 @@ buy(int price) const : bool - - + + AbstractFactory @@ -85,8 +85,8 @@ make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 @@ -97,8 +97,8 @@ make_b() const : std::unique_ptr<ProductB> - - + + Factory2 diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index de2ad203..4b041183 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Visitor @@ -23,8 +23,8 @@ visit_B(const B & item) const = 0 : void - - + + Visitor1 @@ -35,8 +35,8 @@ visit_B(const B & item) const : void - - + + Visitor2 @@ -47,8 +47,8 @@ visit_B(const B & item) const : void - - + + Visitor3 @@ -59,8 +59,8 @@ visit_B(const B & item) const : void - - + + Item @@ -71,8 +71,8 @@ accept(const Visitor & visitor) const = 0 : void - - + + A @@ -81,8 +81,8 @@ accept(const Visitor & visitor) const : void - - + + B diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index 333fb302..2f5faf30 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -23,8 +23,8 @@ method2() = 0 : void - - + + A1 @@ -35,8 +35,8 @@ method2() : void - - + + A2 diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index c5fea584..46fd4028 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Strategy @@ -21,8 +21,8 @@ algorithm() = 0 : void - - + + StrategyA @@ -31,8 +31,8 @@ algorithm() : void - - + + StrategyB @@ -41,8 +41,8 @@ algorithm() : void - - + + StrategyC @@ -51,18 +51,18 @@ algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 892c91a2..e8e1c0f1 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target @@ -23,8 +23,8 @@ m2() = 0 : void - - + + Target1 @@ -35,8 +35,8 @@ m2() : void - - + + Target2 @@ -47,18 +47,18 @@ m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index fce67bff..f44b4cca 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target1 @@ -21,8 +21,8 @@ m2() : void - - + + Target2 @@ -33,8 +33,8 @@ m2() : void - - + + Proxy @@ -42,11 +42,11 @@ T - + - + m_target : std::shared_ptr<T> @@ -56,7 +56,7 @@ m1() : void m2() : void - + Proxy @@ -64,7 +64,7 @@ Target1 - + Proxy @@ -72,25 +72,25 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index 4f2e600d..d9930e1d 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,11 +18,11 @@ T - + - + m_value : T @@ -30,8 +30,8 @@ Memento<T>(T && v) : void value() const : T - - + + Originator @@ -39,11 +39,11 @@ T - + - + m_value : T @@ -57,8 +57,8 @@ print() const : void set(T && v) : void - - + + Caretaker @@ -66,11 +66,11 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> @@ -78,7 +78,7 @@ state(const std::string & n) : Memento<T> & set_state(const std::string & s, Memento<T> && m) : void - + Caretaker @@ -86,7 +86,7 @@ std::string - + Originator @@ -94,25 +94,25 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index f6d4459f..ec50e838 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Shape @@ -21,14 +21,14 @@ ~Shape() = default : void - + Line - - + + Line @@ -39,14 +39,14 @@ display() : void - + Text - - + + Text @@ -57,8 +57,8 @@ display() : void - - + + ShapeDecorator @@ -67,8 +67,8 @@ display() = 0 : void - - + + Color @@ -79,8 +79,8 @@ display() : void - - + + Weight @@ -91,7 +91,7 @@ display() : void - + Line @@ -99,7 +99,7 @@ Color,Weight - + Line @@ -107,7 +107,7 @@ Color - + Text @@ -115,7 +115,7 @@ Color,Weight - + Text @@ -123,39 +123,39 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index 675dd8ba..3d19d310 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - + A class note. - - + + B - + B class note. - - + + C - + C class note. - - + + D - + D class note. - - + + E @@ -64,27 +64,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,10 +94,10 @@ three - + F enum note. - + E @@ -105,59 +105,59 @@ int - - + + R - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** R(C & c) : void - + R class note. diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index 7ade2fe3..e01c82ed 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,64 +45,64 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index 3da1d48c..97f166e7 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,86 +9,86 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + - + eee : E * diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index ccc9050f..e40c741b 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,39 +71,39 @@ int - - + + R - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index e66f314a..42fa7a8a 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - + + Base - - + + TBase - - + + A @@ -35,8 +35,8 @@ operator()() : void - - + + B @@ -45,8 +45,8 @@ operator()() : void - - + + C @@ -55,8 +55,8 @@ operator()() : void - - + + Overload @@ -64,15 +64,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -80,18 +80,18 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index d149011a..ebe61859 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,18 +99,18 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index fa8afbcf..031c11ad 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Void @@ -21,8 +21,8 @@ operator!=(const Void & ) const : bool - - + + lift_void @@ -31,16 +31,16 @@ - - + + lift_void - - + + lift_void @@ -49,8 +49,8 @@ - - + + drop_void @@ -59,16 +59,16 @@ - - + + drop_void - - + + drop_void @@ -77,33 +77,33 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 24660861..5adfc004 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index 35a253d1..c1dbe571 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,23 +59,23 @@ int - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 3000d968..a699262f 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,98 +9,98 @@ - - + + ST - + - + dimensions : struct (anonymous struct at /home/bartek/devel/clang-uml-libtooling/tests/t00037/t00037.cc:6:5) - + - + units : struct (anonymous struct at /home/bartek/devel/clang-uml-libtooling/tests/t00037/t00037.cc:14:5) - - + + ST::(dimensions) - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + ST::(units) - + - + c : double - + - + h : double - - + + A - + - + st : ST diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index 2267501e..5d46c673 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,16 +88,16 @@ - - + + map - - + + map @@ -106,8 +106,8 @@ - - + + map @@ -116,8 +116,8 @@ - - + + map @@ -126,8 +126,8 @@ - - + + map diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index b6320fb3..56274cef 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B * - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T * - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M * - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M * - - + + ns3::FFF @@ -156,11 +156,11 @@ T,M,N - + - + n : N * diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index 0eca83bf..1dac18ca 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - + + A - + - + ii_ : int get_a() : int - - + + AA - - + + AAA - + - + b : B * get_aaa() : int - - + + R diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index 886a14f2..40c86768 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,100 +9,100 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + e : E * - + - + f : F * - + - + g : detail::G * - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index 309b2316..4f270011 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + A @@ -35,16 +35,16 @@ void - + - + a : void * - - + + B @@ -52,22 +52,22 @@ T,K - + - + b : T - + - + bb : K - + A @@ -75,7 +75,7 @@ double - + A @@ -83,7 +83,7 @@ std::string - + B diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index c02bc777..c84f0eb1 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - + dependants - + dependencies - - + + A - - + + B @@ -33,8 +33,8 @@ b(dependants::A * a) : void - - + + BB @@ -43,8 +43,8 @@ bb(dependants::A * a) : void - - + + C @@ -53,8 +53,8 @@ c(dependants::B * b) : void - - + + D @@ -65,8 +65,8 @@ dd(dependants::BB * bb) : void - - + + E @@ -75,24 +75,24 @@ e(dependants::D * d) : void - - + + G - - + + GG - - + + H @@ -103,8 +103,8 @@ hh(dependencies::GG * gg) : void - - + + I @@ -113,8 +113,8 @@ i(dependencies::H * h) : void - - + + J diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index dc4fb06b..3be1d723 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,7 +9,7 @@ - + signal_handler @@ -17,8 +17,8 @@ ,A - - + + sink @@ -27,15 +27,15 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + sink @@ -46,23 +46,23 @@ sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...), type-parameter-0-2> >(sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t & sh) : void - + - + signal : sink<signal_handler<type-parameter-0-0 (type-parameter-0-1...),type-parameter-0-2>>::signal_t * - - + + signal_handler - - + + signal_handler @@ -71,8 +71,8 @@ - - + + signal_handler @@ -81,8 +81,8 @@ - - + + sink diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index 17c3e456..a00c18e0 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - + + A - - + + AA - - + + AAA - - + + AAAA @@ -42,103 +42,103 @@ T - + - + t : T - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::AAA - - + + ns1::ns2::R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index 7743b02a..aced2121 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - + ns1 - + ns2 - + __gnu_cxx - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - + - + i : std::vector<std::uint8_t> foo(AA & aa) : void - - + + A - - + + AA diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index 4ff0ab88..e9f1e13b 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + conditional_t - - + + conditional_t @@ -27,8 +27,8 @@ - - + + conditional_t @@ -37,8 +37,8 @@ - - + + conditional_t @@ -47,8 +47,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index 012e3b9e..c559d7e7 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + Base - + - + base : int foo() = 0 : void - - + + BaseTemplate @@ -35,35 +35,35 @@ T - + - + base : T foo() = 0 : void - - + + B - + - + b : int foo() : void - - + + BTemplate @@ -71,35 +71,35 @@ T - + - + b : T foo() : void - - + + A - + - + a : int foo() : void - - + + ATemplate @@ -107,11 +107,11 @@ T - + - + a : T diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index 098be1d4..19ac5e9c 100644 --- a/docs/test_cases/t00049_class.svg +++ b/docs/test_cases/t00049_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,17 +18,17 @@ T - + - + a : T get_a() : T & - + A @@ -36,7 +36,7 @@ intmap - + A @@ -44,7 +44,7 @@ thestring - + A @@ -52,32 +52,32 @@ std::vector<thestring> - - + + R - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> - + - + a_int_map : A<intmap> diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index ddad9aef..6f5aee5b 100644 --- a/docs/test_cases/t00050_class.svg +++ b/docs/test_cases/t00050_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + utils::D - - + + E @@ -52,8 +52,8 @@ E3 - - + + F @@ -61,44 +61,44 @@ T,V,int N - + - + t : T [N] - + - + v : V - - + + G - - + + NoComment - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula class ultricies mollis dictumst, aenean non a in donec nulla. @@ -125,50 +125,50 @@ imperdiet praesent magnis ridiculus congue gravida curabitur dictum sagittis, enim et magna sit inceptos sodales parturient pharetra mollis, aenean vel nostra tellus commodo pretium sapien sociosqu. - + This is a short description of class G. - + This is an intermediate description of class G. - + This is a long description of class G. - + Lorem ipsum - + TODO 1. Write meaningful comment - + TODO 2. Write tests - + TODO 3. Implement - + Long comment example - + TODO Implement... - + Simple array wrapper. - + Template parameters diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index 46e81e20..b1c8087c 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,59 +9,59 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - + + + + + + + + add(int,int) - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -72,7 +72,7 @@ - + @@ -81,14 +81,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index 0ff3568b..2f83f47f 100644 --- a/docs/test_cases/t20002_sequence.svg +++ b/docs/test_cases/t20002_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1() - + m1() - - + + m2() - + m2() - - + + m3() - + m3() - - + + m4() - + m4() - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20003_sequence.svg b/docs/test_cases/t20003_sequence.svg index 623c3507..202ff5bb 100644 --- a/docs/test_cases/t20003_sequence.svg +++ b/docs/test_cases/t20003_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1<T>(T) - + m1<T>(T) - - + + m2<T>(T) - + m2<T>(T) - - + + m3<T>(T) - + m3<T>(T) - - + + m4<T>(T) - + m4<T>(T) - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20004_sequence.svg b/docs/test_cases/t20004_sequence.svg index d9c7a933..9f2ba2c2 100644 --- a/docs/test_cases/t20004_sequence.svg +++ b/docs/test_cases/t20004_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -29,87 +29,87 @@ - - + + main() - + main() - - + + m1<float>(float) - + m1<float>(float) - - + + m1<unsigned long>(unsigned long) - + m1<unsigned long>(unsigned long) - - + + m4<unsigned long>(unsigned long) - + m4<unsigned long>(unsigned long) - - + + m1<std::string>(std::string) - + m1<std::string>(std::string) - - + + m2<std::string>(std::string) - + m2<std::string>(std::string) - - + + m1<int>(int) - + m1<int>(int) - - + + m2<int>(int) - + m2<int>(int) - - + + m3<int>(int) - + m3<int>(int) - - + + m4<int>(int) - + m4<int>(int) - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -117,11 +117,11 @@ - + - + @@ -129,19 +129,19 @@ - + - + - + - + diff --git a/docs/test_cases/t20005_sequence.svg b/docs/test_cases/t20005_sequence.svg index 762f87e9..52ea8220 100644 --- a/docs/test_cases/t20005_sequence.svg +++ b/docs/test_cases/t20005_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - + + + - - + + C<T> - + C<T> - - + + B<T> - + B<T> - - + + A<T> - + A<T> - - - + + + c(T) - + b(T) - + a(T) diff --git a/docs/test_cases/t20006_sequence.svg b/docs/test_cases/t20006_sequence.svg index 5756ba83..61c2848f 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -34,82 +34,82 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -118,12 +118,12 @@ - + b(std::string) - + a2(std::string) @@ -132,59 +132,59 @@ - + bb1(int,int) - + aa1(int) - + bb2(int,int) - + aa2(int) - + bb1(int,std::string) - + aa2(int) - + bb2(int,std::string) - + aa1(int) - + bb1(int,float) - + bb2(int,float) - + aa2(int) diff --git a/docs/test_cases/t20007_sequence.svg b/docs/test_cases/t20007_sequence.svg index 44235090..0e12cc63 100644 --- a/docs/test_cases/t20007_sequence.svg +++ b/docs/test_cases/t20007_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + Adder<int,int> - + Adder<int,int> - - + + Adder<int,float,double> - + Adder<int,float,double> - - + + Adder<std::string,std::string,std::string> - + Adder<std::string,std::string,std::string> - - - - - + + + + + add(int &&,int &&) - + add(int &&,float &&,double &&) - + add(std::string &&,std::string &&,std::string &&) diff --git a/docs/test_cases/t20008_sequence.svg b/docs/test_cases/t20008_sequence.svg index 79f9024b..30b53539 100644 --- a/docs/test_cases/t20008_sequence.svg +++ b/docs/test_cases/t20008_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<const char *> - + B<const char *> - - + + A<const char *> - + A<const char *> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - - - - - - - + + + + + + + + b(int) - + a1(int) - + b(const char *) - + a2(const char *) - + b(std::string) - + a3(std::string) diff --git a/docs/test_cases/t20009_sequence.svg b/docs/test_cases/t20009_sequence.svg index f9c0a5f3..7dbd5c5c 100644 --- a/docs/test_cases/t20009_sequence.svg +++ b/docs/test_cases/t20009_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<float> - + B<float> - - + + A<float> - + A<float> - - - - - - - - + + + + + + + + b(std::string) - + a(std::string) - + b(int) - + a(int) - + b(float) - + a(float) diff --git a/docs/test_cases/t20010_sequence.svg b/docs/test_cases/t20010_sequence.svg index 93354da2..7ec5e01e 100644 --- a/docs/test_cases/t20010_sequence.svg +++ b/docs/test_cases/t20010_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A - + A - - - - - - - - - - + + + + + + + + + + b1() - + a1() - + b2() - + a2() - + b3() - + a3() - + b4() - + a4() diff --git a/docs/test_cases/t20011_sequence.svg b/docs/test_cases/t20011_sequence.svg index e29f8e4d..f9f704d9 100644 --- a/docs/test_cases/t20011_sequence.svg +++ b/docs/test_cases/t20011_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - + + + + + + + + + + a(int) @@ -52,26 +52,26 @@ alt - + a(int) - + b(int) - + c(int) - + @@ -81,14 +81,14 @@ alt - + b(int) - + @@ -98,7 +98,7 @@ alt - + diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index 2e505b9f..300204cf 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,122 +43,122 @@ - - + + tmain() - + tmain() - - + + tmain()::(lambda t20012.cc:66:20) - + tmain()::(lambda t20012.cc:66:20) - - + + A - + A - - + + B - + B - - + + tmain()::(lambda t20012.cc:79:20) - + tmain()::(lambda t20012.cc:79:20) - - + + C - + C - - + + R<R::(lambda t20012.cc:85:9)> - + R<R::(lambda t20012.cc:85:9)> - - + + tmain()::(lambda t20012.cc:85:9) - + tmain()::(lambda t20012.cc:85:9) - - + + D - + D - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -167,67 +167,67 @@ - + operator()() - + c() - + cc() - + ccc() - + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -238,29 +238,29 @@ - + r() - + operator()() - + c() - + cc() - + @@ -269,7 +269,7 @@ - + add5(int) diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index 18b9dbee..866aee50 100644 --- a/docs/test_cases/t20013_sequence.svg +++ b/docs/test_cases/t20013_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -58,12 +58,12 @@ - + b(double) - + a2(double) @@ -72,12 +72,12 @@ - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20014_sequence.svg b/docs/test_cases/t20014_sequence.svg index 564095d6..55a9c139 100644 --- a/docs/test_cases/t20014_sequence.svg +++ b/docs/test_cases/t20014_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - - - - - - - + + + + + + + + - - + + tmain() - + tmain() - - + + B - + B - - + + A - + A - - + + C<B,int> - + C<B,int> - - - - - - - - - + + + + + + + + + b1(int,int) - + a1(int,int) @@ -67,12 +67,12 @@ - + b2(int,int) - + a2(int,int) @@ -81,17 +81,17 @@ - + c1(int,int) - + b1(int,int) - + a1(int,int) diff --git a/docs/test_cases/t20015_sequence.svg b/docs/test_cases/t20015_sequence.svg index ab56bfb8..154e5189 100644 --- a/docs/test_cases/t20015_sequence.svg +++ b/docs/test_cases/t20015_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + B - + B - - - + + + setup_a(std::shared_ptr<detail::A> &) diff --git a/docs/test_cases/t20016_sequence.svg b/docs/test_cases/t20016_sequence.svg index 27334cd1..24957575 100644 --- a/docs/test_cases/t20016_sequence.svg +++ b/docs/test_cases/t20016_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + B<long> - + B<long> - - + + A - + A - - - - - - + + + + + + b1(long) - + a1(int) - + b2(long) - + a2(const long &) diff --git a/docs/test_cases/t20017_sequence.svg b/docs/test_cases/t20017_sequence.svg index f7e131cd..f3d82e11 100644 --- a/docs/test_cases/t20017_sequence.svg +++ b/docs/test_cases/t20017_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,65 +9,65 @@ - - - - - - + + + + + + - + t20017.cc - + t20017.cc - + include/t20017_a.h - + include/t20017_a.h - + include/t20017_b.h - + include/t20017_b.h - - - - - - + + + + + + tmain() - + a3(int,int) - + b1(int,int) - + a2(int,int) - + a1(int,int) - + b2<int>(int,int) diff --git a/docs/test_cases/t20018_sequence.svg b/docs/test_cases/t20018_sequence.svg index 73a2734f..1c30c7e6 100644 --- a/docs/test_cases/t20018_sequence.svg +++ b/docs/test_cases/t20018_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + @@ -25,93 +25,93 @@ - - + + tmain() - + tmain() - - + + Answer<Factorial<5>,120> - + Answer<Factorial<5>,120> - - + + Factorial<5> - + Factorial<5> - - + + Factorial<4> - + Factorial<4> - - + + Factorial<3> - + Factorial<3> - - + + Factorial<2> - + Factorial<2> - - + + Factorial<1> - + Factorial<1> - - + + Factorial<0> - + Factorial<0> - - - - - - - - - + + + + + + + + + print() - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) diff --git a/docs/test_cases/t20019_sequence.svg b/docs/test_cases/t20019_sequence.svg index ec6d1916..478e4e23 100644 --- a/docs/test_cases/t20019_sequence.svg +++ b/docs/test_cases/t20019_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + Base<D1> - + Base<D1> - - + + D1 - + D1 - - + + Base<D2> - + Base<D2> - - + + D2 - + D2 - - - - - - - - - - + + + + + + + + + + name() - + impl() - + name() - + impl() - + name() - + impl() - + name() - + impl() diff --git a/docs/test_cases/t20020_sequence.svg b/docs/test_cases/t20020_sequence.svg index 8f4f3920..33310850 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,78 +9,78 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + C - + C - - + + B - + B - - + + D<int> - + D<int> - - - - - - - - - - - - - + + + + + + + + + + + + + alt - + a1() @@ -91,7 +91,7 @@ alt - + [ @@ -100,7 +100,7 @@ - + [ @@ -109,7 +109,7 @@ - + b1() @@ -117,7 +117,7 @@ - + [ @@ -126,21 +126,21 @@ - + b2() - + a4() - + log() @@ -148,7 +148,7 @@ alt - + c1() @@ -156,7 +156,7 @@ alt - + @@ -169,7 +169,7 @@ - + @@ -179,7 +179,7 @@ alt - + d1(int,int) diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index 92174676..ac80dcd8 100644 --- a/docs/test_cases/t20021_sequence.svg +++ b/docs/test_cases/t20021_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + C - + C - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + loop - + [ c4() ] - + @@ -89,7 +89,7 @@ - + a3() @@ -102,7 +102,7 @@ loop - + [ @@ -111,7 +111,7 @@ - + [ @@ -120,7 +120,7 @@ - + [ @@ -129,14 +129,14 @@ - + a1() - + [ @@ -148,7 +148,7 @@ loop - + b2() @@ -158,7 +158,7 @@ loop - + [ @@ -167,7 +167,7 @@ - + b2() diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index 54841538..38c9eb89 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - + + + + a() - + b() diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg index 7fb37b9b..9a6e3e04 100644 --- a/docs/test_cases/t20023_sequence.svg +++ b/docs/test_cases/t20023_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,37 +9,37 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - + + + + + + + a() @@ -47,7 +47,7 @@ try - + @@ -60,7 +60,7 @@ [std::runtime_error &] - + @@ -73,7 +73,7 @@ [std::logic_error &] - + @@ -86,7 +86,7 @@ [...] - + diff --git a/docs/test_cases/t20024_sequence.svg b/docs/test_cases/t20024_sequence.svg index 04d29c5e..bbb00947 100644 --- a/docs/test_cases/t20024_sequence.svg +++ b/docs/test_cases/t20024_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -33,36 +33,36 @@ - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + select(enum_a) @@ -72,7 +72,7 @@ switch [zero] - + @@ -85,7 +85,7 @@ [one] - + @@ -98,7 +98,7 @@ [two] - + @@ -111,7 +111,7 @@ [default] - + @@ -124,7 +124,7 @@ - + select(colors) @@ -134,7 +134,7 @@ switch [enum colors::red] - + @@ -143,7 +143,7 @@ [enum colors::orange] - + @@ -152,7 +152,7 @@ [enum colors::green] - + @@ -161,7 +161,7 @@ [default] - + diff --git a/docs/test_cases/t20025_sequence.svg b/docs/test_cases/t20025_sequence.svg index 3e265ad3..3af023f3 100644 --- a/docs/test_cases/t20025_sequence.svg +++ b/docs/test_cases/t20025_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,41 +9,41 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + add(int,int) - + add(int,int) - - - - - + + + + + a() - + @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t20026_sequence.svg b/docs/test_cases/t20026_sequence.svg index dc0e6555..946d1ec2 100644 --- a/docs/test_cases/t20026_sequence.svg +++ b/docs/test_cases/t20026_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20027_sequence.svg b/docs/test_cases/t20027_sequence.svg index bd7e66fa..cd45ef25 100644 --- a/docs/test_cases/t20027_sequence.svg +++ b/docs/test_cases/t20027_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20028_sequence.svg b/docs/test_cases/t20028_sequence.svg index 2d3e26ce..16d1cc0e 100644 --- a/docs/test_cases/t20028_sequence.svg +++ b/docs/test_cases/t20028_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - - - - - + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - + + + + + alt - + a() - + b() - + c() @@ -60,7 +60,7 @@ - + d() diff --git a/docs/test_cases/t20029.md b/docs/test_cases/t20029.md index e415ab81..352f9f77 100644 --- a/docs/test_cases/t20029.md +++ b/docs/test_cases/t20029.md @@ -17,7 +17,13 @@ diagrams: using_namespace: - clanguml::t20029 start_from: - - function: "clanguml::t20029::tmain()" + - function: clanguml::t20029::tmain() + participants_order: + - clanguml::t20029::tmain() + - clanguml::t20029::Encoder> + - clanguml::t20029::Retrier + - clanguml::t20029::ConnectionPool + - clanguml::t20029::encode_b64(std::string &&) ``` ## Source code File t20029.cc diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg index 4796c891..3a8f4bd0 100644 --- a/docs/test_cases/t20029_sequence.svg +++ b/docs/test_cases/t20029_sequence.svg @@ -1,6 +1,6 @@ - + - + @@ -9,117 +9,117 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + + + + tmain() - + tmain() - - - ConnectionPool - - ConnectionPool + + + Encoder<Retrier<ConnectionPool>> + + Encoder<Retrier<ConnectionPool>> - - - Encoder<Retrier<ConnectionPool>> - - Encoder<Retrier<ConnectionPool>> + + + Retrier<ConnectionPool> + + Retrier<ConnectionPool> - - - encode_b64(std::string &&) - - encode_b64(std::string &&) + + + ConnectionPool + + ConnectionPool - - - Retrier<ConnectionPool> - - Retrier<ConnectionPool> + + + encode_b64(std::string &&) + + encode_b64(std::string &&) - - - - - - - - - - + + + + + + + + + + connect() - + loop - + alt - - - + + + [ send(std::string &&) ] - - - - - - encode(std::string &&) + + + + + + encode(std::string &&) - - - + + + - - - - - - - - - - send(std::string &&) + + + + + + + + + + send(std::string &&) - - - loop - - - alt - - - - [ - send(const std::string &) - ] + + + loop + + + alt + + + + [ + send(const std::string &) + ] - - - - + + + + - + diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index a789d1d9..f049ce5b 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,63 +9,63 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index 84b3f16c..3a2d619b 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,113 +9,113 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + BBB diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index fcc24b1e..7c2fbabd 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,35 +9,35 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index 52edef7c..49e6f379 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index cf102651..fe55e4d1 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,48 +9,48 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index f4858ae0..b3b3006f 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - + + B - - + + A - - + + C - + Top A note. diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index 41034159..4dab2829 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,27 +9,27 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index 0a4e7b76..30a0f902 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index 456adb5d..b912675e 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + yaml-cpp/yaml.h - + This is a lib1 include dir - + This is a t40001_include1.h include file diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 253d0551..2aabc01a 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index ec0c4e94..176651a8 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - + include - + dependants - + dependencies - + src - + dependants - + dependencies - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h - - + + t1.cc - - + + t2.cc