73 opt_ref<diagram_element>
get(
const std::string &full_name)
const override;
81 opt_ref<diagram_element>
get(
eid_t id)
const override;
93 template <
typename ElementT>
94 opt_ref<ElementT>
find(
const std::string &
name)
const;
106 template <
typename ElementT> opt_ref<ElementT>
find(
eid_t id)
const;
118 template <
typename ElementT>
119 std::vector<opt_ref<ElementT>>
find(
134 template <
typename ElementT>
135 bool add(
const path &parent_path, std::unique_ptr<ElementT> &&e)
161 inja::json
context()
const override;
180 template <
typename ElementT>
191 template <
typename ElementT>
202 template <
typename ElementT>
207template <
typename ElementT>
210 for (
const auto &element : element_view<ElementT>::view()) {
211 const auto full_name = element.get().full_name(
false);
213 if (full_name ==
name) {
223 for (
const auto &element : element_view<ElementT>::view()) {
224 if (element.get().id() == id) {
232template <
typename ElementT>
236 std::vector<opt_ref<ElementT>> result;
238 for (
const auto &element : element_view<ElementT>::view()) {
239 const auto full_name = element.get().full_name(
false);
241 if (pattern == full_name) {
242 result.emplace_back(element);
249template <
typename ElementT>
253 "Adding package: {}, {}, [{}]", p->name(), p->full_name(
true), p->id());
255 auto ns = p->get_relative_namespace();
256 auto p_ref = std::ref(*p);
260 element_view<ElementT>::add(p_ref);
265template <
typename ElementT>
269 LOG_DBG(
"Adding package: {}, {}, {}, [{}]", p->name(), p->full_name(
false),
274 auto module_relative_to =
path{p->using_namespace()};
276 for (
auto it = parent_path.
begin(); it != parent_path.
end(); it++) {
277 auto pkg = std::make_unique<common::model::package>(
284 auto module_absolute_path = module_relative_to | module_relative_part;
285 pkg->set_module(module_absolute_path.to_string());
286 pkg->set_namespace(module_absolute_path);
288 auto package_absolute_path = module_absolute_path | pkg->name();
290 pkg->set_id(
common::to_id(package_absolute_path.to_string()));
292 auto p_ref = std::ref(*pkg);
294 auto res =
add_element(module_relative_part, std::move(pkg));
296 element_view<ElementT>::add(p_ref);
299 auto p_ref = std::ref(*p);
303 element_view<ElementT>::add(p_ref);
308template <
typename ElementT>
312 LOG_DBG(
"Adding package: {}, {}", p->name(), p->full_name(
true));
316 for (
auto it = parent_path.
begin(); it != parent_path.
end(); it++) {
318 std::make_unique<common::model::package>(p->using_namespace());
321 pkg->set_namespace(ns);
327 auto pp = std::ref(*p);
330 element_view<ElementT>::add(pp);
339bool check_diagram_type<clanguml::package_diagram::model::diagram>(diagram_t t);