58 const std::string &full_name)
const
61 find<class_>(full_name);
66 res = find<enum_>(full_name);
71 res = find<concept_>(full_name);
81 res = find<class_>(
id);
86 res = find<enum_>(
id);
91 res = find<concept_>(
id);
97bool diagram::add_with_namespace_path<common::model::package>(
98 std::unique_ptr<common::model::package> &&p)
100 LOG_DBG(
"Adding namespace package: {}, {}", p->name(), p->full_name(
true));
102 auto ns = p->get_relative_namespace();
104 return add_element(ns, std::move(p));
108bool diagram::add_with_filesystem_path<common::model::package>(
110 std::unique_ptr<common::model::package> &&p)
112 LOG_DBG(
"Adding filesystem package: {}, {}", p->name(), p->full_name(
true));
114 auto ns = p->get_relative_namespace();
116 return add_element(ns, std::move(p));
120bool diagram::add_with_module_path<common::model::package>(
122 std::unique_ptr<common::model::package> &&p)
124 LOG_DBG(
"Adding module package: {}, {}", p->name(), p->full_name(
true));
126 auto ns = p->get_relative_namespace();
128 return add_element(ns, std::move(p));
134 bool found_new{
false};
135 for (
const auto &parent : parents) {
136 for (
const auto &pp : parent.get().parents()) {
137 auto p = find<class_>(pp.id());
140 auto [it, found] = parents.emplace(std::ref(p.value()));
145 LOG_WARN(
"Couldn't find class representing base class: {} [{}]",
159 [
id](
const auto &c) {
return c.get().
id() ==
id; });
165 [
id](
const auto &c) {
return c.get().
id() ==
id; });
171 [
id](
const auto &c) {
return c.get().
id() ==
id; });
176 LOG_DBG(
"Looking for alias for {}",
id);
178 for (
const auto &c :
classes()) {
179 if (c.get().id() == id) {
180 return c.get().alias();
184 for (
const auto &e :
enums()) {
185 if (e.get().id() == id)
186 return e.get().alias();
190 if (c.get().id() == id)
191 return c.get().alias();
200 ctx[
"name"] =
name();
201 ctx[
"type"] =
"class";
206 for (
const auto &c :
classes()) {
207 elements.emplace_back(c.get().context());
211 for (
const auto &e :
enums()) {
212 elements.emplace_back(e.get().context());
217 elements.emplace_back(c.get().context());
232 std::set<eid_t> dependency_relationships_to_remove;
234 for (
auto &r : c.get().relationships()) {
235 if (r.type() != relationship_t::kDependency)
236 dependency_relationships_to_remove.emplace(r.destination());
239 for (
const auto &base : c.get().parents()) {
240 dependency_relationships_to_remove.emplace(base.id());
244 [&dependency_relationships_to_remove, &c](
const auto &r) {
245 if (r.type() != relationship_t::kDependency)
248 auto has_another_relationship_to_destination =
249 dependency_relationships_to_remove.count(r.destination()) >
251 auto is_self_dependency = r.destination() == c.get().id();
253 return has_another_relationship_to_destination ||
262 std::set<eid_t> to_remove;
266 to_remove.emplace(c.get().id());
270 to_remove.emplace(e.get().id());
274 to_remove.emplace(c.get().id());
283 c.get().apply_filter(
filter(), to_remove);
286 e.get().apply_filter(
filter(), to_remove);
289 c.get().apply_filter(
filter(), to_remove);
301bool check_diagram_type<clanguml::class_diagram::model::diagram>(
diagram_t t)
303 return t == diagram_t::kClass;