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)
171 template <
typename ElementT>
182 template <
typename ElementT>
193 template <
typename ElementT>
204 template <
typename ElementT>
209template <
typename ElementT>
212 for (
const auto &element : element_view<ElementT>::view()) {
213 const auto full_name = element.get().full_name(
false);
215 if (full_name ==
name) {
225 for (
const auto &element : element_view<ElementT>::view()) {
226 if (element.get().id() == id) {
234template <
typename ElementT>
238 std::vector<opt_ref<ElementT>> result;
240 for (
const auto &element : element_view<ElementT>::view()) {
241 const auto full_name = element.get().full_name(
false);
243 if (pattern == full_name) {
244 result.emplace_back(element);
251template <
typename ElementT>
255 "Adding package: {}, {}, [{}]", p->name(), p->full_name(
true), p->id());
257 auto ns = p->get_relative_namespace();
258 auto p_ref = std::ref(*p);
262 element_view<ElementT>::add(p_ref);
267template <
typename ElementT>
271 LOG_DBG(
"Adding package: {}, {}, {}, [{}]", p->name(), p->full_name(
false),
276 auto module_relative_to =
path{p->using_namespace()};
278 for (
auto it = parent_path.
begin(); it != parent_path.
end(); it++) {
279 auto pkg = std::make_unique<common::model::package>(
286 auto module_absolute_path = module_relative_to | module_relative_part;
287 pkg->set_module(module_absolute_path.to_string());
288 pkg->set_namespace(module_absolute_path);
290 auto package_absolute_path = module_absolute_path | pkg->name();
292 pkg->set_id(
common::to_id(package_absolute_path.to_string()));
294 auto p_ref = std::ref(*pkg);
296 auto res =
add_element(module_relative_part, std::move(pkg));
298 element_view<ElementT>::add(p_ref);
301 auto p_ref = std::ref(*p);
305 element_view<ElementT>::add(p_ref);
310template <
typename ElementT>
314 LOG_TRACE(
"Adding package: {}, {}", p->name(), p->full_name(
true));
318 for (
auto it = parent_path.
begin(); it != parent_path.
end(); it++) {
319 auto pkg = std::make_unique<common::model::package>(
324 pkg->set_namespace(ns);
330 auto pp = std::ref(*p);
333 element_view<ElementT>::add(pp);
338template <
typename ElementT>
341 return element_view<ElementT>::view();
348bool check_diagram_type<clanguml::package_diagram::model::diagram>(diagram_t t);