Added callee_filter for including/excluding messages based on receiver type (#152)

This commit is contained in:
Bartek Kryza
2023-07-01 21:19:51 +02:00
parent 213483dd3b
commit e50a7b1846
24 changed files with 590 additions and 43 deletions

View File

@@ -24,6 +24,7 @@ using clanguml::common::namespace_or_regex;
using clanguml::common::string_or_regex;
using clanguml::common::model::access_t;
using clanguml::common::model::relationship_t;
using clanguml::config::callee_type;
using clanguml::config::class_diagram;
using clanguml::config::config;
using clanguml::config::diagram_template;
@@ -252,6 +253,38 @@ template <> struct convert<method_type> {
}
};
//
// config callee_type decoder
//
template <> struct convert<callee_type> {
static bool decode(const Node &node, callee_type &rhs)
{
const auto &val = node.as<std::string>();
if (val == to_string(callee_type::constructor))
rhs = callee_type::constructor;
else if (val == to_string(callee_type::assignment))
rhs = callee_type::assignment;
else if (val == to_string(callee_type::operator_))
rhs = callee_type::operator_;
else if (val == to_string(callee_type::defaulted))
rhs = callee_type::defaulted;
else if (val == to_string(callee_type::static_))
rhs = callee_type::static_;
else if (val == to_string(callee_type::function))
rhs = callee_type::function;
else if (val == to_string(callee_type::function_template))
rhs = callee_type::function_template;
else if (val == to_string(callee_type::method))
rhs = callee_type::method;
else if (val == to_string(callee_type::lambda))
rhs = callee_type::lambda;
else
return false;
return true;
}
};
//
// config relationship_t decoder
//
@@ -432,6 +465,10 @@ template <> struct convert<filter> {
if (node["paths"])
rhs.paths = node["paths"].as<decltype(rhs.paths)>();
if (node["callee_types"])
rhs.callee_types =
node["callee_types"].as<decltype(rhs.callee_types)>();
return true;
}
};