75 opt_ref<diagram_element>
get(
const std::string &full_name)
const override;
83 opt_ref<diagram_element>
get(
eid_t id)
const override;
95 template <
typename ElementT>
96 opt_ref<ElementT>
find(
const std::string &
name)
const;
108 template <
typename ElementT> opt_ref<ElementT>
find(
eid_t id)
const;
120 template <
typename ElementT>
121 std::vector<opt_ref<ElementT>>
find(
136 template <
typename ElementT>
137 bool add(
const path &parent_path, std::unique_ptr<ElementT> &&e)
173 template <
typename ElementT>
184 template <
typename ElementT>
195 template <
typename ElementT>
206 template <
typename ElementT>
211template <
typename ElementT>
214 for (
const auto &element : element_view<ElementT>::view()) {
215 const auto full_name = element.get().full_name(
false);
217 if (full_name ==
name) {
227 for (
const auto &element : element_view<ElementT>::view()) {
228 if (element.get().id() == id) {
236template <
typename ElementT>
240 std::vector<opt_ref<ElementT>> result;
242 for (
const auto &element : element_view<ElementT>::view()) {
243 const auto full_name = element.get().full_name(
false);
245 if (pattern == full_name) {
246 result.emplace_back(element);
253template <
typename ElementT>
257 "Adding package: {}, {}, [{}]", p->name(), p->full_name(
true), p->id());
259 auto ns = p->get_relative_namespace();
260 auto p_ref = std::ref(*p);
264 element_view<ElementT>::add(p_ref);
269template <
typename ElementT>
273 LOG_DBG(
"Adding package: {}, {}, {}, [{}]", p->name(), p->full_name(
false),
278 auto module_relative_to =
path{p->using_namespace()};
280 for (
auto it = parent_path.
begin(); it != parent_path.
end(); it++) {
281 auto pkg = std::make_unique<common::model::package>(
288 auto module_absolute_path = module_relative_to | module_relative_part;
289 pkg->set_module(module_absolute_path.to_string());
290 pkg->set_namespace(module_absolute_path);
292 auto package_absolute_path = module_absolute_path | pkg->name();
294 pkg->set_id(
common::to_id(package_absolute_path.to_string()));
296 auto p_ref = std::ref(*pkg);
298 auto res =
add_element(module_relative_part, std::move(pkg));
300 element_view<ElementT>::add(p_ref);
303 auto p_ref = std::ref(*p);
307 element_view<ElementT>::add(p_ref);
312template <
typename ElementT>
316 LOG_TRACE(
"Adding package: {}, {}", p->name(), p->full_name(
true));
320 for (
auto it = parent_path.
begin(); it != parent_path.
end(); it++) {
321 auto pkg = std::make_unique<common::model::package>(
326 pkg->set_namespace(ns);
332 auto pp = std::ref(*p);
335 element_view<ElementT>::add(pp);
340template <
typename ElementT>
343 return element_view<ElementT>::view();
350bool check_diagram_type<clanguml::package_diagram::model::diagram>(diagram_t t);