Initial support for concept dependency relationships in class diagrams

This commit is contained in:
Bartek Kryza
2023-02-25 01:50:07 +01:00
parent 20a0f2d338
commit 274a698713
15 changed files with 750 additions and 34 deletions

View File

@@ -138,6 +138,8 @@ std::string template_parameter::to_string(
{
using clanguml::common::model::namespace_;
assert(!(!type().empty() && concept_constraint().has_value()));
std::string res;
if (!type().empty()) {
if (!relative)
@@ -146,8 +148,17 @@ std::string template_parameter::to_string(
res += namespace_{type()}.relative_to(using_namespace).to_string();
}
if (concept_constraint()) {
if (!relative)
res += namespace_{concept_constraint().value()}.to_string();
else
res += namespace_{concept_constraint().value()}
.relative_to(using_namespace)
.to_string();
}
if (!name().empty()) {
if (!type().empty())
if (!type().empty() || concept_constraint())
res += " ";
if (!relative)
res += namespace_{name()}.to_string();
@@ -216,4 +227,14 @@ bool template_parameter::find_nested_relationships(
return added_aggregation_relationship;
}
void template_parameter::set_concept_constraint(std::string constraint)
{
concept_constraint_ = std::move(constraint);
}
const std::optional<std::string> &template_parameter::concept_constraint() const
{
return concept_constraint_;
}
} // namespace clanguml::common::model