From 9c07dbfde33ff6687e98ff61488557874ab6ed33 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 20 Apr 2024 23:16:02 +0200 Subject: [PATCH 01/11] Added support for call expressions tracking through lambdas in function arguments (#168) --- .../plantuml/sequence_diagram_generator.cc | 6 +- src/sequence_diagram/model/participant.h | 7 +- .../visitor/translation_unit_visitor.cc | 244 +++++++++++++++--- .../visitor/translation_unit_visitor.h | 28 ++ tests/t20044/.clang-uml | 17 ++ tests/t20044/t20044.cc | 100 +++++++ tests/t20044/test_case.h | 91 +++++++ tests/test_cases.cc | 1 + uml/class/class_translation_unit_visitor.yml | 2 +- 9 files changed, 452 insertions(+), 44 deletions(-) create mode 100644 tests/t20044/.clang-uml create mode 100644 tests/t20044/t20044.cc create mode 100644 tests/t20044/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 7d97a80e..64ed970a 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -112,11 +112,15 @@ void generator::generate_call(const message &m, std::ostream &ostr) const void generator::generate_return(const message &m, std::ostream &ostr) const { + // Add return activity only for messages between different actors and // only if the return type is different than void + if (m.from() == m.to()) + return; + const auto &from = model().get_participant(m.from()); const auto &to = model().get_participant(m.to()); - if ((m.from() != m.to()) && !to.value().is_void()) { + if (to.has_value() && !to.value().is_void()) { const std::string from_alias = generate_alias(from.value()); const std::string to_alias = generate_alias(to.value()); diff --git a/src/sequence_diagram/model/participant.h b/src/sequence_diagram/model/participant.h index 950a6f26..68eaeade 100644 --- a/src/sequence_diagram/model/participant.h +++ b/src/sequence_diagram/model/participant.h @@ -190,12 +190,17 @@ public: */ void is_lambda(bool is_lambda); + void set_lambda_operator_id(common::id_t id) { lambda_operator_id_ = id; } + + common::id_t lambda_operator_id() const { return lambda_operator_id_; } + private: bool is_struct_{false}; bool is_template_{false}; bool is_template_instantiation_{false}; bool is_alias_{false}; bool is_lambda_{false}; + common::id_t lambda_operator_id_{0}; std::string full_name_; }; @@ -406,7 +411,7 @@ struct method : public function { * * @return Fully qualified elements name. */ - std::string full_name(bool /*relative*/) const override; + std::string full_name(bool relative) const override; std::string message_name(message_render_mode mode) const override; diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 33b5d558..e6ee6651 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -217,6 +217,22 @@ bool translation_unit_visitor::VisitClassTemplateSpecializationDecl( return true; } +bool translation_unit_visitor::TraverseCXXMethodDecl( + clang::CXXMethodDecl *declaration) +{ + // We need to backup the context, since other methods or functions can + // be traversed during this traversal (e.g. template function/method + // specializations) + auto context_backup = context(); + + RecursiveASTVisitor::TraverseCXXMethodDecl( + declaration); + + call_expression_context_ = context_backup; + + return true; +} + bool translation_unit_visitor::VisitCXXMethodDecl( clang::CXXMethodDecl *declaration) { @@ -229,6 +245,9 @@ bool translation_unit_visitor::VisitCXXMethodDecl( if (auto *method_definition = clang::dyn_cast( declaration_definition); method_definition != nullptr) { + LOG_DBG("Calling VisitCXXMethodDecl recursively for forward " + "declaration"); + return VisitCXXMethodDecl(method_definition); } } @@ -255,7 +274,7 @@ bool translation_unit_visitor::VisitCXXMethodDecl( method_model_ptr->set_id(common::to_id(method_full_name)); // Callee methods in call expressions are referred to by first declaration - // id + // id, so they should both be mapped to method_model if (declaration->isThisDeclarationADefinition()) { set_unique_id( declaration->getFirstDecl()->getID(), method_model_ptr->id()); @@ -276,6 +295,22 @@ bool translation_unit_visitor::VisitCXXMethodDecl( return true; } +bool translation_unit_visitor::TraverseFunctionDecl( + clang::FunctionDecl *declaration) +{ + // We need to backup the context, since other methods or functions can + // be traversed during this traversal (e.g. template function/method + // specializations) + auto context_backup = context(); + + RecursiveASTVisitor::TraverseFunctionDecl( + declaration); + + call_expression_context_ = context_backup; + + return true; +} + bool translation_unit_visitor::VisitFunctionDecl( clang::FunctionDecl *declaration) { @@ -391,8 +426,9 @@ bool translation_unit_visitor::VisitLambdaExpr(clang::LambdaExpr *expr) const auto lambda_full_name = expr->getLambdaClass()->getCanonicalDecl()->getNameAsString(); - LOG_TRACE("Visiting lambda expression {} at {}", lambda_full_name, - expr->getBeginLoc().printToString(source_manager())); + LOG_TRACE("Visiting lambda expression {} at {} [caller_id = {}]", + lambda_full_name, expr->getBeginLoc().printToString(source_manager()), + context().caller_id()); LOG_TRACE("Lambda call operator ID {} - lambda class ID {}, class call " "operator ID {}", @@ -427,6 +463,33 @@ bool translation_unit_visitor::VisitLambdaExpr(clang::LambdaExpr *expr) lambda_method_model_ptr->set_id(common::to_id( get_participant(cls_id).value().full_name(false) + "::" + method_name)); + get_participant(cls_id).value().set_lambda_operator_id( + lambda_method_model_ptr->id()); + + // If lambda expression is in an argument to a method/function, and that + // method function would be excluded by filters + if (std::holds_alternative( + context().current_callexpr())/* && + !should_include( + std::get(context().current_callexpr()))*/) { + using clanguml::common::model::message_t; + using clanguml::sequence_diagram::model::message; + + message m{message_t::kCall, context().caller_id()}; + set_source_location(*expr, m); + m.set_from(context().caller_id()); + m.set_to(lambda_method_model_ptr->id()); + + diagram().add_active_participant(m.from()); + diagram().add_active_participant(m.to()); + + LOG_DBG("Found call {} from {} [{}] to {} [{}]", m.message_name(), + m.from(), m.from(), m.to(), m.to()); + + push_message(std::get(context().current_callexpr()), + std::move(m)); + } + context().enter_lambda_expression(lambda_method_model_ptr->id()); set_unique_id( @@ -454,10 +517,19 @@ bool translation_unit_visitor::TraverseLambdaExpr(clang::LambdaExpr *expr) bool translation_unit_visitor::TraverseCallExpr(clang::CallExpr *expr) { + if (source_manager().isInSystemHeader(expr->getSourceRange().getBegin())) + return true; + + LOG_DBG("Entering call expression at {}", + expr->getBeginLoc().printToString(source_manager())); + context().enter_callexpr(expr); RecursiveASTVisitor::TraverseCallExpr(expr); + LOG_DBG("Leaving call expression at {}", + expr->getBeginLoc().printToString(source_manager())); + context().leave_callexpr(); pop_message_to_diagram(expr); @@ -468,9 +540,24 @@ bool translation_unit_visitor::TraverseCallExpr(clang::CallExpr *expr) bool translation_unit_visitor::TraverseCXXMemberCallExpr( clang::CXXMemberCallExpr *expr) { + if (source_manager().isInSystemHeader(expr->getSourceRange().getBegin())) + return true; + + LOG_DBG("Entering member call expression at {} to {}::{}", + expr->getBeginLoc().printToString(source_manager()), + common::to_string(expr->getObjectType(), context().get_ast_context()), + common::to_string(expr->getMethodDecl())); + + context().enter_callexpr(expr); + RecursiveASTVisitor::TraverseCXXMemberCallExpr( expr); + LOG_DBG("Leaving member call expression at {}", + expr->getBeginLoc().printToString(source_manager())); + + context().leave_callexpr(); + pop_message_to_diagram(expr); return true; @@ -479,9 +566,13 @@ bool translation_unit_visitor::TraverseCXXMemberCallExpr( bool translation_unit_visitor::TraverseCXXOperatorCallExpr( clang::CXXOperatorCallExpr *expr) { + context().enter_callexpr(expr); + RecursiveASTVisitor::TraverseCXXOperatorCallExpr( expr); + context().leave_callexpr(); + pop_message_to_diagram(expr); return true; @@ -944,6 +1035,10 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) if (!context().valid() || context().get_ast_context() == nullptr) return true; + LOG_TRACE("Visiting call expression at {} [caller_id = {}]", + expr->getBeginLoc().printToString(source_manager()), + context().caller_id()); + message m{message_t::kCall, context().caller_id()}; m.in_static_declaration_context(within_static_variable_declaration_ > 0); @@ -957,25 +1052,11 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) if (m.skip()) return true; - auto generated_message_from_comment{false}; - for (const auto &decorator : m.decorators()) { - auto call_decorator = - std::dynamic_pointer_cast(decorator); - if (call_decorator && - call_decorator->applies_to_diagram(config().name)) { - m.set_to(common::to_id(call_decorator->callee)); - generated_message_from_comment = true; - break; - } - } + auto generated_message_from_comment = generate_message_from_comment(m); if (!generated_message_from_comment && !should_include(expr)) return true; - LOG_TRACE("Visiting call expression at {} [caller_id = {}]", - expr->getBeginLoc().printToString(source_manager()), - context().caller_id()); - // If we're currently inside a lambda expression, set it's id as // message source rather then enclosing context // Unless the lambda is declared in a function or method call @@ -987,7 +1068,9 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) m.set_message_scope(common::model::message_scope_t::kCondition); } - if (generated_message_from_comment) { } + if (generated_message_from_comment) { + // Do nothing + } // // Call to an overloaded operator // @@ -1015,8 +1098,11 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) auto *callee_decl = expr->getCalleeDecl(); if (callee_decl == nullptr) { - LOG_DBG("Cannot get callee declaration - trying direct callee..."); + LOG_DBG("Cannot get callee declaration - trying direct function " + "callee..."); callee_decl = expr->getDirectCallee(); + LOG_DBG( + "Found function/method callee in: {}", common::to_string(expr)); } if (callee_decl == nullptr) { @@ -1040,9 +1126,10 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) } } else { - if (!process_function_call_expression(m, expr)) { - LOG_DBG("Skipping call to unsupported type of call expression " - "at: {}", + auto success = process_function_call_expression(m, expr); + + if (!success) { + LOG_DBG("Skipping call to call expression at: {}", expr->getBeginLoc().printToString(source_manager())); return true; @@ -1050,6 +1137,7 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) } } + // Add message to diagram if (m.from() > 0 && m.to() > 0) { if (!generated_message_from_comment) { auto expr_comment = get_expression_comment(source_manager(), @@ -1075,6 +1163,23 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) return true; } +bool translation_unit_visitor::generate_message_from_comment( + model::message &m) const +{ + auto generated_message_from_comment{false}; + for (const auto &decorator : m.decorators()) { + auto call_decorator = + std::dynamic_pointer_cast(decorator); + if (call_decorator && + call_decorator->applies_to_diagram(config().name)) { + m.set_to(common::to_id(call_decorator->callee)); + generated_message_from_comment = true; + break; + } + } + return generated_message_from_comment; +} + bool translation_unit_visitor::TraverseVarDecl(clang::VarDecl *decl) { if (decl->isStaticLocal()) @@ -1155,12 +1260,30 @@ bool translation_unit_visitor::process_operator_call_expression( operator_call_expr->getCalleeDecl()->getID(), operator_call_expr->getBeginLoc().printToString(source_manager())); - auto maybe_id = get_unique_id(operator_call_expr->getCalleeDecl()->getID()); - if (maybe_id.has_value()) { - m.set_to(maybe_id.value()); + // Handle the case if the callee is a lambda + if (const auto *lambda_method = clang::dyn_cast( + operator_call_expr->getCalleeDecl()); + lambda_method != nullptr && lambda_method->getParent()->isLambda()) { + + LOG_DBG("Operator callee is a lambda: {}", + common::to_string(lambda_method)); + + const auto source_location{ + lambda_source_location(lambda_method->getParent()->getLocation())}; + + auto lambda_name = make_lambda_name(lambda_method->getParent()); + + m.set_to(lambda_method->getParent()->getID()); } else { - m.set_to(operator_call_expr->getCalleeDecl()->getID()); + auto maybe_id = + get_unique_id(operator_call_expr->getCalleeDecl()->getID()); + if (maybe_id.has_value()) { + m.set_to(maybe_id.value()); + } + else { + m.set_to(operator_call_expr->getCalleeDecl()->getID()); + } } m.set_message_name(fmt::format( @@ -1513,9 +1636,6 @@ translation_unit_visitor::create_class_model(clang::CXXRecordDecl *cls) c.set_name(type_name); c.set_namespace(ns); c.set_id(common::to_id(c.full_name(false))); - - // TODO: Check if lambda is declared as an argument passed to a - // function/method call } else { LOG_WARN("Cannot find parent declaration for lambda {}", @@ -1675,29 +1795,38 @@ std::string translation_unit_visitor::simplify_system_template( return config().simplify_template_type(full_name); } +std::string translation_unit_visitor::lambda_source_location( + const clang::SourceLocation &source_location) const +{ + const auto file_line = + source_manager().getSpellingLineNumber(source_location); + const auto file_column = + source_manager().getSpellingColumnNumber(source_location); + const std::string file_name = + config() + .make_path_relative( + source_manager().getFilename(source_location).str()) + .string(); + return fmt::format("{}:{}:{}", file_name, file_line, file_column); +} + std::string translation_unit_visitor::make_lambda_name( const clang::CXXRecordDecl *cls) const { std::string result; const auto location = cls->getLocation(); - const auto file_line = source_manager().getSpellingLineNumber(location); - const auto file_column = source_manager().getSpellingColumnNumber(location); - const std::string file_name = - config() - .make_path_relative(source_manager().getFilename(location).str()) - .string(); + const std::string source_location{lambda_source_location(location)}; if (context().caller_id() != 0 && get_participant(context().caller_id()).has_value()) { auto parent_full_name = get_participant(context().caller_id()).value().full_name_no_ns(); - result = fmt::format("{}##(lambda {}:{}:{})", parent_full_name, - file_name, file_line, file_column); + result = + fmt::format("{}##(lambda {})", parent_full_name, source_location); } else { - result = - fmt::format("(lambda {}:{}:{})", file_name, file_line, file_column); + result = fmt::format("(lambda {})", source_location); } return result; @@ -1775,6 +1904,25 @@ void translation_unit_visitor::finalize() } } } + + // Change all messages with target set to an id of a lambda expression to + // to the ID of their operator() - this is necessary, as some calls to + // lambda expressions are visited before the actual lambda expressions + // are visited... + for (auto &[id, activity] : diagram().sequences()) { + for (auto &m : activity.messages()) { + auto participant = diagram().get_participant(m.to()); + + if (participant && participant.value().is_lambda() && + participant.value().lambda_operator_id() != 0) { + LOG_DBG("Changing lambda expression target id from {} to {}", + m.to(), participant.value().lambda_operator_id()); + + m.set_to(participant.value().lambda_operator_id()); + m.set_message_name("operator()"); + } + } + } } std::unique_ptr @@ -1882,7 +2030,21 @@ bool translation_unit_visitor::should_include(const clang::CallExpr *expr) const const auto expr_file = expr->getBeginLoc().printToString(source_manager()); - return diagram().should_include(common::model::source_file{expr_file}); + if (!diagram().should_include(common::model::source_file{expr_file})) + return false; + + const auto *callee_decl = expr->getCalleeDecl(); + + if (callee_decl != nullptr) { + const auto *callee_function = callee_decl->getAsFunction(); + + if ((callee_function == nullptr) || !should_include(callee_function)) + return false; + + return should_include(callee_function); + } + + return true; } bool translation_unit_visitor::should_include( diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index 11e4aae3..2c3cebb4 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -95,6 +95,8 @@ public: bool TraverseLambdaExpr(clang::LambdaExpr *expr); + bool TraverseCXXMethodDecl(clang::CXXMethodDecl *declaration); + bool VisitCXXMethodDecl(clang::CXXMethodDecl *declaration); bool VisitCXXRecordDecl(clang::CXXRecordDecl *declaration); @@ -104,6 +106,8 @@ public: bool VisitClassTemplateSpecializationDecl( clang::ClassTemplateSpecializationDecl *declaration); + bool TraverseFunctionDecl(clang::FunctionDecl *declaration); + bool VisitFunctionDecl(clang::FunctionDecl *declaration); bool VisitFunctionTemplateDecl( @@ -336,6 +340,21 @@ private: */ std::string make_lambda_name(const clang::CXXRecordDecl *cls) const; + /** + * @brief Render lambda source location to string + * + * Returns exact source code location of the lambda expression in the form + * ::. + * + * The filepath is relative to the `relative_to` config option. + * + * @param source_location Clang SourceLocation instance associated with + * lambda expression + * @return String representation of the location + */ + std::string lambda_source_location( + const clang::SourceLocation &source_location) const; + /** * @brief Check if template is a smart pointer * @@ -441,6 +460,15 @@ private: const clang::SourceManager &sm, const clang::ASTContext &context, int64_t caller_id, const clang::Stmt *stmt); + /** + * @brief Initializes model message from comment call directive + * + * @param m Message instance + * @return True, if the comment associated with the call expression + * contained a call directive and it was parsed correctly. + */ + bool generate_message_from_comment(model::message &m) const; + /** * @brief Get template builder reference * diff --git a/tests/t20044/.clang-uml b/tests/t20044/.clang-uml new file mode 100644 index 00000000..37ea1a93 --- /dev/null +++ b/tests/t20044/.clang-uml @@ -0,0 +1,17 @@ +add_compile_flags: + - -fparse-all-comments +diagrams: + t20044_sequence: + type: sequence + glob: + - t20044.cc + generate_message_comments: true + include: + namespaces: + - clanguml::t20044 + exclude: + namespaces: + - clanguml::t20044::detail2 + using_namespace: clanguml::t20044 + from: + - function: "clanguml::t20044::tmain()" \ No newline at end of file diff --git a/tests/t20044/t20044.cc b/tests/t20044/t20044.cc new file mode 100644 index 00000000..832e6c4b --- /dev/null +++ b/tests/t20044/t20044.cc @@ -0,0 +1,100 @@ +// #include "include/expected.hpp" + +#include +#include +#include + +namespace clanguml { +namespace t20044 { + +enum class error { OK, FAIL }; + +namespace detail { +// Trivial std::expected mock-up just for testing calls through lambda +// expressions passed as arguments to methods +template class expected { +private: + std::optional value_; + std::optional error_; + +public: + explicit expected(V v) + : value_{std::move(v)} + { + } + explicit expected(E e) + : error_{std::move(e)} + { + } + + const auto &value() const { return *value_; } + + const auto &error() const { return *error_; } + + template auto and_then(F &&f) && + { + if (value_) + return f(*value_); + + return *this; + } +}; +} // namespace detail + +namespace detail2 { +template void run(F &&f) { f(); } +} // namespace detail2 + +using result_t = detail::expected; + +struct A { + auto a() const { } + + auto a1() const { return result_t{10}; } + + auto a2(int arg) const { return result_t{arg + 1}; } + + auto a4(int arg) const { return result_t{arg + 1}; } + + void a5() { } +}; + +auto a3(int arg) { return result_t{arg + 1}; } + +struct R { + template R(F &&f) { f(); } +}; + +int tmain() +{ + A a; + + // Call to template constructor with callable parameter and lambda + // expression as argument + R r([&a]() { a.a(); }); + + std::function a4_wrapper = &A::a4; + + std::function a4_wrapper_to_a = + std::bind(a4_wrapper, a, std::placeholders::_1); + + // The message to detail2::run() is skipped due to exclude filter, however + // the call to lambda and A::a5() is rendered + // TODO: Add some marker to highlight that this is not a direct call + detail2::run([&]() { a.a5(); }); + + return a + .a1() + // Call to a template method accepting a callable with lambda expression + // as argument, fully tracked showing method's activity and + .and_then([&](auto &&arg) { return a.a2(arg); }) + // TODO: Call to a method accepting a callable with function pointer + // as argument + .and_then(a3) + // TODO: Call to a method accepting a callable with std::function as + // argument + .and_then(a4_wrapper_to_a) + .value(); +} +} +} \ No newline at end of file diff --git a/tests/t20044/test_case.h b/tests/t20044/test_case.h new file mode 100644 index 00000000..b7bbadb4 --- /dev/null +++ b/tests/t20044/test_case.h @@ -0,0 +1,91 @@ +/** + * tests/t20044/test_case.h + * + * Copyright (c) 2021-2024 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("t20044", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20044"); + + auto diagram = config.diagrams["t20044_sequence"]; + + REQUIRE(diagram->name == "t20044_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20044_sequence"); + + { + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); + + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(src, + HasCall( + _A("tmain()"), _A("R"), "R((lambda at t20044.cc:74:9) &&)")); + REQUIRE_THAT(src, + HasCall(_A("R"), _A("tmain()::(lambda t20044.cc:74:9)"), + "operator()()")); + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda t20044.cc:74:9)"), _A("A"), "a()")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("tmain()::(lambda t20044.cc:84:18)"), + "operator()()")); + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda t20044.cc:84:18)"), _A("A"), "a5()")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a1()")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("detail::expected"), + "and_then((lambda at t20044.cc:90:19) &&)")); + + REQUIRE_THAT(src, + HasCall(_A("detail::expected"), + _A("tmain()::(lambda t20044.cc:90:19)"), "operator()()")); + + REQUIRE_THAT(src, + HasCall( + _A("tmain()::(lambda t20044.cc:90:19)"), _A("A"), "a2(int)")); + + REQUIRE_THAT(src, + HasCall( + _A("A"), _A("detail::expected"), "expected(int)")); + + save_puml(config.output_directory(), diagram->name + ".puml", src); + } + + { + auto j = generate_sequence_json(diagram, *model); + + using namespace json; + + save_json(config.output_directory(), diagram->name + ".json", j); + } + + { + auto src = generate_sequence_mermaid(diagram, *model); + + mermaid::AliasMatcher _A(src); + using mermaid::IsClass; + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); + } +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 3f92a7fc..8dc2598b 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -470,6 +470,7 @@ using namespace clanguml::test::matchers; #include "t20041/test_case.h" #include "t20042/test_case.h" #include "t20043/test_case.h" +#include "t20044/test_case.h" /// /// Package diagram tests diff --git a/uml/class/class_translation_unit_visitor.yml b/uml/class/class_translation_unit_visitor.yml index 2180a56b..ca9a7f43 100644 --- a/uml/class/class_translation_unit_visitor.yml +++ b/uml/class/class_translation_unit_visitor.yml @@ -2,7 +2,7 @@ type: class title: Class diagram TU visitor include_relations_also_as_members: false generate_method_arguments: none -generate_packages: false +generate_packages: true glob: - src/common/visitor/*.cc - src/class_diagram/visitor/*.cc From 0539fb010146904adfb0ed7f6727ba1037965ba1 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 27 Apr 2024 10:43:15 +0200 Subject: [PATCH 02/11] Fixed type aliases handling in sequence diagram message names (#260) --- .../generators/json/sequence_diagram_generator.cc | 2 ++ .../generators/mermaid/sequence_diagram_generator.cc | 2 ++ .../generators/plantuml/sequence_diagram_generator.cc | 2 ++ tests/t20044/.clang-uml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/sequence_diagram/generators/json/sequence_diagram_generator.cc b/src/sequence_diagram/generators/json/sequence_diagram_generator.cc index b23816f5..1aeef809 100644 --- a/src/sequence_diagram/generators/json/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/json/sequence_diagram_generator.cc @@ -99,6 +99,8 @@ void generator::generate_call(const message &m, nlohmann::json &parent) const } } + message = config().simplify_template_type(message); + nlohmann::json msg; msg["name"] = message; diff --git a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc index 9183c894..ce3d47bf 100644 --- a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc @@ -128,6 +128,8 @@ void generator::generate_call(const message &m, std::ostream &ostr) const } } + message = config().simplify_template_type(message); + const std::string from_alias = generate_alias(from.value()); const std::string to_alias = generate_alias(to.value()); diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc index 64ed970a..520abf9f 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -78,6 +78,8 @@ void generator::generate_call(const message &m, std::ostream &ostr) const } } + message = config().simplify_template_type(message); + const std::string from_alias = generate_alias(from.value()); const std::string to_alias = generate_alias(to.value()); diff --git a/tests/t20044/.clang-uml b/tests/t20044/.clang-uml index 37ea1a93..3526dcf7 100644 --- a/tests/t20044/.clang-uml +++ b/tests/t20044/.clang-uml @@ -5,6 +5,8 @@ diagrams: type: sequence glob: - t20044.cc + type_aliases: + "detail::expected": result_t generate_message_comments: true include: namespaces: From efc34bcec6a15b5f235cb0bc3c4838792b4a3504 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sun, 28 Apr 2024 00:57:46 +0200 Subject: [PATCH 03/11] Fixed handling of nested lambda expressions in sequence diagrams --- .../visitor/call_expression_context.cc | 3 + .../visitor/translation_unit_visitor.cc | 122 ++++++++++++++---- .../visitor/translation_unit_visitor.h | 3 + tests/t20045/.clang-uml | 13 ++ tests/t20045/t20045.cc | 47 +++++++ tests/t20045/test_case.h | 82 ++++++++++++ tests/t20046/.clang-uml | 13 ++ tests/t20046/t20046.cc | 24 ++++ tests/t20046/test_case.h | 94 ++++++++++++++ tests/test_cases.cc | 2 + tests/test_cases.h | 2 +- tests/test_cases.yaml | 9 ++ util/generate_test_case.py | 43 +++--- 13 files changed, 407 insertions(+), 50 deletions(-) create mode 100644 tests/t20045/.clang-uml create mode 100644 tests/t20045/t20045.cc create mode 100644 tests/t20045/test_case.h create mode 100644 tests/t20046/.clang-uml create mode 100644 tests/t20046/t20046.cc create mode 100644 tests/t20046/test_case.h diff --git a/src/sequence_diagram/visitor/call_expression_context.cc b/src/sequence_diagram/visitor/call_expression_context.cc index 403d460f..8d49c065 100644 --- a/src/sequence_diagram/visitor/call_expression_context.cc +++ b/src/sequence_diagram/visitor/call_expression_context.cc @@ -132,6 +132,9 @@ void call_expression_context::update( std::int64_t call_expression_context::caller_id() const { + if (lambda_caller_id() != 0) + return lambda_caller_id(); + return current_caller_id_; } diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index e6ee6651..ce866539 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -455,8 +455,10 @@ bool translation_unit_visitor::VisitLambdaExpr(clang::LambdaExpr *expr) lambda_method_model_ptr->set_method_name(method_name); lambda_method_model_ptr->set_class_id(cls_id); - lambda_method_model_ptr->set_class_full_name( - lambda_class_model_ptr->full_name(false)); + + // If this is a nested lambda, prepend the parent lambda name to this lambda + auto lambda_class_full_name = lambda_class_model_ptr->full_name(false); + lambda_method_model_ptr->set_class_full_name(lambda_class_full_name); diagram().add_participant(std::move(lambda_class_model_ptr)); @@ -469,9 +471,8 @@ bool translation_unit_visitor::VisitLambdaExpr(clang::LambdaExpr *expr) // If lambda expression is in an argument to a method/function, and that // method function would be excluded by filters if (std::holds_alternative( - context().current_callexpr())/* && - !should_include( - std::get(context().current_callexpr()))*/) { + context().current_callexpr()) && + (context().lambda_caller_id() == 0)) { using clanguml::common::model::message_t; using clanguml::sequence_diagram::model::message; @@ -504,9 +505,6 @@ bool translation_unit_visitor::VisitLambdaExpr(clang::LambdaExpr *expr) bool translation_unit_visitor::TraverseLambdaExpr(clang::LambdaExpr *expr) { - const auto lambda_full_name = - expr->getLambdaClass()->getCanonicalDecl()->getNameAsString(); - RecursiveASTVisitor::TraverseLambdaExpr(expr); // lambda context is entered inside the visitor @@ -543,10 +541,8 @@ bool translation_unit_visitor::TraverseCXXMemberCallExpr( if (source_manager().isInSystemHeader(expr->getSourceRange().getBegin())) return true; - LOG_DBG("Entering member call expression at {} to {}::{}", - expr->getBeginLoc().printToString(source_manager()), - common::to_string(expr->getObjectType(), context().get_ast_context()), - common::to_string(expr->getMethodDecl())); + LOG_DBG("Entering member call expression at {}", + expr->getBeginLoc().printToString(source_manager())); context().enter_callexpr(expr); @@ -599,6 +595,9 @@ bool translation_unit_visitor::TraverseCXXTemporaryObjectExpr( bool translation_unit_visitor::TraverseCXXConstructExpr( clang::CXXConstructExpr *expr) { + LOG_DBG("Entering cxx construct call expression at {}", + expr->getBeginLoc().printToString(source_manager())); + context().enter_callexpr(expr); RecursiveASTVisitor::TraverseCXXConstructExpr( @@ -606,6 +605,9 @@ bool translation_unit_visitor::TraverseCXXConstructExpr( translation_unit_visitor::VisitCXXConstructExpr(expr); + LOG_DBG("Leaving member call expression at {}", + expr->getBeginLoc().printToString(source_manager())); + context().leave_callexpr(); pop_message_to_diagram(expr); @@ -1057,13 +1059,6 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) if (!generated_message_from_comment && !should_include(expr)) return true; - // If we're currently inside a lambda expression, set it's id as - // message source rather then enclosing context - // Unless the lambda is declared in a function or method call - if (context().lambda_caller_id() != 0) { - m.set_from(context().lambda_caller_id()); - } - if (context().is_expr_in_current_control_statement_condition(expr)) { m.set_message_scope(common::model::message_scope_t::kCondition); } @@ -1100,9 +1095,12 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) if (callee_decl == nullptr) { LOG_DBG("Cannot get callee declaration - trying direct function " "callee..."); + callee_decl = expr->getDirectCallee(); - LOG_DBG( - "Found function/method callee in: {}", common::to_string(expr)); + + if (callee_decl != nullptr) + LOG_DBG("Found function/method callee in: {}", + common::to_string(expr)); } if (callee_decl == nullptr) { @@ -1124,6 +1122,17 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) if (!process_unresolved_lookup_call_expression(m, expr)) return true; } + else if (clang::dyn_cast_or_null( + expr->getCallee()) != nullptr) { + LOG_DBG("Processing lambda expression callee"); + if (!process_lambda_call_expression(m, expr)) + return true; + } + else { + LOG_DBG("Found unsupported callee decl type for: {} at {}", + common::to_string(expr), + expr->getBeginLoc().printToString(source_manager())); + } } else { auto success = process_function_call_expression(m, expr); @@ -1219,10 +1228,6 @@ bool translation_unit_visitor::VisitCXXConstructExpr( set_source_location(*expr, m); - if (context().lambda_caller_id() != 0) { - m.set_from(context().lambda_caller_id()); - } - if (context().is_expr_in_current_control_statement_condition(expr)) { m.set_message_scope(common::model::message_scope_t::kCondition); } @@ -1487,6 +1492,26 @@ bool translation_unit_visitor::process_function_call_expression( return true; } +bool translation_unit_visitor::process_lambda_call_expression( + model::message &m, const clang::CallExpr *expr) const +{ + const auto *lambda_expr = + clang::dyn_cast_or_null(expr->getCallee()); + + if (lambda_expr == nullptr) + return true; + + const auto lambda_class_id = lambda_expr->getLambdaClass()->getID(); + const auto maybe_id = get_unique_id(lambda_class_id); + if (!maybe_id.has_value()) + m.set_to(lambda_class_id); + else { + m.set_to(maybe_id.value()); + } + + return true; +} + bool translation_unit_visitor::process_unresolved_lookup_call_expression( model::message &m, const clang::CallExpr *expr) const { @@ -1498,7 +1523,6 @@ bool translation_unit_visitor::process_unresolved_lookup_call_expression( for (const auto *decl : unresolved_expr->decls()) { if (clang::dyn_cast_or_null(decl) != nullptr) { - // Yes, it's a template const auto *ftd = clang::dyn_cast_or_null(decl); @@ -1511,6 +1535,23 @@ bool translation_unit_visitor::process_unresolved_lookup_call_expression( break; } + else if (clang::dyn_cast_or_null(decl) != + nullptr) { + const auto *fd = + clang::dyn_cast_or_null(decl); + + const auto maybe_id = get_unique_id(fd->getID()); + if (!maybe_id.has_value()) + m.set_to(fd->getID()); + else { + m.set_to(maybe_id.value()); + } + + break; + } + else { + LOG_DBG("Unknown unresolved lookup expression"); + } } } @@ -1568,9 +1609,10 @@ translation_unit_visitor::create_class_model(clang::CXXRecordDecl *cls) const auto *parent = cls->getParent(); if ((parent != nullptr) && parent->isRecord()) { - // Here we have 2 options, either: + // Here we have 3 options, either: // - the parent is a regular C++ class/struct // - the parent is a class template declaration/specialization + // - the parent is a lambda (i.e. this is a nested lambda expression) std::optional id_opt; const auto *parent_record_decl = clang::dyn_cast(parent); @@ -1817,7 +1859,31 @@ std::string translation_unit_visitor::make_lambda_name( const auto location = cls->getLocation(); const std::string source_location{lambda_source_location(location)}; - if (context().caller_id() != 0 && + if (context().lambda_caller_id() != 0) { + // Parent is also a lambda (this id points to a lambda operator()) + std::string parent_lambda_class_name{"()"}; + if (diagram().get_participant( + context().lambda_caller_id())) { + auto parent_lambda_class_id = diagram() + .get_participant( + context().lambda_caller_id()) + .value() + .class_id(); + + if (diagram().get_participant( + parent_lambda_class_id)) { + parent_lambda_class_name = + diagram() + .get_participant(parent_lambda_class_id) + .value() + .full_name(false); + } + } + + result = fmt::format( + "{}##(lambda {})", parent_lambda_class_name, source_location); + } + else if (context().caller_id() != 0 && get_participant(context().caller_id()).has_value()) { auto parent_full_name = get_participant(context().caller_id()).value().full_name_no_ns(); diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index 2c3cebb4..e76f90d7 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -436,6 +436,9 @@ private: bool process_unresolved_lookup_call_expression( model::message &m, const clang::CallExpr *expr) const; + bool process_lambda_call_expression( + model::message &m, const clang::CallExpr *expr) const; + /** * @brief Register a message model `m` with a call expression * diff --git a/tests/t20045/.clang-uml b/tests/t20045/.clang-uml new file mode 100644 index 00000000..77290090 --- /dev/null +++ b/tests/t20045/.clang-uml @@ -0,0 +1,13 @@ +add_compile_flags: + - -fparse-all-comments +diagrams: + t20045_sequence: + type: sequence + glob: + - t20045.cc + include: + namespaces: + - clanguml::t20045 + using_namespace: clanguml::t20045 + from: + - function: "clanguml::t20045::tmain()" \ No newline at end of file diff --git a/tests/t20045/t20045.cc b/tests/t20045/t20045.cc new file mode 100644 index 00000000..d7cd3e1f --- /dev/null +++ b/tests/t20045/t20045.cc @@ -0,0 +1,47 @@ +namespace clanguml { +namespace t20045 { + +template int a1(F &&f) { return f(42); } + +int a2(int x) { return 2; } + +int a3(int x) { return 3; } + +struct B { + int b1(int x) { return x + 1; } + int b2(int x) { return x + 2; } +}; + +class C { +public: + explicit C(int x) + : x_{x} + { + } + + int get_x() const { return x_; } + +private: + int x_; +}; + +int tmain() +{ + B b; + + // \uml{call clanguml::t20045::a2(int)} + auto v1 = a1(a2); + + auto v2 = a1([](auto &&arg) { return a3(arg); }); + + auto v3 = a1([&](auto &&arg) { return b.b1(arg); }); + + auto v4 = a1([](auto &&arg) { + C c(arg); + return c.get_x(); + }); + + return 0; +} +} +} \ No newline at end of file diff --git a/tests/t20045/test_case.h b/tests/t20045/test_case.h new file mode 100644 index 00000000..a3c56b10 --- /dev/null +++ b/tests/t20045/test_case.h @@ -0,0 +1,82 @@ +/** + * tests/t20045/test_case.h + * + * Copyright (c) 2021-2024 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("t20045", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20045"); + + auto diagram = config.diagrams["t20045_sequence"]; + + REQUIRE(diagram->name == "t20045_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20045_sequence"); + + { + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); + + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a2(int)"), "")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), + _A("a1<(lambda at t20045.cc:35:18)>((lambda at " + "t20045.cc:35:18) &&)"), + "")); + + REQUIRE_THAT(src, + HasCall(_A("a1<(lambda at t20045.cc:35:18)>((lambda at " + "t20045.cc:35:18) &&)"), + _A("tmain()::(lambda t20045.cc:35:18)"), "operator()()")); + + REQUIRE_THAT(src, + HasCall( + _A("tmain()::(lambda t20045.cc:35:18)"), _A("a3(int)"), "")); + + REQUIRE_THAT(src, + HasCall( + _A("tmain()::(lambda t20045.cc:37:18)"), _A("B"), "b1(int)")); + + REQUIRE_THAT(src, + HasCall( + _A("tmain()::(lambda t20045.cc:39:18)"), _A("C"), "get_x()")); + + save_puml(config.output_directory(), diagram->name + ".puml", src); + } + + { + auto j = generate_sequence_json(diagram, *model); + + using namespace json; + + save_json(config.output_directory(), diagram->name + ".json", j); + } + + { + auto src = generate_sequence_mermaid(diagram, *model); + + mermaid::AliasMatcher _A(src); + using mermaid::IsClass; + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); + } +} \ No newline at end of file diff --git a/tests/t20046/.clang-uml b/tests/t20046/.clang-uml new file mode 100644 index 00000000..2db8bf1c --- /dev/null +++ b/tests/t20046/.clang-uml @@ -0,0 +1,13 @@ +add_compile_flags: + - -fparse-all-comments +diagrams: + t20046_sequence: + type: sequence + glob: + - t20046.cc + include: + namespaces: + - clanguml::t20046 + using_namespace: clanguml::t20046 + from: + - function: "clanguml::t20046::tmain()" \ No newline at end of file diff --git a/tests/t20046/t20046.cc b/tests/t20046/t20046.cc new file mode 100644 index 00000000..16ad93dd --- /dev/null +++ b/tests/t20046/t20046.cc @@ -0,0 +1,24 @@ +namespace clanguml { +namespace t20046 { + +template int a1(F &&f) { return f(42); } + +int a2(int x) { return 2; } + +int a3(int x) { return 3; } + +int tmain() +{ + // Call expression in a nested lambda + auto v1 = [](auto &&arg1) { + return [](auto &&arg2) { return a2(arg2); }(arg1); + }(0); + + // Call expression in a nested lambda in call expression + auto v4 = a1( + [](auto &&arg1) { return [](auto &&arg2) { return a3(arg2); }(arg1); }); + + return 0; +} +} +} \ No newline at end of file diff --git a/tests/t20046/test_case.h b/tests/t20046/test_case.h new file mode 100644 index 00000000..ff71025c --- /dev/null +++ b/tests/t20046/test_case.h @@ -0,0 +1,94 @@ +/** + * tests/t20046/test_case.h + * + * Copyright (c) 2021-2024 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("t20046", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20046"); + + auto diagram = config.diagrams["t20046_sequence"]; + + REQUIRE(diagram->name == "t20046_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20046_sequence"); + + { + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); + + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("tmain()::(lambda t20046.cc:13:15)"), + "operator()()")); + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda t20046.cc:13:15)"), + _A("tmain()::(lambda t20046.cc:13:15)::(lambda " + "t20046.cc:14:16)"), + "operator()()")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda t20046.cc:13:15)::(lambda " + "t20046.cc:14:16)"), + _A("a2(int)"), "")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), + _A("a1<(lambda at t20046.cc:19:9)>((lambda at t20046.cc:19:9) " + "&&)"), + "")); + + REQUIRE_THAT(src, + HasCall( + _A("a1<(lambda at t20046.cc:19:9)>((lambda at t20046.cc:19:9) " + "&&)"), + _A("tmain()::(lambda t20046.cc:19:9)"), "operator()()")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda t20046.cc:19:9)"), + _A("tmain()::(lambda t20046.cc:19:9)::(lambda " + "t20046.cc:19:34)"), + "operator()()")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda t20046.cc:19:9)::(lambda " + "t20046.cc:19:34)"), + _A("a3(int)"), "")); + + save_puml(config.output_directory(), diagram->name + ".puml", src); + } + + { + auto j = generate_sequence_json(diagram, *model); + + using namespace json; + + save_json(config.output_directory(), diagram->name + ".json", j); + } + + { + auto src = generate_sequence_mermaid(diagram, *model); + + mermaid::AliasMatcher _A(src); + using mermaid::IsClass; + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); + } +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 8dc2598b..3253c6ae 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -471,6 +471,8 @@ using namespace clanguml::test::matchers; #include "t20042/test_case.h" #include "t20043/test_case.h" #include "t20044/test_case.h" +#include "t20045/test_case.h" +#include "t20046/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.h b/tests/test_cases.h index 4b16e59c..6cc3cb06 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -400,7 +400,7 @@ struct AliasMatcher { } } - return "__INVALID__ALIAS__"; + return fmt::format("__INVALID__ALIAS__({})", name); } const std::vector puml; diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index 1f611954..a2675040 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -352,6 +352,15 @@ test_cases: - name: t20043 title: Test case for elements diagram filter in sequence diagrams description: + - name: t20044 + title: Test case for template method call expressions with callables + description: + - name: t20045 + title: Test case for template function call expressions with callables + description: + - name: t20046 + title: Test case for call expressions in nested lambdas + description: Package diagrams: - name: t30001 title: Basic package diagram test case diff --git a/util/generate_test_case.py b/util/generate_test_case.py index e024c180..a2a95163 100755 --- a/util/generate_test_case.py +++ b/util/generate_test_case.py @@ -26,63 +26,64 @@ TEST_CASE_MULTIPLIER = 10000 CLASS_DIAGRAM_TEST_CASE_EXAMPLES = """ // Check if all classes exist - //REQUIRE_THAT(puml, IsClass(_A("A"))); + //REQUIRE_THAT(src, IsClass(_A("A"))); // Check if class templates exist - //REQUIRE_THAT(puml, IsClassTemplate("A", "T,P,CMP,int N")); + //REQUIRE_THAT(src, IsClassTemplate("A", "T,P,CMP,int N")); // Check concepts - //REQUIRE_THAT(puml, IsConcept(_A("AConcept"))); - //REQUIRE_THAT(puml, + //REQUIRE_THAT(src, IsConcept(_A("AConcept"))); + //REQUIRE_THAT(src, // IsConceptRequirement( // _A("AConcept"), "sizeof (T) > sizeof (P)")); // Check if all enums exist - //REQUIRE_THAT(puml, IsEnum(_A("Lights"))); + //REQUIRE_THAT(src, IsEnum(_A("Lights"))); // Check if all inner classes exist - //REQUIRE_THAT(puml, IsInnerClass(_A("A"), _A("AA"))); + //REQUIRE_THAT(src, IsInnerClass(_A("A"), _A("AA"))); // Check if all inheritance relationships exist - //REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("Child"))); + //REQUIRE_THAT(src, IsBaseClass(_A("Base"), _A("Child"))); // Check if all methods exist - //REQUIRE_THAT(puml, (IsMethod("foo"))); + //REQUIRE_THAT(src, (IsMethod("foo"))); // Check if all fields exist - //REQUIRE_THAT(puml, (IsField("private_member", "int"))); + //REQUIRE_THAT(src, (IsField("private_member", "int"))); // Check if all relationships exist - //REQUIRE_THAT(puml, IsAssociation(_A("D"), _A("A"), "-as")); - //REQUIRE_THAT(puml, IsDependency(_A("R"), _A("B"))); - //REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("D"), "-ag")); - //REQUIRE_THAT(puml, IsComposition(_A("R"), _A("D"), "-ac")); - //REQUIRE_THAT(puml, IsInstantiation(_A("ABCD::F"), _A("F"))); + //REQUIRE_THAT(src, IsAssociation(_A("D"), _A("A"), "-as")); + //REQUIRE_THAT(src, IsDependency(_A("R"), _A("B"))); + //REQUIRE_THAT(src, IsAggregation(_A("R"), _A("D"), "-ag")); + //REQUIRE_THAT(src, IsComposition(_A("R"), _A("D"), "-ac")); + //REQUIRE_THAT(src, IsInstantiation(_A("ABCD::F"), _A("F"))); """ SEQUENCE_DIAGRAM_TEST_CASE_EXAMPLES = """ // Check if all calls exist - //REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); - //REQUIRE_THAT(puml, HasCall(_A("A"), "a()")); + //REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + //REQUIRE_THAT(src, HasCall(_A("A"), "a()")); """ PACKAGE_DIAGRAM_TEST_CASE_EXAMPLES = """ // Check if all packages exist - //REQUIRE_THAT(puml, IsPackage("ns1")); + //REQUIRE_THAT(src, IsPackage("ns1")); """ INCLUDE_DIAGRAM_TEST_CASE_EXAMPLES = """ // Check all folders exist - //REQUIRE_THAT(puml, IsFolder("lib1")); + //REQUIRE_THAT(src, IsFolder("lib1")); // Check if all files exist - //REQUIRE_THAT(puml, IsFile("lib1.h")); + //REQUIRE_THAT(src, IsFile("lib1.h")); // Check if all includes exists - //REQUIRE_THAT(puml, IsAssociation(_A("t40002.cc"), _A("lib1.h"))); - //REQUIRE_THAT(puml, IsDependency(_A("t40001_include1.h"), _A("string"))); + //REQUIRE_THAT(src, IsAssociation(_A("t40002.cc"), _A("lib1.h"))); + //REQUIRE_THAT(src, IsDependency(_A("t40001_include1.h"), _A("string"))); """ + def test_case_already_exists(name): return os.path.isdir(os.path.join(os.path.dirname(__file__), '..', name)) From 6c6575bc7f954361d2909d16f4a14ac4ff505b89 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Mon, 29 Apr 2024 13:17:02 +0200 Subject: [PATCH 04/11] Added test case for call directive in sequence diagrams --- tests/t20047/.clang-uml | 13 ++++++++ tests/t20047/t20047.cc | 42 ++++++++++++++++++++++++++ tests/t20047/test_case.h | 65 ++++++++++++++++++++++++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 ++ 5 files changed, 124 insertions(+) create mode 100644 tests/t20047/.clang-uml create mode 100644 tests/t20047/t20047.cc create mode 100644 tests/t20047/test_case.h diff --git a/tests/t20047/.clang-uml b/tests/t20047/.clang-uml new file mode 100644 index 00000000..3cb8298f --- /dev/null +++ b/tests/t20047/.clang-uml @@ -0,0 +1,13 @@ +add_compile_flags: + - -fparse-all-comments +diagrams: + t20047_sequence: + type: sequence + glob: + - t20047.cc + include: + namespaces: + - clanguml::t20047 + using_namespace: clanguml::t20047 + from: + - function: "clanguml::t20047::tmain()" \ No newline at end of file diff --git a/tests/t20047/t20047.cc b/tests/t20047/t20047.cc new file mode 100644 index 00000000..4444c54d --- /dev/null +++ b/tests/t20047/t20047.cc @@ -0,0 +1,42 @@ +#include + +namespace clanguml { +namespace t20047 { + +int a1(int x) { return x + 1; } + +int a2(int x) { return x + 2; } + +int a3(int x) { return x + 3; } + +int a4(int x) { return x + 4; } + +int a5(int x) { return x + 5; } + +int a6(int x) { return x + 6; } + +int run(int (*f)(int), int arg) { return f(arg); } + +int tmain() +{ + auto res = + // \uml{call clanguml::t20047::a1(int)} + run(a1, 0); + + res = a3( + // \uml{call clanguml::t20047::a2(int)} + run(a2, 0)); + + // \uml{call clanguml::t20047::a4(int)} + res = [](auto &&x) { return a4(x); }(0); + + // \uml{call clanguml::t20047::a5(int)} + res = std::async(a5, 10).get(); + + // \uml{call clanguml::t20047::a6(int)} + res = [](auto &&x) { return std::async(run, a6, x).get(); }(1); + + return res; +} +} +} \ No newline at end of file diff --git a/tests/t20047/test_case.h b/tests/t20047/test_case.h new file mode 100644 index 00000000..3643c2db --- /dev/null +++ b/tests/t20047/test_case.h @@ -0,0 +1,65 @@ +/** + * tests/t20047/test_case.h + * + * Copyright (c) 2021-2024 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("t20047", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20047"); + + auto diagram = config.diagrams["t20047_sequence"]; + + REQUIRE(diagram->name == "t20047_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20047_sequence"); + + { + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); + + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a1(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a2(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a3(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a4(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a5(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a6(int)"), "")); + + save_puml(config.output_directory(), diagram->name + ".puml", src); + } + + { + auto j = generate_sequence_json(diagram, *model); + + using namespace json; + + save_json(config.output_directory(), diagram->name + ".json", j); + } + + { + auto src = generate_sequence_mermaid(diagram, *model); + + mermaid::AliasMatcher _A(src); + using mermaid::IsClass; + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); + } +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 3253c6ae..cb715570 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -473,6 +473,7 @@ using namespace clanguml::test::matchers; #include "t20044/test_case.h" #include "t20045/test_case.h" #include "t20046/test_case.h" +#include "t20047/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index a2675040..a9f7954e 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -361,6 +361,9 @@ test_cases: - name: t20046 title: Test case for call expressions in nested lambdas description: + - name: t20047 + title: Test case for 'call' comment directive + description: Package diagrams: - name: t30001 title: Basic package diagram test case From 4293a6cc796740deae4d49b977fd2dfd1b287656 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 30 Apr 2024 00:06:42 +0200 Subject: [PATCH 05/11] Improved handling of message call comments (#264) --- src/common/visitor/translation_unit_visitor.h | 36 +++++--- src/decorators/decorators.cc | 25 ++++- src/decorators/decorators.h | 5 +- src/sequence_diagram/model/message.cc | 6 +- .../visitor/translation_unit_visitor.cc | 31 ++++--- .../visitor/translation_unit_visitor.h | 2 +- tests/t20048/.clang-uml | 14 +++ tests/t20048/t20048.cc | 40 ++++++++ tests/t20048/test_case.h | 91 +++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_decorator_parser.cc | 57 ++++++++++-- 11 files changed, 267 insertions(+), 41 deletions(-) create mode 100644 tests/t20048/.clang-uml create mode 100644 tests/t20048/t20048.cc create mode 100644 tests/t20048/test_case.h diff --git a/src/common/visitor/translation_unit_visitor.h b/src/common/visitor/translation_unit_visitor.h index 6f271832..7f7d8242 100644 --- a/src/common/visitor/translation_unit_visitor.h +++ b/src/common/visitor/translation_unit_visitor.h @@ -265,23 +265,29 @@ public: * @param comment clang::RawComment pointer * @param de Reference to clang::DiagnosticsEngine * @param element Reference to element to be updated + * @return Comment with uml directives stripped from it */ - void process_comment(const clang::RawComment *comment, - clang::DiagnosticsEngine &de, + [[maybe_unused]] std::string process_comment( + const clang::RawComment *comment, clang::DiagnosticsEngine &de, clanguml::common::model::decorated_element &e) { - if (comment != nullptr) { - auto [it, inserted] = processed_comments_.emplace(comment); + if (comment == nullptr) + return {}; - if (!inserted) - return; + auto [it, inserted] = processed_comments_.emplace(comment); - // Process clang-uml decorators in the comments - // TODO: Refactor to use standard block comments processable by - // clang comments - e.add_decorators(decorators::parse( - comment->getFormattedText(source_manager_, de))); - } + if (!inserted) + return {}; + + // Process clang-uml decorators in the comments + // TODO: Refactor to use standard block comments processable by + // clang comments + const auto &[decorators, stripped_comment] = + decorators::parse(comment->getFormattedText(source_manager_, de)); + + e.add_decorators(decorators); + + return stripped_comment; } /** @@ -332,6 +338,12 @@ public: */ const ConfigT &config() const { return config_; } +protected: + std::set &processed_comments() + { + return processed_comments_; + } + private: // Reference to the output diagram model DiagramT &diagram_; diff --git a/src/decorators/decorators.cc b/src/decorators/decorators.cc index 0c39d214..090bfeb9 100644 --- a/src/decorators/decorators.cc +++ b/src/decorators/decorators.cc @@ -187,10 +187,12 @@ std::shared_ptr call::from_string(std::string_view c) return res; } -std::vector> parse( +std::pair>, std::string> parse( std::string documentation_block, const std::string &clanguml_tag) { std::vector> res; + std::string stripped_comment; + const std::string begin_tag{"@" + clanguml_tag}; const auto begin_tag_size = begin_tag.size(); @@ -202,12 +204,20 @@ std::vector> parse( const std::string_view block_view{documentation_block}; auto pos = block_view.find("@" + clanguml_tag + "{"); + + if (pos == std::string::npos) { + // This comment had no uml directives + return {{}, util::trim(documentation_block)}; + } + + size_t last_end_pos{0}; while (pos < documentation_block.size()) { auto c_begin = pos + begin_tag_size; - auto c_end = documentation_block.find('}', c_begin); + auto c_end = block_view.find('}', c_begin); - if (c_end == std::string::npos) - return res; + if (c_end == std::string::npos) { + return {res, util::trim(stripped_comment)}; + } auto com = decorator::from_string(block_view.substr(c_begin + 1, c_end - 2)); @@ -215,10 +225,15 @@ std::vector> parse( if (com) res.emplace_back(std::move(com)); + const auto in_between_length = pos - last_end_pos; + stripped_comment += block_view.substr(last_end_pos, in_between_length); + + last_end_pos = pos + (c_end - c_begin + begin_tag_size + 1); + pos = block_view.find("@" + clanguml_tag + "{", c_end); } - return res; + return {res, util::trim(stripped_comment)}; }; } // namespace clanguml::decorators diff --git a/src/decorators/decorators.h b/src/decorators/decorators.h index b745f87a..4afbffac 100644 --- a/src/decorators/decorators.h +++ b/src/decorators/decorators.h @@ -156,9 +156,10 @@ struct call : public decorator { * * @param documentation_block Documentation block extracted from source code * @param clanguml_tag Name of the clanguml tag (default `uml`) - * @return List of clang-uml decorators extracted from comment + * @return Pair of: a list of clang-uml decorators extracted from comment and + * a comment stripped of any uml directives */ -std::vector> parse( +std::pair>, std::string> parse( std::string documentation_block, const std::string &clanguml_tag = "uml"); } // namespace decorators diff --git a/src/sequence_diagram/model/message.cc b/src/sequence_diagram/model/message.cc index fad5ca19..012aecc0 100644 --- a/src/sequence_diagram/model/message.cc +++ b/src/sequence_diagram/model/message.cc @@ -59,7 +59,11 @@ const std::string &message::return_type() const { return return_type_; } const std::optional &message::comment() const { return comment_; } -void message::set_comment(std::string c) { comment_ = std::move(c); } +void message::set_comment(std::string c) +{ + if (!c.empty()) + comment_ = std::move(c); +} void message::set_comment(const std::optional &c) { diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index ce866539..63c0750d 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -1047,24 +1047,28 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) set_source_location(*expr, m); - process_comment(clanguml::common::get_expression_raw_comment( - source_manager(), *context().get_ast_context(), expr), - context().get_ast_context()->getDiagnostics(), m); + const auto *raw_expr_comment = clanguml::common::get_expression_raw_comment( + source_manager(), *context().get_ast_context(), expr); + const auto stripped_comment = process_comment( + raw_expr_comment, context().get_ast_context()->getDiagnostics(), m); if (m.skip()) return true; auto generated_message_from_comment = generate_message_from_comment(m); - if (!generated_message_from_comment && !should_include(expr)) + if (!generated_message_from_comment && !should_include(expr)) { + processed_comments().erase(raw_expr_comment); return true; + } if (context().is_expr_in_current_control_statement_condition(expr)) { m.set_message_scope(common::model::message_scope_t::kCondition); } if (generated_message_from_comment) { - // Do nothing + LOG_DBG( + "Message for this call expression is taken from comment directive"); } // // Call to an overloaded operator @@ -1148,11 +1152,7 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) // Add message to diagram if (m.from() > 0 && m.to() > 0) { - if (!generated_message_from_comment) { - auto expr_comment = get_expression_comment(source_manager(), - *context().get_ast_context(), context().caller_id(), expr); - m.set_comment(expr_comment); - } + m.set_comment(stripped_comment); if (diagram().sequences().find(m.from()) == diagram().sequences().end()) { @@ -2167,10 +2167,17 @@ std::optional translation_unit_visitor::get_expression_comment( if (raw_comment == nullptr) return {}; - if (!processed_comments_.emplace(caller_id, raw_comment).second) { + if (!processed_comments_by_caller_id_.emplace(caller_id, raw_comment) + .second) { return {}; } - return raw_comment->getFormattedText(sm, sm.getDiagnostics()); + const auto &[decorators, stripped_comment] = decorators::parse( + raw_comment->getFormattedText(sm, sm.getDiagnostics())); + + if (stripped_comment.empty()) + return {}; + + return stripped_comment; } } // namespace clanguml::sequence_diagram::visitor diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index e76f90d7..10c779df 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -511,7 +511,7 @@ private: already_visited_in_static_declaration_{}; mutable std::set> - processed_comments_; + processed_comments_by_caller_id_; template_builder_t template_builder_; }; diff --git a/tests/t20048/.clang-uml b/tests/t20048/.clang-uml new file mode 100644 index 00000000..0b3d7e10 --- /dev/null +++ b/tests/t20048/.clang-uml @@ -0,0 +1,14 @@ +add_compile_flags: + - -fparse-all-comments +diagrams: + t20048_sequence: + type: sequence + glob: + - t20048.cc + generate_message_comments: true + include: + namespaces: + - clanguml::t20048 + using_namespace: clanguml::t20048 + from: + - function: "clanguml::t20048::tmain()" \ No newline at end of file diff --git a/tests/t20048/t20048.cc b/tests/t20048/t20048.cc new file mode 100644 index 00000000..cd04fa1c --- /dev/null +++ b/tests/t20048/t20048.cc @@ -0,0 +1,40 @@ +#include + +namespace clanguml { +namespace t20048 { + +int a1(int x) { return x + 1; } + +int a2(int x) { return x + 2; } + +int a3(int x) { return x + 3; } + +int a4(int x) { return x + 4; } + +int a5(int x) { return x + 5; } + +int a6(int x) { return x + 6; } + +int a7(int x) { return x + 7; } + +int tmain() +{ + // a1() adds `1` to the result of a2() + auto res = a1(a2(a3(0))); + + // This lambda calls a4() which adds `4` to it's argument + res = [](auto &&x) { return a4(x); }(0); + + // a5() adds `1` to the result of a6() + res = a5( + // a6() adds `1` to its argument + a6(0)); + + // a7() is called via add std::async + // \uml{call clanguml::t20048::a7(int)} + res = std::async(a7, 10).get(); + + return 0; +} +} +} \ No newline at end of file diff --git a/tests/t20048/test_case.h b/tests/t20048/test_case.h new file mode 100644 index 00000000..b9a45e86 --- /dev/null +++ b/tests/t20048/test_case.h @@ -0,0 +1,91 @@ +/** + * tests/t20048/test_case.h + * + * Copyright (c) 2021-2024 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("t20048", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20048"); + + auto diagram = config.diagrams["t20048_sequence"]; + + REQUIRE(diagram->name == "t20048_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20048_sequence"); + + { + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); + + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a3(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a2(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a1(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a5(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a6(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("a7(int)"), "")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("tmain()::(lambda t20048.cc:26:11)"), + "operator()()")); + REQUIRE_THAT(src, + HasCall( + _A("tmain()::(lambda t20048.cc:26:11)"), _A("a4(int)"), "")); + + REQUIRE_THAT(src, + HasMessageComment(_A("tmain()"), + "a1\\(\\) adds `1` to the result\\n" + "of a2\\(\\)")); + REQUIRE_THAT(src, + HasMessageComment(_A("tmain()"), + "This lambda calls a4\\(\\) which\\n" + "adds `4` to it's argument")); + REQUIRE_THAT(src, + HasMessageComment( + _A("tmain()"), "a6\\(\\) adds `1` to its argument")); + REQUIRE_THAT(src, + HasMessageComment(_A("tmain()"), + "a5\\(\\) adds `1` to the result\\n" + "of a6\\(\\)")); + REQUIRE_THAT(src, + HasMessageComment( + _A("tmain()"), "a7\\(\\) is called via add std::async")); + + save_puml(config.output_directory(), diagram->name + ".puml", src); + } + + { + auto j = generate_sequence_json(diagram, *model); + + using namespace json; + + save_json(config.output_directory(), diagram->name + ".json", j); + } + + { + auto src = generate_sequence_mermaid(diagram, *model); + + mermaid::AliasMatcher _A(src); + using mermaid::IsClass; + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); + } +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index cb715570..1d24eec7 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -474,6 +474,7 @@ using namespace clanguml::test::matchers; #include "t20045/test_case.h" #include "t20046/test_case.h" #include "t20047/test_case.h" +#include "t20048/test_case.h" /// /// Package diagram tests diff --git a/tests/test_decorator_parser.cc b/tests/test_decorator_parser.cc index 5ef6b19a..2334cf4f 100644 --- a/tests/test_decorator_parser.cc +++ b/tests/test_decorator_parser.cc @@ -20,6 +20,7 @@ #include "decorators/decorators.h" #include "catch.h" +#include "util/util.h" TEST_CASE("Test decorator parser on regular comment", "[unit-test]") { @@ -35,9 +36,10 @@ TEST_CASE("Test decorator parser on regular comment", "[unit-test]") using namespace clanguml::decorators; - auto decorators = parse(comment); + auto [decorators, stripped] = parse(comment); CHECK(decorators.empty()); + CHECK(clanguml::util::trim(comment) == stripped); } TEST_CASE("Test decorator parser on note", "[unit-test]") @@ -62,7 +64,7 @@ TEST_CASE("Test decorator parser on note", "[unit-test]") using namespace clanguml::decorators; - auto decorators = parse(comment); + auto [decorators, stripped] = parse(comment); CHECK(decorators.size() == 4); @@ -86,6 +88,15 @@ TEST_CASE("Test decorator parser on note", "[unit-test]") CHECK(n4); CHECK(n4->position == "left"); CHECK(n4->text == "This is a comment"); + + CHECK(stripped == R"(\brief This is a comment. + + This is a longer comment. + + \ + + \param a int an int + \param b float a float)"); } TEST_CASE("Test decorator parser on note with custom tag", "[unit-test]") @@ -110,7 +121,7 @@ TEST_CASE("Test decorator parser on note with custom tag", "[unit-test]") using namespace clanguml::decorators; - auto decorators = parse(comment, "clanguml"); + auto [decorators, stripped] = parse(comment, "clanguml"); CHECK(decorators.size() == 4); @@ -134,6 +145,15 @@ TEST_CASE("Test decorator parser on note with custom tag", "[unit-test]") CHECK(n4); CHECK(n4->position == "left"); CHECK(n4->text == "This is a comment"); + + CHECK(stripped == R"(\brief This is a comment. + + This is a longer comment. + + \ + + \param a int an int + \param b float a float)"); } TEST_CASE("Test decorator parser on style", "[unit-test]") @@ -144,7 +164,7 @@ TEST_CASE("Test decorator parser on style", "[unit-test]") using namespace clanguml::decorators; - auto decorators = parse(comment); + auto [decorators, stripped] = parse(comment); CHECK(decorators.size() == 1); @@ -152,6 +172,7 @@ TEST_CASE("Test decorator parser on style", "[unit-test]") CHECK(n1); CHECK(n1->spec == "#green,dashed,thickness=4"); + CHECK(stripped.empty()); } TEST_CASE("Test decorator parser on aggregation", "[unit-test]") @@ -162,7 +183,7 @@ TEST_CASE("Test decorator parser on aggregation", "[unit-test]") using namespace clanguml::decorators; - auto decorators = parse(comment); + auto [decorators, stripped] = parse(comment); CHECK(decorators.size() == 1); @@ -170,6 +191,7 @@ TEST_CASE("Test decorator parser on aggregation", "[unit-test]") CHECK(n1); CHECK(n1->multiplicity == "0..1:0..*"); + CHECK(stripped.empty()); } TEST_CASE("Test decorator parser on skip", "[unit-test]") @@ -180,13 +202,14 @@ TEST_CASE("Test decorator parser on skip", "[unit-test]") using namespace clanguml::decorators; - auto decorators = parse(comment); + auto [decorators, stripped] = parse(comment); CHECK(decorators.size() == 1); auto n1 = std::dynamic_pointer_cast(decorators.at(0)); CHECK(n1); + CHECK(stripped.empty()); } TEST_CASE("Test decorator parser on skiprelationship", "[unit-test]") @@ -197,13 +220,14 @@ TEST_CASE("Test decorator parser on skiprelationship", "[unit-test]") using namespace clanguml::decorators; - auto decorators = parse(comment); + auto [decorators, stripped] = parse(comment); CHECK(decorators.size() == 1); auto n1 = std::dynamic_pointer_cast(decorators.at(0)); CHECK(n1); + CHECK(stripped.empty()); } TEST_CASE("Test decorator parser on diagram scope", "[unit-test]") @@ -215,7 +239,7 @@ TEST_CASE("Test decorator parser on diagram scope", "[unit-test]") using namespace clanguml::decorators; - auto decorators = parse(comment); + auto [decorators, stripped] = parse(comment); CHECK(decorators.size() == 1); @@ -232,4 +256,21 @@ TEST_CASE("Test decorator parser on diagram scope", "[unit-test]") CHECK(n1->applies_to_diagram("diagram2")); CHECK(!n1->applies_to_diagram("diagram4")); + CHECK(stripped.empty()); +} + +TEST_CASE("Test invalid comment - unterminated curly brace", "[unit-test]") +{ + std::string comment = R"( + Test test test + \uml{call clanguml::test:aa() + )"; + + using namespace clanguml::decorators; + + auto [decorators, stripped] = parse(comment); + + CHECK(decorators.size() == 0); + + CHECK(stripped.empty()); } From 51c5b887a8cba892f43cc4f3dda3752170dfa63d Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 30 Apr 2024 10:53:33 +0200 Subject: [PATCH 06/11] Added lambda operator() arguments to messages in sequence diagrams --- .../visitor/translation_unit_visitor.cc | 54 +++++++++++++++---- .../visitor/translation_unit_visitor.h | 3 ++ tests/t20012/test_case.h | 18 +++---- tests/t20044/test_case.h | 3 +- tests/t20045/test_case.h | 3 +- tests/t20046/test_case.h | 9 ++-- tests/t20048/test_case.h | 2 +- 7 files changed, 66 insertions(+), 26 deletions(-) diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 63c0750d..cf42cb09 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -446,13 +446,8 @@ bool translation_unit_visitor::VisitLambdaExpr(clang::LambdaExpr *expr) set_unique_id(cls->getID(), cls_id); - // Create lambda class operator() participant auto lambda_method_model_ptr = - std::make_unique( - config().using_namespace()); - - const auto *method_name = "operator()"; - lambda_method_model_ptr->set_method_name(method_name); + create_lambda_method_model(expr->getCallOperator()); lambda_method_model_ptr->set_class_id(cls_id); @@ -462,8 +457,9 @@ bool translation_unit_visitor::VisitLambdaExpr(clang::LambdaExpr *expr) diagram().add_participant(std::move(lambda_class_model_ptr)); - lambda_method_model_ptr->set_id(common::to_id( - get_participant(cls_id).value().full_name(false) + "::" + method_name)); + lambda_method_model_ptr->set_id( + common::to_id(get_participant(cls_id).value().full_name(false) + + "::" + lambda_method_model_ptr->full_name_no_ns())); get_participant(cls_id).value().set_lambda_operator_id( lambda_method_model_ptr->id()); @@ -1992,7 +1988,8 @@ void translation_unit_visitor::finalize() } std::unique_ptr -translation_unit_visitor::create_method_model(clang::CXXMethodDecl *declaration) +translation_unit_visitor::create_lambda_method_model( + clang::CXXMethodDecl *declaration) { auto method_model_ptr = std::make_unique( config().using_namespace()); @@ -2009,6 +2006,44 @@ translation_unit_visitor::create_method_model(clang::CXXMethodDecl *declaration) declaration->isMoveAssignmentOperator()); method_model_ptr->is_const(declaration->isConst()); method_model_ptr->is_static(declaration->isStatic()); + method_model_ptr->is_operator(declaration->isOverloadedOperator()); + method_model_ptr->is_constructor( + clang::dyn_cast(declaration) != nullptr); + + method_model_ptr->is_void(declaration->getReturnType()->isVoidType()); + + method_model_ptr->return_type(common::to_string( + declaration->getReturnType(), declaration->getASTContext())); + + for (const auto *param : declaration->parameters()) { + auto parameter_type = + common::to_string(param->getType(), param->getASTContext()); + common::ensure_lambda_type_is_relative(config(), parameter_type); + parameter_type = simplify_system_template(parameter_type); + method_model_ptr->add_parameter(config().using_namespace().relative( + simplify_system_template(parameter_type))); + } + + return method_model_ptr; +} + +std::unique_ptr +translation_unit_visitor::create_method_model(clang::CXXMethodDecl *declaration) +{ + auto method_model_ptr = std::make_unique( + config().using_namespace()); + + common::model::namespace_ ns{declaration->getQualifiedNameAsString()}; + auto method_name = ns.name(); + method_model_ptr->set_method_name(method_name); + ns.pop_back(); + method_model_ptr->set_name(ns.name()); + ns.pop_back(); + + method_model_ptr->is_defaulted(declaration->isDefaulted()); + method_model_ptr->is_assignment(declaration->isCopyAssignmentOperator() || + declaration->isMoveAssignmentOperator()); + method_model_ptr->is_const(declaration->isConst()); method_model_ptr->is_static(declaration->isStatic()); method_model_ptr->is_operator(declaration->isOverloadedOperator()); method_model_ptr->is_constructor( @@ -2040,7 +2075,6 @@ translation_unit_visitor::create_method_model(clang::CXXMethodDecl *declaration) .value() .full_name_no_ns() + "::" + declaration->getNameAsString()); - method_model_ptr->is_static(declaration->isStatic()); method_model_ptr->return_type(common::to_string( declaration->getReturnType(), declaration->getASTContext())); diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index 10c779df..98944838 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -314,6 +314,9 @@ private: std::unique_ptr create_method_model(clang::CXXMethodDecl *cls); + std::unique_ptr + create_lambda_method_model(clang::CXXMethodDecl *cls); + std::unique_ptr build_function_template_instantiation(const clang::FunctionDecl &pDecl); diff --git a/tests/t20012/test_case.h b/tests/t20012/test_case.h index ddebb1d5..99adea7b 100644 --- a/tests/t20012/test_case.h +++ b/tests/t20012/test_case.h @@ -37,7 +37,7 @@ TEST_CASE("t20012", "[test-case][sequence]") // Check if all calls exist REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("tmain()::(lambda t20012.cc:67:20)"), - "operator()()")); + "operator()() const")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20012.cc:67:20)"), _A("A"), "a()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()")); @@ -54,7 +54,7 @@ TEST_CASE("t20012", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20012.cc:80:20)"), - _A("tmain()::(lambda t20012.cc:67:20)"), "operator()()")); + _A("tmain()::(lambda t20012.cc:67:20)"), "operator()() const")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); @@ -65,7 +65,7 @@ TEST_CASE("t20012", "[test-case][sequence]") HasCall(_A("tmain()"), _A("R<(lambda at t20012.cc:86:9)>"), "r()")); REQUIRE_THAT(src, HasCall(_A("R<(lambda at t20012.cc:86:9)>"), - _A("tmain()::(lambda t20012.cc:86:9)"), "operator()()")); + _A("tmain()::(lambda t20012.cc:86:9)"), "operator()() const")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20012.cc:86:9)"), _A("C"), "c()")); @@ -82,7 +82,7 @@ TEST_CASE("t20012", "[test-case][sequence]") std::vector messages = { FindMessage(j, "tmain()", "tmain()::(lambda t20012.cc:67:20)", - "operator()()"), + "operator()() const"), FindMessage(j, "tmain()::(lambda t20012.cc:67:20)", "A", "a()"), FindMessage(j, "A", "A", "aa()"), FindMessage(j, "A", "A", "aaa()"), FindMessage(j, "tmain()::(lambda t20012.cc:67:20)", "B", "b()"), @@ -90,10 +90,10 @@ TEST_CASE("t20012", "[test-case][sequence]") FindMessage(j, "tmain()::(lambda t20012.cc:80:20)", "C", "c()"), FindMessage(j, "C", "C", "cc()"), FindMessage(j, "C", "C", "ccc()"), FindMessage(j, "tmain()::(lambda t20012.cc:80:20)", - "tmain()::(lambda t20012.cc:67:20)", "operator()()"), + "tmain()::(lambda t20012.cc:67:20)", "operator()() const"), FindMessage(j, "tmain()", "R<(lambda at t20012.cc:86:9)>", "r()"), FindMessage(j, "R<(lambda at t20012.cc:86:9)>", - "tmain()::(lambda t20012.cc:86:9)", "operator()()"), + "tmain()::(lambda t20012.cc:86:9)", "operator()() const"), FindMessage(j, "tmain()::(lambda t20012.cc:86:9)", "C", "c()"), // @todo #168 // FindMessage(j, "tmain()", "D", "add5(int)") @@ -112,7 +112,7 @@ TEST_CASE("t20012", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("tmain()::(lambda t20012.cc:67:20)"), - "operator()()")); + "operator()() const")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20012.cc:67:20)"), _A("A"), "a()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()")); @@ -129,7 +129,7 @@ TEST_CASE("t20012", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20012.cc:80:20)"), - _A("tmain()::(lambda t20012.cc:67:20)"), "operator()()")); + _A("tmain()::(lambda t20012.cc:67:20)"), "operator()() const")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); @@ -137,7 +137,7 @@ TEST_CASE("t20012", "[test-case][sequence]") HasCall(_A("tmain()"), _A("R<(lambda at t20012.cc:86:9)>"), "r()")); REQUIRE_THAT(src, HasCall(_A("R<(lambda at t20012.cc:86:9)>"), - _A("tmain()::(lambda t20012.cc:86:9)"), "operator()()")); + _A("tmain()::(lambda t20012.cc:86:9)"), "operator()() const")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20012.cc:86:9)"), _A("C"), "c()")); diff --git a/tests/t20044/test_case.h b/tests/t20044/test_case.h index b7bbadb4..3ff700b3 100644 --- a/tests/t20044/test_case.h +++ b/tests/t20044/test_case.h @@ -59,7 +59,8 @@ TEST_CASE("t20044", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("detail::expected"), - _A("tmain()::(lambda t20044.cc:90:19)"), "operator()()")); + _A("tmain()::(lambda t20044.cc:90:19)"), + "operator()(auto &&) const")); REQUIRE_THAT(src, HasCall( diff --git a/tests/t20045/test_case.h b/tests/t20045/test_case.h index a3c56b10..5d8d7775 100644 --- a/tests/t20045/test_case.h +++ b/tests/t20045/test_case.h @@ -46,7 +46,8 @@ TEST_CASE("t20045", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("a1<(lambda at t20045.cc:35:18)>((lambda at " "t20045.cc:35:18) &&)"), - _A("tmain()::(lambda t20045.cc:35:18)"), "operator()()")); + _A("tmain()::(lambda t20045.cc:35:18)"), + "operator()(auto &&) const")); REQUIRE_THAT(src, HasCall( diff --git a/tests/t20046/test_case.h b/tests/t20046/test_case.h index ff71025c..c4ddbacb 100644 --- a/tests/t20046/test_case.h +++ b/tests/t20046/test_case.h @@ -37,12 +37,12 @@ TEST_CASE("t20046", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("tmain()::(lambda t20046.cc:13:15)"), - "operator()()")); + "operator()(auto &&) const")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20046.cc:13:15)"), _A("tmain()::(lambda t20046.cc:13:15)::(lambda " "t20046.cc:14:16)"), - "operator()()")); + "operator()(auto &&) const")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20046.cc:13:15)::(lambda " @@ -59,13 +59,14 @@ TEST_CASE("t20046", "[test-case][sequence]") HasCall( _A("a1<(lambda at t20046.cc:19:9)>((lambda at t20046.cc:19:9) " "&&)"), - _A("tmain()::(lambda t20046.cc:19:9)"), "operator()()")); + _A("tmain()::(lambda t20046.cc:19:9)"), + "operator()(auto &&) const")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20046.cc:19:9)"), _A("tmain()::(lambda t20046.cc:19:9)::(lambda " "t20046.cc:19:34)"), - "operator()()")); + "operator()(auto &&) const")); REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20046.cc:19:9)::(lambda " diff --git a/tests/t20048/test_case.h b/tests/t20048/test_case.h index b9a45e86..aa83b02f 100644 --- a/tests/t20048/test_case.h +++ b/tests/t20048/test_case.h @@ -45,7 +45,7 @@ TEST_CASE("t20048", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("tmain()::(lambda t20048.cc:26:11)"), - "operator()()")); + "operator()(auto &&) const")); REQUIRE_THAT(src, HasCall( _A("tmain()::(lambda t20048.cc:26:11)"), _A("a4(int)"), "")); From dfb4f38ded926c717a30681166f8d9b6417f53b7 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 30 Apr 2024 11:51:31 +0200 Subject: [PATCH 07/11] Fixed generation of internal clang-uml diagrams --- src/sequence_diagram/model/diagram.cc | 5 ++++ src/sequence_diagram/model/diagram.h | 8 ++++++ .../visitor/translation_unit_visitor.cc | 19 +++++++++----- tests/t20012/test_case.h | 26 ++++++++++++++----- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/sequence_diagram/model/diagram.cc b/src/sequence_diagram/model/diagram.cc index 5edb4220..03253968 100644 --- a/src/sequence_diagram/model/diagram.cc +++ b/src/sequence_diagram/model/diagram.cc @@ -98,6 +98,11 @@ const activity &diagram::get_activity(common::id_t id) const return sequences_.at(id); } +bool diagram::has_activity(common::id_t id) const +{ + return sequences_.count(id) > 0; +} + activity &diagram::get_activity(common::id_t id) { return sequences_.at(id); } void diagram::add_message(model::message &&message) diff --git a/src/sequence_diagram/model/diagram.h b/src/sequence_diagram/model/diagram.h index 3b485b4d..f8aa3740 100644 --- a/src/sequence_diagram/model/diagram.h +++ b/src/sequence_diagram/model/diagram.h @@ -100,6 +100,14 @@ public: */ void add_active_participant(common::id_t id); + /** + * @brief Check if diagram has activity identified by caller id + * + * @param id Caller id representing the activity + * @return True, if an activity already exists + */ + bool has_activity(common::id_t id) const; + /** * @brief Get reference to current activity of a participant * diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index cf42cb09..14b5c8e1 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -514,14 +514,14 @@ bool translation_unit_visitor::TraverseCallExpr(clang::CallExpr *expr) if (source_manager().isInSystemHeader(expr->getSourceRange().getBegin())) return true; - LOG_DBG("Entering call expression at {}", + LOG_TRACE("Entering call expression at {}", expr->getBeginLoc().printToString(source_manager())); context().enter_callexpr(expr); RecursiveASTVisitor::TraverseCallExpr(expr); - LOG_DBG("Leaving call expression at {}", + LOG_TRACE("Leaving call expression at {}", expr->getBeginLoc().printToString(source_manager())); context().leave_callexpr(); @@ -537,7 +537,7 @@ bool translation_unit_visitor::TraverseCXXMemberCallExpr( if (source_manager().isInSystemHeader(expr->getSourceRange().getBegin())) return true; - LOG_DBG("Entering member call expression at {}", + LOG_TRACE("Entering member call expression at {}", expr->getBeginLoc().printToString(source_manager())); context().enter_callexpr(expr); @@ -545,7 +545,7 @@ bool translation_unit_visitor::TraverseCXXMemberCallExpr( RecursiveASTVisitor::TraverseCXXMemberCallExpr( expr); - LOG_DBG("Leaving member call expression at {}", + LOG_TRACE("Leaving member call expression at {}", expr->getBeginLoc().printToString(source_manager())); context().leave_callexpr(); @@ -591,7 +591,7 @@ bool translation_unit_visitor::TraverseCXXTemporaryObjectExpr( bool translation_unit_visitor::TraverseCXXConstructExpr( clang::CXXConstructExpr *expr) { - LOG_DBG("Entering cxx construct call expression at {}", + LOG_TRACE("Entering cxx construct call expression at {}", expr->getBeginLoc().printToString(source_manager())); context().enter_callexpr(expr); @@ -601,7 +601,7 @@ bool translation_unit_visitor::TraverseCXXConstructExpr( translation_unit_visitor::VisitCXXConstructExpr(expr); - LOG_DBG("Leaving member call expression at {}", + LOG_TRACE("Leaving member call expression at {}", expr->getBeginLoc().printToString(source_manager())); context().leave_callexpr(); @@ -1918,7 +1918,12 @@ void translation_unit_visitor::pop_message_to_diagram(clang::CallExpr *expr) 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)); + + if (caller_id == 0) + return; + + if (diagram().has_activity(caller_id)) + diagram().get_activity(caller_id).add_message(std::move(msg)); call_expr_message_map_.erase(expr); } diff --git a/tests/t20012/test_case.h b/tests/t20012/test_case.h index 99adea7b..918a7d96 100644 --- a/tests/t20012/test_case.h +++ b/tests/t20012/test_case.h @@ -69,8 +69,12 @@ TEST_CASE("t20012", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20012.cc:86:9)"), _A("C"), "c()")); - // @todo #168 - // REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("D"), "add5(int)")); + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("tmain()::(lambda t20012.cc:94:9)"), + "operator()(auto) const")); + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda t20012.cc:94:9)"), _A("D"), + "add5(int) const")); save_puml(config.output_directory(), diagram->name + ".puml", src); } @@ -84,19 +88,20 @@ TEST_CASE("t20012", "[test-case][sequence]") FindMessage(j, "tmain()", "tmain()::(lambda t20012.cc:67:20)", "operator()() const"), FindMessage(j, "tmain()::(lambda t20012.cc:67:20)", "A", "a()"), - FindMessage(j, "A", "A", "aa()"), FindMessage(j, "A", "A", "aaa()"), + FindMessage(j, "A", "A", "aa()"), + FindMessage(j, "A", "A", "aaa()"), FindMessage(j, "tmain()::(lambda t20012.cc:67:20)", "B", "b()"), - FindMessage(j, "B", "B", "bb()"), FindMessage(j, "B", "B", "bbb()"), + FindMessage(j, "B", "B", "bb()"), + FindMessage(j, "B", "B", "bbb()"), FindMessage(j, "tmain()::(lambda t20012.cc:80:20)", "C", "c()"), - FindMessage(j, "C", "C", "cc()"), FindMessage(j, "C", "C", "ccc()"), + FindMessage(j, "C", "C", "cc()"), + FindMessage(j, "C", "C", "ccc()"), FindMessage(j, "tmain()::(lambda t20012.cc:80:20)", "tmain()::(lambda t20012.cc:67:20)", "operator()() const"), FindMessage(j, "tmain()", "R<(lambda at t20012.cc:86:9)>", "r()"), FindMessage(j, "R<(lambda at t20012.cc:86:9)>", "tmain()::(lambda t20012.cc:86:9)", "operator()() const"), FindMessage(j, "tmain()::(lambda t20012.cc:86:9)", "C", "c()"), - // @todo #168 - // FindMessage(j, "tmain()", "D", "add5(int)") }; REQUIRE(std::is_sorted(messages.begin(), messages.end())); @@ -141,6 +146,13 @@ TEST_CASE("t20012", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda t20012.cc:86:9)"), _A("C"), "c()")); + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("tmain()::(lambda t20012.cc:94:9)"), + "operator()(auto) const")); + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda t20012.cc:94:9)"), _A("D"), + "add5(int) const")); + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } From 67363013fee465322b4700f9f96f2199bc1c2af9 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 1 May 2024 18:18:23 +0200 Subject: [PATCH 08/11] Added support for CUDA calls in sequence diagrams (#263) --- CMakeLists.txt | 17 +++- Makefile | 4 + README.md | 1 + src/common/clang_utils.cc | 9 +++ src/common/clang_utils.h | 9 +++ .../json/sequence_diagram_generator.cc | 8 ++ .../mermaid/sequence_diagram_generator.cc | 46 ++++++++--- .../plantuml/sequence_diagram_generator.cc | 27 ++++++- src/sequence_diagram/model/participant.cc | 8 ++ src/sequence_diagram/model/participant.h | 30 +++++++ .../visitor/translation_unit_visitor.cc | 80 ++++++++++++++++-- .../visitor/translation_unit_visitor.h | 7 +- tests/CMakeLists.txt | 23 +++++- tests/t20049/.clang-uml | 11 +++ tests/t20049/t20049.cu | 36 +++++++++ tests/t20049/t20049.cuh | 11 +++ tests/t20049/test_case.h | 81 +++++++++++++++++++ tests/t20050/.clang-uml | 12 +++ tests/t20050/t20050.cu | 38 +++++++++ tests/t20050/t20050.cuh | 9 +++ tests/t20050/test_case.h | 80 ++++++++++++++++++ tests/test_cases.cc | 2 + tests/test_cases.h | 28 ++----- tests/test_cases.yaml | 9 +++ util/generate_test_cases_docs.py | 3 +- 25 files changed, 543 insertions(+), 46 deletions(-) create mode 100644 tests/t20049/.clang-uml create mode 100644 tests/t20049/t20049.cu create mode 100644 tests/t20049/t20049.cuh create mode 100644 tests/t20049/test_case.h create mode 100644 tests/t20050/.clang-uml create mode 100644 tests/t20050/t20050.cu create mode 100644 tests/t20050/t20050.cuh create mode 100644 tests/t20050/test_case.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 7721ff83..6941ccbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,7 +154,20 @@ add_subdirectory(src) # option(BUILD_TESTS "" ON) option(ENABLE_CXX_MODULES_TEST_CASES "" OFF) +option(ENABLE_CUDA_TEST_CASES "" OFF) + +# +# Setup CUDA if available +# +if(ENABLE_CUDA_TEST_CASES) + include(CheckLanguage) + check_language(CUDA) + if(DEFINED CMAKE_CUDA_COMPILER) + set(ENABLE_CUDA_TEST_CASES ON) + endif(DEFINED CMAKE_CUDA_COMPILER) +endif(ENABLE_CUDA_TEST_CASES) + if(BUILD_TESTS) - enable_testing() - add_subdirectory(tests) + enable_testing() + add_subdirectory(tests) endif(BUILD_TESTS) diff --git a/Makefile b/Makefile index 7c296dba..577b6153 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,7 @@ CMAKE_EXE_LINKER_FLAGS ?= CMAKE_GENERATOR ?= Unix Makefiles ENABLE_CXX_MODULES_TEST_CASES ?= OFF +ENABLE_CUDA_TEST_CASES ?= OFF GIT_VERSION ?= $(shell git describe --tags --always --abbrev=7) PKG_VERSION ?= $(shell git describe --tags --always --abbrev=7 | tr - .) @@ -63,6 +64,7 @@ debug/CMakeLists.txt: -DLLVM_CONFIG_PATH=${LLVM_CONFIG_PATH} \ -DLINK_LLVM_SHARED=${LLVM_SHARED} \ -DCMAKE_PREFIX=${CMAKE_PREFIX} \ + -DENABLE_CUDA_TEST_CASES=$(ENABLE_CUDA_TEST_CASES) \ -DENABLE_CXX_MODULES_TEST_CASES=$(ENABLE_CXX_MODULES_TEST_CASES) release/CMakeLists.txt: @@ -77,6 +79,7 @@ release/CMakeLists.txt: -DLLVM_CONFIG_PATH=${LLVM_CONFIG_PATH} \ -DLINK_LLVM_SHARED=${LLVM_SHARED} \ -DCMAKE_PREFIX=${CMAKE_PREFIX} \ + -DENABLE_CUDA_TEST_CASES=$(ENABLE_CUDA_TEST_CASES) \ -DENABLE_CXX_MODULES_TEST_CASES=$(ENABLE_CXX_MODULES_TEST_CASES) debug_tidy/CMakeLists.txt: @@ -92,6 +95,7 @@ debug_tidy/CMakeLists.txt: -DLLVM_CONFIG_PATH=${LLVM_CONFIG_PATH} \ -DLINK_LLVM_SHARED=${LLVM_SHARED} \ -DCMAKE_PREFIX=${CMAKE_PREFIX} \ + -DENABLE_CUDA_TEST_CASES=$(ENABLE_CUDA_TEST_CASES) \ -DENABLE_CXX_MODULES_TEST_CASES=$(ENABLE_CXX_MODULES_TEST_CASES) debug: debug/CMakeLists.txt diff --git a/README.md b/README.md index c6b697ae..b9378391 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Main features supported so far include: * Handling of template code including constexpr conditionals - [_example_](docs/test_cases/t20018.md) * Handling of lambda expressions - [_example_](docs/test_cases/t20012.md) * Interactive links to online code to classes and call expressions - [_example_](https://raw.githubusercontent.com/bkryza/clang-uml/master/docs/test_cases/t20021_sequence.svg) + * Support for CUDA Kernel and CUDA Device function calls - [_example_](docs/test_cases/t20050.md) * **Package diagram generation** * Generation of package diagram based on C++ namespaces - [_example_](docs/test_cases/t30001.md) * Generation of package diagram based on subdirectories - [_example_](docs/test_cases/t30010.md) diff --git a/src/common/clang_utils.cc b/src/common/clang_utils.cc index 8ce1a351..addaf544 100644 --- a/src/common/clang_utils.cc +++ b/src/common/clang_utils.cc @@ -944,4 +944,13 @@ bool is_struct(const clang::NamedDecl *decl) return false; } +bool has_attr(const clang::FunctionDecl *decl, clang::attr::Kind function_attr) +{ + for (const auto &attr : decl->attrs()) { + if (attr->getKind() == function_attr) + return true; + } + + return false; +} } // namespace clanguml::common diff --git a/src/common/clang_utils.h b/src/common/clang_utils.h index 11e39488..e5bf04cf 100644 --- a/src/common/clang_utils.h +++ b/src/common/clang_utils.h @@ -315,4 +315,13 @@ bool is_coroutine(const clang::FunctionDecl &decl); */ bool is_struct(const clang::NamedDecl *decl); +/** + * Check if function declaration contains specified attributed + * + * @param decl Function declaration + * @param function_attr Clang function attribute + * @return True, if decl contains specified function attribute + */ +bool has_attr(const clang::FunctionDecl *decl, clang::attr::Kind function_attr); + } // namespace clanguml::common diff --git a/src/sequence_diagram/generators/json/sequence_diagram_generator.cc b/src/sequence_diagram/generators/json/sequence_diagram_generator.cc index 1aeef809..3c0bdfec 100644 --- a/src/sequence_diagram/generators/json/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/json/sequence_diagram_generator.cc @@ -39,6 +39,14 @@ void to_json(nlohmann::json &j, const participant &c) if (c.type_name() == "method") { j["name"] = dynamic_cast(c).method_name(); } + + if (c.type_name() == "function" || c.type_name() == "function_template") { + const auto &f = dynamic_cast(c); + if (f.is_cuda_kernel()) + j["is_cuda_kernel"] = true; + if (f.is_cuda_device()) + j["is_cuda_device"] = true; + } } void to_json(nlohmann::json &j, const activity &c) diff --git a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc index ce3d47bf..41bf9390 100644 --- a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc @@ -119,12 +119,23 @@ void generator::generate_call(const message &m, std::ostream &ostr) const } else if (config().combine_free_functions_into_file_participants()) { if (to.value().type_name() == "function") { - message = dynamic_cast(to.value()) - .message_name(render_mode); + const auto &f = dynamic_cast(to.value()); + + message = f.message_name(render_mode); + + if (f.is_cuda_kernel()) + message = fmt::format("<< CUDA Kernel >>
{}", message); + else if (f.is_cuda_device()) + message = fmt::format("<< CUDA Device >>
{}", message); } else if (to.value().type_name() == "function_template") { - message = dynamic_cast(to.value()) - .message_name(render_mode); + const auto &f = dynamic_cast(to.value()); + message = f.message_name(render_mode); + + if (f.is_cuda_kernel()) + message = fmt::format("<< CUDA Kernel >>
{}", message); + else if (f.is_cuda_device()) + message = fmt::format("<< CUDA Device >>
{}", message); } } @@ -397,11 +408,10 @@ void generator::generate_participant( config().combine_free_functions_into_file_participants()) { // Create a single participant for all functions declared in a // single file - const auto &file_path = - model() - .get_participant(participant_id) - .value() - .file(); + const auto &f = + model().get_participant(participant_id).value(); + + const auto &file_path = f.file(); assert(!file_path.empty()); @@ -427,8 +437,22 @@ void generator::generate_participant( config().simplify_template_type(participant.full_name(false))); common::ensure_lambda_type_is_relative(config(), participant_name); - ostr << indent(1) << "participant " << participant.alias() << " as " - << render_participant_name(participant_name); + ostr << indent(1) << "participant " << participant.alias() << " as "; + + if (participant.type_name() == "function" || + participant.type_name() == "function_template") { + const auto &f = + model() + .get_participant(participant_id) + .value(); + + if (f.is_cuda_kernel()) + ostr << "<< CUDA Kernel >>
"; + else if (f.is_cuda_device()) + ostr << "<< CUDA Device >>
"; + } + + ostr << render_participant_name(participant_name); ostr << '\n'; generated_participants_.emplace(participant_id); diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc index 520abf9f..7134e891 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -69,12 +69,22 @@ void generator::generate_call(const message &m, std::ostream &ostr) const } else if (config().combine_free_functions_into_file_participants()) { if (to.value().type_name() == "function") { - message = dynamic_cast(to.value()) - .message_name(render_mode); + const auto &f = dynamic_cast(to.value()); + message = f.message_name(render_mode); + + if (f.is_cuda_kernel()) + message = fmt::format("<< CUDA Kernel >>\\n{}", message); + else if (f.is_cuda_device()) + message = fmt::format("<< CUDA Device >>\\n{}", message); } else if (to.value().type_name() == "function_template") { - message = dynamic_cast(to.value()) - .message_name(render_mode); + const auto &f = dynamic_cast(to.value()); + message = f.message_name(render_mode); + + if (f.is_cuda_kernel()) + message = fmt::format("<< CUDA Kernel >>\\n{}", message); + else if (f.is_cuda_device()) + message = fmt::format("<< CUDA Device >>\\n{}", message); } } @@ -432,6 +442,15 @@ void generator::generate_participant( ostr << "participant \"" << render_name(participant_name) << "\" as " << participant.alias(); + if (const auto *function_ptr = + dynamic_cast(&participant); + function_ptr) { + if (function_ptr->is_cuda_kernel()) + ostr << " << CUDA Kernel >>"; + else if (function_ptr->is_cuda_device()) + ostr << " << CUDA Device >>"; + } + if (config().generate_links) { common_generator::generate_link( ostr, participant); diff --git a/src/sequence_diagram/model/participant.cc b/src/sequence_diagram/model/participant.cc index 6e393c7a..cf183edb 100644 --- a/src/sequence_diagram/model/participant.cc +++ b/src/sequence_diagram/model/participant.cc @@ -150,6 +150,14 @@ bool function::is_operator() const { return is_operator_; } void function::is_operator(bool o) { is_operator_ = o; } +bool function::is_cuda_kernel() const { return is_cuda_kernel_; } + +void function::is_cuda_kernel(bool c) { is_cuda_kernel_ = c; } + +bool function::is_cuda_device() const { return is_cuda_device_; } + +void function::is_cuda_device(bool c) { is_cuda_device_ = c; } + void function::return_type(const std::string &rt) { return_type_ = rt; } const std::string &function::return_type() const { return return_type_; } diff --git a/src/sequence_diagram/model/participant.h b/src/sequence_diagram/model/participant.h index 68eaeade..92de35c8 100644 --- a/src/sequence_diagram/model/participant.h +++ b/src/sequence_diagram/model/participant.h @@ -303,6 +303,34 @@ struct function : public participant { */ void is_operator(bool o); + /** + * @brief Check, if a functions is a call to CUDA Kernel + * + * @return True, if the method is a CUDA kernel call + */ + bool is_cuda_kernel() const; + + /** + * @brief Set whether the method is a CUDA kernel call + * + * @param v True, if the method is a CUDA kernel call + */ + void is_cuda_kernel(bool c); + + /** + * @brief Check, if a functions is a call to CUDA device + * + * @return True, if the method is a CUDA device call + */ + bool is_cuda_device() const; + + /** + * @brief Set whether the method is a CUDA device call + * + * @param v True, if the method is a CUDA device call + */ + void is_cuda_device(bool c); + /** * @brief Set functions return type * @@ -339,6 +367,8 @@ private: bool is_void_{false}; bool is_static_{false}; bool is_operator_{false}; + bool is_cuda_kernel_{false}; + bool is_cuda_device_{false}; std::string return_type_; std::vector parameters_; }; diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 14b5c8e1..af8454be 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -360,6 +360,12 @@ bool translation_unit_visitor::VisitFunctionDecl( function_model_ptr->is_operator(declaration->isOverloadedOperator()); + function_model_ptr->is_cuda_kernel( + common::has_attr(declaration, clang::attr::CUDAGlobal)); + + function_model_ptr->is_cuda_device( + common::has_attr(declaration, clang::attr::CUDADevice)); + context().update(declaration); context().set_caller_id(function_model_ptr->id()); @@ -531,6 +537,29 @@ bool translation_unit_visitor::TraverseCallExpr(clang::CallExpr *expr) return true; } +bool translation_unit_visitor::TraverseCUDAKernelCallExpr( + clang::CUDAKernelCallExpr *expr) +{ + if (source_manager().isInSystemHeader(expr->getSourceRange().getBegin())) + return true; + + LOG_TRACE("Entering CUDA kernel call expression at {}", + expr->getBeginLoc().printToString(source_manager())); + + context().enter_callexpr(expr); + + RecursiveASTVisitor::TraverseCallExpr(expr); + + LOG_TRACE("Leaving CUDA kernel call expression at {}", + expr->getBeginLoc().printToString(source_manager())); + + context().leave_callexpr(); + + pop_message_to_diagram(expr); + + return true; +} + bool translation_unit_visitor::TraverseCXXMemberCallExpr( clang::CXXMemberCallExpr *expr) { @@ -1067,6 +1096,15 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) "Message for this call expression is taken from comment directive"); } // + // Call to a CUDA kernel function + // + else if (const auto *cuda_call_expr = + clang::dyn_cast_or_null(expr); + cuda_call_expr != nullptr) { + if (!process_cuda_kernel_call_expression(m, cuda_call_expr)) + return true; + } + // // Call to an overloaded operator // else if (const auto *operator_call_expr = @@ -1250,6 +1288,43 @@ bool translation_unit_visitor::VisitCXXConstructExpr( return true; } +bool translation_unit_visitor::process_cuda_kernel_call_expression( + model::message &m, const clang::CUDAKernelCallExpr *expr) +{ + const auto *callee_decl = expr->getCalleeDecl(); + + if (callee_decl == nullptr) + return false; + + const auto *callee_function = callee_decl->getAsFunction(); + + if (callee_function == nullptr) + return false; + + if (!should_include(callee_function)) + return false; + + // Skip free functions declared in files outside of included paths + if (config().combine_free_functions_into_file_participants() && + !diagram().should_include(common::model::source_file{m.file()})) + return false; + + auto callee_name = callee_function->getQualifiedNameAsString() + "()"; + + const auto maybe_id = get_unique_id(callee_function->getID()); + if (!maybe_id.has_value()) { + // This is hopefully not an interesting call... + m.set_to(callee_function->getID()); + } + else { + m.set_to(maybe_id.value()); + } + + m.set_message_name(callee_name.substr(0, callee_name.size() - 2)); + + return true; +} + bool translation_unit_visitor::process_operator_call_expression( model::message &m, const clang::CXXOperatorCallExpr *operator_call_expr) { @@ -1469,8 +1544,6 @@ bool translation_unit_visitor::process_function_call_expression( auto callee_name = callee_function->getQualifiedNameAsString() + "()"; - std::unique_ptr f_ptr; - const auto maybe_id = get_unique_id(callee_function->getID()); if (!maybe_id.has_value()) { // This is hopefully not an interesting call... @@ -1482,9 +1555,6 @@ bool translation_unit_visitor::process_function_call_expression( m.set_message_name(callee_name.substr(0, callee_name.size() - 2)); - if (f_ptr) - diagram().add_participant(std::move(f_ptr)); - return true; } diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.h b/src/sequence_diagram/visitor/translation_unit_visitor.h index 98944838..7678fb98 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.h +++ b/src/sequence_diagram/visitor/translation_unit_visitor.h @@ -77,9 +77,11 @@ public: bool VisitCallExpr(clang::CallExpr *expr); + bool TraverseVarDecl(clang::VarDecl *VD); + bool TraverseCallExpr(clang::CallExpr *expr); - bool TraverseVarDecl(clang::VarDecl *VD); + bool TraverseCUDAKernelCallExpr(clang::CUDAKernelCallExpr *expr); bool TraverseCXXMemberCallExpr(clang::CXXMemberCallExpr *expr); @@ -395,6 +397,9 @@ private: bool process_operator_call_expression(model::message &m, const clang::CXXOperatorCallExpr *operator_call_expr); + bool process_cuda_kernel_call_expression( + model::message &m, const clang::CUDAKernelCallExpr *cuda_call_expr); + /** * @brief Handle a class method call expresion * diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ffc38e33..3ab3cfce 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,13 +9,18 @@ file(GLOB_RECURSE TEST_CONFIG_YMLS test_config_data/*.yml set(TEST_CASES_REQUIRING_CXX20 t00056 t00058 t00059 t00065 t00069) set(TEST_CASES_REQUIRING_CXX20_MODULES t00070 t00071 t00072 t30012 t30013 t30014 t30015) +set(TEST_CASES_REQUIRING_CUDA t20049 t20050) if(ENABLE_CXX_MODULES_TEST_CASES) + message(STATUS "Enabling C++ modules test cases") + foreach(CXX20_MOD_TC ${TEST_CASES_REQUIRING_CXX20_MODULES}) list(APPEND TEST_CASES_REQUIRING_CXX20 ${CXX20_MOD_TC}) endforeach() set(CMAKE_CXX_SCAN_FOR_MODULES ON) else() + message(STATUS "Disabling C++ modules test cases") + foreach(CXX20_MOD_TC ${TEST_CASES_REQUIRING_CXX20_MODULES}) list(FILTER TEST_CASE_SOURCES EXCLUDE @@ -23,10 +28,23 @@ else() list(FILTER TEST_CASE_CONFIGS EXCLUDE REGEX ".*${CXX20_MOD_TC}.*") - endforeach() endif(ENABLE_CXX_MODULES_TEST_CASES) +if(NOT ENABLE_CUDA_TEST_CASES) + message(STATUS "Enabling CUDA test cases") + foreach(CUDA_TC ${TEST_CASES_REQUIRING_CUDA}) + list(FILTER TEST_CASE_SOURCES + EXCLUDE + REGEX ".*${CUDA_TC}.*") + list(FILTER TEST_CASE_CONFIGS + EXCLUDE + REGEX ".*${CUDA_TC}.*") + endforeach() +else() + message(STATUS "Enabling CUDA test cases") +endif(NOT ENABLE_CUDA_TEST_CASES) + set(CLANG_UML_TEST_LIBRARIES clang-umllib ${YAML_CPP_LIBRARIES} @@ -39,7 +57,6 @@ endif(MSVC) list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_20 SUPPORTS_CXX_STD_20) -message(STATUS "Enabling C++20 test cases") # Remove test cases which require C++20 if they are not supported here if(SUPPORTS_CXX_STD_20 EQUAL -1 @@ -53,8 +70,10 @@ if(SUPPORTS_CXX_STD_20 EQUAL -1 EXCLUDE REGEX ".*${CXX20_TC}.*") endforeach() + message(STATUS "Disabling C++20 test cases") else() set(ENABLE_CXX_STD_20_TEST_CASES 1) + message(STATUS "Enabling C++20 test cases") endif() if(APPLE) diff --git a/tests/t20049/.clang-uml b/tests/t20049/.clang-uml new file mode 100644 index 00000000..2061996e --- /dev/null +++ b/tests/t20049/.clang-uml @@ -0,0 +1,11 @@ +diagrams: + t20049_sequence: + type: sequence + glob: + - t20049.cu + include: + namespaces: + - clanguml::t20049 + using_namespace: clanguml::t20049 + from: + - function: "clanguml::t20049::tmain()" diff --git a/tests/t20049/t20049.cu b/tests/t20049/t20049.cu new file mode 100644 index 00000000..5a2106d9 --- /dev/null +++ b/tests/t20049/t20049.cu @@ -0,0 +1,36 @@ +#include "t20049.cuh" + +namespace clanguml { +namespace t20049 { + +constexpr unsigned long N{1000}; + +__device__ float square(float a) { return a * a; } + +__global__ void vector_square_add(float *out, float *a, float *b, int n) +{ + for (int i = 0; i < n; i++) { + out[i] = add(square(a[i]), square(b[i])); + } +} + +int tmain() +{ + float *a, *b, *out; + + a = (float *)malloc(sizeof(float) * N); + b = (float *)malloc(sizeof(float) * N); + out = (float *)malloc(sizeof(float) * N); + + for (int i = 0; i < N; i++) { + a[i] = 1.0f; + b[i] = 2.0f; + } + + vector_square_add<<<1, 1>>>(out, a, b, N); + + return 0; +} + +} +} \ No newline at end of file diff --git a/tests/t20049/t20049.cuh b/tests/t20049/t20049.cuh new file mode 100644 index 00000000..d006e517 --- /dev/null +++ b/tests/t20049/t20049.cuh @@ -0,0 +1,11 @@ +namespace clanguml { +namespace t20049 { + +template __device__ T add(T a, T b) { return a + b; } + +__device__ float square(float a); + +__global__ void vector_add(float *out, float *a, float *b, int n); + +} +} \ No newline at end of file diff --git a/tests/t20049/test_case.h b/tests/t20049/test_case.h new file mode 100644 index 00000000..f73722b9 --- /dev/null +++ b/tests/t20049/test_case.h @@ -0,0 +1,81 @@ +/** + * tests/t20049/test_case.h + * + * Copyright (c) 2021-2024 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("t20049", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20049"); + + auto diagram = config.diagrams["t20049_sequence"]; + + REQUIRE(diagram->name == "t20049_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20049_sequence"); + + { + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); + + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), + _A("vector_square_add(float *,float *,float *,int)"), "")); + REQUIRE_THAT(src, + HasCall(_A("vector_square_add(float *,float *,float *,int)"), + _A("square(float)"), "")); + REQUIRE_THAT(src, + HasCall(_A("vector_square_add(float *,float *,float *,int)"), + _A("add(float,float)"), "")); + + save_puml(config.output_directory(), diagram->name + ".puml", src); + } + + { + auto j = generate_sequence_json(diagram, *model); + + using namespace json; + + save_json(config.output_directory(), diagram->name + ".json", j); + } + + { + auto src = generate_sequence_mermaid(diagram, *model); + + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), + _A("<< CUDA Kernel >>
vector_square_add(float *,float " + "*,float *,int)"), + "")); + REQUIRE_THAT(src, + HasCall(_A("<< CUDA Kernel >>
vector_square_add(float *,float " + "*,float *,int)"), + _A("<< CUDA Device >>
square(float)"), "")); + REQUIRE_THAT(src, + HasCall(_A("<< CUDA Kernel >>
vector_square_add(float *,float " + "*,float *,int)"), + _A("<< CUDA Device >>
add(float,float)"), "")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); + } +} \ No newline at end of file diff --git a/tests/t20050/.clang-uml b/tests/t20050/.clang-uml new file mode 100644 index 00000000..8195bcc1 --- /dev/null +++ b/tests/t20050/.clang-uml @@ -0,0 +1,12 @@ +diagrams: + t20050_sequence: + type: sequence + glob: + - t20050.cu + include: + namespaces: + - clanguml::t20050 + using_namespace: clanguml::t20050 + combine_free_functions_into_file_participants: true + from: + - function: "clanguml::t20050::tmain()" \ No newline at end of file diff --git a/tests/t20050/t20050.cu b/tests/t20050/t20050.cu new file mode 100644 index 00000000..83f147cb --- /dev/null +++ b/tests/t20050/t20050.cu @@ -0,0 +1,38 @@ +#include "t20050.cuh" + +namespace clanguml { +namespace t20050 { + +constexpr unsigned long N{1000}; + +template __device__ T add(T a, T b) { return a + b; } + +__device__ float square(float a) { return a * a; } + +__global__ void vector_square_add(float *out, float *a, float *b, int n) +{ + for (int i = 0; i < n; i++) { + out[i] = add(square(a[i]), square(b[i])); + } +} + +int tmain() +{ + float *a, *b, *out; + + a = (float *)malloc(sizeof(float) * N); + b = (float *)malloc(sizeof(float) * N); + out = (float *)malloc(sizeof(float) * N); + + for (int i = 0; i < N; i++) { + a[i] = 1.0f; + b[i] = 2.0f; + } + + vector_square_add<<<1, 1>>>(out, a, b, N); + + return 0; +} + +} +} \ No newline at end of file diff --git a/tests/t20050/t20050.cuh b/tests/t20050/t20050.cuh new file mode 100644 index 00000000..cafe8ca4 --- /dev/null +++ b/tests/t20050/t20050.cuh @@ -0,0 +1,9 @@ +namespace clanguml { +namespace t20050 { + +__device__ float square(float a); + +__global__ void vector_add(float *out, float *a, float *b, int n); + +} +} \ No newline at end of file diff --git a/tests/t20050/test_case.h b/tests/t20050/test_case.h new file mode 100644 index 00000000..935f3e8a --- /dev/null +++ b/tests/t20050/test_case.h @@ -0,0 +1,80 @@ +/** + * tests/t20050/test_case.h + * + * Copyright (c) 2021-2024 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("t20050", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20050"); + + auto diagram = config.diagrams["t20050_sequence"]; + + REQUIRE(diagram->name == "t20050_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20050_sequence"); + + { + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); + + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + + // Check if all calls exist + REQUIRE_THAT(src, + HasCall(_A("t20050.cu"), _A("t20050.cu"), + "<< CUDA Kernel >>\\\\nvector_square_add(float *,float *,float " + "*,int)")); + REQUIRE_THAT(src, + HasCall(_A("t20050.cu"), _A("t20050.cu"), + "<< CUDA Device >>\\\\nsquare(float)")); + REQUIRE_THAT(src, + HasCall(_A("t20050.cu"), _A("t20050.cu"), + "<< CUDA Device >>\\\\nadd(float,float)")); + + save_puml(config.output_directory(), diagram->name + ".puml", src); + } + + { + auto j = generate_sequence_json(diagram, *model); + + using namespace json; + + save_json(config.output_directory(), diagram->name + ".json", j); + } + + { + auto src = generate_sequence_mermaid(diagram, *model); + + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, + HasCall(_A("t20050.cu"), _A("t20050.cu"), + "<< CUDA Kernel >>
vector_square_add(float *,float *,float " + "*,int)")); + REQUIRE_THAT(src, + HasCall(_A("t20050.cu"), _A("t20050.cu"), + "<< CUDA Device >>
square(float)")); + REQUIRE_THAT(src, + HasCall(_A("t20050.cu"), _A("t20050.cu"), + "<< CUDA Device >>
add(float,float)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); + } +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 1d24eec7..983dbccd 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -475,6 +475,8 @@ using namespace clanguml::test::matchers; #include "t20046/test_case.h" #include "t20047/test_case.h" #include "t20048/test_case.h" +#include "t20049/test_case.h" +#include "t20050/test_case.h" /// /// Package diagram tests diff --git a/tests/test_cases.h b/tests/test_cases.h index 6cc3cb06..b8e61102 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -169,17 +169,11 @@ public: bool match(T const &in) const override { - std::istringstream fin(in); - std::string line; - std::regex r{m_is_response ? response_pattern : call_pattern}; - - while (std::getline(fin, line)) { - std::smatch base_match; - std::regex_search(in, base_match, r); - if (base_match.size() > 0) - return true; - } + std::smatch base_match; + std::regex_search(in, base_match, r); + if (base_match.size() > 0) + return true; return false; } @@ -255,17 +249,11 @@ public: bool match(T const &in) const override { - std::istringstream fin(in); - std::string line; - std::regex r{m_is_response ? response_pattern : call_pattern}; - - while (std::getline(fin, line)) { - std::smatch base_match; - std::regex_search(in, base_match, r); - if (base_match.size() > 0) - return true; - } + std::smatch base_match; + std::regex_search(in, base_match, r); + if (base_match.size() > 0) + return true; return false; } diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index a9f7954e..f2deb8ad 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -364,6 +364,15 @@ test_cases: - name: t20047 title: Test case for 'call' comment directive description: + - name: t20048 + title: Test case for message comments + description: + - name: t20049 + title: Test case for CUDA kernel calls + description: + - name: t20050 + title: Test case for CUDA kernel calls with participants combined to file + description: Package diagrams: - name: t30001 title: Basic package diagram test case diff --git a/util/generate_test_cases_docs.py b/util/generate_test_cases_docs.py index 03fcd97a..70fc4076 100755 --- a/util/generate_test_cases_docs.py +++ b/util/generate_test_cases_docs.py @@ -60,7 +60,8 @@ with open(r'tests/test_cases.yaml') as f: tc.write("## Source code\n") for root, dirs, files in os.walk(f'tests/{name}/'): for source_file in files: - if source_file.endswith((".h", ".cc", ".c", ".cppm")): + if source_file.endswith(( + ".h", ".cc", ".c", ".cppm", ".cu", ".cuh")): if source_file == "test_case.h": continue file_path = os.path.join(root, source_file) From b574a41a64fbb977766b58638986a9f4347216b1 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 1 May 2024 19:01:25 +0200 Subject: [PATCH 09/11] Added test case for cuda_kernel and cuda_device callee types in callee_type filter (#263) --- docs/diagram_filters.md | 2 + src/common/model/diagram_filter.cc | 14 ++++++ src/config/config.cc | 4 ++ src/config/config.h | 4 +- src/config/schema.h | 2 + src/config/yaml_decoders.cc | 4 ++ tests/CMakeLists.txt | 2 +- tests/t20051/.clang-uml | 14 ++++++ tests/t20051/t20051.cu | 38 ++++++++++++++ tests/t20051/t20051.cuh | 9 ++++ tests/t20051/test_case.h | 81 ++++++++++++++++++++++++++++++ tests/test_cases.cc | 1 + 12 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 tests/t20051/.clang-uml create mode 100644 tests/t20051/t20051.cu create mode 100644 tests/t20051/t20051.cuh create mode 100644 tests/t20051/test_case.h diff --git a/docs/diagram_filters.md b/docs/diagram_filters.md index 4e996f4f..d312ab7b 100644 --- a/docs/diagram_filters.md +++ b/docs/diagram_filters.md @@ -258,6 +258,8 @@ The following callee types are supported: * `function` * `function_template` * `lambda` + * `cuda_kernel` + * `cuda_device` ## dependants and dependencies diff --git a/src/common/model/diagram_filter.cc b/src/common/model/diagram_filter.cc index 3e807d92..431fc2b5 100644 --- a/src/common/model/diagram_filter.cc +++ b/src/common/model/diagram_filter.cc @@ -455,6 +455,16 @@ tvl::value_t callee_filter::match( return dynamic_cast(p) != nullptr; }; + auto is_cuda_kernel = [](const participant *p) { + const auto *f = dynamic_cast(p); + return (f != nullptr) && (f->is_cuda_kernel()); + }; + + auto is_cuda_device = [](const participant *p) { + const auto *f = dynamic_cast(p); + return (f != nullptr) && (f->is_cuda_device()); + }; + switch (ct) { case config::callee_type::method: return p.type_name() == "method"; @@ -477,6 +487,10 @@ tvl::value_t callee_filter::match( return p.type_name() == "function_template"; case config::callee_type::lambda: return p.type_name() == "method" && is_lambda((method &)p); + case config::callee_type::cuda_kernel: + return is_cuda_kernel(&p); + case config::callee_type::cuda_device: + return is_cuda_device(&p); } return false; diff --git a/src/config/config.cc b/src/config/config.cc index 0eb83f91..627b8ce3 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -106,6 +106,10 @@ std::string to_string(callee_type mt) return "function_template"; case callee_type::lambda: return "lambda"; + case callee_type::cuda_kernel: + return "cuda_kernel"; + case callee_type::cuda_device: + return "cuda_device"; } assert(false); diff --git a/src/config/config.h b/src/config/config.h index e76a8bef..ee69c0a1 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -78,7 +78,9 @@ enum class callee_type { method, function, function_template, - lambda + lambda, + cuda_kernel, + cuda_device }; std::string to_string(callee_type mt); diff --git a/src/config/schema.h b/src/config/schema.h index 2b0eabb1..1768774c 100644 --- a/src/config/schema.h +++ b/src/config/schema.h @@ -112,6 +112,8 @@ types: - function - function_template - lambda + - cuda_kernel + - cuda_device context_filter_match_t: match: radius: int diff --git a/src/config/yaml_decoders.cc b/src/config/yaml_decoders.cc index a63271d0..6f4e4c1b 100644 --- a/src/config/yaml_decoders.cc +++ b/src/config/yaml_decoders.cc @@ -312,6 +312,10 @@ template <> struct convert { rhs = callee_type::method; else if (val == to_string(callee_type::lambda)) rhs = callee_type::lambda; + else if (val == to_string(callee_type::cuda_kernel)) + rhs = callee_type::cuda_kernel; + else if (val == to_string(callee_type::cuda_device)) + rhs = callee_type::cuda_device; else return false; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3ab3cfce..f2c94d8e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,7 +9,7 @@ file(GLOB_RECURSE TEST_CONFIG_YMLS test_config_data/*.yml set(TEST_CASES_REQUIRING_CXX20 t00056 t00058 t00059 t00065 t00069) set(TEST_CASES_REQUIRING_CXX20_MODULES t00070 t00071 t00072 t30012 t30013 t30014 t30015) -set(TEST_CASES_REQUIRING_CUDA t20049 t20050) +set(TEST_CASES_REQUIRING_CUDA t20049 t20050 t20051) if(ENABLE_CXX_MODULES_TEST_CASES) message(STATUS "Enabling C++ modules test cases") diff --git a/tests/t20051/.clang-uml b/tests/t20051/.clang-uml new file mode 100644 index 00000000..51b64589 --- /dev/null +++ b/tests/t20051/.clang-uml @@ -0,0 +1,14 @@ +diagrams: + t20051_sequence: + type: sequence + glob: + - t20051.cu + include: + namespaces: + - clanguml::t20051 + exclude: + callee_types: + - cuda_device + using_namespace: clanguml::t20051 + from: + - function: "clanguml::t20051::tmain()" \ No newline at end of file diff --git a/tests/t20051/t20051.cu b/tests/t20051/t20051.cu new file mode 100644 index 00000000..1935d3c0 --- /dev/null +++ b/tests/t20051/t20051.cu @@ -0,0 +1,38 @@ +#include "t20051.cuh" + +namespace clanguml { +namespace t20051 { + +constexpr unsigned long N{1000}; + +template __device__ T add(T a, T b) { return a + b; } + +__device__ float square(float a) { return a * a; } + +__global__ void vector_square_add(float *out, float *a, float *b, int n) +{ + for (int i = 0; i < n; i++) { + out[i] = add(square(a[i]), square(b[i])); + } +} + +int tmain() +{ + float *a, *b, *out; + + a = (float *)malloc(sizeof(float) * N); + b = (float *)malloc(sizeof(float) * N); + out = (float *)malloc(sizeof(float) * N); + + for (int i = 0; i < N; i++) { + a[i] = 1.0f; + b[i] = 2.0f; + } + + vector_square_add<<<1, 1>>>(out, a, b, N); + + return 0; +} + +} +} \ No newline at end of file diff --git a/tests/t20051/t20051.cuh b/tests/t20051/t20051.cuh new file mode 100644 index 00000000..cdf0460e --- /dev/null +++ b/tests/t20051/t20051.cuh @@ -0,0 +1,9 @@ +namespace clanguml { +namespace t20051 { + +__device__ float square(float a); + +__global__ void vector_add(float *out, float *a, float *b, int n); + +} +} \ No newline at end of file diff --git a/tests/t20051/test_case.h b/tests/t20051/test_case.h new file mode 100644 index 00000000..0c3806f0 --- /dev/null +++ b/tests/t20051/test_case.h @@ -0,0 +1,81 @@ +/** + * tests/t20051/test_case.h + * + * Copyright (c) 2021-2024 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("t20051", "[test-case][sequence]") +{ + auto [config, db] = load_config("t20051"); + + auto diagram = config.diagrams["t20051_sequence"]; + + REQUIRE(diagram->name == "t20051_sequence"); + + auto model = generate_sequence_diagram(*db, diagram); + + REQUIRE(model->name() == "t20051_sequence"); + + { + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); + + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), + _A("vector_square_add(float *,float *,float *,int)"), "")); + REQUIRE_THAT(src, + !HasCall(_A("vector_square_add(float *,float *,float *,int)"), + _A("square(float)"), "")); + REQUIRE_THAT(src, + !HasCall(_A("vector_square_add(float *,float *,float *,int)"), + _A("add(float,float)"), "")); + + save_puml(config.output_directory(), diagram->name + ".puml", src); + } + + { + auto j = generate_sequence_json(diagram, *model); + + using namespace json; + + save_json(config.output_directory(), diagram->name + ".json", j); + } + + { + auto src = generate_sequence_mermaid(diagram, *model); + + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), + _A("<< CUDA Kernel >>
vector_square_add(float *,float " + "*,float *,int)"), + "")); + REQUIRE_THAT(src, + !HasCall(_A("<< CUDA Kernel >>
vector_square_add(float *,float " + "*,float *,int)"), + _A("<< CUDA Device >>
square(float)"), "")); + REQUIRE_THAT(src, + !HasCall(_A("<< CUDA Kernel >>
vector_square_add(float *,float " + "*,float *,int)"), + _A("<< CUDA Device >>
add(float,float)"), "")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); + } +} \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 983dbccd..080737f3 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -477,6 +477,7 @@ using namespace clanguml::test::matchers; #include "t20048/test_case.h" #include "t20049/test_case.h" #include "t20050/test_case.h" +#include "t20051/test_case.h" /// /// Package diagram tests From 35b66beeca53dfe2212a18052649025e5e1f87b4 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 1 May 2024 19:39:50 +0200 Subject: [PATCH 10/11] Updated test cases documentation --- CHANGELOG.md | 7 + docs/test_cases.md | 8 + docs/test_cases/t00002_class.svg | 68 +- docs/test_cases/t00002_class_mermaid.svg | 10 +- docs/test_cases/t00003_class.svg | 126 ++-- docs/test_cases/t00003_class_mermaid.svg | 2 +- docs/test_cases/t00004_class.svg | 86 +-- docs/test_cases/t00004_class_mermaid.svg | 32 +- docs/test_cases/t00005_class.svg | 110 +-- docs/test_cases/t00005_class_mermaid.svg | 24 +- docs/test_cases/t00006_class.svg | 134 ++-- docs/test_cases/t00006_class_mermaid.svg | 38 +- docs/test_cases/t00007_class.svg | 30 +- docs/test_cases/t00007_class_mermaid.svg | 8 +- docs/test_cases/t00008_class.svg | 82 +-- docs/test_cases/t00008_class_mermaid.svg | 16 +- docs/test_cases/t00009_class.svg | 38 +- docs/test_cases/t00009_class_mermaid.svg | 10 +- docs/test_cases/t00010_class.svg | 38 +- docs/test_cases/t00010_class_mermaid.svg | 10 +- docs/test_cases/t00011_class.svg | 30 +- docs/test_cases/t00011_class_mermaid.svg | 6 +- docs/test_cases/t00012_class.svg | 76 +-- docs/test_cases/t00012_class_mermaid.svg | 18 +- docs/test_cases/t00013_class.svg | 130 ++-- docs/test_cases/t00013_class_mermaid.svg | 24 +- docs/test_cases/t00014_class.svg | 146 ++-- docs/test_cases/t00014_class_mermaid.svg | 36 +- docs/test_cases/t00015_class.svg | 22 +- docs/test_cases/t00015_class_mermaid.svg | 10 +- docs/test_cases/t00016_class.svg | 26 +- docs/test_cases/t00016_class_mermaid.svg | 12 +- docs/test_cases/t00017_class.svg | 70 +- docs/test_cases/t00017_class_mermaid.svg | 24 +- docs/test_cases/t00018_class.svg | 66 +- docs/test_cases/t00018_class_mermaid.svg | 4 +- docs/test_cases/t00019_class.svg | 84 +-- docs/test_cases/t00019_class_mermaid.svg | 16 +- docs/test_cases/t00020_class.svg | 94 +-- docs/test_cases/t00020_class_mermaid.svg | 18 +- docs/test_cases/t00021_class.svg | 82 +-- docs/test_cases/t00021_class_mermaid.svg | 14 +- docs/test_cases/t00022_class.svg | 42 +- docs/test_cases/t00022_class_mermaid.svg | 6 +- docs/test_cases/t00023_class.svg | 54 +- docs/test_cases/t00023_class_mermaid.svg | 10 +- docs/test_cases/t00024_class.svg | 62 +- docs/test_cases/t00024_class_mermaid.svg | 8 +- docs/test_cases/t00025_class.svg | 66 +- docs/test_cases/t00025_class_mermaid.svg | 12 +- docs/test_cases/t00026_class.svg | 82 +-- docs/test_cases/t00026_class_mermaid.svg | 12 +- docs/test_cases/t00027_class.svg | 98 +-- docs/test_cases/t00027_class_mermaid.svg | 26 +- docs/test_cases/t00028_class.svg | 88 +-- docs/test_cases/t00028_class_mermaid.svg | 18 +- docs/test_cases/t00029_class.svg | 58 +- docs/test_cases/t00029_class_mermaid.svg | 18 +- docs/test_cases/t00030_class.svg | 46 +- docs/test_cases/t00030_class_mermaid.svg | 12 +- docs/test_cases/t00031_class.svg | 56 +- docs/test_cases/t00031_class_mermaid.svg | 12 +- docs/test_cases/t00032_class.svg | 54 +- docs/test_cases/t00032_class_mermaid.svg | 16 +- docs/test_cases/t00033_class.svg | 54 +- docs/test_cases/t00033_class_mermaid.svg | 16 +- docs/test_cases/t00034_class.svg | 46 +- docs/test_cases/t00034_class_mermaid.svg | 14 +- docs/test_cases/t00035_class.svg | 22 +- docs/test_cases/t00035_class_mermaid.svg | 10 +- docs/test_cases/t00036_class.svg | 40 +- docs/test_cases/t00036_class_mermaid.svg | 10 +- docs/test_cases/t00037_class.svg | 58 +- docs/test_cases/t00037_class_mermaid.svg | 8 +- docs/test_cases/t00038_class.svg | 54 +- docs/test_cases/t00038_class_mermaid.svg | 24 +- docs/test_cases/t00039_class.svg | 78 +-- docs/test_cases/t00039_class_mermaid.svg | 28 +- docs/test_cases/t00040_class.svg | 38 +- docs/test_cases/t00040_class_mermaid.svg | 8 +- docs/test_cases/t00041_class.svg | 58 +- docs/test_cases/t00041_class_mermaid.svg | 18 +- docs/test_cases/t00042_class.svg | 42 +- docs/test_cases/t00042_class_mermaid.svg | 12 +- docs/test_cases/t00043_class.svg | 90 +-- docs/test_cases/t00043_class_mermaid.svg | 22 +- docs/test_cases/t00044_class.svg | 42 +- docs/test_cases/t00044_class_mermaid.svg | 14 +- docs/test_cases/t00045_class.svg | 74 +-- docs/test_cases/t00045_class_mermaid.svg | 24 +- docs/test_cases/t00046_class.svg | 66 +- docs/test_cases/t00046_class_mermaid.svg | 18 +- docs/test_cases/t00047_class.svg | 18 +- docs/test_cases/t00047_class_mermaid.svg | 8 +- docs/test_cases/t00048_class.svg | 74 +-- docs/test_cases/t00048_class_mermaid.svg | 12 +- docs/test_cases/t00049_class.svg | 50 +- docs/test_cases/t00049_class_mermaid.svg | 10 +- docs/test_cases/t00050_class.svg | 70 +- docs/test_cases/t00050_class_mermaid.svg | 16 +- docs/test_cases/t00051_class.svg | 82 +-- docs/test_cases/t00051_class_mermaid.svg | 10 +- docs/test_cases/t00052_class.svg | 42 +- docs/test_cases/t00052_class_mermaid.svg | 12 +- docs/test_cases/t00053_class.svg | 70 +- docs/test_cases/t00053_class_mermaid.svg | 34 +- docs/test_cases/t00054_class.svg | 78 +-- docs/test_cases/t00054_class_mermaid.svg | 34 +- docs/test_cases/t00055_class.svg | 42 +- docs/test_cases/t00055_class_mermaid.svg | 20 +- docs/test_cases/t00056_class.svg | 94 +-- docs/test_cases/t00056_class_mermaid.svg | 28 +- docs/test_cases/t00057_class.svg | 126 ++-- docs/test_cases/t00057_class_mermaid.svg | 20 +- docs/test_cases/t00058_class.svg | 54 +- docs/test_cases/t00058_class_mermaid.svg | 16 +- docs/test_cases/t00059_class.svg | 94 +-- docs/test_cases/t00059_class_mermaid.svg | 22 +- docs/test_cases/t00060_class.svg | 38 +- docs/test_cases/t00060_class_mermaid.svg | 12 +- docs/test_cases/t00061_class.svg | 6 +- docs/test_cases/t00061_class_mermaid.svg | 2 +- docs/test_cases/t00062_class.svg | 198 +++--- docs/test_cases/t00062_class_mermaid.svg | 44 +- docs/test_cases/t00063_class.svg | 6 +- docs/test_cases/t00063_class_mermaid.svg | 2 +- docs/test_cases/t00064_class.svg | 118 ++-- docs/test_cases/t00064_class_mermaid.svg | 46 +- docs/test_cases/t00065_class.svg | 102 +-- docs/test_cases/t00065_class_mermaid.svg | 24 +- docs/test_cases/t00066_class.svg | 126 ++-- docs/test_cases/t00066_class_mermaid.svg | 2 +- docs/test_cases/t00067_class.svg | 86 +-- docs/test_cases/t00067_class_mermaid.svg | 2 +- docs/test_cases/t00068_r0_class.svg | 14 +- docs/test_cases/t00068_r0_class_mermaid.svg | 2 +- docs/test_cases/t00068_r1_class.svg | 38 +- docs/test_cases/t00068_r1_class_mermaid.svg | 10 +- docs/test_cases/t00068_r2_class.svg | 54 +- docs/test_cases/t00068_r2_class_mermaid.svg | 16 +- docs/test_cases/t00069_class.svg | 74 +-- docs/test_cases/t00069_class_mermaid.svg | 8 +- docs/test_cases/t00070_class.svg | 30 +- docs/test_cases/t00070_class_mermaid.svg | 8 +- docs/test_cases/t00071_class.svg | 80 +-- docs/test_cases/t00071_class_mermaid.svg | 20 +- docs/test_cases/t00072_class.svg | 64 +- docs/test_cases/t00072_class_mermaid.svg | 18 +- docs/test_cases/t00073_class.svg | 50 +- docs/test_cases/t00073_class_mermaid.svg | 14 +- docs/test_cases/t00074_class.svg | 14 +- docs/test_cases/t00074_class_mermaid.svg | 6 +- docs/test_cases/t00075_class.svg | 58 +- docs/test_cases/t00075_class_mermaid.svg | 16 +- docs/test_cases/t20001.md | 2 - docs/test_cases/t20001_sequence.svg | 78 +-- 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 | 162 ++--- 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.md | 136 +++- docs/test_cases/t20012_sequence.svg | 408 ++++++------ docs/test_cases/t20012_sequence_mermaid.svg | 210 +++--- 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 | 124 ++-- docs/test_cases/t20021_sequence.svg | 106 +-- docs/test_cases/t20022_sequence.svg | 42 +- docs/test_cases/t20023_sequence.svg | 50 +- docs/test_cases/t20024_sequence.svg | 88 +-- docs/test_cases/t20025_sequence.svg | 36 +- 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_sequence.svg | 88 +-- docs/test_cases/t20030_sequence.svg | 112 ++-- docs/test_cases/t20031_sequence.svg | 58 +- docs/test_cases/t20032_sequence.svg | 60 +- docs/test_cases/t20033_sequence.svg | 128 ++-- docs/test_cases/t20034.md | 52 +- docs/test_cases/t20034_sequence.svg | 104 +-- docs/test_cases/t20034_sequence_mermaid.svg | 16 +- docs/test_cases/t20035_sequence.svg | 32 +- docs/test_cases/t20036_sequence.svg | 64 +- docs/test_cases/t20037_sequence.svg | 108 +-- docs/test_cases/t20038.md | 4 +- docs/test_cases/t20038_sequence.svg | 331 +++++---- docs/test_cases/t20038_sequence_mermaid.svg | 202 +++--- docs/test_cases/t20039_sequence.svg | 84 +-- docs/test_cases/t20040_sequence.svg | 102 +-- docs/test_cases/t20041_sequence.svg | 60 +- docs/test_cases/t20042_sequence.svg | 48 +- docs/test_cases/t20043_sequence.svg | 36 +- docs/test_cases/t20044.md | 700 ++++++++++++++++++++ docs/test_cases/t20044_sequence.svg | 201 ++++++ docs/test_cases/t20044_sequence_mermaid.svg | 297 +++++++++ docs/test_cases/t20045.md | 492 ++++++++++++++ docs/test_cases/t20045_sequence.svg | 177 +++++ docs/test_cases/t20045_sequence_mermaid.svg | 278 ++++++++ docs/test_cases/t20046.md | 351 ++++++++++ docs/test_cases/t20046_sequence.svg | 131 ++++ docs/test_cases/t20046_sequence_mermaid.svg | 212 ++++++ docs/test_cases/t20047.md | 298 +++++++++ docs/test_cases/t20047_sequence.svg | 112 ++++ docs/test_cases/t20047_sequence_mermaid.svg | 190 ++++++ docs/test_cases/t20048.md | 377 +++++++++++ docs/test_cases/t20048_sequence.svg | 161 +++++ docs/test_cases/t20048_sequence_mermaid.svg | 273 ++++++++ docs/test_cases/t20049.md | 236 +++++++ docs/test_cases/t20049_sequence.svg | 83 +++ docs/test_cases/t20049_sequence_mermaid.svg | 158 +++++ docs/test_cases/t20050.md | 246 +++++++ docs/test_cases/t20050_sequence.svg | 81 +++ docs/test_cases/t20050_sequence_mermaid.svg | 118 ++++ docs/test_cases/t20051.md | 143 ++++ docs/test_cases/t20051_sequence.svg | 37 ++ docs/test_cases/t20051_sequence_mermaid.svg | 84 +++ docs/test_cases/t30001_package.svg | 48 +- docs/test_cases/t30002_package.svg | 94 +-- 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/t30009_package.svg | 42 +- docs/test_cases/t30010_package.svg | 24 +- docs/test_cases/t30011_package.svg | 24 +- docs/test_cases/t30012_package.svg | 20 +- docs/test_cases/t30013_package.svg | 78 +-- docs/test_cases/t30014_package.svg | 16 +- docs/test_cases/t30015_package.svg | 80 +-- docs/test_cases/t40001_include.svg | 28 +- docs/test_cases/t40001_include_mermaid.svg | 6 +- docs/test_cases/t40002_include.svg | 34 +- docs/test_cases/t40002_include_mermaid.svg | 10 +- docs/test_cases/t40003_include.svg | 46 +- docs/test_cases/t40003_include_mermaid.svg | 18 +- tests/t20049/t20049.cuh | 2 +- tests/t20050/t20050.cuh | 2 +- tests/t20051/t20051.cuh | 2 +- tests/test_cases.yaml | 3 + 253 files changed, 11155 insertions(+), 5562 deletions(-) create mode 100644 docs/test_cases/t20044.md create mode 100644 docs/test_cases/t20044_sequence.svg create mode 100644 docs/test_cases/t20044_sequence_mermaid.svg create mode 100644 docs/test_cases/t20045.md create mode 100644 docs/test_cases/t20045_sequence.svg create mode 100644 docs/test_cases/t20045_sequence_mermaid.svg create mode 100644 docs/test_cases/t20046.md create mode 100644 docs/test_cases/t20046_sequence.svg create mode 100644 docs/test_cases/t20046_sequence_mermaid.svg create mode 100644 docs/test_cases/t20047.md create mode 100644 docs/test_cases/t20047_sequence.svg create mode 100644 docs/test_cases/t20047_sequence_mermaid.svg create mode 100644 docs/test_cases/t20048.md create mode 100644 docs/test_cases/t20048_sequence.svg create mode 100644 docs/test_cases/t20048_sequence_mermaid.svg create mode 100644 docs/test_cases/t20049.md create mode 100644 docs/test_cases/t20049_sequence.svg create mode 100644 docs/test_cases/t20049_sequence_mermaid.svg create mode 100644 docs/test_cases/t20050.md create mode 100644 docs/test_cases/t20050_sequence.svg create mode 100644 docs/test_cases/t20050_sequence_mermaid.svg create mode 100644 docs/test_cases/t20051.md create mode 100644 docs/test_cases/t20051_sequence.svg create mode 100644 docs/test_cases/t20051_sequence_mermaid.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 1318bb94..762678b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG + * Added support for CUDA calls in sequence diagrams (#263) + * Improved handling of message call comments (#264) + * Fixed handling of nested lambda expressions in sequence diagrams + * Fixed type aliases handling in sequence diagram message names (#260) + * Added support for call expressions tracking through lambdas in function + arguments (#168) + * Added Nix build files (Thanks @hatch01, @uku3lig, @thomaslepoix) * Fixed building with LLVM 18 (#251) ### 0.5.1 diff --git a/docs/test_cases.md b/docs/test_cases.md index 7403d7bf..17baa7f1 100644 --- a/docs/test_cases.md +++ b/docs/test_cases.md @@ -124,6 +124,14 @@ * [t20041](./test_cases/t20041.md) - Test case for recursive variadic template class call * [t20042](./test_cases/t20042.md) - Test case for template overload pattern * [t20043](./test_cases/t20043.md) - Test case for elements diagram filter in sequence diagrams + * [t20044](./test_cases/t20044.md) - Test case for template method call expressions with callables + * [t20045](./test_cases/t20045.md) - Test case for template function call expressions with callables + * [t20046](./test_cases/t20046.md) - Test case for call expressions in nested lambdas + * [t20047](./test_cases/t20047.md) - Test case for 'call' comment directive + * [t20048](./test_cases/t20048.md) - Test case for message comments + * [t20049](./test_cases/t20049.md) - Test case for CUDA kernel calls + * [t20050](./test_cases/t20050.md) - Test case for CUDA kernel calls with participants combined to file + * [t20051](./test_cases/t20051.md) - Test case for CUDA calls callee_type filter ## 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 61c18fa0..8ff4b29f 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -10,123 +10,123 @@ Basic class diagram example - - + + A - + - + foo_a() = 0 : void - + - + foo_c() = 0 : void - - + + B - + - + foo_a() : void - - + + C - + - + foo_c() : void - - + + D - + - + foo_a() : void - + - + foo_c() : void - + - + as : std::vector<A *> - - + + E - + - + foo_a() : void - + - + foo_c() : void - + - + as : std::vector<A *> - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00002_class_mermaid.svg b/docs/test_cases/t00002_class_mermaid.svg index 0a5577f9..a63ffae6 100644 --- a/docs/test_cases/t00002_class_mermaid.svg +++ b/docs/test_cases/t00002_class_mermaid.svg @@ -169,7 +169,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -222,7 +222,7 @@ - + @@ -246,7 +246,7 @@ - + @@ -280,7 +280,7 @@ - + diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index c04a23f4..4db4a2e2 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,227 +9,227 @@ - - + + A - + - + A() = default : void - + - + A(int i) : void - + - + A(A &&) = default : void - + - + A(const A &) = deleted : void A<T>(T t) : void - + - + ~A() = default : void - + - + operator=(A && other) noexcept : A & - + - + operator=(A & other) noexcept : A & - + - + operator++() : A & - + - + auto_method() : int - + - + basic_method() : void - + - + const_method() const : void - + - + create_from_int(int i) : A - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + double_int(const int i) : int - + - + private_method() : void - + - + protected_method() : void - + - + size() constexpr const : std::size_t - + - + static_method() : int - + - + sum(const double a, const double b) : int - + - + a_ : int - + - + auto_member : const unsigned long - + - + b_ : int - + - + c_ : int - + - + compare : std::function<bool (const int)> - + - + private_member : int - + - + protected_member : int - + - + public_member : int - + - + static_const_int : const int - + - + static_int : int diff --git a/docs/test_cases/t00003_class_mermaid.svg b/docs/test_cases/t00003_class_mermaid.svg index 5c2b56fc..21cfe294 100644 --- a/docs/test_cases/t00003_class_mermaid.svg +++ b/docs/test_cases/t00003_class_mermaid.svg @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index f24589e4..44196adb 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,38 +28,38 @@ AA_3 - - + + A - + - + foo() const : void - + - + foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -69,16 +69,16 @@ Red - - + + A::AA::AAA - - + + C::B @@ -87,8 +87,8 @@ - - + + C @@ -97,38 +97,38 @@ - + - + b_int : B<int> - + - + t : T - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -137,8 +137,8 @@ CCC_2 - - + + C::B @@ -147,15 +147,15 @@ - + - + b : V - - + + C::CC @@ -164,16 +164,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -183,8 +183,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00004_class_mermaid.svg b/docs/test_cases/t00004_class_mermaid.svg index 59e5db66..c5c83c13 100644 --- a/docs/test_cases/t00004_class_mermaid.svg +++ b/docs/test_cases/t00004_class_mermaid.svg @@ -210,7 +210,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -263,7 +263,7 @@ - + @@ -292,7 +292,7 @@ - + @@ -311,7 +311,7 @@ - + @@ -345,7 +345,7 @@ - + @@ -364,7 +364,7 @@ - + @@ -383,7 +383,7 @@ - + @@ -412,7 +412,7 @@ - + @@ -431,7 +431,7 @@ - + @@ -450,7 +450,7 @@ - + @@ -479,7 +479,7 @@ - + @@ -503,7 +503,7 @@ - + @@ -532,7 +532,7 @@ - + @@ -551,7 +551,7 @@ - + @@ -585,7 +585,7 @@ - + diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index eefabebb..092f886a 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,205 +9,205 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + 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 * - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00005_class_mermaid.svg b/docs/test_cases/t00005_class_mermaid.svg index 14e732ff..afa2eb38 100644 --- a/docs/test_cases/t00005_class_mermaid.svg +++ b/docs/test_cases/t00005_class_mermaid.svg @@ -186,7 +186,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -224,7 +224,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -300,7 +300,7 @@ - + @@ -319,7 +319,7 @@ - + @@ -338,7 +338,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -376,7 +376,7 @@ - + @@ -395,7 +395,7 @@ - + diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index 26267ffa..05851db6 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 @@ -147,15 +147,15 @@ - + - + data : std::vector<T> - - + + custom_container @@ -164,103 +164,103 @@ - - + + 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/t00006_class_mermaid.svg b/docs/test_cases/t00006_class_mermaid.svg index a71a425d..1926e5b8 100644 --- a/docs/test_cases/t00006_class_mermaid.svg +++ b/docs/test_cases/t00006_class_mermaid.svg @@ -270,7 +270,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -308,7 +308,7 @@ - + @@ -327,7 +327,7 @@ - + @@ -346,7 +346,7 @@ - + @@ -365,7 +365,7 @@ - + @@ -384,7 +384,7 @@ - + @@ -403,7 +403,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -441,7 +441,7 @@ - + @@ -460,7 +460,7 @@ - + @@ -479,7 +479,7 @@ - + @@ -498,7 +498,7 @@ - + @@ -517,7 +517,7 @@ - + @@ -536,7 +536,7 @@ - + @@ -555,7 +555,7 @@ - + @@ -574,7 +574,7 @@ - + @@ -598,7 +598,7 @@ - + @@ -617,7 +617,7 @@ - + diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 0f5cde04..7d1e7cc9 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - + + 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/t00007_class_mermaid.svg b/docs/test_cases/t00007_class_mermaid.svg index e2a15ba0..212334b2 100644 --- a/docs/test_cases/t00007_class_mermaid.svg +++ b/docs/test_cases/t00007_class_mermaid.svg @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index 32b2cae9..a4066393 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,50 +19,50 @@ - + - + comparator : CMP - + - + ints : std::array<int,N> - + - + pointer : T * - + - + reference : T & - + - + value : T - + - + values : std::vector<P> - - + + Vector @@ -71,15 +71,15 @@ - + - + values : std::vector<T> - - + + B @@ -88,15 +88,15 @@ - + - + template_template : C<T> - - + + B @@ -105,8 +105,8 @@ - - + + D @@ -115,31 +115,31 @@ D<Items...>(std::tuple<Items...> *) : void - + - + add(int i) : void - + - + ints : B<int,Vector> - - + + E - - + + E::nested_template @@ -147,16 +147,16 @@ ET - + - + get(ET * d) : DT * - - + + E::nested_template @@ -164,11 +164,11 @@ char - + - + getDecl(char * c) : DeclType * diff --git a/docs/test_cases/t00008_class_mermaid.svg b/docs/test_cases/t00008_class_mermaid.svg index 7cef610e..91b4808f 100644 --- a/docs/test_cases/t00008_class_mermaid.svg +++ b/docs/test_cases/t00008_class_mermaid.svg @@ -114,7 +114,7 @@ - + @@ -163,7 +163,7 @@ - + @@ -187,7 +187,7 @@ - + @@ -211,7 +211,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -264,7 +264,7 @@ - + @@ -283,7 +283,7 @@ - + @@ -307,7 +307,7 @@ - + diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 7ae0214c..a91c3cdf 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + value : T - - + + A @@ -36,8 +36,8 @@ - - + + A @@ -46,8 +46,8 @@ - - + + A @@ -56,33 +56,33 @@ - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00009_class_mermaid.svg b/docs/test_cases/t00009_class_mermaid.svg index c921e55f..2cd632bc 100644 --- a/docs/test_cases/t00009_class_mermaid.svg +++ b/docs/test_cases/t00009_class_mermaid.svg @@ -126,7 +126,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -188,7 +188,7 @@ - + @@ -207,7 +207,7 @@ - + diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index d5d21583..b4c9594f 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,22 +19,22 @@ - + - + first : T - + - + second : P - - + + A @@ -43,8 +43,8 @@ - - + + B @@ -53,15 +53,15 @@ - + - + astring : A<T,std::string> - - + + B @@ -70,19 +70,19 @@ - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00010_class_mermaid.svg b/docs/test_cases/t00010_class_mermaid.svg index 0974117c..e663a933 100644 --- a/docs/test_cases/t00010_class_mermaid.svg +++ b/docs/test_cases/t00010_class_mermaid.svg @@ -102,7 +102,7 @@ - + @@ -131,7 +131,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -174,7 +174,7 @@ - + @@ -193,7 +193,7 @@ - + diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 338a6708..e8271e05 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -19,48 +19,48 @@ - + - + value : T - - + + A - + - + foo() : void - - + + B - + - + foo() : void - + - + m_a : A * diff --git a/docs/test_cases/t00011_class_mermaid.svg b/docs/test_cases/t00011_class_mermaid.svg index bf415cb2..0eed9231 100644 --- a/docs/test_cases/t00011_class_mermaid.svg +++ b/docs/test_cases/t00011_class_mermaid.svg @@ -78,7 +78,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index 089dd40f..a7d8a0bb 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,22 +19,22 @@ - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,15 +60,15 @@ - + - + ints : std::array<T,sizeof...(Is)> - - + + A @@ -77,8 +77,8 @@ - - + + A @@ -87,8 +87,8 @@ - - + + B @@ -97,8 +97,8 @@ - - + + B @@ -107,8 +107,8 @@ - - + + C @@ -117,50 +117,50 @@ - - + + 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/t00012_class_mermaid.svg b/docs/test_cases/t00012_class_mermaid.svg index c0eba13a..a10688cb 100644 --- a/docs/test_cases/t00012_class_mermaid.svg +++ b/docs/test_cases/t00012_class_mermaid.svg @@ -174,7 +174,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -227,7 +227,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -270,7 +270,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -308,7 +308,7 @@ - + @@ -327,7 +327,7 @@ - + @@ -346,7 +346,7 @@ - + diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index f2962917..469195fd 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 @@ -19,15 +19,15 @@ - + - + f : T - - + + ABCD::F @@ -36,75 +36,75 @@ - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + print(R * r) : void - + - + d : int - - + + E @@ -113,15 +113,15 @@ - + - + e : T - - + + G @@ -130,22 +130,22 @@ - + - + args : std::tuple<Args...> - + - + g : T - - + + E @@ -154,8 +154,8 @@ - - + + G @@ -164,8 +164,8 @@ - - + + E @@ -174,93 +174,93 @@ - - + + R - + - + get_a(A * a) : int - + - + get_b(B & b) : int - + - + get_c(C c) : int - + - + get_const_b(const B & b) : int - + - + get_d(D && d) : int - + - + get_d2(D && d) : int get_e<T>(E<T> e) : T get_f<T>(const F<T> & f) : T - + - + get_int_e(const E<int> & e) : int - + - + get_int_e2(E<int> & e) : int - + - + get_int_f(const ABCD::F<int> & f) : int - + - + estring : E<std::string> - + - + gintstring : G<int,float,std::string> diff --git a/docs/test_cases/t00013_class_mermaid.svg b/docs/test_cases/t00013_class_mermaid.svg index 2236b38c..973fa784 100644 --- a/docs/test_cases/t00013_class_mermaid.svg +++ b/docs/test_cases/t00013_class_mermaid.svg @@ -234,7 +234,7 @@ - + @@ -258,7 +258,7 @@ - + @@ -277,7 +277,7 @@ - + @@ -301,7 +301,7 @@ - + @@ -325,7 +325,7 @@ - + @@ -349,7 +349,7 @@ - + @@ -378,7 +378,7 @@ - + @@ -402,7 +402,7 @@ - + @@ -431,7 +431,7 @@ - + @@ -450,7 +450,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -488,7 +488,7 @@ - + diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index df914996..84903b59 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,37 +19,37 @@ - + - + p : P - + - + t : T - - + + B - + - + value : std::string - - + + A @@ -58,8 +58,8 @@ - - + + A @@ -68,8 +68,8 @@ - - + + A @@ -78,8 +78,8 @@ - - + + A @@ -88,8 +88,8 @@ - - + + A @@ -98,8 +98,8 @@ - - + + A @@ -108,8 +108,8 @@ - - + + A @@ -118,8 +118,8 @@ - - + + A @@ -128,8 +128,8 @@ - - + + A @@ -138,8 +138,8 @@ - - + + A @@ -148,8 +148,8 @@ - - + + A @@ -158,8 +158,8 @@ - - + + A @@ -168,8 +168,8 @@ - - + + A @@ -178,7 +178,7 @@ - + A @@ -186,7 +186,7 @@ char,std::string - + A @@ -194,8 +194,8 @@ wchar_t,std::string - - + + R @@ -204,116 +204,116 @@ - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + atfloat : AAPtr<T,float> - + - + bapair : PairPairBA<bool> - + - + boolstring : A<bool,std::string> - + - + bs : BVector - + - + bs2 : BVector2 - + - + bstringstring : BStringString - + - + cb : SimpleCallback<ACharString> - + - + floatstring : AStringPtr<float> - + - + gcb : GenericCallback<AWCharString> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00014_class_mermaid.svg b/docs/test_cases/t00014_class_mermaid.svg index ff1e52f9..64225afa 100644 --- a/docs/test_cases/t00014_class_mermaid.svg +++ b/docs/test_cases/t00014_class_mermaid.svg @@ -474,7 +474,7 @@ - + @@ -503,7 +503,7 @@ - + @@ -527,7 +527,7 @@ - + @@ -546,7 +546,7 @@ - + @@ -565,7 +565,7 @@ - + @@ -584,7 +584,7 @@ - + @@ -603,7 +603,7 @@ - + @@ -622,7 +622,7 @@ - + @@ -641,7 +641,7 @@ - + @@ -660,7 +660,7 @@ - + @@ -679,7 +679,7 @@ - + @@ -698,7 +698,7 @@ - + @@ -717,7 +717,7 @@ - + @@ -736,7 +736,7 @@ - + @@ -755,7 +755,7 @@ - + @@ -774,7 +774,7 @@ - + @@ -793,7 +793,7 @@ - + @@ -812,7 +812,7 @@ - + diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index 4ffa62ee..bdcdb79e 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/t00015_class_mermaid.svg b/docs/test_cases/t00015_class_mermaid.svg index e6b9fed5..17d419b2 100644 --- a/docs/test_cases/t00015_class_mermaid.svg +++ b/docs/test_cases/t00015_class_mermaid.svg @@ -84,7 +84,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -141,7 +141,7 @@ - + @@ -160,7 +160,7 @@ - + diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index 022a4d4c..6d2f3d93 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 @@ -21,8 +21,8 @@ value : enum - - + + is_numeric @@ -33,8 +33,8 @@ value : enum - - + + is_numeric @@ -45,8 +45,8 @@ value : enum - - + + is_numeric @@ -57,8 +57,8 @@ value : enum - - + + is_numeric @@ -69,8 +69,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00016_class_mermaid.svg b/docs/test_cases/t00016_class_mermaid.svg index 786430a0..66fb312b 100644 --- a/docs/test_cases/t00016_class_mermaid.svg +++ b/docs/test_cases/t00016_class_mermaid.svg @@ -114,7 +114,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -162,7 +162,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -234,7 +234,7 @@ - + diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 5a22057f..d4d6dd0e 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,135 +9,135 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + R(int & some_int, C & cc, const E & ee, F && ff, I *& ii) : void - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00017_class_mermaid.svg b/docs/test_cases/t00017_class_mermaid.svg index c064f02c..9c70c527 100644 --- a/docs/test_cases/t00017_class_mermaid.svg +++ b/docs/test_cases/t00017_class_mermaid.svg @@ -186,7 +186,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -224,7 +224,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -300,7 +300,7 @@ - + @@ -319,7 +319,7 @@ - + @@ -338,7 +338,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -376,7 +376,7 @@ - + @@ -395,7 +395,7 @@ - + diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index 1811b9a1..d420f34a 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,121 +9,121 @@ - - + + impl::widget - + - + widget(int n) : void - + - + draw(const widget & w) const : void - + - + draw(const widget & w) : void - + - + n : int - - + + widget - + - + widget(int) : void - + - + widget(widget &&) : void - + - + widget(const widget &) = deleted : void - + - + ~widget() : void - + - + operator=(widget &&) : widget & - + - + operator=(const widget &) = deleted : widget & - + - + draw() const : void - + - + draw() : void - + - + shown() const : bool - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00018_class_mermaid.svg b/docs/test_cases/t00018_class_mermaid.svg index 144f83a9..6f6d4f74 100644 --- a/docs/test_cases/t00018_class_mermaid.svg +++ b/docs/test_cases/t00018_class_mermaid.svg @@ -78,7 +78,7 @@ - + @@ -117,7 +117,7 @@ - + diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 5f51ed9d..91381fe0 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,45 +9,45 @@ - - + + Base - + - + Base() = default : void - + - + ~Base() constexpr = default : void - + - + m1() : int - + - + m2() : std::string - - + + Layer1 @@ -55,23 +55,23 @@ LowerLayer - + - + m1() : int - + - + m2() : std::string - - + + Layer2 @@ -79,16 +79,16 @@ LowerLayer - + - + all_calls_count() const : int - - + + Layer3 @@ -96,50 +96,50 @@ LowerLayer - + - + m1() : int - + - + m1_calls() const : int - + - + m2() : std::string - + - + m2_calls() const : int - + - + m_m1_calls : int - + - + m_m2_calls : int - + Layer3 @@ -147,7 +147,7 @@ Base - + Layer2 @@ -155,7 +155,7 @@ Layer3<Base> - + Layer1 @@ -163,19 +163,19 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00019_class_mermaid.svg b/docs/test_cases/t00019_class_mermaid.svg index 51df1183..a22f1e83 100644 --- a/docs/test_cases/t00019_class_mermaid.svg +++ b/docs/test_cases/t00019_class_mermaid.svg @@ -132,7 +132,7 @@ - + @@ -171,7 +171,7 @@ - + @@ -200,7 +200,7 @@ - + @@ -224,7 +224,7 @@ - + @@ -273,7 +273,7 @@ - + @@ -292,7 +292,7 @@ - + @@ -311,7 +311,7 @@ - + @@ -330,7 +330,7 @@ - + diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index 0fef0b72..95192b2f 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,175 +9,175 @@ - - + + ProductA - + - + ~ProductA() constexpr = default : void - + - + sell(int price) const = 0 : bool - - + + ProductA1 - + - + sell(int price) const : bool - - + + ProductA2 - + - + sell(int price) const : bool - - + + ProductB - + - + ~ProductB() constexpr = default : void - + - + buy(int price) const = 0 : bool - - + + ProductB1 - + - + buy(int price) const : bool - - + + ProductB2 - + - + buy(int price) const : bool - - + + AbstractFactory - + - + make_a() const = 0 : std::unique_ptr<ProductA> - + - + make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> - - + + Factory2 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> diff --git a/docs/test_cases/t00020_class_mermaid.svg b/docs/test_cases/t00020_class_mermaid.svg index a36f7233..a6c4abf1 100644 --- a/docs/test_cases/t00020_class_mermaid.svg +++ b/docs/test_cases/t00020_class_mermaid.svg @@ -186,7 +186,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -239,7 +239,7 @@ - + @@ -263,7 +263,7 @@ - + @@ -292,7 +292,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -340,7 +340,7 @@ - + @@ -369,7 +369,7 @@ - + @@ -398,7 +398,7 @@ - + diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index a1a8f06b..a7a95563 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,152 +9,152 @@ - - + + Visitor - + - + ~Visitor() constexpr = default : void - + - + visit_A(const A & item) const = 0 : void - + - + visit_B(const B & item) const = 0 : void - - + + Visitor1 - + - + visit_A(const A & item) const : void - + - + visit_B(const B & item) const : void - - + + Visitor2 - + - + visit_A(const A & item) const : void - + - + visit_B(const B & item) const : void - - + + Visitor3 - + - + visit_A(const A & item) const : void - + - + visit_B(const B & item) const : void - - + + Item - + - + ~Item() constexpr = default : void - + - + accept(const Visitor & visitor) const = 0 : void - - + + A - + - + accept(const Visitor & visitor) const : void - - + + B - + - + accept(const Visitor & visitor) const : void diff --git a/docs/test_cases/t00021_class_mermaid.svg b/docs/test_cases/t00021_class_mermaid.svg index 3d4f3dd1..ad0254f6 100644 --- a/docs/test_cases/t00021_class_mermaid.svg +++ b/docs/test_cases/t00021_class_mermaid.svg @@ -236,7 +236,7 @@ - + @@ -270,7 +270,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -328,7 +328,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -410,7 +410,7 @@ - + diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index a1066901..e4616972 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,76 +9,76 @@ - - + + A - + - + method1() = 0 : void - + - + method2() = 0 : void - + - + template_method() : void - - + + A1 - + - + method1() : void - + - + method2() : void - - + + A2 - + - + method1() : void - + - + method2() : void diff --git a/docs/test_cases/t00022_class_mermaid.svg b/docs/test_cases/t00022_class_mermaid.svg index 413edf1c..4d119ea0 100644 --- a/docs/test_cases/t00022_class_mermaid.svg +++ b/docs/test_cases/t00022_class_mermaid.svg @@ -74,7 +74,7 @@ - + @@ -108,7 +108,7 @@ - + @@ -137,7 +137,7 @@ - + diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index a9135c99..1e716967 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,102 +9,102 @@ - - + + Strategy - + - + ~Strategy() constexpr = default : void - + - + algorithm() = 0 : void - - + + StrategyA - + - + algorithm() : void - - + + StrategyB - + - + algorithm() : void - - + + StrategyC - + - + algorithm() : void - - + + Context - + - + Context(std::unique_ptr<Strategy> strategy) : void - + - + apply() : void - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00023_class_mermaid.svg b/docs/test_cases/t00023_class_mermaid.svg index 8852708c..51b3ce53 100644 --- a/docs/test_cases/t00023_class_mermaid.svg +++ b/docs/test_cases/t00023_class_mermaid.svg @@ -96,7 +96,7 @@ - + @@ -125,7 +125,7 @@ - + @@ -149,7 +149,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -197,7 +197,7 @@ - + diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index ea188ba4..4856900d 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,115 +9,115 @@ - - + + Target - + - + ~Target() = 0 : void - + - + m1() = 0 : void - + - + m2() = 0 : void - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy - + - + Proxy(std::shared_ptr<Target> target) : void - + - + m1() : void - + - + m2() : void - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00024_class_mermaid.svg b/docs/test_cases/t00024_class_mermaid.svg index 692e1e88..d0ad288c 100644 --- a/docs/test_cases/t00024_class_mermaid.svg +++ b/docs/test_cases/t00024_class_mermaid.svg @@ -96,7 +96,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -188,7 +188,7 @@ - + diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index 1227a2f4..c2800b78 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,52 +9,52 @@ - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy @@ -62,38 +62,38 @@ T - + - + Proxy(std::shared_ptr<T> target) : void - + - + m1() : void - + - + m2() : void - + - + m_target : std::shared_ptr<T> - - + + Proxy @@ -102,8 +102,8 @@ - - + + Proxy @@ -112,26 +112,26 @@ - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00025_class_mermaid.svg b/docs/test_cases/t00025_class_mermaid.svg index 4d28ec6c..64a27a3f 100644 --- a/docs/test_cases/t00025_class_mermaid.svg +++ b/docs/test_cases/t00025_class_mermaid.svg @@ -126,7 +126,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -184,7 +184,7 @@ - + @@ -223,7 +223,7 @@ - + @@ -242,7 +242,7 @@ - + @@ -261,7 +261,7 @@ - + diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index 0873afc8..cb368105 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,31 +18,31 @@ T - + - + Memento(T && v) : void - + - + value() const : T - + - + m_value : T - - + + Originator @@ -50,52 +50,52 @@ T - + - + Originator(T && v) : void - + - + load(const Memento<T> & m) : void - + - + memoize_value() const : Memento<T> - + - + print() const : void - + - + set(T && v) : void - + - + m_value : T - - + + Caretaker @@ -103,30 +103,30 @@ T - + - + set_state(const std::string & s, Memento<T> && m) : void - + - + state(const std::string & n) : Memento<T> & - + - + m_mementos : std::unordered_map<std::string,Memento<T>> - - + + Caretaker @@ -135,8 +135,8 @@ - - + + Originator @@ -145,26 +145,26 @@ - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00026_class_mermaid.svg b/docs/test_cases/t00026_class_mermaid.svg index 94b6e471..1d603c81 100644 --- a/docs/test_cases/t00026_class_mermaid.svg +++ b/docs/test_cases/t00026_class_mermaid.svg @@ -126,7 +126,7 @@ - + @@ -160,7 +160,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -281,7 +281,7 @@ - + diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index a7255699..a71327e7 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - + + Shape - + - + ~Shape() constexpr = default : void - + - + display() = 0 : void - - + + Line - - + + Line @@ -49,24 +49,24 @@ T<>... - + - + display() : void - - + + Text - - + + Text @@ -74,31 +74,31 @@ T<>... - + - + display() : void - - + + ShapeDecorator - + - + display() = 0 : void - - + + Color @@ -106,16 +106,16 @@ T - + - + display() : void - - + + Weight @@ -123,16 +123,16 @@ T - + - + display() : void - - + + Line @@ -141,8 +141,8 @@ - - + + Line @@ -151,8 +151,8 @@ - - + + Text @@ -161,8 +161,8 @@ - - + + Text @@ -171,40 +171,40 @@ - - + + Window - + - + border : Line<Color,Weight> - + - + description : Text<Color> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> diff --git a/docs/test_cases/t00027_class_mermaid.svg b/docs/test_cases/t00027_class_mermaid.svg index 21eed449..b8da91cd 100644 --- a/docs/test_cases/t00027_class_mermaid.svg +++ b/docs/test_cases/t00027_class_mermaid.svg @@ -190,7 +190,7 @@ - + @@ -219,7 +219,7 @@ - + @@ -238,7 +238,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -305,7 +305,7 @@ - + @@ -329,7 +329,7 @@ - + @@ -353,7 +353,7 @@ - + @@ -377,7 +377,7 @@ - + @@ -396,7 +396,7 @@ - + @@ -415,7 +415,7 @@ - + @@ -434,7 +434,7 @@ - + @@ -453,7 +453,7 @@ - + diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index f549dffe..3c577fbb 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 @@ -65,26 +65,26 @@ - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,11 +94,11 @@ three - + F enum note. - - + + E @@ -107,70 +107,70 @@ - - + + R - + - + R(C & c) : void - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** - + R class note. - + R contains an instance of A. - + Reference to C. diff --git a/docs/test_cases/t00028_class_mermaid.svg b/docs/test_cases/t00028_class_mermaid.svg index 8642531e..3c3d6e8b 100644 --- a/docs/test_cases/t00028_class_mermaid.svg +++ b/docs/test_cases/t00028_class_mermaid.svg @@ -218,7 +218,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -256,7 +256,7 @@ - + @@ -275,7 +275,7 @@ - + @@ -294,7 +294,7 @@ - + @@ -318,7 +318,7 @@ - + @@ -337,7 +337,7 @@ - + @@ -371,7 +371,7 @@ - + @@ -390,7 +390,7 @@ - + diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index 1ce06069..6ea76d9e 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 @@ -27,30 +27,30 @@ - + - + param : T - - + + D - + - + param : T - - + + E @@ -60,65 +60,65 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00029_class_mermaid.svg b/docs/test_cases/t00029_class_mermaid.svg index 187538e4..8553eb13 100644 --- a/docs/test_cases/t00029_class_mermaid.svg +++ b/docs/test_cases/t00029_class_mermaid.svg @@ -78,7 +78,7 @@ - + @@ -97,7 +97,7 @@ - + @@ -121,7 +121,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -217,7 +217,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -255,7 +255,7 @@ - + diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index 08a001a7..474ff751 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,87 +9,87 @@ - - + + 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/t00030_class_mermaid.svg b/docs/test_cases/t00030_class_mermaid.svg index 339382e3..0b9aa402 100644 --- a/docs/test_cases/t00030_class_mermaid.svg +++ b/docs/test_cases/t00030_class_mermaid.svg @@ -164,7 +164,7 @@ - + @@ -183,7 +183,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -240,7 +240,7 @@ - + @@ -259,7 +259,7 @@ - + diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index 8f98cd9d..819949e0 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 - - + + @@ -48,23 +48,23 @@ - + - + ttt : T - - + + D - - + + C @@ -73,47 +73,47 @@ - - + + R - + - + add_b(B b) : void - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00031_class_mermaid.svg b/docs/test_cases/t00031_class_mermaid.svg index 4d5a5aa2..26bb9a34 100644 --- a/docs/test_cases/t00031_class_mermaid.svg +++ b/docs/test_cases/t00031_class_mermaid.svg @@ -126,7 +126,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -222,7 +222,7 @@ - + @@ -241,7 +241,7 @@ - + diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index c232241c..15d6594c 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,69 +9,69 @@ - - + + Base - - + + TBase - - + + A - + - + operator()() : void - - + + B - + - + operator()() : void - - + + C - + - + operator()() : void - - + + Overload @@ -80,15 +80,15 @@ - + - + counter : L - - + + Overload @@ -97,19 +97,19 @@ - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00032_class_mermaid.svg b/docs/test_cases/t00032_class_mermaid.svg index d100116d..2d8c81e2 100644 --- a/docs/test_cases/t00032_class_mermaid.svg +++ b/docs/test_cases/t00032_class_mermaid.svg @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -190,7 +190,7 @@ - + @@ -214,7 +214,7 @@ - + @@ -238,7 +238,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -281,7 +281,7 @@ - + diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index ab5b8e66..c31711bb 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + aaa : T - - + + B @@ -36,15 +36,15 @@ - + - + bbb : T - - + + C @@ -53,30 +53,30 @@ - + - + ccc : T - - + + D - + - + ddd : int - - + + C @@ -85,8 +85,8 @@ - - + + B @@ -95,8 +95,8 @@ - - + + A @@ -105,19 +105,19 @@ - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00033_class_mermaid.svg b/docs/test_cases/t00033_class_mermaid.svg index 724e1dfc..ced23893 100644 --- a/docs/test_cases/t00033_class_mermaid.svg +++ b/docs/test_cases/t00033_class_mermaid.svg @@ -138,7 +138,7 @@ - + @@ -162,7 +162,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -253,7 +253,7 @@ - + @@ -272,7 +272,7 @@ - + @@ -291,7 +291,7 @@ - + diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index 61a6448f..5ba93053 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Void - + - + operator!=(const Void &) constexpr const : bool - + - + operator==(const Void &) constexpr const : bool - - + + lift_void @@ -41,8 +41,8 @@ - - + + lift_void @@ -51,8 +51,8 @@ - - + + drop_void @@ -61,8 +61,8 @@ - - + + drop_void @@ -71,34 +71,34 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00034_class_mermaid.svg b/docs/test_cases/t00034_class_mermaid.svg index fc564e3d..203b322d 100644 --- a/docs/test_cases/t00034_class_mermaid.svg +++ b/docs/test_cases/t00034_class_mermaid.svg @@ -102,7 +102,7 @@ - + @@ -131,7 +131,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -188,7 +188,7 @@ - + @@ -207,7 +207,7 @@ - + @@ -226,7 +226,7 @@ - + diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 7be743fa..e1a9b2b7 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/t00035_class_mermaid.svg b/docs/test_cases/t00035_class_mermaid.svg index 15497fba..cd613d47 100644 --- a/docs/test_cases/t00035_class_mermaid.svg +++ b/docs/test_cases/t00035_class_mermaid.svg @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index eac601a5..e337b597 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 @@ -44,15 +44,15 @@ - + - + a : T - - + + A @@ -61,23 +61,23 @@ - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00036_class_mermaid.svg b/docs/test_cases/t00036_class_mermaid.svg index 51df7ec6..518ac5d2 100644 --- a/docs/test_cases/t00036_class_mermaid.svg +++ b/docs/test_cases/t00036_class_mermaid.svg @@ -78,7 +78,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -131,7 +131,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -174,7 +174,7 @@ - + diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 692ba2a5..0d44fe7c 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,106 +9,106 @@ - - + + ST - + - + dimensions : ST::(anonymous_662) - + - + units : ST::(anonymous_792) - - + + ST::(dimensions) - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + ST::(units) - + - + c : double - + - + h : double - - + + A - + - + A() : void - + - + st : ST diff --git a/docs/test_cases/t00037_class_mermaid.svg b/docs/test_cases/t00037_class_mermaid.svg index b0c4773f..e35d91d1 100644 --- a/docs/test_cases/t00037_class_mermaid.svg +++ b/docs/test_cases/t00037_class_mermaid.svg @@ -90,7 +90,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -187,7 +187,7 @@ - + diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index 801b958a..30f18818 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,8 +88,8 @@ - - + + map @@ -98,8 +98,8 @@ - - + + map @@ -108,8 +108,8 @@ - - + + map @@ -118,8 +118,8 @@ - - + + map diff --git a/docs/test_cases/t00038_class_mermaid.svg b/docs/test_cases/t00038_class_mermaid.svg index 50ff9d15..b98fdd9a 100644 --- a/docs/test_cases/t00038_class_mermaid.svg +++ b/docs/test_cases/t00038_class_mermaid.svg @@ -202,7 +202,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -308,7 +308,7 @@ - + @@ -327,7 +327,7 @@ - + @@ -346,7 +346,7 @@ - + @@ -370,7 +370,7 @@ - + @@ -389,7 +389,7 @@ - + @@ -408,7 +408,7 @@ - + @@ -427,7 +427,7 @@ - + @@ -446,7 +446,7 @@ - + diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index 702b662c..d4c5fd52 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 @@ -106,15 +106,15 @@ - + - + t : T * - - + + ns3::FF @@ -123,15 +123,15 @@ - + - + m : M * - - + + ns3::FE @@ -140,15 +140,15 @@ - + - + m : M * - - + + ns3::FFF @@ -157,11 +157,11 @@ - + - + n : N * diff --git a/docs/test_cases/t00039_class_mermaid.svg b/docs/test_cases/t00039_class_mermaid.svg index fc5e0def..53f23c0f 100644 --- a/docs/test_cases/t00039_class_mermaid.svg +++ b/docs/test_cases/t00039_class_mermaid.svg @@ -184,7 +184,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -222,7 +222,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -298,7 +298,7 @@ - + @@ -317,7 +317,7 @@ - + @@ -336,7 +336,7 @@ - + @@ -360,7 +360,7 @@ - + @@ -379,7 +379,7 @@ - + @@ -403,7 +403,7 @@ - + @@ -427,7 +427,7 @@ - + @@ -451,7 +451,7 @@ - + diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index 2a814796..0cd2eca0 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,70 +9,70 @@ - - + + A - + - + get_a() : int - + - + ii_ : int - - + + AA - - + + AAA - + - + get_aaa() : int - + - + b : B * - - + + R - + - + foo(A * a) : void diff --git a/docs/test_cases/t00040_class_mermaid.svg b/docs/test_cases/t00040_class_mermaid.svg index 1e6902e4..1e1572ec 100644 --- a/docs/test_cases/t00040_class_mermaid.svg +++ b/docs/test_cases/t00040_class_mermaid.svg @@ -74,7 +74,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -151,7 +151,7 @@ - + diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index 9263c8fd..3dfd228c 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,107 +9,107 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + foo(H * h) : void - + - + e : E * - + - + f : F * - + - + g : detail::G * - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00041_class_mermaid.svg b/docs/test_cases/t00041_class_mermaid.svg index 1dd8d20f..036c992f 100644 --- a/docs/test_cases/t00041_class_mermaid.svg +++ b/docs/test_cases/t00041_class_mermaid.svg @@ -130,7 +130,7 @@ - + @@ -149,7 +149,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -211,7 +211,7 @@ - + @@ -250,7 +250,7 @@ - + @@ -269,7 +269,7 @@ - + @@ -288,7 +288,7 @@ - + @@ -307,7 +307,7 @@ - + diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index 1cc113ff..e130c550 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + a : T - - + + A @@ -36,15 +36,15 @@ - + - + a : void * - - + + B @@ -53,22 +53,22 @@ - + - + b : T - + - + bb : K - - + + A @@ -77,8 +77,8 @@ - - + + A @@ -87,8 +87,8 @@ - - + + B diff --git a/docs/test_cases/t00042_class_mermaid.svg b/docs/test_cases/t00042_class_mermaid.svg index 85f7d809..5e0208c2 100644 --- a/docs/test_cases/t00042_class_mermaid.svg +++ b/docs/test_cases/t00042_class_mermaid.svg @@ -102,7 +102,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -217,7 +217,7 @@ - + diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index 82d15aec..516020b7 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,167 +9,167 @@ - + dependants - + dependencies - - + + A - - + + B - + - + b(A * a) : void - - + + BB - + - + bb(A * a) : void - - + + C - + - + c(B * b) : void - - + + D - + - + d(C * c) : void - + - + dd(BB * bb) : void - - + + E - + - + e(D * d) : void - - + + G - - + + GG - - + + H - + - + h(G * g) : void - + - + hh(GG * gg) : void - - + + I - + - + i(H * h) : void - - + + J - + - + i(I * i) : void diff --git a/docs/test_cases/t00043_class_mermaid.svg b/docs/test_cases/t00043_class_mermaid.svg index e6220a4e..0d729833 100644 --- a/docs/test_cases/t00043_class_mermaid.svg +++ b/docs/test_cases/t00043_class_mermaid.svg @@ -174,7 +174,7 @@ - + @@ -193,7 +193,7 @@ - + @@ -217,7 +217,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -265,7 +265,7 @@ - + @@ -294,7 +294,7 @@ - + @@ -318,7 +318,7 @@ - + @@ -337,7 +337,7 @@ - + @@ -356,7 +356,7 @@ - + @@ -385,7 +385,7 @@ - + @@ -409,7 +409,7 @@ - + diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index 095b5e76..f0326f71 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + signal_handler @@ -19,8 +19,8 @@ - - + + sink @@ -28,26 +28,26 @@ signal_handler<Ret(Args...),A> - + - + sink(signal_t & sh) : void get_signal<CastTo>() : CastTo * - + - + signal : signal_t * - - + + signal_handler @@ -56,8 +56,8 @@ - - + + sink @@ -66,23 +66,23 @@ - - + + R - + - + sink1 : sink<signal_handler<void (int),bool>> - - + + signal_handler @@ -91,8 +91,8 @@ - - + + sink diff --git a/docs/test_cases/t00044_class_mermaid.svg b/docs/test_cases/t00044_class_mermaid.svg index 2bcc28de..c9b71480 100644 --- a/docs/test_cases/t00044_class_mermaid.svg +++ b/docs/test_cases/t00044_class_mermaid.svg @@ -138,7 +138,7 @@ - + @@ -157,7 +157,7 @@ - + @@ -191,7 +191,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -253,7 +253,7 @@ - + @@ -272,7 +272,7 @@ - + diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index e5b72622..82250605 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 @@ -43,110 +43,110 @@ - + - + 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 - + - + foo(AA & aa) : void - + - + a : A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00045_class_mermaid.svg b/docs/test_cases/t00045_class_mermaid.svg index 9b6ee1cb..fd80fd7e 100644 --- a/docs/test_cases/t00045_class_mermaid.svg +++ b/docs/test_cases/t00045_class_mermaid.svg @@ -166,7 +166,7 @@ - + @@ -185,7 +185,7 @@ - + @@ -204,7 +204,7 @@ - + @@ -223,7 +223,7 @@ - + @@ -247,7 +247,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -285,7 +285,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -323,7 +323,7 @@ - + @@ -342,7 +342,7 @@ - + @@ -361,7 +361,7 @@ - + @@ -380,7 +380,7 @@ - + diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index 8e413e84..a36e9f32 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,120 +9,120 @@ - + ns1 - + ns2 - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + foo(AA & aa) : void - + - + a : A * - + - + i : std::vector<std::uint8_t> - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - - + + A - - + + AA diff --git a/docs/test_cases/t00046_class_mermaid.svg b/docs/test_cases/t00046_class_mermaid.svg index 6913afc6..bd3a8643 100644 --- a/docs/test_cases/t00046_class_mermaid.svg +++ b/docs/test_cases/t00046_class_mermaid.svg @@ -154,7 +154,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -211,7 +211,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -249,7 +249,7 @@ - + @@ -268,7 +268,7 @@ - + @@ -287,7 +287,7 @@ - + @@ -306,7 +306,7 @@ - + diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index 1ea64471..e4067c33 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + conditional_t @@ -19,8 +19,8 @@ - - + + conditional_t @@ -29,8 +29,8 @@ - - + + conditional_t @@ -39,8 +39,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00047_class_mermaid.svg b/docs/test_cases/t00047_class_mermaid.svg index c7d275b7..34aa7a0b 100644 --- a/docs/test_cases/t00047_class_mermaid.svg +++ b/docs/test_cases/t00047_class_mermaid.svg @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index ab907403..c84bfa09 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Base - + - + foo() = 0 : void - + - + base : int - - + + BaseTemplate @@ -40,45 +40,45 @@ T - + - + foo() = 0 : void - + - + base : T - - + + B - + - + foo() : void - + - + b : int - - + + BTemplate @@ -86,45 +86,45 @@ T - + - + foo() : void - + - + b : T - - + + A - + - + foo() : void - + - + a : int - - + + ATemplate @@ -132,19 +132,19 @@ T - + - + foo() : void - + - + a : T diff --git a/docs/test_cases/t00048_class_mermaid.svg b/docs/test_cases/t00048_class_mermaid.svg index 6646c1a9..3dc7fe0b 100644 --- a/docs/test_cases/t00048_class_mermaid.svg +++ b/docs/test_cases/t00048_class_mermaid.svg @@ -94,7 +94,7 @@ - + @@ -123,7 +123,7 @@ - + @@ -152,7 +152,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -239,7 +239,7 @@ - + diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index f0fb0f78..3f21fe7c 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,23 +18,23 @@ T - + - + get_a() : T & - + - + a : T - - + + A @@ -43,8 +43,8 @@ - - + + A @@ -53,8 +53,8 @@ - - + + A @@ -63,47 +63,47 @@ - - + + R - + - + get_int_map() : A<intmap> - + - + set_int_map(A<intmap> && int_map) : void - + - + a_int_map : A<intmap> - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> diff --git a/docs/test_cases/t00049_class_mermaid.svg b/docs/test_cases/t00049_class_mermaid.svg index a8304379..b8cf4def 100644 --- a/docs/test_cases/t00049_class_mermaid.svg +++ b/docs/test_cases/t00049_class_mermaid.svg @@ -126,7 +126,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -174,7 +174,7 @@ - + @@ -193,7 +193,7 @@ - + @@ -212,7 +212,7 @@ - + diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index 222c583e..7cdcb339 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 @@ -62,43 +62,43 @@ - + - + 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/t00050_class_mermaid.svg b/docs/test_cases/t00050_class_mermaid.svg index 090ed384..57981f36 100644 --- a/docs/test_cases/t00050_class_mermaid.svg +++ b/docs/test_cases/t00050_class_mermaid.svg @@ -184,7 +184,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -222,7 +222,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -294,7 +294,7 @@ - + @@ -323,7 +323,7 @@ - + @@ -342,7 +342,7 @@ - + diff --git a/docs/test_cases/t00051_class.svg b/docs/test_cases/t00051_class.svg index 898783f0..8017f68d 100644 --- a/docs/test_cases/t00051_class.svg +++ b/docs/test_cases/t00051_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + B @@ -18,45 +18,45 @@ F,FF=F - + - + B(F && f, FF && ff) : void - + - + f() : void - + - + ff() : void - + - + f_ : F - + - + ff_ : FF - - + + B @@ -64,81 +64,81 @@ (lambda at t00051.cc:43:18),(lambda at t00051.cc:43:27) - + - + B((lambda at t00051.cc:43:18) && f, (lambda at t00051.cc:43:27) && ff) : void - + - + f() : void - + - + ff() : void - + - + f_ : (lambda at t00051.cc:43:18) - + - + ff_ : (lambda at t00051.cc:43:27) - - + + A - + - + get_function() : (lambda at t00051.cc:48:16) - + - + start_thread1() : custom_thread1 - + - + start_thread2() : custom_thread2 - + - + start_thread3() : B<(lambda at t00051.cc:43:18),(lambda at t00051.cc:43:27)> - - + + A::custom_thread1 @@ -147,18 +147,18 @@ custom_thread1<Function,Args...>(Function && f, Args &&... args) : void - - + + A::custom_thread2 - + - + thread((lambda at t00051.cc:59:27) &&) : void diff --git a/docs/test_cases/t00051_class_mermaid.svg b/docs/test_cases/t00051_class_mermaid.svg index 449546bf..414ee647 100644 --- a/docs/test_cases/t00051_class_mermaid.svg +++ b/docs/test_cases/t00051_class_mermaid.svg @@ -102,7 +102,7 @@ - + @@ -146,7 +146,7 @@ - + @@ -190,7 +190,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -253,7 +253,7 @@ - + diff --git a/docs/test_cases/t00052_class.svg b/docs/test_cases/t00052_class.svg index 9d9c6062..6ae3b713 100644 --- a/docs/test_cases/t00052_class.svg +++ b/docs/test_cases/t00052_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ aa<F,Q>(F && f, Q q) : void - - + + B @@ -30,18 +30,18 @@ T - + - + b(T t) : T bb<F>(F && f, T t) : T - - + + C @@ -52,8 +52,8 @@ c<P>(P p) : T - - + + B @@ -62,8 +62,8 @@ - - + + C @@ -72,33 +72,33 @@ - - + + R - + - + a : A - + - + b : B<int> - + - + c : C<int> diff --git a/docs/test_cases/t00052_class_mermaid.svg b/docs/test_cases/t00052_class_mermaid.svg index 3ae2c8d6..b45bdff7 100644 --- a/docs/test_cases/t00052_class_mermaid.svg +++ b/docs/test_cases/t00052_class_mermaid.svg @@ -114,7 +114,7 @@ - + @@ -143,7 +143,7 @@ - + @@ -172,7 +172,7 @@ - + @@ -196,7 +196,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -234,7 +234,7 @@ - + diff --git a/docs/test_cases/t00053_class.svg b/docs/test_cases/t00053_class.svg index 130ffd38..71904897 100644 --- a/docs/test_cases/t00053_class.svg +++ b/docs/test_cases/t00053_class.svg @@ -1,6 +1,6 @@ - + @@ -9,72 +9,72 @@ - - + + A - - + + C - - + + E - - + + F - - + + a - - + + c - - + + e - - + + f - - + + h @@ -82,8 +82,8 @@ hhh - - + + j @@ -91,56 +91,56 @@ jjj - - + + b - - + + d - - + + g - - + + B - - + + D - - + + G - - + + i diff --git a/docs/test_cases/t00053_class_mermaid.svg b/docs/test_cases/t00053_class_mermaid.svg index 01c51692..6821d919 100644 --- a/docs/test_cases/t00053_class_mermaid.svg +++ b/docs/test_cases/t00053_class_mermaid.svg @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -190,7 +190,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -247,7 +247,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -285,7 +285,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -323,7 +323,7 @@ - + @@ -342,7 +342,7 @@ - + @@ -366,7 +366,7 @@ - + diff --git a/docs/test_cases/t00054_class.svg b/docs/test_cases/t00054_class.svg index 88ba6ea5..82e89d5e 100644 --- a/docs/test_cases/t00054_class.svg +++ b/docs/test_cases/t00054_class.svg @@ -1,6 +1,6 @@ - + @@ -9,28 +9,28 @@ - + detail - + detail2 - + detail3 - + detail4 - - + + d - - + + a @@ -40,8 +40,8 @@ - - + + c @@ -51,8 +51,8 @@ - - + + e @@ -62,40 +62,40 @@ - - + + C - - + + F - - + + D - - + + E - - + + A @@ -104,8 +104,8 @@ - - + + B @@ -114,8 +114,8 @@ - - + + f @@ -124,8 +124,8 @@ - - + + G @@ -133,8 +133,8 @@ - - + + h @@ -143,8 +143,8 @@ hhh - - + + i @@ -153,8 +153,8 @@ iii - - + + j @@ -163,16 +163,16 @@ jjj - - + + b - - + + g diff --git a/docs/test_cases/t00054_class_mermaid.svg b/docs/test_cases/t00054_class_mermaid.svg index 1714699c..d9c484ca 100644 --- a/docs/test_cases/t00054_class_mermaid.svg +++ b/docs/test_cases/t00054_class_mermaid.svg @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -185,7 +185,7 @@ - + @@ -204,7 +204,7 @@ - + @@ -223,7 +223,7 @@ - + @@ -242,7 +242,7 @@ - + @@ -261,7 +261,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -328,7 +328,7 @@ - + @@ -352,7 +352,7 @@ - + @@ -371,7 +371,7 @@ - + diff --git a/docs/test_cases/t00055_class.svg b/docs/test_cases/t00055_class.svg index 872ed89b..24f5d2b7 100644 --- a/docs/test_cases/t00055_class.svg +++ b/docs/test_cases/t00055_class.svg @@ -1,6 +1,6 @@ - + @@ -9,80 +9,80 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J diff --git a/docs/test_cases/t00055_class_mermaid.svg b/docs/test_cases/t00055_class_mermaid.svg index fdc75e26..65345ff6 100644 --- a/docs/test_cases/t00055_class_mermaid.svg +++ b/docs/test_cases/t00055_class_mermaid.svg @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -185,7 +185,7 @@ - + @@ -204,7 +204,7 @@ - + @@ -223,7 +223,7 @@ - + diff --git a/docs/test_cases/t00056_class.svg b/docs/test_cases/t00056_class.svg index 3e9cc6ae..fd03e1ad 100644 --- a/docs/test_cases/t00056_class.svg +++ b/docs/test_cases/t00056_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + «concept» @@ -20,8 +20,8 @@ - - + + «concept» @@ -33,8 +33,8 @@ sizeof (l) > sizeof (r) - - + + «concept» @@ -44,8 +44,8 @@ - - + + «concept» @@ -58,8 +58,8 @@ container.begin() container.end() - - + + «concept» @@ -71,8 +71,8 @@ typename T::value_type - - + + «concept» @@ -86,8 +86,8 @@ {std::to_string(s)} noexcept {std::to_string(s)} -> std::same_as<std::string> - - + + «concept» @@ -97,8 +97,8 @@ - - + + «concept» @@ -108,8 +108,8 @@ - - + + A @@ -118,15 +118,15 @@ - + - + a : T - - + + B @@ -135,15 +135,15 @@ - + - + b : T - - + + C @@ -152,15 +152,15 @@ - + - + c : T - - + + D @@ -169,8 +169,8 @@ - - + + E @@ -179,29 +179,29 @@ - + - + e1 : T1 - + - + e2 : T2 - + - + e3 : T3 - - + + F @@ -210,25 +210,25 @@ - + - + f1 : T1 - + - + f2 : T2 - + - + f3 : T3 diff --git a/docs/test_cases/t00056_class_mermaid.svg b/docs/test_cases/t00056_class_mermaid.svg index b542cfce..153e0165 100644 --- a/docs/test_cases/t00056_class_mermaid.svg +++ b/docs/test_cases/t00056_class_mermaid.svg @@ -222,7 +222,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -270,7 +270,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -323,7 +323,7 @@ - + @@ -352,7 +352,7 @@ - + @@ -391,7 +391,7 @@ - + @@ -410,7 +410,7 @@ - + @@ -429,7 +429,7 @@ - + @@ -453,7 +453,7 @@ - + @@ -477,7 +477,7 @@ - + @@ -501,7 +501,7 @@ - + @@ -520,7 +520,7 @@ - + @@ -554,7 +554,7 @@ - + diff --git a/docs/test_cases/t00057_class.svg b/docs/test_cases/t00057_class.svg index 08cd3548..838384ac 100644 --- a/docs/test_cases/t00057_class.svg +++ b/docs/test_cases/t00057_class.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + t00057_A - + - + a1 : int - - + + t00057_B - + - + b1 : int - - + + t00057_C - + - + c1 : int - - + + «union» @@ -63,73 +63,73 @@ - + - + d1 : int - + - + d2 : float - - + + t00057_E - + - + coordinates : t00057_E::(anonymous_739) - + - + e : int - + - + height : t00057_E::(anonymous_807) - - + + t00057_E::(coordinates) - + - + x : int - + - + y : int - - + + «union» @@ -137,105 +137,105 @@ - + - + t : double - + - + z : int - - + + t00057_G - + - + g1 : int - - + + t00057_R - + - + a : struct t00057_A - + - + b : t00057_B - + - + c : struct t00057_C * - + - + d : union t00057_D - + - + e : struct t00057_E * - + - + f : struct t00057_F * - + - + g : struct t00057_G * - - + + t00057_F - + - + f1 : int diff --git a/docs/test_cases/t00057_class_mermaid.svg b/docs/test_cases/t00057_class_mermaid.svg index 0f0c1cd9..3502803d 100644 --- a/docs/test_cases/t00057_class_mermaid.svg +++ b/docs/test_cases/t00057_class_mermaid.svg @@ -162,7 +162,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -263,7 +263,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -326,7 +326,7 @@ - + @@ -355,7 +355,7 @@ - + @@ -379,7 +379,7 @@ - + @@ -433,7 +433,7 @@ - + diff --git a/docs/test_cases/t00058_class.svg b/docs/test_cases/t00058_class.svg index 4f50bd89..d7e79c0a 100644 --- a/docs/test_cases/t00058_class.svg +++ b/docs/test_cases/t00058_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + first_type @@ -19,8 +19,8 @@ - - + + «concept» @@ -30,8 +30,8 @@ - - + + A @@ -40,15 +40,15 @@ - + - + a : std::vector<T> - - + + B @@ -57,22 +57,22 @@ - + - + b : std::vector<T> - + - + bb : P - - + + A @@ -81,8 +81,8 @@ - - + + A @@ -91,8 +91,8 @@ - - + + B @@ -101,26 +101,26 @@ - - + + R - + - + aa : A<int,int,double,std::string> - + - + bb : B<int,std::string,int,double,A<int,int>> diff --git a/docs/test_cases/t00058_class_mermaid.svg b/docs/test_cases/t00058_class_mermaid.svg index d918b23d..0582af9e 100644 --- a/docs/test_cases/t00058_class_mermaid.svg +++ b/docs/test_cases/t00058_class_mermaid.svg @@ -150,7 +150,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -188,7 +188,7 @@ - + @@ -212,7 +212,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -298,7 +298,7 @@ - + diff --git a/docs/test_cases/t00059_class.svg b/docs/test_cases/t00059_class.svg index c8e6b55d..cb8495ea 100644 --- a/docs/test_cases/t00059_class.svg +++ b/docs/test_cases/t00059_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + «concept» @@ -23,8 +23,8 @@ T{} t.get_name() - - + + «concept» @@ -36,8 +36,8 @@ t.get_sweetness() - - + + «concept» @@ -49,96 +49,96 @@ t.get_bitterness() - - + + gala_apple - + - + get_name() const : std::string - + - + get_sweetness() const : float - - + + empire_apple - + - + get_name() const : std::string - + - + get_sweetness() const : float - - + + lima_orange - + - + get_bitterness() const : float - + - + get_name() const : std::string - - + + valencia_orange - + - + get_bitterness() const : float - + - + get_name() const : std::string - - + + fruit_factory @@ -146,23 +146,23 @@ apple_c TA,orange_c TO - + - + create_apple() const : TA - + - + create_orange() const : TO - - + + fruit_factory @@ -171,8 +171,8 @@ - - + + fruit_factory @@ -181,26 +181,26 @@ - - + + R - + - + factory_1 : fruit_factory_1 - + - + factory_2 : fruit_factory_2 diff --git a/docs/test_cases/t00059_class_mermaid.svg b/docs/test_cases/t00059_class_mermaid.svg index 733acf0a..99961fbb 100644 --- a/docs/test_cases/t00059_class_mermaid.svg +++ b/docs/test_cases/t00059_class_mermaid.svg @@ -198,7 +198,7 @@ - + @@ -232,7 +232,7 @@ - + @@ -261,7 +261,7 @@ - + @@ -290,7 +290,7 @@ - + @@ -319,7 +319,7 @@ - + @@ -348,7 +348,7 @@ - + @@ -377,7 +377,7 @@ - + @@ -406,7 +406,7 @@ - + @@ -435,7 +435,7 @@ - + @@ -454,7 +454,7 @@ - + @@ -473,7 +473,7 @@ - + diff --git a/docs/test_cases/t00060_class.svg b/docs/test_cases/t00060_class.svg index 30493956..156bd667 100644 --- a/docs/test_cases/t00060_class.svg +++ b/docs/test_cases/t00060_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + D - - + + G @@ -51,15 +51,15 @@ - + - + g : T - - + + H @@ -68,18 +68,18 @@ - + - + h : G<T> - + - + hh : P diff --git a/docs/test_cases/t00060_class_mermaid.svg b/docs/test_cases/t00060_class_mermaid.svg index 0f89e643..d62167ac 100644 --- a/docs/test_cases/t00060_class_mermaid.svg +++ b/docs/test_cases/t00060_class_mermaid.svg @@ -116,7 +116,7 @@ - + @@ -135,7 +135,7 @@ - + @@ -154,7 +154,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -216,7 +216,7 @@ - + diff --git a/docs/test_cases/t00061_class.svg b/docs/test_cases/t00061_class.svg index ea92b5e3..8751ff31 100644 --- a/docs/test_cases/t00061_class.svg +++ b/docs/test_cases/t00061_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A diff --git a/docs/test_cases/t00061_class_mermaid.svg b/docs/test_cases/t00061_class_mermaid.svg index 1a82fe8a..c8d8de47 100644 --- a/docs/test_cases/t00061_class_mermaid.svg +++ b/docs/test_cases/t00061_class_mermaid.svg @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t00062_class.svg b/docs/test_cases/t00062_class.svg index 0db32b03..7d8c2fe9 100644 --- a/docs/test_cases/t00062_class.svg +++ b/docs/test_cases/t00062_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + u : U & - - + + A @@ -36,15 +36,15 @@ - + - + u : U & - - + + A @@ -53,8 +53,8 @@ - - + + A @@ -63,15 +63,15 @@ - + - + u : U ** - - + + A @@ -80,15 +80,15 @@ - + - + u : U *** - - + + A @@ -97,15 +97,15 @@ - + - + u : U *** - - + + A @@ -114,15 +114,15 @@ - + - + u : U && - - + + A @@ -131,15 +131,15 @@ - + - + u : const U & - - + + A @@ -148,22 +148,22 @@ - + - + c : C & - + - + m : M C::* - - + + A @@ -172,22 +172,22 @@ - + - + c : C && - + - + m : M C::* - - + + A @@ -196,22 +196,22 @@ - + - + c : C & - + - + m : M C::* - - + + A @@ -220,15 +220,15 @@ - + - + c : C & - - + + A @@ -237,22 +237,22 @@ - + - + c : C && - + - + m : M C::* - - + + A @@ -261,22 +261,22 @@ - + - + c : C && - + - + mf : float C::* - - + + A @@ -285,22 +285,22 @@ - + - + c : C & - + - + m : M C::* - - + + A @@ -309,15 +309,15 @@ - + - + n : char[N] - - + + A @@ -326,15 +326,15 @@ - + - + n : std::vector<char> - - + + A @@ -343,15 +343,15 @@ - + - + klm : char[K][L][M] - - + + A @@ -360,15 +360,15 @@ - + - + u : bool - - + + A @@ -377,15 +377,15 @@ - + - + c : C<T> - - + + A @@ -394,22 +394,22 @@ - + - + args : std::tuple<Args...> - + - + c : C<T> - - + + A diff --git a/docs/test_cases/t00062_class_mermaid.svg b/docs/test_cases/t00062_class_mermaid.svg index 78357cce..5b80ef00 100644 --- a/docs/test_cases/t00062_class_mermaid.svg +++ b/docs/test_cases/t00062_class_mermaid.svg @@ -306,7 +306,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -354,7 +354,7 @@ - + @@ -373,7 +373,7 @@ - + @@ -397,7 +397,7 @@ - + @@ -421,7 +421,7 @@ - + @@ -445,7 +445,7 @@ - + @@ -469,7 +469,7 @@ - + @@ -493,7 +493,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -551,7 +551,7 @@ - + @@ -580,7 +580,7 @@ - + @@ -604,7 +604,7 @@ - + @@ -633,7 +633,7 @@ - + @@ -662,7 +662,7 @@ - + @@ -691,7 +691,7 @@ - + @@ -715,7 +715,7 @@ - + @@ -739,7 +739,7 @@ - + @@ -763,7 +763,7 @@ - + @@ -787,7 +787,7 @@ - + @@ -811,7 +811,7 @@ - + @@ -840,7 +840,7 @@ - + diff --git a/docs/test_cases/t00063_class.svg b/docs/test_cases/t00063_class.svg index e0e3e1ea..eade2900 100644 --- a/docs/test_cases/t00063_class.svg +++ b/docs/test_cases/t00063_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A diff --git a/docs/test_cases/t00063_class_mermaid.svg b/docs/test_cases/t00063_class_mermaid.svg index a34256d0..1f46300a 100644 --- a/docs/test_cases/t00063_class_mermaid.svg +++ b/docs/test_cases/t00063_class_mermaid.svg @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t00064_class.svg b/docs/test_cases/t00064_class.svg index 914118ad..33e499e0 100644 --- a/docs/test_cases/t00064_class.svg +++ b/docs/test_cases/t00064_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + type_list @@ -19,8 +19,8 @@ - - + + type_list @@ -29,8 +29,8 @@ - - + + type_list @@ -39,8 +39,8 @@ - - + + type_list @@ -49,8 +49,8 @@ - - + + head @@ -59,8 +59,8 @@ - - + + type_list @@ -69,8 +69,8 @@ - - + + type_list @@ -79,8 +79,8 @@ - - + + type_list @@ -89,8 +89,8 @@ - - + + type_group_pair @@ -99,15 +99,15 @@ - + - + size : const size_t - - + + optional_ref @@ -116,8 +116,8 @@ - - + + optional_ref @@ -126,8 +126,8 @@ - - + + type_group_pair_it @@ -135,54 +135,54 @@ It,type_list<First...>,type_list<Second...> - + - + find(const value_type & v) constexpr : unsigned int - + - + get(unsigned int i) : ref_t - + - + getp(unsigned int i) : const value_type * - - + + A - - + + B - - + + C - - + + type_list @@ -191,8 +191,8 @@ - - + + type_list @@ -201,8 +201,8 @@ - - + + type_list @@ -211,8 +211,8 @@ - - + + type_group_pair @@ -221,30 +221,30 @@ - - + + R - + - + abc : type_group_pair<type_list<float,double>,type_list<A,B,C>> - + - + aboolint : type_list<A,bool,int> - - + + type_group_pair @@ -253,8 +253,8 @@ - - + + type_group_pair_it @@ -263,8 +263,8 @@ - - + + head diff --git a/docs/test_cases/t00064_class_mermaid.svg b/docs/test_cases/t00064_class_mermaid.svg index 6d3c6dd2..32dec995 100644 --- a/docs/test_cases/t00064_class_mermaid.svg +++ b/docs/test_cases/t00064_class_mermaid.svg @@ -390,7 +390,7 @@ - + @@ -409,7 +409,7 @@ - + @@ -428,7 +428,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -466,7 +466,7 @@ - + @@ -485,7 +485,7 @@ - + @@ -504,7 +504,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -542,7 +542,7 @@ - + @@ -566,7 +566,7 @@ - + @@ -585,7 +585,7 @@ - + @@ -604,7 +604,7 @@ - + @@ -638,7 +638,7 @@ - + @@ -657,7 +657,7 @@ - + @@ -676,7 +676,7 @@ - + @@ -695,7 +695,7 @@ - + @@ -714,7 +714,7 @@ - + @@ -733,7 +733,7 @@ - + @@ -752,7 +752,7 @@ - + @@ -771,7 +771,7 @@ - + @@ -800,7 +800,7 @@ - + @@ -819,7 +819,7 @@ - + @@ -838,7 +838,7 @@ - + diff --git a/docs/test_cases/t00065_class.svg b/docs/test_cases/t00065_class.svg index 643d9ebd..eeaeef5c 100644 --- a/docs/test_cases/t00065_class.svg +++ b/docs/test_cases/t00065_class.svg @@ -1,6 +1,6 @@ - + @@ -9,20 +9,20 @@ - + module1 - + submodule1a - + module2 - + concepts - - + + ABC @@ -32,8 +32,8 @@ c - - + + XYZ @@ -43,68 +43,68 @@ z - - + + A - + - + abc : ABC - + - + pimpl : detail::AImpl * - + - + xyz : XYZ - - + + detail::AImpl - - + + B - + - + B() = default : void - + - + b() : void - - + + C @@ -113,15 +113,15 @@ - + - + t : T * - - + + C @@ -130,8 +130,8 @@ - - + + D @@ -140,22 +140,22 @@ - + - + c : C<int> - + - + t : T - - + + C @@ -164,8 +164,8 @@ - - + + D @@ -174,8 +174,8 @@ - - + + «concept» @@ -188,33 +188,33 @@ T{} t.b() - - + + R - + - + a : A * - + - + c : C<B> - + - + d : D<B> diff --git a/docs/test_cases/t00065_class_mermaid.svg b/docs/test_cases/t00065_class_mermaid.svg index 732abc79..03b55830 100644 --- a/docs/test_cases/t00065_class_mermaid.svg +++ b/docs/test_cases/t00065_class_mermaid.svg @@ -210,7 +210,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -263,7 +263,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -331,7 +331,7 @@ - + @@ -365,7 +365,7 @@ - + @@ -394,7 +394,7 @@ - + @@ -418,7 +418,7 @@ - + @@ -437,7 +437,7 @@ - + @@ -466,7 +466,7 @@ - + @@ -485,7 +485,7 @@ - + @@ -504,7 +504,7 @@ - + diff --git a/docs/test_cases/t00066_class.svg b/docs/test_cases/t00066_class.svg index 2fee943a..147f928f 100644 --- a/docs/test_cases/t00066_class.svg +++ b/docs/test_cases/t00066_class.svg @@ -1,6 +1,6 @@ - + @@ -9,222 +9,222 @@ - - + + 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 - + - + A() = default : void - + - + A(int i) : void - + - + A(A &&) = default : void - + - + A(const A &) = deleted : void - + - + ~A() = default : void - + - + basic_method() : void - + - + static_method() : int - + - + const_method() const : void - + - + auto_method() : int - + - + operator++() : A & - + - + operator=(A && other) noexcept : A & - + - + operator=(A & other) noexcept : A & - + - + size() const : std::size_t - + - + double_int(const int i) : int - + - + sum(const double a, const double b) : int - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + create_from_int(int i) : A - + - + protected_method() : void - + - + private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00066_class_mermaid.svg b/docs/test_cases/t00066_class_mermaid.svg index 10aab352..68ac8d99 100644 --- a/docs/test_cases/t00066_class_mermaid.svg +++ b/docs/test_cases/t00066_class_mermaid.svg @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t00067_class.svg b/docs/test_cases/t00067_class.svg index 2111fcec..e1083aca 100644 --- a/docs/test_cases/t00067_class.svg +++ b/docs/test_cases/t00067_class.svg @@ -1,6 +1,6 @@ - + @@ -9,152 +9,152 @@ - - + + A - + - + auto_method() : int - + - + basic_method() : void - + - + const_method() const : void - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + double_int(const int i) : int - + - + private_method() : void - + - + protected_method() : void - + - + size() const : std::size_t - + - + sum(const double a, const double b) : int - + - + a_ : int - + - + auto_member : const unsigned long - + - + b_ : int - + - + c_ : int - + - + compare : std::function<bool (const int)> - + - + private_member : int - + - + protected_member : int - + - + public_member : int - + - + static_const_int : const int - + - + static_int : int diff --git a/docs/test_cases/t00067_class_mermaid.svg b/docs/test_cases/t00067_class_mermaid.svg index b60145fb..ce1ae11f 100644 --- a/docs/test_cases/t00067_class_mermaid.svg +++ b/docs/test_cases/t00067_class_mermaid.svg @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t00068_r0_class.svg b/docs/test_cases/t00068_r0_class.svg index ff2e26fb..b5fceb44 100644 --- a/docs/test_cases/t00068_r0_class.svg +++ b/docs/test_cases/t00068_r0_class.svg @@ -1,6 +1,6 @@ - + @@ -10,26 +10,26 @@ AAA context of radius 0 - - + + AAA - + - + akind : AKind - + - + bb : BB * diff --git a/docs/test_cases/t00068_r0_class_mermaid.svg b/docs/test_cases/t00068_r0_class_mermaid.svg index 71a25c67..d141c131 100644 --- a/docs/test_cases/t00068_r0_class_mermaid.svg +++ b/docs/test_cases/t00068_r0_class_mermaid.svg @@ -53,7 +53,7 @@ - + diff --git a/docs/test_cases/t00068_r1_class.svg b/docs/test_cases/t00068_r1_class.svg index 4a79a7f5..c529568c 100644 --- a/docs/test_cases/t00068_r1_class.svg +++ b/docs/test_cases/t00068_r1_class.svg @@ -1,6 +1,6 @@ - + @@ -10,23 +10,23 @@ AAA context of radius 1 - - + + BB - + - + b : std::vector<B> - - + + AKind @@ -36,49 +36,49 @@ ThreeA - - + + AA - - + + AAA - + - + akind : AKind - + - + bb : BB * - - + + R - + - + aaa : AAA * diff --git a/docs/test_cases/t00068_r1_class_mermaid.svg b/docs/test_cases/t00068_r1_class_mermaid.svg index e110e94b..711b3417 100644 --- a/docs/test_cases/t00068_r1_class_mermaid.svg +++ b/docs/test_cases/t00068_r1_class_mermaid.svg @@ -101,7 +101,7 @@ - + @@ -125,7 +125,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -207,7 +207,7 @@ - + diff --git a/docs/test_cases/t00068_r2_class.svg b/docs/test_cases/t00068_r2_class.svg index f2742bf0..313c8ec7 100644 --- a/docs/test_cases/t00068_r2_class.svg +++ b/docs/test_cases/t00068_r2_class.svg @@ -1,6 +1,6 @@ - + @@ -10,31 +10,31 @@ AAA context of radius 2 - - + + B - - + + BB - + - + b : std::vector<B> - - + + AKind @@ -44,72 +44,72 @@ ThreeA - - + + A - - + + AA - - + + AAA - + - + akind : AKind - + - + bb : BB * - - + + R - + - + aaa : AAA * - - + + RR - + - + r : std::shared_ptr<R> diff --git a/docs/test_cases/t00068_r2_class_mermaid.svg b/docs/test_cases/t00068_r2_class_mermaid.svg index 6642cc2f..b694132f 100644 --- a/docs/test_cases/t00068_r2_class_mermaid.svg +++ b/docs/test_cases/t00068_r2_class_mermaid.svg @@ -135,7 +135,7 @@ - + @@ -154,7 +154,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -212,7 +212,7 @@ - + @@ -231,7 +231,7 @@ - + @@ -250,7 +250,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -303,7 +303,7 @@ - + diff --git a/docs/test_cases/t00069_class.svg b/docs/test_cases/t00069_class.svg index 507fdb11..ad2ad157 100644 --- a/docs/test_cases/t00069_class.svg +++ b/docs/test_cases/t00069_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + generator @@ -18,96 +18,96 @@ T - + - + generator(handle_type h) : void - + - + ~generator() : void - + - + full_ : bool - + - + h_ : handle_type - - + + generator::promise_type - + - + final_suspend() noexcept : std::suspend_always - + - + get_return_object() : generator<T> - + - + initial_suspend() : std::suspend_always - + - + return_void() : void - + - + unhandled_exception() : void yield_value<std::convertible_to From>(From && from) : std::suspend_always - + - + exception_ : std::exception_ptr - + - + value_ : T - - + + generator @@ -116,33 +116,33 @@ - - + + A - + - + iota() [coroutine] : generator<unsigned long> - + - + seed() [coroutine] : generator<unsigned long> - + - + counter_ : unsigned long diff --git a/docs/test_cases/t00069_class_mermaid.svg b/docs/test_cases/t00069_class_mermaid.svg index 6babe6da..88938899 100644 --- a/docs/test_cases/t00069_class_mermaid.svg +++ b/docs/test_cases/t00069_class_mermaid.svg @@ -90,7 +90,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -188,7 +188,7 @@ - + @@ -207,7 +207,7 @@ - + diff --git a/docs/test_cases/t00070_class.svg b/docs/test_cases/t00070_class.svg index 47beb5b4..5a959e93 100644 --- a/docs/test_cases/t00070_class.svg +++ b/docs/test_cases/t00070_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + BB @@ -27,15 +27,15 @@ - + - + t : T - - + + BBB @@ -44,26 +44,26 @@ bbb2 - - + + A - + - + get() : int - + - + a : int diff --git a/docs/test_cases/t00070_class_mermaid.svg b/docs/test_cases/t00070_class_mermaid.svg index b42a71b4..04597fce 100644 --- a/docs/test_cases/t00070_class_mermaid.svg +++ b/docs/test_cases/t00070_class_mermaid.svg @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -124,7 +124,7 @@ - + diff --git a/docs/test_cases/t00071_class.svg b/docs/test_cases/t00071_class.svg index e7c75a6f..d7ede988 100644 --- a/docs/test_cases/t00071_class.svg +++ b/docs/test_cases/t00071_class.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - + app - + lib1 - + mod1 - + mod2 - + lib2 - - + + A - + - + get() : int - + - + a : int - - + + B - - + + BB @@ -64,15 +64,15 @@ - + - + t : T - - + + detail::BBB @@ -81,32 +81,32 @@ bbb2 - - + + D - - + + E - - + + C - - + + CC @@ -115,15 +115,15 @@ - + - + t : T - - + + detail::CCC @@ -132,33 +132,33 @@ ccc2 - - + + R - + - + a : A * - + - + b : B * - + - + c : C * diff --git a/docs/test_cases/t00071_class_mermaid.svg b/docs/test_cases/t00071_class_mermaid.svg index b90e9459..a0169e98 100644 --- a/docs/test_cases/t00071_class_mermaid.svg +++ b/docs/test_cases/t00071_class_mermaid.svg @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -133,7 +133,7 @@ - + @@ -162,7 +162,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -200,7 +200,7 @@ - + @@ -219,7 +219,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -272,7 +272,7 @@ - + @@ -301,7 +301,7 @@ - + diff --git a/docs/test_cases/t00072_class.svg b/docs/test_cases/t00072_class.svg index fa4ad3ba..6958c7cb 100644 --- a/docs/test_cases/t00072_class.svg +++ b/docs/test_cases/t00072_class.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - + app - + :lib1 - + mod1 - + mod2 - + :lib2 - - + + A - + - + get() : int - + - + a : int - - + + B - - + + BB @@ -64,15 +64,15 @@ - + - + t : T - - + + detail::BBB @@ -81,32 +81,32 @@ bbb2 - - + + D - - + + E - - + + C - - + + CC @@ -115,15 +115,15 @@ - + - + t : T - - + + detail::CCC diff --git a/docs/test_cases/t00072_class_mermaid.svg b/docs/test_cases/t00072_class_mermaid.svg index ef51c5a1..d287b519 100644 --- a/docs/test_cases/t00072_class_mermaid.svg +++ b/docs/test_cases/t00072_class_mermaid.svg @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -124,7 +124,7 @@ - + @@ -143,7 +143,7 @@ - + @@ -162,7 +162,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -234,7 +234,7 @@ - + diff --git a/docs/test_cases/t00073_class.svg b/docs/test_cases/t00073_class.svg index 6fb8ba30..f9eed783 100644 --- a/docs/test_cases/t00073_class.svg +++ b/docs/test_cases/t00073_class.svg @@ -1,6 +1,6 @@ - + @@ -9,70 +9,70 @@ - - + + A - - + + AHandler - + - + operator()(A & a) const : void - + - + handle(A & a) const : void - - + + B - - + + BHandler - + - + operator()(B & b) const : void - + - + handle(B & b) const : void - - + + Overload @@ -81,8 +81,8 @@ - - + + Overload @@ -91,19 +91,19 @@ - - + + R - + - + dispatch : Overload<AHandler,BHandler> diff --git a/docs/test_cases/t00073_class_mermaid.svg b/docs/test_cases/t00073_class_mermaid.svg index d72d2dc5..b53b1492 100644 --- a/docs/test_cases/t00073_class_mermaid.svg +++ b/docs/test_cases/t00073_class_mermaid.svg @@ -122,7 +122,7 @@ - + @@ -141,7 +141,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -218,7 +218,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -256,7 +256,7 @@ - + diff --git a/docs/test_cases/t00074_class.svg b/docs/test_cases/t00074_class.svg index 103716d7..ab061949 100644 --- a/docs/test_cases/t00074_class.svg +++ b/docs/test_cases/t00074_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + «concept» @@ -20,8 +20,8 @@ - - + + «concept» @@ -31,8 +31,8 @@ - - + + «concept» diff --git a/docs/test_cases/t00074_class_mermaid.svg b/docs/test_cases/t00074_class_mermaid.svg index 3eff4679..c2097ed7 100644 --- a/docs/test_cases/t00074_class_mermaid.svg +++ b/docs/test_cases/t00074_class_mermaid.svg @@ -78,7 +78,7 @@ - + @@ -97,7 +97,7 @@ - + @@ -116,7 +116,7 @@ - + diff --git a/docs/test_cases/t00075_class.svg b/docs/test_cases/t00075_class.svg index 2f35ef5b..6c849f68 100644 --- a/docs/test_cases/t00075_class.svg +++ b/docs/test_cases/t00075_class.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - + ns1 - + ns2 - - + + @@ -30,8 +30,8 @@ T{} t.e() - - + + E @@ -40,40 +40,40 @@ k2 - - + + A - + - + e() const : E - - + + B - + - + e() const : E - - + + @@ -83,15 +83,15 @@ - + - + a_or_b : T - - + + @@ -101,8 +101,8 @@ - - + + @@ -112,8 +112,8 @@ - - + + @@ -121,18 +121,18 @@ - + - + a : ABE<A> - + - + b : ABE<B> diff --git a/docs/test_cases/t00075_class_mermaid.svg b/docs/test_cases/t00075_class_mermaid.svg index 88049162..3a698c67 100644 --- a/docs/test_cases/t00075_class_mermaid.svg +++ b/docs/test_cases/t00075_class_mermaid.svg @@ -162,7 +162,7 @@ - + @@ -196,7 +196,7 @@ - + @@ -225,7 +225,7 @@ - + @@ -249,7 +249,7 @@ - + @@ -273,7 +273,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -335,7 +335,7 @@ - + diff --git a/docs/test_cases/t20001.md b/docs/test_cases/t20001.md index 94e14048..ad8edfae 100644 --- a/docs/test_cases/t20001.md +++ b/docs/test_cases/t20001.md @@ -284,7 +284,6 @@ int tmain() "type": "message" }, { - "comment": "\\uml{note Just add 2 numbers}", "from": { "activity_id": "622672604730036140", "participant_id": "622672604730036140" @@ -305,7 +304,6 @@ int tmain() "type": "message" }, { - "comment": "\\uml{note[] And now add another 2}", "from": { "activity_id": "622672604730036140", "participant_id": "622672604730036140" diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index 3aec474c..4f0724f3 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -10,79 +10,79 @@ Basic sequence diagram example - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - + + + + + + + + + + A() - + B(A &) - + Just add 2 numbers - + add(int,int) - + And now add another 2 - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -93,7 +93,7 @@ - + @@ -102,14 +102,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index b65e1849..9c86c369 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 853b855c..59a81158 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 ba76d91d..3f54e093 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 4ff68e5c..c6cf8a8c 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 fe3339da..2724be0f 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -36,84 +36,84 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -122,12 +122,12 @@ - + b(std::string) - + a2(std::string) @@ -136,69 +136,69 @@ - + BB(AA<int> *) - + BB(AA<int> &) - + 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 4e026834..75b1b418 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 7ff4a8c9..35ff962a 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 9ee8dbe9..0e444eb1 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 f37888c9..0837edb0 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 1f0cef76..f1baeb24 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.md b/docs/test_cases/t20012.md index c962d787..d00a8239 100644 --- a/docs/test_cases/t20012.md +++ b/docs/test_cases/t20012.md @@ -149,8 +149,8 @@ void tmain() { "activities": [ { - "display_name": "operator()()", - "id": "1314931307342523651", + "display_name": "operator()() const", + "id": "844942554717397525", "name": "operator()", "namespace": "", "type": "method" @@ -279,8 +279,8 @@ void tmain() { "activities": [ { - "display_name": "operator()()", - "id": "1464047298179756286", + "display_name": "operator()() const", + "id": "2080867854705352490", "name": "operator()", "namespace": "", "type": "method" @@ -396,8 +396,8 @@ void tmain() { "activities": [ { - "display_name": "operator()()", - "id": "1801444422355429914", + "display_name": "operator()() const", + "id": "997617437879117371", "name": "operator()", "namespace": "", "type": "method" @@ -414,6 +414,56 @@ void tmain() "translation_unit": "t20012.cc" }, "type": "lambda" + }, + { + "activities": [ + { + "display_name": "operator()(auto) const", + "id": "1625806587339243213", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20012.cc:94:9)", + "id": "1585686021763298522", + "name": "tmain()::(lambda t20012.cc:94:9)", + "namespace": "clanguml::t20012", + "source_location": { + "column": 9, + "file": "t20012.cc", + "line": 94, + "translation_unit": "t20012.cc" + }, + "type": "lambda" + }, + { + "activities": [ + { + "display_name": "add5(int) const", + "id": "379068559069876883", + "name": "add5", + "namespace": "", + "source_location": { + "column": 9, + "file": "t20012.cc", + "line": 37, + "translation_unit": "t20012.cc" + }, + "type": "method" + } + ], + "display_name": "D", + "id": "1627226326147373737", + "name": "D", + "namespace": "clanguml::t20012", + "source_location": { + "column": 8, + "file": "t20012.cc", + "line": 36, + "translation_unit": "t20012.cc" + }, + "type": "class" } ], "sequences": [ @@ -424,8 +474,8 @@ void tmain() "activity_id": "893699278278125827", "participant_id": "893699278278125827" }, - "name": "operator()()", - "return_type": "", + "name": "operator()() const", + "return_type": "void", "scope": "normal", "source_location": { "column": 5, @@ -434,14 +484,14 @@ void tmain() "translation_unit": "t20012.cc" }, "to": { - "activity_id": "1314931307342523651", + "activity_id": "844942554717397525", "participant_id": "1823127147500894672" }, "type": "message" }, { "from": { - "activity_id": "1314931307342523651", + "activity_id": "844942554717397525", "participant_id": "1823127147500894672" }, "name": "a()", @@ -501,7 +551,7 @@ void tmain() }, { "from": { - "activity_id": "1314931307342523651", + "activity_id": "844942554717397525", "participant_id": "1823127147500894672" }, "name": "b()", @@ -564,8 +614,8 @@ void tmain() "activity_id": "893699278278125827", "participant_id": "893699278278125827" }, - "name": "operator()()", - "return_type": "", + "name": "operator()() const", + "return_type": "void", "scope": "normal", "source_location": { "column": 5, @@ -574,14 +624,14 @@ void tmain() "translation_unit": "t20012.cc" }, "to": { - "activity_id": "1464047298179756286", + "activity_id": "2080867854705352490", "participant_id": "2103332104162021186" }, "type": "message" }, { "from": { - "activity_id": "1464047298179756286", + "activity_id": "2080867854705352490", "participant_id": "2103332104162021186" }, "name": "c()", @@ -641,11 +691,11 @@ void tmain() }, { "from": { - "activity_id": "1464047298179756286", + "activity_id": "2080867854705352490", "participant_id": "2103332104162021186" }, - "name": "operator()()", - "return_type": "", + "name": "operator()() const", + "return_type": "void", "scope": "normal", "source_location": { "column": 9, @@ -654,7 +704,7 @@ void tmain() "translation_unit": "t20012.cc" }, "to": { - "activity_id": "1314931307342523651", + "activity_id": "844942554717397525", "participant_id": "1823127147500894672" }, "type": "message" @@ -704,8 +754,8 @@ void tmain() "activity_id": "1627963942447215983", "participant_id": "1418878159628415236" }, - "name": "operator()()", - "return_type": "", + "name": "operator()() const", + "return_type": "void", "scope": "normal", "source_location": { "column": 16, @@ -714,14 +764,14 @@ void tmain() "translation_unit": "t20012.cc" }, "to": { - "activity_id": "1801444422355429914", + "activity_id": "997617437879117371", "participant_id": "1523229682883773614" }, "type": "message" }, { "from": { - "activity_id": "1801444422355429914", + "activity_id": "997617437879117371", "participant_id": "1523229682883773614" }, "name": "c()", @@ -738,6 +788,46 @@ void tmain() "participant_id": "2071958121786360262" }, "type": "message" + }, + { + "from": { + "activity_id": "893699278278125827", + "participant_id": "893699278278125827" + }, + "name": "operator()(auto) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 9, + "file": "t20012.cc", + "line": 94, + "translation_unit": "t20012.cc" + }, + "to": { + "activity_id": "1625806587339243213", + "participant_id": "1585686021763298522" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1625806587339243213", + "participant_id": "1585686021763298522" + }, + "name": "add5(int) const", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 31, + "file": "t20012.cc", + "line": 94, + "translation_unit": "t20012.cc" + }, + "to": { + "activity_id": "379068559069876883", + "participant_id": "1627226326147373737" + }, + "type": "message" } ], "start_from": { diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index adb8132d..a545d840 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + - + @@ -9,263 +9,287 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() - - tmain() + + tmain() - - + + tmain()::(lambda t20012.cc:67:20) - - tmain()::(lambda t20012.cc:67:20) + + tmain()::(lambda t20012.cc:67:20) - - + + A - - A + + A - - + + B - - B + + B - - + + tmain()::(lambda t20012.cc:80:20) - - tmain()::(lambda t20012.cc:80:20) + + tmain()::(lambda t20012.cc:80:20) - - + + C - - C + + C - - + + R<(lambda at t20012.cc:86:9)> - - R<(lambda at t20012.cc:86:9)> + + R<(lambda at t20012.cc:86:9)> - - + + tmain()::(lambda t20012.cc:86:9) - - tmain()::(lambda t20012.cc:86:9) + + tmain()::(lambda t20012.cc:86:9) - - - - - - - - - - - - - - - - - - - - - - - - - - + + + tmain()::(lambda t20012.cc:94:9) + + tmain()::(lambda t20012.cc:94:9) + + + + D + + D + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - operator()() + operator()() const - + a() - + aa() - + aaa() - + b() - + bb() - + bbb() - - - - - - operator()() + + + + operator()() const - - - - c() + + + + c() - - - - - - cc() + + + + + + cc() - - - - - - ccc() + + + + + + ccc() - - - - operator()() + + + + operator()() const - - - - a() + + + + a() - - - - - - aa() + + + + + + aa() - - - - - - aaa() + + + + + + aaa() - - - - b() + + + + b() - - - - - - bb() + + + + + + bb() - - - - - - bbb() + + + + + + bbb() - - - - - - - - R((lambda at t20012.cc:86:9) &&) + + + + R((lambda at t20012.cc:86:9) &&) - - - - r() + + + + r() - - - - operator()() + + + + operator()() const - - - - c() + + + + c() - - - - - - cc() + + + + + + cc() - - - - - - ccc() + + + + + + ccc() - - + + + + operator()(auto) const + + + + + add5(int) const + + + + + diff --git a/docs/test_cases/t20012_sequence_mermaid.svg b/docs/test_cases/t20012_sequence_mermaid.svg index e7b36fa9..a750a377 100644 --- a/docs/test_cases/t20012_sequence_mermaid.svg +++ b/docs/test_cases/t20012_sequence_mermaid.svg @@ -1,54 +1,84 @@ - + - - + + + D + + + + + + tmain()::(lambda t20012.cc:94:9) + + + + + tmain()::(lambda t20012.cc:86:9) - - + + R<(lambda at t20012.cc:86:9)> - - + + C - - + + tmain()::(lambda t20012.cc:80:20) - - + + B - - + + A - - + + tmain()::(lambda t20012.cc:67:20) - - + + tmain() - + + + + + D + + + + + + + + + tmain()::(lambda t20012.cc:94:9) + + + + + @@ -57,7 +87,7 @@ - + @@ -66,7 +96,7 @@ - + @@ -75,7 +105,7 @@ - + @@ -84,7 +114,7 @@ - + @@ -93,7 +123,7 @@ - + @@ -102,7 +132,7 @@ - + @@ -111,7 +141,7 @@ - + @@ -158,10 +188,10 @@ - + - + @@ -182,57 +212,63 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - operator()() + + + + + + + operator()() const a() @@ -246,46 +282,46 @@ bbb() - ​ - - operator()() - - c() - - cc() - - ccc() - - operator()() - - a() - - aa() - - aaa() - - b() - - bb() - - bbb() - - ​ - - ​ - - R((lambda at t20012.cc:86:9) &&) - - r() - - operator()() - - c() - - cc() - - ccc() - - ​ - + operator()() const + + c() + + cc() + + ccc() + + operator()() const + + a() + + aa() + + aaa() + + b() + + bb() + + bbb() + + R((lambda at t20012.cc:86:9) &&) + + r() + + operator()() const + + c() + + cc() + + ccc() + + operator()(auto) const + + add5(int) const + + ​ + + ​ + diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index 484a808c..14494355 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 027b0923..3774cf54 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 e11dad3c..42f7f196 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 962dce47..0bef2945 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 cdaed217..cb0fd710 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 bc2c08cd..15c20e5f 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 14396154..0706bb9c 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 fc2b5802..40a94dbe 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,82 +9,82 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + C - + C - - + + B - + B - - + + D<int> - + D<int> - - - - - - - - - - - - - - + + + + + + + + + + + + + + alt - + a1() @@ -92,7 +92,7 @@ - + a5() @@ -103,7 +103,7 @@ alt - + [ @@ -112,7 +112,7 @@ - + [ @@ -121,7 +121,7 @@ - + b1() @@ -129,7 +129,7 @@ - + [ @@ -138,7 +138,7 @@ - + b2() @@ -146,14 +146,14 @@ - + a4() - + log() @@ -161,7 +161,7 @@ alt - + c1() const @@ -169,7 +169,7 @@ alt - + @@ -182,7 +182,7 @@ - + @@ -192,7 +192,7 @@ alt - + d1(int,int) diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index 92c17a29..7ba53283 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() const @@ -158,7 +158,7 @@ loop - + [ @@ -167,7 +167,7 @@ - + b2() const diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index 91986e1a..a409cf92 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - + + + + + A(std::unique_ptr ) - + a() - + b() diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg index c3310108..13e8df51 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 6e5bd5ba..bbfbd03f 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 d58cf084..dedf10bb 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() - + diff --git a/docs/test_cases/t20026_sequence.svg b/docs/test_cases/t20026_sequence.svg index eb1f94d7..2818cabf 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 1d62b95c..88d44637 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 2bf5af90..6a9eb41b 100644 --- a/docs/test_cases/t20028_sequence.svg +++ b/docs/test_cases/t20028_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,36 +9,36 @@ - - - - - - + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - + + + + + alt - + [ @@ -47,14 +47,14 @@ - + b() - + c() @@ -62,7 +62,7 @@ - + d() diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg index 6dfd0bd8..971647a5 100644 --- a/docs/test_cases/t20029_sequence.svg +++ b/docs/test_cases/t20029_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,69 +9,69 @@ - - - - - - - - - - - + + + + + + + + + + + - - + + tmain() - + tmain() - - + + Encoder<Retrier<ConnectionPool>> - + Encoder<Retrier<ConnectionPool>> - - + + Retrier<ConnectionPool> - + Retrier<ConnectionPool> - - + + ConnectionPool - + ConnectionPool - - + + encode_b64(std::string &&) - + encode_b64(std::string &&) - - - - - - - - + + + + + + + + Establish connection to the remote server synchronously - + connect() - + Repeat for each line in the input stream @@ -81,26 +81,26 @@ alt - + [ send(std::string &&) ] - + Encode the message using Base64 encoding and pass it to the next layer - + encode(std::string &&) - + @@ -110,12 +110,12 @@ - + send(std::string &&) - + Repeat until send() succeeds or retry count is exceeded @@ -125,7 +125,7 @@ alt - + [ diff --git a/docs/test_cases/t20030_sequence.svg b/docs/test_cases/t20030_sequence.svg index 49241797..42b0729f 100644 --- a/docs/test_cases/t20030_sequence.svg +++ b/docs/test_cases/t20030_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + tmain(int) - + tmain(int) - - + + magic() - + magic() - - + + A - + A - - + + tmain(bool,int) - + tmain(bool,int) - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + A(int) - + operator+=(int) - + @@ -92,36 +92,36 @@ - + A() - + create() - + A() - + create() - + operator+=(int) - + @@ -130,12 +130,12 @@ - + operator=(const A &) - + @@ -144,7 +144,7 @@ - + value() const diff --git a/docs/test_cases/t20031_sequence.svg b/docs/test_cases/t20031_sequence.svg index 037b46f8..2781d836 100644 --- a/docs/test_cases/t20031_sequence.svg +++ b/docs/test_cases/t20031_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,64 +9,64 @@ - - - - - + + + + + - - + + tmain(int) - + tmain(int) - - + + magic() - + magic() - - + + tmain(bool,int) - + tmain(bool,int) - - + + execute(std::function<int ()>) - + execute(std::function<int ()>) - - + + A - + A - - - - - - + + + + + + - + - + value() const diff --git a/docs/test_cases/t20032_sequence.svg b/docs/test_cases/t20032_sequence.svg index 97f7ce2b..4a9a8c75 100644 --- a/docs/test_cases/t20032_sequence.svg +++ b/docs/test_cases/t20032_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -60,12 +60,12 @@ int - + b(double) - + a2(double) @@ -76,12 +76,12 @@ double - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20033_sequence.svg b/docs/test_cases/t20033_sequence.svg index 891f620a..b3154d76 100644 --- a/docs/test_cases/t20033_sequence.svg +++ b/docs/test_cases/t20033_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,73 +9,73 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - + + + + + - + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + alt [false] [reinterpret_cast<uint64_t>(&a) % 100 == 0ULL] - + a1() @@ -84,7 +84,7 @@ [reinterpret_cast<uint64_t>(&a) % 64 == 0ULL] - + a2() @@ -93,7 +93,7 @@ [a.a2() == 2 && a.a3() == 3] - + [ @@ -102,7 +102,7 @@ - + [ @@ -111,7 +111,7 @@ - + a3() @@ -119,7 +119,7 @@ - + a4() @@ -130,7 +130,7 @@ alt [int i = a.a2(); i != 2] - + [ @@ -139,7 +139,7 @@ - + a3() @@ -150,7 +150,7 @@ loop [int i = 0; i < a.a2(); i++] - + [ @@ -159,14 +159,14 @@ - + a3() - + a3() @@ -177,7 +177,7 @@ loop [retry_count--] - + a2() @@ -188,14 +188,14 @@ loop [retry_count++ < a.a3()] - + a4() - + [ @@ -208,7 +208,7 @@ alt [a.a4() % 6] - + [ @@ -222,7 +222,7 @@ loop [ints] - + a4() diff --git a/docs/test_cases/t20034.md b/docs/test_cases/t20034.md index 39cb673b..e840ab54 100644 --- a/docs/test_cases/t20034.md +++ b/docs/test_cases/t20034.md @@ -279,8 +279,8 @@ void B::b4() { "activities": [ { - "display_name": "operator()()", - "id": "1996671438591925718", + "display_name": "operator()() const", + "id": "1534431449322420953", "name": "operator()", "namespace": "", "type": "method" @@ -383,13 +383,33 @@ void B::b4() "activity_id": "1707514178726476738", "participant_id": "272777525372220260" }, - "name": "a2()", + "name": "operator()() const", "return_type": "void", "scope": "normal", "source_location": { "column": 9, "file": "t20034.cc", - "line": 49, + "line": 57, + "translation_unit": "t20034.cc" + }, + "to": { + "activity_id": "1534431449322420953", + "participant_id": "1026588549514900751" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1534431449322420953", + "participant_id": "1026588549514900751" + }, + "name": "a2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 29, + "file": "t20034.cc", + "line": 56, "translation_unit": "t20034.cc" }, "to": { @@ -407,33 +427,13 @@ void B::b4() "activity_id": "1707514178726476738", "participant_id": "272777525372220260" }, - "name": "operator()()", - "return_type": "", - "scope": "normal", - "source_location": { - "column": 9, - "file": "t20034.cc", - "line": 57, - "translation_unit": "t20034.cc" - }, - "to": { - "activity_id": "1996671438591925718", - "participant_id": "1026588549514900751" - }, - "type": "message" - }, - { - "from": { - "activity_id": "1996671438591925718", - "participant_id": "1026588549514900751" - }, "name": "a2()", "return_type": "void", "scope": "normal", "source_location": { - "column": 29, + "column": 9, "file": "t20034.cc", - "line": 56, + "line": 49, "translation_unit": "t20034.cc" }, "to": { diff --git a/docs/test_cases/t20034_sequence.svg b/docs/test_cases/t20034_sequence.svg index 8199a3de..8b74cbf8 100644 --- a/docs/test_cases/t20034_sequence.svg +++ b/docs/test_cases/t20034_sequence.svg @@ -1,6 +1,6 @@ - + @@ -14,154 +14,154 @@ - - + + D - + D - - + + C - + C - - + + B - + B - - + + A - + A - - + + D::d2()::(lambda t20034.cc:56:18) - + D::d2()::(lambda t20034.cc:56:18) d2() - + c2() - + b2() - + a2() - + d2() - - - - a2() + + + + operator()() const - - - - - - d2() - - - - operator()() + + + + a2() - - - - a2() + + + + + + d2() + + + + a2() - + d2() - + c4() - + b4() - + b2() - + a2() - + d2() - + c1() - + b1() - + a2() - + d2() - + c3() - + c2() - + b2() - + a2() diff --git a/docs/test_cases/t20034_sequence_mermaid.svg b/docs/test_cases/t20034_sequence_mermaid.svg index e8db8167..da681fd6 100644 --- a/docs/test_cases/t20034_sequence_mermaid.svg +++ b/docs/test_cases/t20034_sequence_mermaid.svg @@ -137,14 +137,14 @@ d2() - a2() - - d2() - - operator()() - - a2() - + operator()() const + + a2() + + d2() + + a2() + d2() c4() diff --git a/docs/test_cases/t20035_sequence.svg b/docs/test_cases/t20035_sequence.svg index 7b4681e5..72229298 100644 --- a/docs/test_cases/t20035_sequence.svg +++ b/docs/test_cases/t20035_sequence.svg @@ -1,6 +1,6 @@ - + @@ -13,39 +13,39 @@ - - + + tmain(int,char **) - + tmain(int,char **) - - + + a(int) - + a(int) - - + + b1(int) - + b1(int) - - + + c(int) - + c(int) - + - + - + diff --git a/docs/test_cases/t20036_sequence.svg b/docs/test_cases/t20036_sequence.svg index b37d6f13..22578589 100644 --- a/docs/test_cases/t20036_sequence.svg +++ b/docs/test_cases/t20036_sequence.svg @@ -1,6 +1,6 @@ - + @@ -13,131 +13,131 @@ - - + + C - + C - - + + B - + B - - + + A - + A - - + + D - + D c1() - + b1() - + a2() - + d1() - + c2() - + b2() - + a2() - + d3() - + a2() - + c4() - + b2() - + a2() - + c3() - + c2() - + b2() - + a2() - + d2() - + c2() - + b2() - + a2() diff --git a/docs/test_cases/t20037_sequence.svg b/docs/test_cases/t20037_sequence.svg index 456b5ff2..ee684d27 100644 --- a/docs/test_cases/t20037_sequence.svg +++ b/docs/test_cases/t20037_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + a() - + a() - - + + A - + A - - + + initb() - + initb() - - + + B - + B - - + + c() - + c() - - - - - - - - - - - - - + + + + + + + + + + + + + - + A() - + - + get() - + @@ -105,18 +105,18 @@ - + - + get() - + @@ -124,18 +124,18 @@ - + - + get() - + diff --git a/docs/test_cases/t20038.md b/docs/test_cases/t20038.md index f6ffab1e..babaeeb1 100644 --- a/docs/test_cases/t20038.md +++ b/docs/test_cases/t20038.md @@ -515,7 +515,6 @@ template T add(T a, T b) "type": "message" }, { - "comment": "Invoke 'add' implementation", "from": { "activity_id": "2008308445790932614", "participant_id": "2008308445790932614" @@ -578,7 +577,7 @@ template T add(T a, T b) "type": "message" }, { - "comment": "This is a generic comment about calling bbbbb()\n\n\\uml{note:some_other_diagram[] This is specific for some_other_diagram}\n\\uml{note:t20038_sequence[] Calling B::bbbbb()}", + "comment": "This is a generic comment about calling bbbbb()", "from": { "activity_id": "1013610625329227974", "participant_id": "1013610625329227974" @@ -624,6 +623,7 @@ template T add(T a, T b) { "messages": [ { + "comment": "This is a conditional operator", "from": { "activity_id": "1013610625329227974", "participant_id": "1013610625329227974" diff --git a/docs/test_cases/t20038_sequence.svg b/docs/test_cases/t20038_sequence.svg index 8974e5ef..a92bfccf 100644 --- a/docs/test_cases/t20038_sequence.svg +++ b/docs/test_cases/t20038_sequence.svg @@ -1,6 +1,6 @@ - + - + @@ -9,92 +9,92 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + tmain() - - tmain() + + tmain() - - + + B - - B + + B - - + + A - - A + + A - - + + add<int>(int,int) - - add<int>(int,int) + + add<int>(int,int) - - + + add_impl<int>(int,int) - - add_impl<int>(int,int) + + add_impl<int>(int,int) - - + + add_impl<double>(double,double) - - add_impl<double>(double,double) + + add_impl<double>(double,double) - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + Nisl purus in mollis nunc sed id semper. Varius vel pharetra vel turpis. Arcu @@ -111,18 +111,18 @@ alt - + Repeat 5 times... loop - + b() - + a() @@ -132,15 +132,15 @@ - + ... or just once - + b() - + a() @@ -149,12 +149,12 @@ - + bbb() - + aaa() @@ -163,109 +163,106 @@ - + bbbb() - + aaaa() - + - - - Invoke 'add' implementation - - - + + + - - - - - - - - - - - This comment should be rendered only - once - - - - wrap(int) + + + + + + + + + + + This comment should be rendered only + once + + + + wrap(int) - - - - - What is 2 + 2? - - - + + + + + What is 2 + 2? + + + - - - - - Calling B::bbbbb() - - - - bbbbb() + + + + + Calling B::bbbbb() + + + + bbbbb() - - - - aaaa() + + + + aaaa() - - - + + + - - - Invoke 'add' implementation - - - + + + - - - - - - - - - - - This is a conditional operator - - - alt - - - - [ - bbb() - ] + + + + + + + + + + + This is a conditional operator + + + alt + + + This is a conditional operator + + + + [ + bbb() + ] - - - - aaa() + + + + aaa() - - - - - + + + + + diff --git a/docs/test_cases/t20038_sequence_mermaid.svg b/docs/test_cases/t20038_sequence_mermaid.svg index 91eb0a95..e9912878 100644 --- a/docs/test_cases/t20038_sequence_mermaid.svg +++ b/docs/test_cases/t20038_sequence_mermaid.svg @@ -1,42 +1,42 @@ - + - - + + add_impl<double>(double,double) - - + + add_impl<int>(int,int) - - + + add<int>(int,int) - - + + A - - + + B - - + + tmain() - + @@ -45,7 +45,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -223,90 +223,84 @@ - + - + - + - - - Invoke 'add' implementation - + - - - - - + + This comment should be rendered only - + once - + - - + + What is 2 + 2? - + - - + + Calling B::bbbbb() - + - + - + - - - Invoke 'add' implementation - + - - - - - + + This is a conditional operator - + + + This is a conditional operator + - + - - - - - - - alt - - ​ + + + + + + + + + + alt + + ​ b() @@ -339,46 +333,46 @@ ​ - ​ - - ​ - - ​ - - ​ - - ​ - - wrap(int) - - ​ - - ​ - - ​ - - bbbbb() - - aaaa() - - ​ - - ​ - - ​ - - ​ - - ​ - - ​ - - [bbb()] - - aaa() - - ​ - - ​ - + ​ + + ​ + + ​ + + ​ + + ​ + + wrap(int) + + ​ + + ​ + + ​ + + bbbbb() + + aaaa() + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + [bbb()] + + aaa() + + ​ + + ​ + diff --git a/docs/test_cases/t20039_sequence.svg b/docs/test_cases/t20039_sequence.svg index bc8c47e0..ba1737ec 100644 --- a/docs/test_cases/t20039_sequence.svg +++ b/docs/test_cases/t20039_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,89 +23,89 @@ - - + + tmain() - + tmain() - - + + R - + R - - + + A<int> - + A<int> - - + + A<int_vec_t> - + A<int_vec_t> - - + + A<string_vec_t> - + A<string_vec_t> - - + + A<int_map_t> - + A<int_map_t> - - + + A<string_map_t> - + A<string_map_t> - - - - - - - - + + + + + + + + run() - + a(int) - + a(int_vec_t) - + a(string_vec_t) - + a(int_map_t) - + a(string_map_t) diff --git a/docs/test_cases/t20040_sequence.svg b/docs/test_cases/t20040_sequence.svg index 5816cb24..5fd6fa81 100644 --- a/docs/test_cases/t20040_sequence.svg +++ b/docs/test_cases/t20040_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,15 +9,15 @@ - - - - - - - - - + + + + + + + + + @@ -26,92 +26,92 @@ - - + + tmain() - + tmain() - - + + print<int,double,std::string>(int,double,std::string) - + print<int,double,std::string>(int,double,std::string) - - + + print<double,std::string>(double,std::string) - + print<double,std::string>(double,std::string) - - + + print<std::string>(std::string) - + print<std::string>(std::string) - - + + print() - + print() - - + + doublePrint<std::string,int>(std::string,int) - + doublePrint<std::string,int>(std::string,int) - - + + print<std::string,int>(std::string,int) - + print<std::string,int>(std::string,int) - - + + print<int>(int) - + print<int>(int) - - - - - - - - - - + + + + + + + + + + - + - + - + - + - + - + - + diff --git a/docs/test_cases/t20041_sequence.svg b/docs/test_cases/t20041_sequence.svg index 4bfe6bd4..598572bd 100644 --- a/docs/test_cases/t20041_sequence.svg +++ b/docs/test_cases/t20041_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,67 +9,67 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + A<int,double,std::string> - + A<int,double,std::string> - - + + A<double,std::string> - + A<double,std::string> - - + + A<std::string> - + A<std::string> - - + + A - + A - - - - - - + + + + + + print(int,double,std::string) - + print(double,std::string) - + print(std::string) - + print() diff --git a/docs/test_cases/t20042_sequence.svg b/docs/test_cases/t20042_sequence.svg index 98a1c34f..8b3a1fbc 100644 --- a/docs/test_cases/t20042_sequence.svg +++ b/docs/test_cases/t20042_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,55 +9,55 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + AHandler - + AHandler - - + + BHandler - + BHandler - - - - - - + + + + + + operator()(A &) const - + handle(A &) const - + operator()(B &) const - + diff --git a/docs/test_cases/t20043_sequence.svg b/docs/test_cases/t20043_sequence.svg index c8ace2c2..a3e9f637 100644 --- a/docs/test_cases/t20043_sequence.svg +++ b/docs/test_cases/t20043_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - - + + + - - + + tmain() - + tmain() - - + + D - + D - - + + C - + C - - - - + + + + d() - + c() diff --git a/docs/test_cases/t20044.md b/docs/test_cases/t20044.md new file mode 100644 index 00000000..ef55e192 --- /dev/null +++ b/docs/test_cases/t20044.md @@ -0,0 +1,700 @@ +# t20044 - Test case for template method call expressions with callables +## Config +```yaml +add_compile_flags: + - -fparse-all-comments +diagrams: + t20044_sequence: + type: sequence + glob: + - t20044.cc + type_aliases: + "detail::expected": result_t + generate_message_comments: true + include: + namespaces: + - clanguml::t20044 + exclude: + namespaces: + - clanguml::t20044::detail2 + using_namespace: clanguml::t20044 + from: + - function: "clanguml::t20044::tmain()" +``` +## Source code +File `tests/t20044/t20044.cc` +```cpp +// #include "include/expected.hpp" + +#include +#include +#include + +namespace clanguml { +namespace t20044 { + +enum class error { OK, FAIL }; + +namespace detail { +// Trivial std::expected mock-up just for testing calls through lambda +// expressions passed as arguments to methods +template class expected { +private: + std::optional value_; + std::optional error_; + +public: + explicit expected(V v) + : value_{std::move(v)} + { + } + explicit expected(E e) + : error_{std::move(e)} + { + } + + const auto &value() const { return *value_; } + + const auto &error() const { return *error_; } + + template auto and_then(F &&f) && + { + if (value_) + return f(*value_); + + return *this; + } +}; +} // namespace detail + +namespace detail2 { +template void run(F &&f) { f(); } +} // namespace detail2 + +using result_t = detail::expected; + +struct A { + auto a() const { } + + auto a1() const { return result_t{10}; } + + auto a2(int arg) const { return result_t{arg + 1}; } + + auto a4(int arg) const { return result_t{arg + 1}; } + + void a5() { } +}; + +auto a3(int arg) { return result_t{arg + 1}; } + +struct R { + template R(F &&f) { f(); } +}; + +int tmain() +{ + A a; + + // Call to template constructor with callable parameter and lambda + // expression as argument + R r([&a]() { a.a(); }); + + std::function a4_wrapper = &A::a4; + + std::function a4_wrapper_to_a = + std::bind(a4_wrapper, a, std::placeholders::_1); + + // The message to detail2::run() is skipped due to exclude filter, however + // the call to lambda and A::a5() is rendered + // TODO: Add some marker to highlight that this is not a direct call + detail2::run([&]() { a.a5(); }); + + return a + .a1() + // Call to a template method accepting a callable with lambda expression + // as argument, fully tracked showing method's activity and + .and_then([&](auto &&arg) { return a.a2(arg); }) + // TODO: Call to a method accepting a callable with function pointer + // as argument + .and_then(a3) + // TODO: Call to a method accepting a callable with std::function as + // argument + .and_then(a4_wrapper_to_a) + .value(); +} +} +} +``` +## Generated PlantUML diagrams +![t20044_sequence](./t20044_sequence.svg "Test case for template method call expressions with callables") +## Generated Mermaid diagrams +![t20044_sequence](./t20044_sequence_mermaid.svg "Test case for template method call expressions with callables") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20044_sequence", + "participants": [ + { + "display_name": "tmain()", + "id": "252888248193934644", + "name": "tmain", + "namespace": "clanguml::t20044", + "source_location": { + "column": 5, + "file": "t20044.cc", + "line": 68, + "translation_unit": "t20044.cc" + }, + "type": "function" + }, + { + "activities": [ + { + "display_name": "R((lambda at t20044.cc:74:9) &&)", + "id": "2121949343931231437", + "name": "R", + "namespace": "", + "source_location": { + "column": 27, + "file": "t20044.cc", + "line": 65, + "translation_unit": "t20044.cc" + }, + "type": "method" + } + ], + "display_name": "R", + "id": "1556111147598935846", + "name": "R", + "namespace": "clanguml::t20044", + "source_location": { + "column": 8, + "file": "t20044.cc", + "line": 64, + "translation_unit": "t20044.cc" + }, + "type": "class" + }, + { + "activities": [ + { + "display_name": "operator()() const", + "id": "818357152220364831", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20044.cc:74:9)", + "id": "731168008522991712", + "name": "tmain()::(lambda t20044.cc:74:9)", + "namespace": "clanguml::t20044", + "source_location": { + "column": 9, + "file": "t20044.cc", + "line": 74, + "translation_unit": "t20044.cc" + }, + "type": "lambda" + }, + { + "activities": [ + { + "display_name": "a() const", + "id": "853950074322224524", + "name": "a", + "namespace": "", + "source_location": { + "column": 10, + "file": "t20044.cc", + "line": 51, + "translation_unit": "t20044.cc" + }, + "type": "method" + }, + { + "display_name": "a5()", + "id": "1743691164520385657", + "name": "a5", + "namespace": "", + "source_location": { + "column": 10, + "file": "t20044.cc", + "line": 59, + "translation_unit": "t20044.cc" + }, + "type": "method" + }, + { + "display_name": "a1() const", + "id": "701399225037526851", + "name": "a1", + "namespace": "", + "source_location": { + "column": 10, + "file": "t20044.cc", + "line": 53, + "translation_unit": "t20044.cc" + }, + "type": "method" + }, + { + "display_name": "a2(int) const", + "id": "85144570008244024", + "name": "a2", + "namespace": "", + "source_location": { + "column": 10, + "file": "t20044.cc", + "line": 55, + "translation_unit": "t20044.cc" + }, + "type": "method" + } + ], + "display_name": "A", + "id": "1026615617828083132", + "name": "A", + "namespace": "clanguml::t20044", + "source_location": { + "column": 8, + "file": "t20044.cc", + "line": 50, + "translation_unit": "t20044.cc" + }, + "type": "class" + }, + { + "activities": [ + { + "display_name": "operator()() const", + "id": "436096372302626180", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20044.cc:84:18)", + "id": "1462639563075674191", + "name": "tmain()::(lambda t20044.cc:84:18)", + "namespace": "clanguml::t20044", + "source_location": { + "column": 18, + "file": "t20044.cc", + "line": 84, + "translation_unit": "t20044.cc" + }, + "type": "lambda" + }, + { + "activities": [ + { + "display_name": "expected(int)", + "id": "1539466150622485129", + "name": "expected", + "namespace": "", + "source_location": { + "column": 14, + "file": "t20044.cc", + "line": 21, + "translation_unit": "t20044.cc" + }, + "type": "method" + }, + { + "display_name": "and_then((lambda at t20044.cc:90:19) &&)", + "id": "377073498530267347", + "name": "and_then", + "namespace": "", + "source_location": { + "column": 29, + "file": "t20044.cc", + "line": 34, + "translation_unit": "t20044.cc" + }, + "type": "method" + }, + { + "display_name": "and_then(detail::expected (&)(int))", + "id": "688251630893467966", + "name": "and_then", + "namespace": "", + "source_location": { + "column": 29, + "file": "t20044.cc", + "line": 34, + "translation_unit": "t20044.cc" + }, + "type": "method" + }, + { + "display_name": "and_then(std::function (int)> &)", + "id": "139031379616853201", + "name": "and_then", + "namespace": "", + "source_location": { + "column": 29, + "file": "t20044.cc", + "line": 34, + "translation_unit": "t20044.cc" + }, + "type": "method" + }, + { + "display_name": "value() const", + "id": "954804726969205606", + "name": "value", + "namespace": "", + "source_location": { + "column": 17, + "file": "t20044.cc", + "line": 30, + "translation_unit": "t20044.cc" + }, + "type": "method" + } + ], + "display_name": "expected", + "id": "109801426773060225", + "name": "expected", + "namespace": "clanguml::t20044::detail", + "source_location": { + "column": 41, + "file": "t20044.cc", + "line": 15, + "translation_unit": "t20044.cc" + }, + "type": "class" + }, + { + "activities": [ + { + "display_name": "operator()(auto &&) const", + "id": "1768106129901104346", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20044.cc:90:19)", + "id": "929315761786829928", + "name": "tmain()::(lambda t20044.cc:90:19)", + "namespace": "clanguml::t20044", + "source_location": { + "column": 19, + "file": "t20044.cc", + "line": 90, + "translation_unit": "t20044.cc" + }, + "type": "lambda" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "252888248193934644", + "participant_id": "252888248193934644" + }, + "name": "R((lambda at t20044.cc:74:9) &&)", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 7, + "file": "t20044.cc", + "line": 74, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "2121949343931231437", + "participant_id": "1556111147598935846" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2121949343931231437", + "participant_id": "1556111147598935846" + }, + "name": "operator()() const", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 38, + "file": "t20044.cc", + "line": 65, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "818357152220364831", + "participant_id": "731168008522991712" + }, + "type": "message" + }, + { + "comment": "Call to template constructor with callable parameter and lambda\nexpression as argument", + "from": { + "activity_id": "818357152220364831", + "participant_id": "731168008522991712" + }, + "name": "a() const", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 18, + "file": "t20044.cc", + "line": 74, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "853950074322224524", + "participant_id": "1026615617828083132" + }, + "type": "message" + }, + { + "from": { + "activity_id": "252888248193934644", + "participant_id": "252888248193934644" + }, + "name": "operator()() const", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 18, + "file": "t20044.cc", + "line": 84, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "436096372302626180", + "participant_id": "1462639563075674191" + }, + "type": "message" + }, + { + "comment": "The message to detail2::run() is skipped due to exclude filter, however\nthe call to lambda and A::a5() is rendered\nTODO: Add some marker to highlight that this is not a direct call", + "from": { + "activity_id": "436096372302626180", + "participant_id": "1462639563075674191" + }, + "name": "a5()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 26, + "file": "t20044.cc", + "line": 84, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "1743691164520385657", + "participant_id": "1026615617828083132" + }, + "type": "message" + }, + { + "from": { + "activity_id": "252888248193934644", + "participant_id": "252888248193934644" + }, + "name": "a1() const", + "return_type": "result_t", + "scope": "normal", + "source_location": { + "column": 12, + "file": "t20044.cc", + "line": 86, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "701399225037526851", + "participant_id": "1026615617828083132" + }, + "type": "message" + }, + { + "from": { + "activity_id": "701399225037526851", + "participant_id": "1026615617828083132" + }, + "name": "expected(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 30, + "file": "t20044.cc", + "line": 53, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "1539466150622485129", + "participant_id": "109801426773060225" + }, + "type": "message" + }, + { + "from": { + "activity_id": "252888248193934644", + "participant_id": "252888248193934644" + }, + "name": "and_then((lambda at t20044.cc:90:19) &&)", + "return_type": "clanguml::t20044::detail::expected", + "scope": "normal", + "source_location": { + "column": 12, + "file": "t20044.cc", + "line": 86, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "377073498530267347", + "participant_id": "109801426773060225" + }, + "type": "message" + }, + { + "activity_id": "377073498530267347", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "377073498530267347", + "participant_id": "109801426773060225" + }, + "name": "operator()(auto &&) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 20, + "file": "t20044.cc", + "line": 37, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "1768106129901104346", + "participant_id": "929315761786829928" + }, + "type": "message" + }, + { + "comment": "Call to a template method accepting a callable with lambda expression\nas argument, fully tracked showing method's activity and", + "from": { + "activity_id": "1768106129901104346", + "participant_id": "929315761786829928" + }, + "name": "a2(int) const", + "return_type": "result_t", + "scope": "normal", + "source_location": { + "column": 44, + "file": "t20044.cc", + "line": 90, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "85144570008244024", + "participant_id": "1026615617828083132" + }, + "type": "message" + }, + { + "from": { + "activity_id": "85144570008244024", + "participant_id": "1026615617828083132" + }, + "name": "expected(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 37, + "file": "t20044.cc", + "line": 55, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "1539466150622485129", + "participant_id": "109801426773060225" + }, + "type": "message" + } + ], + "type": "consequent" + } + ], + "name": "if", + "type": "alt" + }, + { + "from": { + "activity_id": "252888248193934644", + "participant_id": "252888248193934644" + }, + "name": "and_then(result_t (&)(int))", + "return_type": "clanguml::t20044::detail::expected", + "scope": "normal", + "source_location": { + "column": 12, + "file": "t20044.cc", + "line": 86, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "688251630893467966", + "participant_id": "109801426773060225" + }, + "type": "message" + }, + { + "from": { + "activity_id": "252888248193934644", + "participant_id": "252888248193934644" + }, + "name": "and_then(std::function &)", + "return_type": "clanguml::t20044::detail::expected", + "scope": "normal", + "source_location": { + "column": 12, + "file": "t20044.cc", + "line": 86, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "139031379616853201", + "participant_id": "109801426773060225" + }, + "type": "message" + }, + { + "from": { + "activity_id": "252888248193934644", + "participant_id": "252888248193934644" + }, + "name": "value() const", + "return_type": "int const &", + "scope": "normal", + "source_location": { + "column": 12, + "file": "t20044.cc", + "line": 86, + "translation_unit": "t20044.cc" + }, + "to": { + "activity_id": "954804726969205606", + "participant_id": "109801426773060225" + }, + "type": "message" + } + ], + "start_from": { + "id": 252888248193934644, + "location": "clanguml::t20044::tmain()" + } + } + ], + "using_namespace": "clanguml::t20044" +} +``` diff --git a/docs/test_cases/t20044_sequence.svg b/docs/test_cases/t20044_sequence.svg new file mode 100644 index 00000000..b1f01f52 --- /dev/null +++ b/docs/test_cases/t20044_sequence.svg @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + R + + R + + + + tmain()::(lambda t20044.cc:74:9) + + tmain()::(lambda t20044.cc:74:9) + + + + A + + A + + + + tmain()::(lambda t20044.cc:84:18) + + tmain()::(lambda t20044.cc:84:18) + + + + detail::expected<int,error> + + detail::expected<int,error> + + + + tmain()::(lambda t20044.cc:90:19) + + tmain()::(lambda t20044.cc:90:19) + + + + + + + + + + + + + + + + + + + + R((lambda at t20044.cc:74:9) &&) + + + + + operator()() const + + + + Call to template constructor + with callable parameter and + lambda expression as argument + + + + a() const + + + + + operator()() const + + + + The message to detail2::run() + is skipped due to exclude + filter, however the call + to lambda and A::a5() is + rendered TODO: Add some marker + to highlight that this is + not a direct call + + + + a5() + + + + + a1() const + + + + + expected(int) + + + + + + + and_then((lambda at t20044.cc:90:19) &&) + + + + alt + + + + operator()(auto &&) const + + + + Call to a template method + accepting a callable with + lambda expression as argument, + fully tracked showing method's + activity and + + + + a2(int) const + + + + + expected(int) + + + + + + + + + + + and_then(result_t (&)(int)) + + + + + + + and_then(std::function<result_t (int)> &) + + + + + + + value() const + + + + + diff --git a/docs/test_cases/t20044_sequence_mermaid.svg b/docs/test_cases/t20044_sequence_mermaid.svg new file mode 100644 index 00000000..03e4df3e --- /dev/null +++ b/docs/test_cases/t20044_sequence_mermaid.svg @@ -0,0 +1,297 @@ + + + + + tmain()::(lambda t20044.cc:90:19) + + + + + + detail::expected<int,error> + + + + + + tmain()::(lambda t20044.cc:84:18) + + + + + + A + + + + + + tmain()::(lambda t20044.cc:74:9) + + + + + + R + + + + + + tmain() + + + + + + + + tmain()::(lambda t20044.cc:90:19) + + + + + + + + + detail::expected<int,error> + + + + + + + + + tmain()::(lambda t20044.cc:84:18) + + + + + + + + + A + + + + + + + + + tmain()::(lambda t20044.cc:74:9) + + + + + + + + + R + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Call to template constructor + + + with callable parameter and + + + lambda expression as argument + + + + + + + + + + + + The message to detail2::run() + + + is skipped due to exclude + + + filter, however the call + + + to lambda and A::a5() is + + + rendered TODO: Add some marker + + + to highlight that this is + + + not a direct call + + + + + + + + + + + + + + + + + + + + + Call to a template method + + + accepting a callable with + + + lambda expression as argument, + + + fully tracked showing method's + + + activity and + + + + + + + + + + + + + + + alt + + ​ + + + + + + + + + + + + R((lambda at t20044.cc:74:9) &&) + + operator()() const + + a() const + + operator()() const + + a5() + + a1() const + + expected(int) + + ​ + + and_then((lambda at t20044.cc:90:19) &&) + + operator()(auto &&) const + + a2(int) const + + expected(int) + + ​ + + ​ + + ​ + + and_then(result_t (&)(int)) + + ​ + + and_then(std::function<result_t (int)> &) + + ​ + + value() const + + ​ + + diff --git a/docs/test_cases/t20045.md b/docs/test_cases/t20045.md new file mode 100644 index 00000000..2b17fa49 --- /dev/null +++ b/docs/test_cases/t20045.md @@ -0,0 +1,492 @@ +# t20045 - Test case for template function call expressions with callables +## Config +```yaml +add_compile_flags: + - -fparse-all-comments +diagrams: + t20045_sequence: + type: sequence + glob: + - t20045.cc + include: + namespaces: + - clanguml::t20045 + using_namespace: clanguml::t20045 + from: + - function: "clanguml::t20045::tmain()" +``` +## Source code +File `tests/t20045/t20045.cc` +```cpp +namespace clanguml { +namespace t20045 { + +template int a1(F &&f) { return f(42); } + +int a2(int x) { return 2; } + +int a3(int x) { return 3; } + +struct B { + int b1(int x) { return x + 1; } + int b2(int x) { return x + 2; } +}; + +class C { +public: + explicit C(int x) + : x_{x} + { + } + + int get_x() const { return x_; } + +private: + int x_; +}; + +int tmain() +{ + B b; + + // \uml{call clanguml::t20045::a2(int)} + auto v1 = a1(a2); + + auto v2 = a1([](auto &&arg) { return a3(arg); }); + + auto v3 = a1([&](auto &&arg) { return b.b1(arg); }); + + auto v4 = a1([](auto &&arg) { + C c(arg); + return c.get_x(); + }); + + return 0; +} +} +} +``` +## Generated PlantUML diagrams +![t20045_sequence](./t20045_sequence.svg "Test case for template function call expressions with callables") +## Generated Mermaid diagrams +![t20045_sequence](./t20045_sequence_mermaid.svg "Test case for template function call expressions with callables") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20045_sequence", + "participants": [ + { + "display_name": "tmain()", + "id": "2117440102058621189", + "name": "tmain", + "namespace": "clanguml::t20045", + "source_location": { + "column": 5, + "file": "t20045.cc", + "line": 28, + "translation_unit": "t20045.cc" + }, + "type": "function" + }, + { + "display_name": "a2(int)", + "id": "422137031007650421", + "name": "a2", + "namespace": "clanguml::t20045", + "source_location": { + "column": 5, + "file": "t20045.cc", + "line": 6, + "translation_unit": "t20045.cc" + }, + "type": "function" + }, + { + "display_name": "a1<(lambda at t20045.cc:35:18)>((lambda at /home/bartek/devel/clang-uml/tests/t20045/t20045.cc:35:18) &&)", + "id": "771242326042389239", + "name": "a1", + "namespace": "clanguml::t20045", + "source_location": { + "column": 27, + "file": "t20045.cc", + "line": 4, + "translation_unit": "t20045.cc" + }, + "type": "function_template" + }, + { + "activities": [ + { + "display_name": "operator()(auto &&) const", + "id": "1420491111902448188", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20045.cc:35:18)", + "id": "36644484176793235", + "name": "tmain()::(lambda t20045.cc:35:18)", + "namespace": "clanguml::t20045", + "source_location": { + "column": 18, + "file": "t20045.cc", + "line": 35, + "translation_unit": "t20045.cc" + }, + "type": "lambda" + }, + { + "display_name": "a3(int)", + "id": "399307921304660486", + "name": "a3", + "namespace": "clanguml::t20045", + "source_location": { + "column": 5, + "file": "t20045.cc", + "line": 8, + "translation_unit": "t20045.cc" + }, + "type": "function" + }, + { + "display_name": "a1<(lambda at t20045.cc:37:18)>((lambda at /home/bartek/devel/clang-uml/tests/t20045/t20045.cc:37:18) &&)", + "id": "708264873048728082", + "name": "a1", + "namespace": "clanguml::t20045", + "source_location": { + "column": 27, + "file": "t20045.cc", + "line": 4, + "translation_unit": "t20045.cc" + }, + "type": "function_template" + }, + { + "activities": [ + { + "display_name": "operator()(auto &&) const", + "id": "1995217387134011144", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20045.cc:37:18)", + "id": "1556269922572504148", + "name": "tmain()::(lambda t20045.cc:37:18)", + "namespace": "clanguml::t20045", + "source_location": { + "column": 18, + "file": "t20045.cc", + "line": 37, + "translation_unit": "t20045.cc" + }, + "type": "lambda" + }, + { + "activities": [ + { + "display_name": "b1(int)", + "id": "820437645998690739", + "name": "b1", + "namespace": "", + "source_location": { + "column": 9, + "file": "t20045.cc", + "line": 11, + "translation_unit": "t20045.cc" + }, + "type": "method" + } + ], + "display_name": "B", + "id": "1737887355752592935", + "name": "B", + "namespace": "clanguml::t20045", + "source_location": { + "column": 8, + "file": "t20045.cc", + "line": 10, + "translation_unit": "t20045.cc" + }, + "type": "class" + }, + { + "display_name": "a1<(lambda at t20045.cc:39:18)>((lambda at /home/bartek/devel/clang-uml/tests/t20045/t20045.cc:39:18) &&)", + "id": "1935046237572139126", + "name": "a1", + "namespace": "clanguml::t20045", + "source_location": { + "column": 27, + "file": "t20045.cc", + "line": 4, + "translation_unit": "t20045.cc" + }, + "type": "function_template" + }, + { + "activities": [ + { + "display_name": "operator()(auto &&) const", + "id": "786866346046560964", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20045.cc:39:18)", + "id": "132403781431240789", + "name": "tmain()::(lambda t20045.cc:39:18)", + "namespace": "clanguml::t20045", + "source_location": { + "column": 18, + "file": "t20045.cc", + "line": 39, + "translation_unit": "t20045.cc" + }, + "type": "lambda" + }, + { + "activities": [ + { + "display_name": "get_x() const", + "id": "570815384165305751", + "name": "get_x", + "namespace": "", + "source_location": { + "column": 9, + "file": "t20045.cc", + "line": 22, + "translation_unit": "t20045.cc" + }, + "type": "method" + } + ], + "display_name": "C", + "id": "1812199014066862625", + "name": "C", + "namespace": "clanguml::t20045", + "source_location": { + "column": 7, + "file": "t20045.cc", + "line": 15, + "translation_unit": "t20045.cc" + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "2117440102058621189", + "participant_id": "2117440102058621189" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 15, + "file": "t20045.cc", + "line": 33, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "422137031007650421", + "participant_id": "422137031007650421" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2117440102058621189", + "participant_id": "2117440102058621189" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "column": 15, + "file": "t20045.cc", + "line": 35, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "771242326042389239", + "participant_id": "771242326042389239" + }, + "type": "message" + }, + { + "from": { + "activity_id": "771242326042389239", + "participant_id": "771242326042389239" + }, + "name": "operator()(auto &&) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 46, + "file": "t20045.cc", + "line": 4, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "1420491111902448188", + "participant_id": "36644484176793235" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1420491111902448188", + "participant_id": "36644484176793235" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 42, + "file": "t20045.cc", + "line": 35, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "399307921304660486", + "participant_id": "399307921304660486" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2117440102058621189", + "participant_id": "2117440102058621189" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "column": 15, + "file": "t20045.cc", + "line": 37, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "708264873048728082", + "participant_id": "708264873048728082" + }, + "type": "message" + }, + { + "from": { + "activity_id": "708264873048728082", + "participant_id": "708264873048728082" + }, + "name": "operator()(auto &&) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 46, + "file": "t20045.cc", + "line": 4, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "1995217387134011144", + "participant_id": "1556269922572504148" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1995217387134011144", + "participant_id": "1556269922572504148" + }, + "name": "b1(int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 43, + "file": "t20045.cc", + "line": 37, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "820437645998690739", + "participant_id": "1737887355752592935" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2117440102058621189", + "participant_id": "2117440102058621189" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "column": 15, + "file": "t20045.cc", + "line": 39, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "1935046237572139126", + "participant_id": "1935046237572139126" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1935046237572139126", + "participant_id": "1935046237572139126" + }, + "name": "operator()(auto &&) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 46, + "file": "t20045.cc", + "line": 4, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "786866346046560964", + "participant_id": "132403781431240789" + }, + "type": "message" + }, + { + "from": { + "activity_id": "786866346046560964", + "participant_id": "132403781431240789" + }, + "name": "get_x() const", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 16, + "file": "t20045.cc", + "line": 41, + "translation_unit": "t20045.cc" + }, + "to": { + "activity_id": "570815384165305751", + "participant_id": "1812199014066862625" + }, + "type": "message" + } + ], + "start_from": { + "id": 2117440102058621189, + "location": "clanguml::t20045::tmain()" + } + } + ], + "using_namespace": "clanguml::t20045" +} +``` diff --git a/docs/test_cases/t20045_sequence.svg b/docs/test_cases/t20045_sequence.svg new file mode 100644 index 00000000..afb259b9 --- /dev/null +++ b/docs/test_cases/t20045_sequence.svg @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + a2(int) + + a2(int) + + + + a1<(lambda at t20045.cc:35:18)>((lambda at t20045.cc:35:18) &&) + + a1<(lambda at t20045.cc:35:18)>((lambda at t20045.cc:35:18) &&) + + + + tmain()::(lambda t20045.cc:35:18) + + tmain()::(lambda t20045.cc:35:18) + + + + a3(int) + + a3(int) + + + + a1<(lambda at t20045.cc:37:18)>((lambda at t20045.cc:37:18) &&) + + a1<(lambda at t20045.cc:37:18)>((lambda at t20045.cc:37:18) &&) + + + + tmain()::(lambda t20045.cc:37:18) + + tmain()::(lambda t20045.cc:37:18) + + + + B + + B + + + + a1<(lambda at t20045.cc:39:18)>((lambda at t20045.cc:39:18) &&) + + a1<(lambda at t20045.cc:39:18)>((lambda at t20045.cc:39:18) &&) + + + + tmain()::(lambda t20045.cc:39:18) + + tmain()::(lambda t20045.cc:39:18) + + + + C + + C + + + + + + + + + + + + + + + + + + + + + + + + + + operator()(auto &&) const + + + + + + + + + + + + + + + + + + + operator()(auto &&) const + + + + + b1(int) + + + + + + + + + + + + + + + operator()(auto &&) const + + + + + get_x() const + + + + + + + + + diff --git a/docs/test_cases/t20045_sequence_mermaid.svg b/docs/test_cases/t20045_sequence_mermaid.svg new file mode 100644 index 00000000..534c2ec1 --- /dev/null +++ b/docs/test_cases/t20045_sequence_mermaid.svg @@ -0,0 +1,278 @@ + + + + + C + + + + + + tmain()::(lambda t20045.cc:39:18) + + + + + + a1<(lambda at t20045.cc:39:18)>((lambda at t20045.cc:39:18) &&) + + + + + + B + + + + + + tmain()::(lambda t20045.cc:37:18) + + + + + + a1<(lambda at t20045.cc:37:18)>((lambda at t20045.cc:37:18) &&) + + + + + + a3(int) + + + + + + tmain()::(lambda t20045.cc:35:18) + + + + + + a1<(lambda at t20045.cc:35:18)>((lambda at t20045.cc:35:18) &&) + + + + + + a2(int) + + + + + + tmain() + + + + + + + + C + + + + + + + + + tmain()::(lambda t20045.cc:39:18) + + + + + + + + + a1<(lambda at t20045.cc:39:18)>((lambda at t20045.cc:39:18) &&) + + + + + + + + + B + + + + + + + + + tmain()::(lambda t20045.cc:37:18) + + + + + + + + + a1<(lambda at t20045.cc:37:18)>((lambda at t20045.cc:37:18) &&) + + + + + + + + + a3(int) + + + + + + + + + tmain()::(lambda t20045.cc:35:18) + + + + + + + + + a1<(lambda at t20045.cc:35:18)>((lambda at t20045.cc:35:18) &&) + + + + + + + + + a2(int) + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ​ + + ​ + + ​ + + operator()(auto &&) const + + ​ + + ​ + + ​ + + ​ + + ​ + + operator()(auto &&) const + + b1(int) + + ​ + + ​ + + ​ + + ​ + + operator()(auto &&) const + + get_x() const + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20046.md b/docs/test_cases/t20046.md new file mode 100644 index 00000000..a0e40e1f --- /dev/null +++ b/docs/test_cases/t20046.md @@ -0,0 +1,351 @@ +# t20046 - Test case for call expressions in nested lambdas +## Config +```yaml +add_compile_flags: + - -fparse-all-comments +diagrams: + t20046_sequence: + type: sequence + glob: + - t20046.cc + include: + namespaces: + - clanguml::t20046 + using_namespace: clanguml::t20046 + from: + - function: "clanguml::t20046::tmain()" +``` +## Source code +File `tests/t20046/t20046.cc` +```cpp +namespace clanguml { +namespace t20046 { + +template int a1(F &&f) { return f(42); } + +int a2(int x) { return 2; } + +int a3(int x) { return 3; } + +int tmain() +{ + // Call expression in a nested lambda + auto v1 = [](auto &&arg1) { + return [](auto &&arg2) { return a2(arg2); }(arg1); + }(0); + + // Call expression in a nested lambda in call expression + auto v4 = a1( + [](auto &&arg1) { return [](auto &&arg2) { return a3(arg2); }(arg1); }); + + return 0; +} +} +} +``` +## Generated PlantUML diagrams +![t20046_sequence](./t20046_sequence.svg "Test case for call expressions in nested lambdas") +## Generated Mermaid diagrams +![t20046_sequence](./t20046_sequence_mermaid.svg "Test case for call expressions in nested lambdas") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20046_sequence", + "participants": [ + { + "display_name": "tmain()", + "id": "1092597347191364515", + "name": "tmain", + "namespace": "clanguml::t20046", + "source_location": { + "column": 5, + "file": "t20046.cc", + "line": 10, + "translation_unit": "t20046.cc" + }, + "type": "function" + }, + { + "activities": [ + { + "display_name": "operator()(auto &&) const", + "id": "174997669781821772", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20046.cc:13:15)", + "id": "1868201491114557068", + "name": "tmain()::(lambda t20046.cc:13:15)", + "namespace": "clanguml::t20046", + "source_location": { + "column": 15, + "file": "t20046.cc", + "line": 13, + "translation_unit": "t20046.cc" + }, + "type": "lambda" + }, + { + "activities": [ + { + "display_name": "operator()(auto &&) const", + "id": "771372907204554082", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20046.cc:13:15)::(lambda t20046.cc:14:16)", + "id": "163480314503646451", + "name": "clanguml::t20046::tmain()::(lambda t20046.cc:13:15)::(lambda t20046.cc:14:16)", + "namespace": "clanguml::t20046", + "source_location": { + "column": 16, + "file": "t20046.cc", + "line": 14, + "translation_unit": "t20046.cc" + }, + "type": "lambda" + }, + { + "display_name": "a2(int)", + "id": "267222823829967475", + "name": "a2", + "namespace": "clanguml::t20046", + "source_location": { + "column": 5, + "file": "t20046.cc", + "line": 6, + "translation_unit": "t20046.cc" + }, + "type": "function" + }, + { + "display_name": "a1<(lambda at t20046.cc:19:9)>((lambda at /home/bartek/devel/clang-uml/tests/t20046/t20046.cc:19:9) &&)", + "id": "404852580994337987", + "name": "a1", + "namespace": "clanguml::t20046", + "source_location": { + "column": 27, + "file": "t20046.cc", + "line": 4, + "translation_unit": "t20046.cc" + }, + "type": "function_template" + }, + { + "activities": [ + { + "display_name": "operator()(auto &&) const", + "id": "326496579896748789", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20046.cc:19:9)", + "id": "1833526997995356163", + "name": "tmain()::(lambda t20046.cc:19:9)", + "namespace": "clanguml::t20046", + "source_location": { + "column": 9, + "file": "t20046.cc", + "line": 19, + "translation_unit": "t20046.cc" + }, + "type": "lambda" + }, + { + "activities": [ + { + "display_name": "operator()(auto &&) const", + "id": "1093593470536515636", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20046.cc:19:9)::(lambda t20046.cc:19:34)", + "id": "2177951153338850159", + "name": "clanguml::t20046::tmain()::(lambda t20046.cc:19:9)::(lambda t20046.cc:19:34)", + "namespace": "clanguml::t20046", + "source_location": { + "column": 34, + "file": "t20046.cc", + "line": 19, + "translation_unit": "t20046.cc" + }, + "type": "lambda" + }, + { + "display_name": "a3(int)", + "id": "1043774975066033521", + "name": "a3", + "namespace": "clanguml::t20046", + "source_location": { + "column": 5, + "file": "t20046.cc", + "line": 8, + "translation_unit": "t20046.cc" + }, + "type": "function" + } + ], + "sequences": [ + { + "messages": [ + { + "comment": "Call expression in a nested lambda", + "from": { + "activity_id": "1092597347191364515", + "participant_id": "1092597347191364515" + }, + "name": "operator()(auto &&) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 15, + "file": "t20046.cc", + "line": 13, + "translation_unit": "t20046.cc" + }, + "to": { + "activity_id": "174997669781821772", + "participant_id": "1868201491114557068" + }, + "type": "message" + }, + { + "from": { + "activity_id": "174997669781821772", + "participant_id": "1868201491114557068" + }, + "name": "operator()(auto &&) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 16, + "file": "t20046.cc", + "line": 14, + "translation_unit": "t20046.cc" + }, + "to": { + "activity_id": "771372907204554082", + "participant_id": "163480314503646451" + }, + "type": "message" + }, + { + "from": { + "activity_id": "771372907204554082", + "participant_id": "163480314503646451" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 41, + "file": "t20046.cc", + "line": 14, + "translation_unit": "t20046.cc" + }, + "to": { + "activity_id": "267222823829967475", + "participant_id": "267222823829967475" + }, + "type": "message" + }, + { + "comment": "Call expression in a nested lambda in call expression", + "from": { + "activity_id": "1092597347191364515", + "participant_id": "1092597347191364515" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "column": 15, + "file": "t20046.cc", + "line": 18, + "translation_unit": "t20046.cc" + }, + "to": { + "activity_id": "404852580994337987", + "participant_id": "404852580994337987" + }, + "type": "message" + }, + { + "from": { + "activity_id": "404852580994337987", + "participant_id": "404852580994337987" + }, + "name": "operator()(auto &&) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 46, + "file": "t20046.cc", + "line": 4, + "translation_unit": "t20046.cc" + }, + "to": { + "activity_id": "326496579896748789", + "participant_id": "1833526997995356163" + }, + "type": "message" + }, + { + "from": { + "activity_id": "326496579896748789", + "participant_id": "1833526997995356163" + }, + "name": "operator()(auto &&) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 34, + "file": "t20046.cc", + "line": 19, + "translation_unit": "t20046.cc" + }, + "to": { + "activity_id": "1093593470536515636", + "participant_id": "2177951153338850159" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1093593470536515636", + "participant_id": "2177951153338850159" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 59, + "file": "t20046.cc", + "line": 19, + "translation_unit": "t20046.cc" + }, + "to": { + "activity_id": "1043774975066033521", + "participant_id": "1043774975066033521" + }, + "type": "message" + } + ], + "start_from": { + "id": 1092597347191364515, + "location": "clanguml::t20046::tmain()" + } + } + ], + "using_namespace": "clanguml::t20046" +} +``` diff --git a/docs/test_cases/t20046_sequence.svg b/docs/test_cases/t20046_sequence.svg new file mode 100644 index 00000000..b3794830 --- /dev/null +++ b/docs/test_cases/t20046_sequence.svg @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + tmain()::(lambda t20046.cc:13:15) + + tmain()::(lambda t20046.cc:13:15) + + + + tmain()::(lambda t20046.cc:13:15)::(lambda t20046.cc:14:16) + + tmain()::(lambda t20046.cc:13:15)::(lambda t20046.cc:14:16) + + + + a2(int) + + a2(int) + + + + a1<(lambda at t20046.cc:19:9)>((lambda at t20046.cc:19:9) &&) + + a1<(lambda at t20046.cc:19:9)>((lambda at t20046.cc:19:9) &&) + + + + tmain()::(lambda t20046.cc:19:9) + + tmain()::(lambda t20046.cc:19:9) + + + + tmain()::(lambda t20046.cc:19:9)::(lambda t20046.cc:19:34) + + tmain()::(lambda t20046.cc:19:9)::(lambda t20046.cc:19:34) + + + + a3(int) + + a3(int) + + + + + + + + + + + + + operator()(auto &&) const + + + + + operator()(auto &&) const + + + + + + + + + + + + + + + + + + + operator()(auto &&) const + + + + + operator()(auto &&) const + + + + + + + + + + + + + + + diff --git a/docs/test_cases/t20046_sequence_mermaid.svg b/docs/test_cases/t20046_sequence_mermaid.svg new file mode 100644 index 00000000..44b60e5b --- /dev/null +++ b/docs/test_cases/t20046_sequence_mermaid.svg @@ -0,0 +1,212 @@ + + + + + a3(int) + + + + + + tmain()::(lambda t20046.cc:19:9)::(lambda t20046.cc:19:34) + + + + + + tmain()::(lambda t20046.cc:19:9) + + + + + + a1<(lambda at t20046.cc:19:9)>((lambda at t20046.cc:19:9) &&) + + + + + + a2(int) + + + + + + tmain()::(lambda t20046.cc:13:15)::(lambda t20046.cc:14:16) + + + + + + tmain()::(lambda t20046.cc:13:15) + + + + + + tmain() + + + + + + + + a3(int) + + + + + + + + + tmain()::(lambda t20046.cc:19:9)::(lambda t20046.cc:19:34) + + + + + + + + + tmain()::(lambda t20046.cc:19:9) + + + + + + + + + a1<(lambda at t20046.cc:19:9)>((lambda at t20046.cc:19:9) &&) + + + + + + + + + a2(int) + + + + + + + + + tmain()::(lambda t20046.cc:13:15)::(lambda t20046.cc:14:16) + + + + + + + + + tmain()::(lambda t20046.cc:13:15) + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + operator()(auto &&) const + + operator()(auto &&) const + + ​ + + ​ + + ​ + + ​ + + ​ + + operator()(auto &&) const + + operator()(auto &&) const + + ​ + + ​ + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20047.md b/docs/test_cases/t20047.md new file mode 100644 index 00000000..a6e17c7b --- /dev/null +++ b/docs/test_cases/t20047.md @@ -0,0 +1,298 @@ +# t20047 - Test case for 'call' comment directive +## Config +```yaml +add_compile_flags: + - -fparse-all-comments +diagrams: + t20047_sequence: + type: sequence + glob: + - t20047.cc + include: + namespaces: + - clanguml::t20047 + using_namespace: clanguml::t20047 + from: + - function: "clanguml::t20047::tmain()" +``` +## Source code +File `tests/t20047/t20047.cc` +```cpp +#include + +namespace clanguml { +namespace t20047 { + +int a1(int x) { return x + 1; } + +int a2(int x) { return x + 2; } + +int a3(int x) { return x + 3; } + +int a4(int x) { return x + 4; } + +int a5(int x) { return x + 5; } + +int a6(int x) { return x + 6; } + +int run(int (*f)(int), int arg) { return f(arg); } + +int tmain() +{ + auto res = + // \uml{call clanguml::t20047::a1(int)} + run(a1, 0); + + res = a3( + // \uml{call clanguml::t20047::a2(int)} + run(a2, 0)); + + // \uml{call clanguml::t20047::a4(int)} + res = [](auto &&x) { return a4(x); }(0); + + // \uml{call clanguml::t20047::a5(int)} + res = std::async(a5, 10).get(); + + // \uml{call clanguml::t20047::a6(int)} + res = [](auto &&x) { return std::async(run, a6, x).get(); }(1); + + return res; +} +} +} +``` +## Generated PlantUML diagrams +![t20047_sequence](./t20047_sequence.svg "Test case for 'call' comment directive") +## Generated Mermaid diagrams +![t20047_sequence](./t20047_sequence_mermaid.svg "Test case for 'call' comment directive") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20047_sequence", + "participants": [ + { + "display_name": "tmain()", + "id": "395335809944376006", + "name": "tmain", + "namespace": "clanguml::t20047", + "source_location": { + "column": 5, + "file": "t20047.cc", + "line": 20, + "translation_unit": "t20047.cc" + }, + "type": "function" + }, + { + "display_name": "a1(int)", + "id": "1143426315383292679", + "name": "a1", + "namespace": "clanguml::t20047", + "source_location": { + "column": 5, + "file": "t20047.cc", + "line": 6, + "translation_unit": "t20047.cc" + }, + "type": "function" + }, + { + "display_name": "a2(int)", + "id": "642420844675776100", + "name": "a2", + "namespace": "clanguml::t20047", + "source_location": { + "column": 5, + "file": "t20047.cc", + "line": 8, + "translation_unit": "t20047.cc" + }, + "type": "function" + }, + { + "display_name": "a3(int)", + "id": "270462331062298387", + "name": "a3", + "namespace": "clanguml::t20047", + "source_location": { + "column": 5, + "file": "t20047.cc", + "line": 10, + "translation_unit": "t20047.cc" + }, + "type": "function" + }, + { + "display_name": "a4(int)", + "id": "128784832900379603", + "name": "a4", + "namespace": "clanguml::t20047", + "source_location": { + "column": 5, + "file": "t20047.cc", + "line": 12, + "translation_unit": "t20047.cc" + }, + "type": "function" + }, + { + "display_name": "a5(int)", + "id": "2182660880755444870", + "name": "a5", + "namespace": "clanguml::t20047", + "source_location": { + "column": 5, + "file": "t20047.cc", + "line": 14, + "translation_unit": "t20047.cc" + }, + "type": "function" + }, + { + "display_name": "a6(int)", + "id": "1272350614275781124", + "name": "a6", + "namespace": "clanguml::t20047", + "source_location": { + "column": 5, + "file": "t20047.cc", + "line": 16, + "translation_unit": "t20047.cc" + }, + "type": "function" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "395335809944376006", + "participant_id": "395335809944376006" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 9, + "file": "t20047.cc", + "line": 24, + "translation_unit": "t20047.cc" + }, + "to": { + "activity_id": "1143426315383292679", + "participant_id": "1143426315383292679" + }, + "type": "message" + }, + { + "from": { + "activity_id": "395335809944376006", + "participant_id": "395335809944376006" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 9, + "file": "t20047.cc", + "line": 28, + "translation_unit": "t20047.cc" + }, + "to": { + "activity_id": "642420844675776100", + "participant_id": "642420844675776100" + }, + "type": "message" + }, + { + "from": { + "activity_id": "395335809944376006", + "participant_id": "395335809944376006" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 11, + "file": "t20047.cc", + "line": 26, + "translation_unit": "t20047.cc" + }, + "to": { + "activity_id": "270462331062298387", + "participant_id": "270462331062298387" + }, + "type": "message" + }, + { + "from": { + "activity_id": "395335809944376006", + "participant_id": "395335809944376006" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 11, + "file": "t20047.cc", + "line": 31, + "translation_unit": "t20047.cc" + }, + "to": { + "activity_id": "128784832900379603", + "participant_id": "128784832900379603" + }, + "type": "message" + }, + { + "from": { + "activity_id": "395335809944376006", + "participant_id": "395335809944376006" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 11, + "file": "t20047.cc", + "line": 34, + "translation_unit": "t20047.cc" + }, + "to": { + "activity_id": "2182660880755444870", + "participant_id": "2182660880755444870" + }, + "type": "message" + }, + { + "from": { + "activity_id": "395335809944376006", + "participant_id": "395335809944376006" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 11, + "file": "t20047.cc", + "line": 37, + "translation_unit": "t20047.cc" + }, + "to": { + "activity_id": "1272350614275781124", + "participant_id": "1272350614275781124" + }, + "type": "message" + } + ], + "start_from": { + "id": 395335809944376006, + "location": "clanguml::t20047::tmain()" + } + } + ], + "using_namespace": "clanguml::t20047" +} +``` diff --git a/docs/test_cases/t20047_sequence.svg b/docs/test_cases/t20047_sequence.svg new file mode 100644 index 00000000..2156521a --- /dev/null +++ b/docs/test_cases/t20047_sequence.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + a1(int) + + a1(int) + + + + a2(int) + + a2(int) + + + + a3(int) + + a3(int) + + + + a4(int) + + a4(int) + + + + a5(int) + + a5(int) + + + + a6(int) + + a6(int) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/test_cases/t20047_sequence_mermaid.svg b/docs/test_cases/t20047_sequence_mermaid.svg new file mode 100644 index 00000000..0511d0c1 --- /dev/null +++ b/docs/test_cases/t20047_sequence_mermaid.svg @@ -0,0 +1,190 @@ + + + + + a6(int) + + + + + + a5(int) + + + + + + a4(int) + + + + + + a3(int) + + + + + + a2(int) + + + + + + a1(int) + + + + + + tmain() + + + + + + + + a6(int) + + + + + + + + + a5(int) + + + + + + + + + a4(int) + + + + + + + + + a3(int) + + + + + + + + + a2(int) + + + + + + + + + a1(int) + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20048.md b/docs/test_cases/t20048.md new file mode 100644 index 00000000..abb86ddb --- /dev/null +++ b/docs/test_cases/t20048.md @@ -0,0 +1,377 @@ +# t20048 - Test case for message comments +## Config +```yaml +add_compile_flags: + - -fparse-all-comments +diagrams: + t20048_sequence: + type: sequence + glob: + - t20048.cc + generate_message_comments: true + include: + namespaces: + - clanguml::t20048 + using_namespace: clanguml::t20048 + from: + - function: "clanguml::t20048::tmain()" +``` +## Source code +File `tests/t20048/t20048.cc` +```cpp +#include + +namespace clanguml { +namespace t20048 { + +int a1(int x) { return x + 1; } + +int a2(int x) { return x + 2; } + +int a3(int x) { return x + 3; } + +int a4(int x) { return x + 4; } + +int a5(int x) { return x + 5; } + +int a6(int x) { return x + 6; } + +int a7(int x) { return x + 7; } + +int tmain() +{ + // a1() adds `1` to the result of a2() + auto res = a1(a2(a3(0))); + + // This lambda calls a4() which adds `4` to it's argument + res = [](auto &&x) { return a4(x); }(0); + + // a5() adds `1` to the result of a6() + res = a5( + // a6() adds `1` to its argument + a6(0)); + + // a7() is called via add std::async + // \uml{call clanguml::t20048::a7(int)} + res = std::async(a7, 10).get(); + + return 0; +} +} +} +``` +## Generated PlantUML diagrams +![t20048_sequence](./t20048_sequence.svg "Test case for message comments") +## Generated Mermaid diagrams +![t20048_sequence](./t20048_sequence_mermaid.svg "Test case for message comments") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20048_sequence", + "participants": [ + { + "display_name": "tmain()", + "id": "1438172520221545830", + "name": "tmain", + "namespace": "clanguml::t20048", + "source_location": { + "column": 5, + "file": "t20048.cc", + "line": 20, + "translation_unit": "t20048.cc" + }, + "type": "function" + }, + { + "display_name": "a3(int)", + "id": "1592723040639512239", + "name": "a3", + "namespace": "clanguml::t20048", + "source_location": { + "column": 5, + "file": "t20048.cc", + "line": 10, + "translation_unit": "t20048.cc" + }, + "type": "function" + }, + { + "display_name": "a2(int)", + "id": "1494883525267049301", + "name": "a2", + "namespace": "clanguml::t20048", + "source_location": { + "column": 5, + "file": "t20048.cc", + "line": 8, + "translation_unit": "t20048.cc" + }, + "type": "function" + }, + { + "display_name": "a1(int)", + "id": "1139681416936587734", + "name": "a1", + "namespace": "clanguml::t20048", + "source_location": { + "column": 5, + "file": "t20048.cc", + "line": 6, + "translation_unit": "t20048.cc" + }, + "type": "function" + }, + { + "activities": [ + { + "display_name": "operator()(auto &&) const", + "id": "1272214062049882942", + "name": "operator()", + "namespace": "", + "type": "method" + } + ], + "display_name": "tmain()::(lambda t20048.cc:26:11)", + "id": "794500632550538124", + "name": "tmain()::(lambda t20048.cc:26:11)", + "namespace": "clanguml::t20048", + "source_location": { + "column": 11, + "file": "t20048.cc", + "line": 26, + "translation_unit": "t20048.cc" + }, + "type": "lambda" + }, + { + "display_name": "a4(int)", + "id": "986710377344543262", + "name": "a4", + "namespace": "clanguml::t20048", + "source_location": { + "column": 5, + "file": "t20048.cc", + "line": 12, + "translation_unit": "t20048.cc" + }, + "type": "function" + }, + { + "display_name": "a6(int)", + "id": "372194568810958399", + "name": "a6", + "namespace": "clanguml::t20048", + "source_location": { + "column": 5, + "file": "t20048.cc", + "line": 16, + "translation_unit": "t20048.cc" + }, + "type": "function" + }, + { + "display_name": "a5(int)", + "id": "473170110460301705", + "name": "a5", + "namespace": "clanguml::t20048", + "source_location": { + "column": 5, + "file": "t20048.cc", + "line": 14, + "translation_unit": "t20048.cc" + }, + "type": "function" + }, + { + "display_name": "a7(int)", + "id": "156504678810211848", + "name": "a7", + "namespace": "clanguml::t20048", + "source_location": { + "column": 5, + "file": "t20048.cc", + "line": 18, + "translation_unit": "t20048.cc" + }, + "type": "function" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1438172520221545830", + "participant_id": "1438172520221545830" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 22, + "file": "t20048.cc", + "line": 23, + "translation_unit": "t20048.cc" + }, + "to": { + "activity_id": "1592723040639512239", + "participant_id": "1592723040639512239" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1438172520221545830", + "participant_id": "1438172520221545830" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 19, + "file": "t20048.cc", + "line": 23, + "translation_unit": "t20048.cc" + }, + "to": { + "activity_id": "1494883525267049301", + "participant_id": "1494883525267049301" + }, + "type": "message" + }, + { + "comment": "a1() adds `1` to the result of a2()", + "from": { + "activity_id": "1438172520221545830", + "participant_id": "1438172520221545830" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 16, + "file": "t20048.cc", + "line": 23, + "translation_unit": "t20048.cc" + }, + "to": { + "activity_id": "1139681416936587734", + "participant_id": "1139681416936587734" + }, + "type": "message" + }, + { + "comment": "This lambda calls a4() which adds `4` to it's argument", + "from": { + "activity_id": "1438172520221545830", + "participant_id": "1438172520221545830" + }, + "name": "operator()(auto &&) const", + "return_type": "auto", + "scope": "normal", + "source_location": { + "column": 11, + "file": "t20048.cc", + "line": 26, + "translation_unit": "t20048.cc" + }, + "to": { + "activity_id": "1272214062049882942", + "participant_id": "794500632550538124" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1272214062049882942", + "participant_id": "794500632550538124" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 33, + "file": "t20048.cc", + "line": 26, + "translation_unit": "t20048.cc" + }, + "to": { + "activity_id": "986710377344543262", + "participant_id": "986710377344543262" + }, + "type": "message" + }, + { + "comment": "a6() adds `1` to its argument", + "from": { + "activity_id": "1438172520221545830", + "participant_id": "1438172520221545830" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 9, + "file": "t20048.cc", + "line": 31, + "translation_unit": "t20048.cc" + }, + "to": { + "activity_id": "372194568810958399", + "participant_id": "372194568810958399" + }, + "type": "message" + }, + { + "comment": "a5() adds `1` to the result of a6()", + "from": { + "activity_id": "1438172520221545830", + "participant_id": "1438172520221545830" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 11, + "file": "t20048.cc", + "line": 29, + "translation_unit": "t20048.cc" + }, + "to": { + "activity_id": "473170110460301705", + "participant_id": "473170110460301705" + }, + "type": "message" + }, + { + "comment": "a7() is called via add std::async", + "from": { + "activity_id": "1438172520221545830", + "participant_id": "1438172520221545830" + }, + "name": "", + "return_type": "int", + "scope": "normal", + "source_location": { + "column": 11, + "file": "t20048.cc", + "line": 35, + "translation_unit": "t20048.cc" + }, + "to": { + "activity_id": "156504678810211848", + "participant_id": "156504678810211848" + }, + "type": "message" + } + ], + "start_from": { + "id": 1438172520221545830, + "location": "clanguml::t20048::tmain()" + } + } + ], + "using_namespace": "clanguml::t20048" +} +``` diff --git a/docs/test_cases/t20048_sequence.svg b/docs/test_cases/t20048_sequence.svg new file mode 100644 index 00000000..4a85e0be --- /dev/null +++ b/docs/test_cases/t20048_sequence.svg @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + a3(int) + + a3(int) + + + + a2(int) + + a2(int) + + + + a1(int) + + a1(int) + + + + tmain()::(lambda t20048.cc:26:11) + + tmain()::(lambda t20048.cc:26:11) + + + + a4(int) + + a4(int) + + + + a6(int) + + a6(int) + + + + a5(int) + + a5(int) + + + + a7(int) + + a7(int) + + + + + + + + + + + + + + + + + + + + + + + + + a1() adds `1` to the result + of a2() + + + + + + + + + This lambda calls a4() which + adds `4` to it's argument + + + + operator()(auto &&) const + + + + + + + + + + + + a6() adds `1` to its argument + + + + + + + + + a5() adds `1` to the result + of a6() + + + + + + + + + a7() is called via add std::async + + + + + + + + diff --git a/docs/test_cases/t20048_sequence_mermaid.svg b/docs/test_cases/t20048_sequence_mermaid.svg new file mode 100644 index 00000000..2e3a1a07 --- /dev/null +++ b/docs/test_cases/t20048_sequence_mermaid.svg @@ -0,0 +1,273 @@ + + + + + a7(int) + + + + + + a5(int) + + + + + + a6(int) + + + + + + a4(int) + + + + + + tmain()::(lambda t20048.cc:26:11) + + + + + + a1(int) + + + + + + a2(int) + + + + + + a3(int) + + + + + + tmain() + + + + + + + + a7(int) + + + + + + + + + a5(int) + + + + + + + + + a6(int) + + + + + + + + + a4(int) + + + + + + + + + tmain()::(lambda t20048.cc:26:11) + + + + + + + + + a1(int) + + + + + + + + + a2(int) + + + + + + + + + a3(int) + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a1() adds `1` to the result + + + of a2() + + + + + + + + + This lambda calls a4() which + + + adds `4` to it's argument + + + + + + + + + + + + a6() adds `1` to its argument + + + + + + + + + a5() adds `1` to the result + + + of a6() + + + + + + + + + a7() is called via add std::async + + + + + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + operator()(auto &&) const + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20049.md b/docs/test_cases/t20049.md new file mode 100644 index 00000000..0064a468 --- /dev/null +++ b/docs/test_cases/t20049.md @@ -0,0 +1,236 @@ +# t20049 - Test case for CUDA kernel calls +## Config +```yaml +diagrams: + t20049_sequence: + type: sequence + glob: + - t20049.cu + include: + namespaces: + - clanguml::t20049 + using_namespace: clanguml::t20049 + from: + - function: "clanguml::t20049::tmain()" + +``` +## Source code +File `tests/t20049/t20049.cuh` +```cpp +namespace clanguml { +namespace t20049 { + +template __device__ T add(T a, T b) { return a + b; } + +__device__ float square(float a); + +__global__ void vector_square_add(float *out, float *a, float *b, int n); + +} +} +``` +File `tests/t20049/t20049.cu` +```cpp +#include "t20049.cuh" + +namespace clanguml { +namespace t20049 { + +constexpr unsigned long N{1000}; + +__device__ float square(float a) { return a * a; } + +__global__ void vector_square_add(float *out, float *a, float *b, int n) +{ + for (int i = 0; i < n; i++) { + out[i] = add(square(a[i]), square(b[i])); + } +} + +int tmain() +{ + float *a, *b, *out; + + a = (float *)malloc(sizeof(float) * N); + b = (float *)malloc(sizeof(float) * N); + out = (float *)malloc(sizeof(float) * N); + + for (int i = 0; i < N; i++) { + a[i] = 1.0f; + b[i] = 2.0f; + } + + vector_square_add<<<1, 1>>>(out, a, b, N); + + return 0; +} + +} +} +``` +## Generated PlantUML diagrams +![t20049_sequence](./t20049_sequence.svg "Test case for CUDA kernel calls") +## Generated Mermaid diagrams +![t20049_sequence](./t20049_sequence_mermaid.svg "Test case for CUDA kernel calls") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20049_sequence", + "participants": [ + { + "display_name": "tmain()", + "id": "1498198764898287853", + "name": "tmain", + "namespace": "clanguml::t20049", + "source_location": { + "column": 5, + "file": "t20049.cu", + "line": 17, + "translation_unit": "t20049.cu" + }, + "type": "function" + }, + { + "display_name": "vector_square_add(float *,float *,float *,int)", + "id": "1998596618150288680", + "is_cuda_kernel": true, + "name": "vector_square_add", + "namespace": "clanguml::t20049", + "source_location": { + "column": 17, + "file": "t20049.cu", + "line": 10, + "translation_unit": "t20049.cu" + }, + "type": "function" + }, + { + "display_name": "square(float)", + "id": "817124001270348685", + "is_cuda_device": true, + "name": "square", + "namespace": "clanguml::t20049", + "source_location": { + "column": 18, + "file": "t20049.cu", + "line": 8, + "translation_unit": "t20049.cu" + }, + "type": "function" + }, + { + "display_name": "add(float,float)", + "id": "1897367040611447556", + "is_cuda_device": true, + "name": "add", + "namespace": "clanguml::t20049", + "source_location": { + "column": 36, + "file": "t20049.cuh", + "line": 4, + "translation_unit": "t20049.cu" + }, + "type": "function_template" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1498198764898287853", + "participant_id": "1498198764898287853" + }, + "name": "", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 5, + "file": "t20049.cu", + "line": 30, + "translation_unit": "t20049.cu" + }, + "to": { + "activity_id": "1998596618150288680", + "participant_id": "1998596618150288680" + }, + "type": "message" + }, + { + "activity_id": "1998596618150288680", + "messages": [ + { + "from": { + "activity_id": "1998596618150288680", + "participant_id": "1998596618150288680" + }, + "name": "", + "return_type": "float", + "scope": "normal", + "source_location": { + "column": 22, + "file": "t20049.cu", + "line": 13, + "translation_unit": "t20049.cu" + }, + "to": { + "activity_id": "817124001270348685", + "participant_id": "817124001270348685" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1998596618150288680", + "participant_id": "1998596618150288680" + }, + "name": "", + "return_type": "float", + "scope": "normal", + "source_location": { + "column": 36, + "file": "t20049.cu", + "line": 13, + "translation_unit": "t20049.cu" + }, + "to": { + "activity_id": "817124001270348685", + "participant_id": "817124001270348685" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1998596618150288680", + "participant_id": "1998596618150288680" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "column": 18, + "file": "t20049.cu", + "line": 13, + "translation_unit": "t20049.cu" + }, + "to": { + "activity_id": "1897367040611447556", + "participant_id": "1897367040611447556" + }, + "type": "message" + } + ], + "name": "for", + "type": "loop" + } + ], + "start_from": { + "id": 1498198764898287853, + "location": "clanguml::t20049::tmain()" + } + } + ], + "using_namespace": "clanguml::t20049" +} +``` diff --git a/docs/test_cases/t20049_sequence.svg b/docs/test_cases/t20049_sequence.svg new file mode 100644 index 00000000..72e93d79 --- /dev/null +++ b/docs/test_cases/t20049_sequence.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + «CUDA Kernel» + vector_square_add(float *,float *,float *,int) + + «CUDA Kernel» + vector_square_add(float *,float *,float *,int) + + + + «CUDA Device» + square(float) + + «CUDA Device» + square(float) + + + + «CUDA Device» + add<float>(float,float) + + «CUDA Device» + add<float>(float,float) + + + + + + + + + + + + + loop + + + + + + + + + + + + + + + + + + + + diff --git a/docs/test_cases/t20049_sequence_mermaid.svg b/docs/test_cases/t20049_sequence_mermaid.svg new file mode 100644 index 00000000..c6ef9e82 --- /dev/null +++ b/docs/test_cases/t20049_sequence_mermaid.svg @@ -0,0 +1,158 @@ + + + + + << CUDA Device >> + + + add<float>(float,float) + + + + + + << CUDA Device >> + + + square(float) + + + + + + << CUDA Kernel >> + + + vector_square_add(float *,float *,float *,int) + + + + + + tmain() + + + + + + + + << CUDA Device >> + + + add<float>(float,float) + + + + + + + + + << CUDA Device >> + + + square(float) + + + + + + + + + << CUDA Kernel >> + + + vector_square_add(float *,float *,float *,int) + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + loop + + ​ + + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20050.md b/docs/test_cases/t20050.md new file mode 100644 index 00000000..e53b500f --- /dev/null +++ b/docs/test_cases/t20050.md @@ -0,0 +1,246 @@ +# t20050 - Test case for CUDA kernel calls with participants combined to file +## Config +```yaml +diagrams: + t20050_sequence: + type: sequence + glob: + - t20050.cu + include: + namespaces: + - clanguml::t20050 + using_namespace: clanguml::t20050 + combine_free_functions_into_file_participants: true + from: + - function: "clanguml::t20050::tmain()" +``` +## Source code +File `tests/t20050/t20050.cuh` +```cpp +namespace clanguml { +namespace t20050 { + +__device__ float square(float a); + +__global__ void vector_square_add(float *out, float *a, float *b, int n); + +} +} +``` +File `tests/t20050/t20050.cu` +```cpp +#include "t20050.cuh" + +namespace clanguml { +namespace t20050 { + +constexpr unsigned long N{1000}; + +template __device__ T add(T a, T b) { return a + b; } + +__device__ float square(float a) { return a * a; } + +__global__ void vector_square_add(float *out, float *a, float *b, int n) +{ + for (int i = 0; i < n; i++) { + out[i] = add(square(a[i]), square(b[i])); + } +} + +int tmain() +{ + float *a, *b, *out; + + a = (float *)malloc(sizeof(float) * N); + b = (float *)malloc(sizeof(float) * N); + out = (float *)malloc(sizeof(float) * N); + + for (int i = 0; i < N; i++) { + a[i] = 1.0f; + b[i] = 2.0f; + } + + vector_square_add<<<1, 1>>>(out, a, b, N); + + return 0; +} + +} +} +``` +## Generated PlantUML diagrams +![t20050_sequence](./t20050_sequence.svg "Test case for CUDA kernel calls with participants combined to file") +## Generated Mermaid diagrams +![t20050_sequence](./t20050_sequence_mermaid.svg "Test case for CUDA kernel calls with participants combined to file") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20050_sequence", + "participants": [ + { + "activities": [ + { + "display_name": "tmain()", + "id": "1047834785038011964", + "name": "tmain", + "namespace": "clanguml::t20050", + "source_location": { + "column": 5, + "file": "t20050.cu", + "line": 19, + "translation_unit": "t20050.cu" + }, + "type": "function" + }, + { + "display_name": "vector_square_add(float *,float *,float *,int)", + "id": "100545266160871109", + "is_cuda_kernel": true, + "name": "vector_square_add", + "namespace": "clanguml::t20050", + "source_location": { + "column": 17, + "file": "t20050.cu", + "line": 12, + "translation_unit": "t20050.cu" + }, + "type": "function" + }, + { + "display_name": "square(float)", + "id": "193263048716247783", + "is_cuda_device": true, + "name": "square", + "namespace": "clanguml::t20050", + "source_location": { + "column": 18, + "file": "t20050.cu", + "line": 10, + "translation_unit": "t20050.cu" + }, + "type": "function" + }, + { + "display_name": "add(float,float)", + "id": "60344909513106774", + "is_cuda_device": true, + "name": "add", + "namespace": "clanguml::t20050", + "source_location": { + "column": 36, + "file": "t20050.cu", + "line": 8, + "translation_unit": "t20050.cu" + }, + "type": "function_template" + } + ], + "display_name": "t20050.cu", + "id": "551473340136355806", + "name": "t20050.cu", + "namespace": "clanguml::t20050", + "type": "file" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1047834785038011964", + "participant_id": "551473340136355806" + }, + "name": "vector_square_add(float *,float *,float *,int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 5, + "file": "t20050.cu", + "line": 32, + "translation_unit": "t20050.cu" + }, + "to": { + "activity_id": "100545266160871109", + "participant_id": "551473340136355806" + }, + "type": "message" + }, + { + "activity_id": "100545266160871109", + "messages": [ + { + "from": { + "activity_id": "100545266160871109", + "participant_id": "551473340136355806" + }, + "name": "square(float)", + "return_type": "float", + "scope": "normal", + "source_location": { + "column": 22, + "file": "t20050.cu", + "line": 15, + "translation_unit": "t20050.cu" + }, + "to": { + "activity_id": "193263048716247783", + "participant_id": "551473340136355806" + }, + "type": "message" + }, + { + "from": { + "activity_id": "100545266160871109", + "participant_id": "551473340136355806" + }, + "name": "square(float)", + "return_type": "float", + "scope": "normal", + "source_location": { + "column": 36, + "file": "t20050.cu", + "line": 15, + "translation_unit": "t20050.cu" + }, + "to": { + "activity_id": "193263048716247783", + "participant_id": "551473340136355806" + }, + "type": "message" + }, + { + "from": { + "activity_id": "100545266160871109", + "participant_id": "551473340136355806" + }, + "name": "add(float,float)", + "return_type": "", + "scope": "normal", + "source_location": { + "column": 18, + "file": "t20050.cu", + "line": 15, + "translation_unit": "t20050.cu" + }, + "to": { + "activity_id": "60344909513106774", + "participant_id": "551473340136355806" + }, + "type": "message" + } + ], + "name": "for", + "type": "loop" + } + ], + "return_type": "int", + "start_from": { + "id": 1047834785038011964, + "location": "clanguml::t20050::tmain()" + } + } + ], + "using_namespace": "clanguml::t20050" +} +``` diff --git a/docs/test_cases/t20050_sequence.svg b/docs/test_cases/t20050_sequence.svg new file mode 100644 index 00000000..a363fa8f --- /dev/null +++ b/docs/test_cases/t20050_sequence.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + t20050.cu + + t20050.cu + + + + + + + + tmain() + + + + + + << CUDA Kernel >> + vector_square_add(float *,float *,float *,int) + + + + loop + + + + + + << CUDA Device >> + square(float) + + + + + + + + + + + << CUDA Device >> + square(float) + + + + + + + + + + + << CUDA Device >> + add<float>(float,float) + + + + + + + + + diff --git a/docs/test_cases/t20050_sequence_mermaid.svg b/docs/test_cases/t20050_sequence_mermaid.svg new file mode 100644 index 00000000..a2f52c32 --- /dev/null +++ b/docs/test_cases/t20050_sequence_mermaid.svg @@ -0,0 +1,118 @@ + + + + + * + + + + + + t20050.cu + + + + + + + + * + + + + + + + + + t20050.cu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + loop + + ​ + + + tmain() + + << CUDA Kernel >> + vector_square_add(float *,float *,float *,int) + + << CUDA Device >> + square(float) + + ​ + + << CUDA Device >> + square(float) + + ​ + + << CUDA Device >> + add<float>(float,float) + + ​ + + ​ + + diff --git a/docs/test_cases/t20051.md b/docs/test_cases/t20051.md new file mode 100644 index 00000000..fab32475 --- /dev/null +++ b/docs/test_cases/t20051.md @@ -0,0 +1,143 @@ +# t20051 - Test case for CUDA calls callee_type filter +## Config +```yaml +diagrams: + t20051_sequence: + type: sequence + glob: + - t20051.cu + include: + namespaces: + - clanguml::t20051 + exclude: + callee_types: + - cuda_device + using_namespace: clanguml::t20051 + from: + - function: "clanguml::t20051::tmain()" +``` +## Source code +File `tests/t20051/t20051.cu` +```cpp +#include "t20051.cuh" + +namespace clanguml { +namespace t20051 { + +constexpr unsigned long N{1000}; + +template __device__ T add(T a, T b) { return a + b; } + +__device__ float square(float a) { return a * a; } + +__global__ void vector_square_add(float *out, float *a, float *b, int n) +{ + for (int i = 0; i < n; i++) { + out[i] = add(square(a[i]), square(b[i])); + } +} + +int tmain() +{ + float *a, *b, *out; + + a = (float *)malloc(sizeof(float) * N); + b = (float *)malloc(sizeof(float) * N); + out = (float *)malloc(sizeof(float) * N); + + for (int i = 0; i < N; i++) { + a[i] = 1.0f; + b[i] = 2.0f; + } + + vector_square_add<<<1, 1>>>(out, a, b, N); + + return 0; +} + +} +} +``` +File `tests/t20051/t20051.cuh` +```cpp +namespace clanguml { +namespace t20051 { + +__device__ float square(float a); + +__global__ void vector_square_add(float *out, float *a, float *b, int n); + +} +} +``` +## Generated PlantUML diagrams +![t20051_sequence](./t20051_sequence.svg "Test case for CUDA calls callee_type filter") +## Generated Mermaid diagrams +![t20051_sequence](./t20051_sequence_mermaid.svg "Test case for CUDA calls callee_type filter") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20051_sequence", + "participants": [ + { + "display_name": "tmain()", + "id": "33004218577871304", + "name": "tmain", + "namespace": "clanguml::t20051", + "source_location": { + "column": 5, + "file": "t20051.cu", + "line": 19, + "translation_unit": "t20051.cu" + }, + "type": "function" + }, + { + "display_name": "vector_square_add(float *,float *,float *,int)", + "id": "1972238512532321229", + "is_cuda_kernel": true, + "name": "vector_square_add", + "namespace": "clanguml::t20051", + "source_location": { + "column": 17, + "file": "t20051.cu", + "line": 12, + "translation_unit": "t20051.cu" + }, + "type": "function" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "33004218577871304", + "participant_id": "33004218577871304" + }, + "name": "", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 5, + "file": "t20051.cu", + "line": 32, + "translation_unit": "t20051.cu" + }, + "to": { + "activity_id": "1972238512532321229", + "participant_id": "1972238512532321229" + }, + "type": "message" + } + ], + "start_from": { + "id": 33004218577871304, + "location": "clanguml::t20051::tmain()" + } + } + ], + "using_namespace": "clanguml::t20051" +} +``` diff --git a/docs/test_cases/t20051_sequence.svg b/docs/test_cases/t20051_sequence.svg new file mode 100644 index 00000000..544c7a04 --- /dev/null +++ b/docs/test_cases/t20051_sequence.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + tmain() + + tmain() + + + + «CUDA Kernel» + vector_square_add(float *,float *,float *,int) + + «CUDA Kernel» + vector_square_add(float *,float *,float *,int) + + + + + + + + + diff --git a/docs/test_cases/t20051_sequence_mermaid.svg b/docs/test_cases/t20051_sequence_mermaid.svg new file mode 100644 index 00000000..05a805b3 --- /dev/null +++ b/docs/test_cases/t20051_sequence_mermaid.svg @@ -0,0 +1,84 @@ + + + + + << CUDA Kernel >> + + + vector_square_add(float *,float *,float *,int) + + + + + + tmain() + + + + + + + + << CUDA Kernel >> + + + vector_square_add(float *,float *,float *,int) + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ​ + + diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 0d215c7f..d8a980e8 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -10,63 +10,63 @@ Basic package diagram example - - + + 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 42e29e0a..b4b5b3b0 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + A18 - - + + BBB diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index 870b0e1f..838f1950 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 7fb0ed2b..75456f8b 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 73947e17..a72aac7b 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 2554545d..07015c09 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 918b7f09..9175fca4 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 dacda4a0..23f4a5c2 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/t30009_package.svg b/docs/test_cases/t30009_package.svg index a24c4f1c..3feec82e 100644 --- a/docs/test_cases/t30009_package.svg +++ b/docs/test_cases/t30009_package.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + One - - + + Two - - + + B - - + + D - - + + A - - + + C - - + + A - - + + B - - + + C - - + + D diff --git a/docs/test_cases/t30010_package.svg b/docs/test_cases/t30010_package.svg index 55a88e19..10a4cce7 100644 --- a/docs/test_cases/t30010_package.svg +++ b/docs/test_cases/t30010_package.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - + libraries - - + + lib1 - - + + lib2 - - + + lib3 - - + + lib4 - - + + app diff --git a/docs/test_cases/t30011_package.svg b/docs/test_cases/t30011_package.svg index c39bda2a..4291dc8f 100644 --- a/docs/test_cases/t30011_package.svg +++ b/docs/test_cases/t30011_package.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - + libraries - - + + lib1 - - + + lib2 - - + + lib3 - - + + lib4 - - + + app diff --git a/docs/test_cases/t30012_package.svg b/docs/test_cases/t30012_package.svg index 02d17eb5..ad256d1f 100644 --- a/docs/test_cases/t30012_package.svg +++ b/docs/test_cases/t30012_package.svg @@ -1,6 +1,6 @@ - + @@ -9,26 +9,26 @@ - + app - - + + lib1 - - + + mod1 - - + + mod2 - - + + lib2 diff --git a/docs/test_cases/t30013_package.svg b/docs/test_cases/t30013_package.svg index 6762bcb4..911ede94 100644 --- a/docs/test_cases/t30013_package.svg +++ b/docs/test_cases/t30013_package.svg @@ -1,6 +1,6 @@ - + @@ -9,98 +9,98 @@ - - + + mod1 - - + + mod2 - - + + mod3 - - + + mod4 - - + + mod5 - - + + mod6 - - + + mod7 - - + + mod8 - - + + mod9 - - + + mod10 - - + + mod11 - - + + mod12 - - + + mod13 - - + + mod14 - - + + mod15 - - + + mod16 - - + + mod17 - - + + mod18 - - + + app diff --git a/docs/test_cases/t30014_package.svg b/docs/test_cases/t30014_package.svg index a0f74be5..16d1fa34 100644 --- a/docs/test_cases/t30014_package.svg +++ b/docs/test_cases/t30014_package.svg @@ -1,6 +1,6 @@ - + @@ -9,21 +9,21 @@ - + app - - + + :lib1 - - + + mod1 - - + + :lib2 diff --git a/docs/test_cases/t30015_package.svg b/docs/test_cases/t30015_package.svg index 04c919ef..9d43f912 100644 --- a/docs/test_cases/t30015_package.svg +++ b/docs/test_cases/t30015_package.svg @@ -1,6 +1,6 @@ - + @@ -9,101 +9,101 @@ - + lib1 - - + + :mod1 - - + + :mod2 - - + + :mod3 - - + + :mod4 - - + + :mod5 - - + + :mod6 - - + + :mod7 - - + + :mod8 - - + + :mod9 - - + + :mod10 - - + + :mod11 - - + + :mod12 - - + + :mod13 - - + + :mod14 - - + + :mod15 - - + + :mod16 - - + + :mod17 - - + + :mod18 - - + + app diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index 5dd7b52e..e0fa34aa 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -10,41 +10,41 @@ Basic include diagram example - + 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/t40001_include_mermaid.svg b/docs/test_cases/t40001_include_mermaid.svg index 86a3bae3..76f4aa75 100644 --- a/docs/test_cases/t40001_include_mermaid.svg +++ b/docs/test_cases/t40001_include_mermaid.svg @@ -138,7 +138,7 @@ - + @@ -151,7 +151,7 @@ - + @@ -164,7 +164,7 @@ - + diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 58e2a3a3..241ec046 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/t40002_include_mermaid.svg b/docs/test_cases/t40002_include_mermaid.svg index 92fc5a8f..5a95a8d0 100644 --- a/docs/test_cases/t40002_include_mermaid.svg +++ b/docs/test_cases/t40002_include_mermaid.svg @@ -137,7 +137,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -163,7 +163,7 @@ - + @@ -176,7 +176,7 @@ - + @@ -189,7 +189,7 @@ - + diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index c7da6c7b..aeb77ed6 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,62 +9,62 @@ - + src - + dependants - + dependencies - + include - + dependants - + dependencies - - + + t1.cc - - + + t2.cc - - + + t3.h - - + + t2.h - + t1.h - - + + t3.h - - + + t2.h - + t1.h - - + + t5.h diff --git a/docs/test_cases/t40003_include_mermaid.svg b/docs/test_cases/t40003_include_mermaid.svg index 7e7c556a..ddfc4051 100644 --- a/docs/test_cases/t40003_include_mermaid.svg +++ b/docs/test_cases/t40003_include_mermaid.svg @@ -167,7 +167,7 @@ - + @@ -180,7 +180,7 @@ - + @@ -193,7 +193,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -219,7 +219,7 @@ - + @@ -232,7 +232,7 @@ - + @@ -245,7 +245,7 @@ - + @@ -258,7 +258,7 @@ - + @@ -271,7 +271,7 @@ - + diff --git a/tests/t20049/t20049.cuh b/tests/t20049/t20049.cuh index d006e517..6062e401 100644 --- a/tests/t20049/t20049.cuh +++ b/tests/t20049/t20049.cuh @@ -5,7 +5,7 @@ template __device__ T add(T a, T b) { return a + b; } __device__ float square(float a); -__global__ void vector_add(float *out, float *a, float *b, int n); +__global__ void vector_square_add(float *out, float *a, float *b, int n); } } \ No newline at end of file diff --git a/tests/t20050/t20050.cuh b/tests/t20050/t20050.cuh index cafe8ca4..f429e918 100644 --- a/tests/t20050/t20050.cuh +++ b/tests/t20050/t20050.cuh @@ -3,7 +3,7 @@ namespace t20050 { __device__ float square(float a); -__global__ void vector_add(float *out, float *a, float *b, int n); +__global__ void vector_square_add(float *out, float *a, float *b, int n); } } \ No newline at end of file diff --git a/tests/t20051/t20051.cuh b/tests/t20051/t20051.cuh index cdf0460e..2b39cd61 100644 --- a/tests/t20051/t20051.cuh +++ b/tests/t20051/t20051.cuh @@ -3,7 +3,7 @@ namespace t20051 { __device__ float square(float a); -__global__ void vector_add(float *out, float *a, float *b, int n); +__global__ void vector_square_add(float *out, float *a, float *b, int n); } } \ No newline at end of file diff --git a/tests/test_cases.yaml b/tests/test_cases.yaml index f2deb8ad..8e174172 100644 --- a/tests/test_cases.yaml +++ b/tests/test_cases.yaml @@ -373,6 +373,9 @@ test_cases: - name: t20050 title: Test case for CUDA kernel calls with participants combined to file description: + - name: t20051 + title: Test case for CUDA calls callee_type filter + description: Package diagrams: - name: t30001 title: Basic package diagram test case From 1a3d1c19cfff0a93db6028192a44aec461eb66f6 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 1 May 2024 21:27:33 +0200 Subject: [PATCH 11/11] Fixed cmake CUDA target defines --- CMakeLists.txt | 3 --- tests/CMakeLists.txt | 5 +++-- tests/test_cases.cc | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6941ccbe..17124374 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,9 +162,6 @@ option(ENABLE_CUDA_TEST_CASES "" OFF) if(ENABLE_CUDA_TEST_CASES) include(CheckLanguage) check_language(CUDA) - if(DEFINED CMAKE_CUDA_COMPILER) - set(ENABLE_CUDA_TEST_CASES ON) - endif(DEFINED CMAKE_CUDA_COMPILER) endif(ENABLE_CUDA_TEST_CASES) if(BUILD_TESTS) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f2c94d8e..3ce15f5f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -32,7 +32,7 @@ else() endif(ENABLE_CXX_MODULES_TEST_CASES) if(NOT ENABLE_CUDA_TEST_CASES) - message(STATUS "Enabling CUDA test cases") + message(STATUS "Disabling CUDA test cases") foreach(CUDA_TC ${TEST_CASES_REQUIRING_CUDA}) list(FILTER TEST_CASE_SOURCES EXCLUDE @@ -112,7 +112,8 @@ foreach(TEST_NAME ${TEST_NAMES}) $) target_compile_definitions(${TEST_NAME} PRIVATE $<$:ENABLE_CXX_STD_20_TEST_CASES> - $<$:ENABLE_CXX_MODULES_TEST_CASES>) + $<$:ENABLE_CXX_MODULES_TEST_CASES> + $<$:ENABLE_CUDA_TEST_CASES>) target_compile_options(${TEST_NAME} PRIVATE $<$: $<$,$>: diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 080737f3..5797bf67 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -475,9 +475,11 @@ using namespace clanguml::test::matchers; #include "t20046/test_case.h" #include "t20047/test_case.h" #include "t20048/test_case.h" +#if defined(ENABLE_CUDA_TEST_CASES) #include "t20049/test_case.h" #include "t20050/test_case.h" #include "t20051/test_case.h" +#endif /// /// Package diagram tests