0.6.1
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
clanguml::class_diagram::model::diagram Class Reference

Class representing a class diagram. More...

Detailed Description

Class representing a class diagram.

Definition at line 54 of file diagram.h.

#include <diagram.h>

Public Types

using nested_trait_t = nested_trait_ns
 

Public Member Functions

 diagram ()=default
 
 diagram (const diagram &)=delete
 
 diagram (diagram &&)=default
 
diagramoperator= (const diagram &)=delete
 
diagramoperator= (diagram &&)=default
 
diagram_t type () const override
 Get the diagram model type - in this case class.
 
bool should_include (const class_member &m) const
 Whether a class_member should be included in the diagram.
 
bool should_include (const objc_member &m) const
 
bool should_include (const class_method &m) const
 Whether a class_method should be included in the diagram.
 
bool should_include (const objc_method &m) const
 
opt_ref< diagram_elementget (const std::string &full_name) const override
 Search for element in the diagram by fully qualified name.
 
opt_ref< diagram_elementget (eid_t id) const override
 Search for element in the diagram by id.
 
const common::reference_vector< class_ > & classes () const
 Get list of references to classes in the diagram model.
 
const common::reference_vector< enum_ > & enums () const
 Get list of references to enums in the diagram model.
 
const common::reference_vector< concept_ > & concepts () const
 Get list of references to concepts in the diagram model.
 
const common::reference_vector< objc_interface > & objc_interfaces () const
 
template<typename ElementT >
bool contains (const ElementT &e)
 Check, if diagram contains a specific element.
 
template<typename ElementT >
opt_ref< ElementT > find (const std::string &name) const
 Find an element in the diagram by name.
 
template<typename ElementT >
std::vector< opt_ref< ElementT > > find (const clanguml::common::string_or_regex &pattern) const
 Find elements in the diagram by regex pattern.
 
template<typename ElementT >
opt_ref< ElementT > find (eid_t id) const
 Find an element in the diagram by id.
 
template<typename ElementT >
const common::reference_vector< ElementT > & elements () const
 Get reference to vector of elements of specific type.
 
template<typename ElementT >
bool add (const path &parent_path, std::unique_ptr< ElementT > &&e)
 Add element to the diagram at a specified nested path.
 
template<typename ElementT >
void move (eid_t id, const path &parent_path)
 
template<typename ElementT >
void remove (eid_t id)
 
std::string to_alias (eid_t id) const
 Convert element id to PlantUML alias.
 
void get_parents (clanguml::common::reference_set< class_ > &parents) const
 Given an initial set of classes, add all their parents to the argument.
 
bool has_element (eid_t id) const override
 Check if diagram contains element by id.
 
void remove_redundant_dependencies ()
 Remove redundant dependency relationships.
 
bool is_empty () const override
 Check whether the diagram is empty.
 
void apply_filter () override
 
- Public Member Functions inherited from clanguml::common::model::diagram
 diagram ()
 
 diagram (const diagram &)=delete
 
 diagram (diagram &&) noexcept
 
diagramoperator= (const diagram &)=delete
 
diagramoperator= (diagram &&) noexcept
 
virtual ~diagram ()
 
virtual diagram_t type () const =0
 Return type of the diagram.
 
virtual opt_ref< clanguml::common::model::diagram_elementget (const std::string &full_name) const =0
 
virtual common::optional_ref< clanguml::common::model::diagram_elementget (eid_t id) const =0
 
virtual common::optional_ref< clanguml::common::model::diagram_elementget_with_namespace (const std::string &name, const namespace_ &ns) const
 
void set_name (const std::string &name)
 
std::string name () const
 
void set_filter (std::unique_ptr< diagram_filter > filter)
 
const diagram_filterfilter () const
 
void set_complete (bool complete)
 Set diagram in a complete state.
 
bool complete () const
 Whether the diagram is complete.
 
virtual void finalize ()
 Once the diagram is complete, run any final processing.
 
bool should_include (const element &e) const
 
bool should_include (const namespace_ &ns) const
 
bool should_include (const source_file &path) const
 
bool should_include (relationship r) const
 
bool should_include (relationship_t r) const
 
bool should_include (access_t s) const
 
bool should_include (const std::string &s) const =delete
 
virtual bool has_element (const eid_t) const
 
virtual bool should_include (const namespace_ &ns, const std::string &name) const
 
virtual bool is_empty () const =0
 Check whether the diagram is empty.
 
virtual void apply_filter ()
 
- Public Member Functions inherited from clanguml::common::model::element_views< Ts >
template<typename F >
void for_all_elements (F &&f)
 
template<typename F >
void for_all_elements (F &&f) const
 
template<typename T >
const element_view< T > & view () const
 
template<typename T , typename F >
void dynamic_apply (T *e, F &&f) const
 Calls f function on e if it can be dynamically casted to any type in the element_views.
 
- Public Member Functions inherited from clanguml::common::model::element_view< Ts >
void add (std::reference_wrapper< Ts > element)
 Add reference to diagram element.
 
const reference_vector< Ts > & view () const
 Get collection of reference to diagram elements.
 
reference_vector< Ts > & view ()
 Get collection of reference to diagram elements.
 
common::optional_ref< Ts > get (eid_t id) const
 Get typed diagram element by id.
 
bool is_empty () const
 Check whether the element view is empty.
 
void remove (const std::set< eid_t > &element_ids)
 
void for_each (F &&f) const
 
- Public Member Functions inherited from clanguml::common::model::nested_trait< T, Path >
 nested_trait ()=default
 
 nested_trait (const nested_trait &)=delete
 
 nested_trait (nested_trait &&) noexcept=default
 
nested_traitoperator= (const nested_trait &)=delete
 
nested_traitoperator= (nested_trait &&) noexcept=default
 
virtual ~nested_trait ()=default
 
bool is_root () const
 
void is_root (bool a)
 
template<typename V = T>
bool add_element (std::unique_ptr< V > element)
 
template<typename V = T>
bool add_element (const Path &path, std::unique_ptr< V > p)
 
template<typename V = T>
auto get_element (const Path &path) const
 
template<typename V = T>
auto get_element (const std::string &name, bool is_root=false) const
 
template<typename F >
bool all_of (F &&f) const
 
bool is_empty (bool include_inner_packages=false) const
 
auto cbegin () const
 
auto cend () const
 
auto begin () const
 
auto end () const
 
void print_tree (const int level) const
 
template<typename V = T>
std::unique_ptr< V > get_and_remove (eid_t id)
 
void remove (const std::set< eid_t > &element_ids)
 

Private Member Functions

template<typename ElementT >
bool add_with_namespace_path (std::unique_ptr< ElementT > &&e)
 
template<typename ElementT >
bool add_with_module_path (const common::model::path &parent_path, std::unique_ptr< ElementT > &&e)
 
template<typename ElementT >
bool add_with_filesystem_path (const common::model::path &parent_path, std::unique_ptr< ElementT > &&e)
 

Private Attributes

std::set< eid_t > added_elements_
 

Additional Inherited Members

- Protected Member Functions inherited from clanguml::common::model::diagram
diagram_filterfilter ()
 

Member Typedef Documentation

◆ nested_trait_t

Definition at line 58 of file diagram.h.

Constructor & Destructor Documentation

◆ diagram() [1/3]

clanguml::class_diagram::model::diagram::diagram ( )
default

◆ diagram() [2/3]

clanguml::class_diagram::model::diagram::diagram ( const diagram )
delete

◆ diagram() [3/3]

clanguml::class_diagram::model::diagram::diagram ( diagram &&  )
default

Member Function Documentation

◆ add()

template<typename ElementT >
bool clanguml::class_diagram::model::diagram::add ( const path parent_path,
std::unique_ptr< ElementT > &&  e 
)
inline

Add element to the diagram at a specified nested path.

Adds an element to a diagram, at a specific package (if any exist). The package is specified by the parent_path, which can be either a namespace or a directory path.

Template Parameters
ElementTType of diagram element.
Parameters
parent_pathPath to the parent package of the new diagram element.
eDiagram element to be added.
Returns
True, if the element was added to the diagram.

Definition at line 206 of file diagram.h.

207 {
208 if (parent_path.type() == common::model::path_type::kNamespace) {
209 return add_with_namespace_path(std::move(e));
210 }
211
212 if (parent_path.type() == common::model::path_type::kModule) {
213 return add_with_module_path(parent_path, std::move(e));
214 }
215
216 return add_with_filesystem_path(parent_path, std::move(e));
217 }

◆ add_with_filesystem_path()

template<typename ElementT >
bool clanguml::class_diagram::model::diagram::add_with_filesystem_path ( const common::model::path parent_path,
std::unique_ptr< ElementT > &&  e 
)
private

Definition at line 400 of file diagram.h.

402{
403 if (added_elements_.count(e->id()) > 0)
404 return false;
405
406 LOG_DBG("Adding element {} at path {}", e->full_name(false),
407 parent_path.to_string());
408
409 const auto element_type = e->type_name();
410
411 // Make sure all parent modules are already packages in the
412 // model
413 for (auto it = parent_path.begin(); it != parent_path.end(); it++) {
414 auto pkg = std::make_unique<common::model::package>(
415 e->using_namespace(), parent_path.type());
416 pkg->set_name(*it);
417 auto package_path =
418 common::model::path(parent_path.begin(), it, parent_path.type());
419 pkg->set_namespace(package_path);
420 pkg->set_id(common::to_id("__directory__" + pkg->full_name(false)));
421
422 LOG_DBG("Adding filesystem package {} at path {}", pkg->name(),
423 package_path.to_string());
424
425 add(package_path, std::move(pkg));
426 }
427
428 const auto base_name = e->name();
429 const auto full_name = e->full_name(false);
430 auto &e_ref = *e;
431
432 if (add_element(parent_path, std::move(e))) {
433 added_elements_.emplace(e_ref.id());
434 element_view<ElementT>::add(std::ref(e_ref));
435 return true;
436 }
437
438 return false;
439}

◆ add_with_module_path()

template<typename ElementT >
bool clanguml::class_diagram::model::diagram::add_with_module_path ( const common::model::path parent_path,
std::unique_ptr< ElementT > &&  e 
)
private

Definition at line 362 of file diagram.h.

364{
365 if (added_elements_.count(e->id()) > 0)
366 return true;
367
368 added_elements_.emplace(e->id());
369
370 const auto element_type = e->type_name();
371
372 // Make sure all parent modules are already packages in the
373 // model
374 for (auto it = parent_path.begin(); it != parent_path.end(); it++) {
375 auto pkg = std::make_unique<common::model::package>(
376 e->using_namespace(), parent_path.type());
377 pkg->set_name(*it);
378 auto ns =
379 common::model::path(parent_path.begin(), it, parent_path.type());
380 // ns.pop_back();
381 pkg->set_namespace(ns);
382 pkg->set_id(common::to_id(pkg->full_name(false)));
383
384 add(ns, std::move(pkg));
385 }
386
387 const auto base_name = e->name();
388 const auto full_name = e->full_name(false);
389 auto &e_ref = *e;
390
391 if (add_element(parent_path, std::move(e))) {
392 element_view<ElementT>::add(std::ref(e_ref));
393 return true;
394 }
395
396 return false;
397}

◆ add_with_namespace_path()

template<typename ElementT >
bool clanguml::class_diagram::model::diagram::add_with_namespace_path ( std::unique_ptr< ElementT > &&  e)
private

Definition at line 305 of file diagram.h.

306{
307 if (added_elements_.count(e->id()) > 0)
308 return true;
309
310 added_elements_.emplace(e->id());
311
312 const auto base_name = e->name();
313 const auto full_name = e->full_name(false);
314 const auto element_type = e->type_name();
315
316 LOG_DBG("Adding {}: {}::{}, {}", element_type,
317 e->get_namespace().to_string(), base_name, full_name);
318
319 if (util::contains(base_name, "::"))
320 throw std::runtime_error("Name cannot contain namespace: " + base_name);
321
322 const auto ns = e->get_relative_namespace();
323
324 auto name = base_name;
325 auto name_and_ns = ns | name;
326 auto &e_ref = *e;
327 auto id = e_ref.id();
328
329 try {
330 if (!contains(e_ref)) {
331 if (add_element(ns, std::move(e)))
332 element_view<ElementT>::add(std::ref(e_ref));
333
334#if !defined(NDEBUG)
335 const auto maybe_el = get_element<ElementT>(name_and_ns);
336 const auto &el = maybe_el.value();
337
338 if ((el.name() != name) || !(el.get_relative_namespace() == ns))
339 throw std::runtime_error(
340 "Invalid element stored in the diagram tree");
341
342 LOG_DBG("Added {} {} ({} - [{}])", element_type, base_name,
343 full_name, id);
344#endif
345
346 return true;
347 }
348 }
349 catch (const std::runtime_error &e) {
350 LOG_WARN("Cannot add {} {} with id {} due to: {}", element_type, name,
351 id, e.what());
352 return false;
353 }
354
355 LOG_DBG("{} {} ({} - [{}]) already in the model", element_type, base_name,
356 full_name, id);
357
358 return false;
359}

◆ apply_filter()

void clanguml::class_diagram::model::diagram::apply_filter ( )
overridevirtual

Reimplemented from clanguml::common::model::diagram.

Definition at line 271 of file diagram.cc.

272{
273 // First find all element ids which should be removed
274 std::set<eid_t> to_remove;
275
276 while (true) {
277 for_all_elements([&](auto &&elements_view) mutable {
278 for (const auto &el : elements_view)
279 if (!filter().should_include(el.get()))
280 to_remove.emplace(el.get().id());
281 });
282
283 if (to_remove.empty())
284 break;
285
290
291 nested_trait_ns::remove(to_remove);
292
293 to_remove.clear();
294
295 filter().reset();
296 }
297
298 for_all_elements([&](auto &&elements_view) mutable {
299 for (const auto &el : elements_view)
300 el.get().apply_filter(filter(), to_remove);
301 });
302}

◆ classes()

const common::reference_vector< class_ > & clanguml::class_diagram::model::diagram::classes ( ) const

Get list of references to classes in the diagram model.

Returns
List of references to classes in the diagram model.

Definition at line 47 of file diagram.cc.

48{
50}

◆ concepts()

const common::reference_vector< concept_ > & clanguml::class_diagram::model::diagram::concepts ( ) const

Get list of references to concepts in the diagram model.

Returns
List of references to concepts in the diagram model.

Definition at line 57 of file diagram.cc.

58{
60}

◆ contains()

template<typename ElementT >
bool clanguml::class_diagram::model::diagram::contains ( const ElementT &  e)

Check, if diagram contains a specific element.

Template Parameters
ElementTType of diagram element (e.g. class_)
Parameters
eElement to check
Returns
True, if element already exists in the diagram

Definition at line 296 of file diagram.h.

297{
298 return std::any_of(element_view<ElementT>::view().cbegin(),
300 [&element](
301 const auto &element_opt) { return element_opt.get() == element; });
302}

◆ elements()

template<typename ElementT >
const common::reference_vector< ElementT > & clanguml::class_diagram::model::diagram::elements

Get reference to vector of elements of specific type.

Template Parameters
ElementTType of elements view
Returns
Reference to elements vector

Definition at line 489 of file diagram.h.

490{
492}

◆ enums()

const common::reference_vector< enum_ > & clanguml::class_diagram::model::diagram::enums ( ) const

Get list of references to enums in the diagram model.

Returns
List of references to enums in the diagram model.

Definition at line 52 of file diagram.cc.

53{
55}

◆ find() [1/3]

template<typename ElementT >
std::vector< opt_ref< ElementT > > clanguml::class_diagram::model::diagram::find ( const clanguml::common::string_or_regex pattern) const

Find elements in the diagram by regex pattern.

This method allows for typed search, where the type of searched for element is determined from template specialization.

Template Parameters
ElementTType of element (e.g. class_)
Parameters
nameString or regex pattern
Returns
List of optional references to matched elements.

Definition at line 459 of file diagram.h.

461{
462 std::vector<opt_ref<ElementT>> result;
463
464 for (const auto &element : element_view<ElementT>::view()) {
465 const auto full_name = element.get().full_name(false);
466 auto full_name_escaped = full_name;
467 util::replace_all(full_name_escaped, "##", "::");
468
469 if (pattern == full_name || pattern == full_name_escaped) {
470 result.emplace_back(element);
471 }
472 }
473
474 return result;
475}

◆ find() [2/3]

template<typename ElementT >
opt_ref< ElementT > clanguml::class_diagram::model::diagram::find ( const std::string &  name) const

Find an element in the diagram by name.

This method allows for typed search, where the type of searched for element is determined from template specialization.

Template Parameters
ElementTType of element (e.g. class_)
Parameters
nameFully qualified name of the element
Returns
Optional reference to a diagram element

Definition at line 442 of file diagram.h.

443{
444 for (const auto &element : element_view<ElementT>::view()) {
445 const auto full_name = element.get().full_name(false);
446
447 auto full_name_escaped = full_name;
448 util::replace_all(full_name_escaped, "##", "::");
449
450 if (name == full_name || name == full_name_escaped) {
451 return {element};
452 }
453 }
454
455 return {};
456}

◆ find() [3/3]

template<typename ElementT >
opt_ref< ElementT > clanguml::class_diagram::model::diagram::find ( eid_t  id) const

Find an element in the diagram by id.

This method allows for typed search, where the type of searched for element is determined from template specialization.

Template Parameters
ElementTType of element (e.g. class_)
Parameters
idId of the element
Returns
Optional reference to a diagram element

Definition at line 477 of file diagram.h.

478{
479 for (const auto &element : element_view<ElementT>::view()) {
480 if (element.get().id() == id) {
481 return {element};
482 }
483 }
484
485 return {};
486}

◆ get() [1/2]

common::optional_ref< clanguml::common::model::diagram_element > clanguml::class_diagram::model::diagram::get ( const std::string &  full_name) const
overridevirtual

Search for element in the diagram by fully qualified name.

Parameters
full_nameFully qualified element name.
Returns
Optional reference to a diagram element.

Implements clanguml::common::model::diagram.

Definition at line 72 of file diagram.cc.

74{
75 common::optional_ref<clanguml::common::model::diagram_element> res =
76 find<class_>(full_name);
77
78 if (res.has_value())
79 return res;
80
81 res = find<enum_>(full_name);
82
83 if (res.has_value())
84 return res;
85
86 res = find<concept_>(full_name);
87
88 if (res.has_value())
89 return res;
90
91 res = find<objc_interface>(full_name);
92
93 return res;
94}

◆ get() [2/2]

common::optional_ref< clanguml::common::model::diagram_element > clanguml::class_diagram::model::diagram::get ( eid_t  id) const
override

Search for element in the diagram by id.

Parameters
idElement id.
Returns
Optional reference to a diagram element.

Definition at line 96 of file diagram.cc.

98{
99 common::optional_ref<clanguml::common::model::diagram_element> res;
100
101 res = find<class_>(id);
102
103 if (res.has_value())
104 return res;
105
106 res = find<enum_>(id);
107
108 if (res.has_value())
109 return res;
110
111 res = find<concept_>(id);
112
113 if (res.has_value())
114 return res;
115
116 res = find<objc_interface>(id);
117
118 return res;
119}

◆ get_parents()

void clanguml::class_diagram::model::diagram::get_parents ( clanguml::common::reference_set< class_ > &  parents) const

Given an initial set of classes, add all their parents to the argument.

Parameters
parentsIn and out parameter with the parent classes.

Definition at line 159 of file diagram.cc.

161{
162 bool found_new{false};
163 for (const auto &parent : parents) {
164 for (const auto &rel : parent.get().relationships()) {
166 continue;
167
168 auto p = find<class_>(rel.destination());
169
170 if (p.has_value()) {
171 auto [it, found] = parents.emplace(std::ref(p.value()));
172 if (found)
173 found_new = true;
174 }
175 else {
176 LOG_WARN("Couldn't find class representing base class: {}",
177 rel.destination().value());
178 }
179 }
180 }
181
182 if (found_new) {
183 get_parents(parents);
184 }
185}

◆ has_element()

bool clanguml::class_diagram::model::diagram::has_element ( eid_t  id) const
override

Check if diagram contains element by id.

Todo:
Remove in favour of 'contains'
Parameters
idId of the element.
Returns
True, if diagram contains an element with a specific id.

Definition at line 187 of file diagram.cc.

188{
189 const auto has_class = std::any_of(classes().begin(), classes().end(),
190 [id](const auto &c) { return c.get().id() == id; });
191
192 if (has_class)
193 return true;
194
195 const auto has_concept = std::any_of(classes().begin(), classes().end(),
196 [id](const auto &c) { return c.get().id() == id; });
197
198 if (has_concept)
199 return true;
200
201 const auto has_enum = std::any_of(enums().begin(), enums().end(),
202 [id](const auto &c) { return c.get().id() == id; });
203
204 if (has_enum)
205 return true;
206
207 return std::any_of(objc_interfaces().begin(), objc_interfaces().end(),
208 [id](const auto &c) { return c.get().id() == id; });
209}

◆ is_empty()

bool clanguml::class_diagram::model::diagram::is_empty ( ) const
overridevirtual

Check whether the diagram is empty.

Returns
True, if diagram is empty

Implements clanguml::common::model::diagram.

Definition at line 304 of file diagram.cc.

◆ move()

template<typename ElementT >
void clanguml::class_diagram::model::diagram::move ( eid_t  id,
const path parent_path 
)
inline

Definition at line 219 of file diagram.h.

220 {
221 LOG_DBG("Moving element {} to package {}", id.value(),
222 parent_path.to_string());
223
224 auto e = nested_trait_ns::get_and_remove<ElementT>(id);
225 assert(e);
226
228 added_elements_.erase(id);
229
230 this->add<ElementT>(parent_path, std::move(e));
231 }

◆ objc_interfaces()

const common::reference_vector< objc_interface > & clanguml::class_diagram::model::diagram::objc_interfaces ( ) const

Definition at line 62 of file diagram.cc.

63{
65}

◆ operator=() [1/2]

diagram & clanguml::class_diagram::model::diagram::operator= ( const diagram )
delete

◆ operator=() [2/2]

diagram & clanguml::class_diagram::model::diagram::operator= ( diagram &&  )
default

◆ remove()

template<typename ElementT >
void clanguml::class_diagram::model::diagram::remove ( eid_t  id)
inline

Definition at line 233 of file diagram.h.

234 {
237 }

◆ remove_redundant_dependencies()

void clanguml::class_diagram::model::diagram::remove_redundant_dependencies ( )

Remove redundant dependency relationships.

Definition at line 239 of file diagram.cc.

240{
241 using common::eid_t;
242 using common::model::relationship;
244
245 for_all_elements([&](auto &&elements_view) mutable {
246 for (const auto &el : elements_view) {
247 std::set<eid_t> dependency_relationships_to_remove;
248
249 for (auto &r : el.get().relationships()) {
250 if (r.type() != relationship_t::kDependency)
251 dependency_relationships_to_remove.emplace(r.destination());
252 }
253
254 util::erase_if(el.get().relationships(),
255 [&dependency_relationships_to_remove, &el](const auto &r) {
256 if (r.type() != relationship_t::kDependency)
257 return false;
258
259 auto has_another_relationship_to_destination =
260 dependency_relationships_to_remove.count(
261 r.destination()) > 0;
262 auto is_self_dependency = r.destination() == el.get().id();
263
264 return has_another_relationship_to_destination ||
265 is_self_dependency;
266 });
267 }
268 });
269}

◆ should_include() [1/4]

bool clanguml::class_diagram::model::diagram::should_include ( const class_member m) const

Whether a class_member should be included in the diagram.

Parameters
mClass member
Returns
True, if class member should be included in the diagram.

Definition at line 27 of file diagram.cc.

28{
29 return filter().should_include(m);
30}

◆ should_include() [2/4]

bool clanguml::class_diagram::model::diagram::should_include ( const class_method m) const

Whether a class_method should be included in the diagram.

Parameters
mClass method
Returns
True, if class method should be included in the diagram.

Definition at line 32 of file diagram.cc.

33{
34 return filter().should_include(m);
35}

◆ should_include() [3/4]

bool clanguml::class_diagram::model::diagram::should_include ( const objc_member m) const

Definition at line 37 of file diagram.cc.

38{
39 return filter().should_include(m);
40}

◆ should_include() [4/4]

bool clanguml::class_diagram::model::diagram::should_include ( const objc_method m) const

Definition at line 42 of file diagram.cc.

43{
44 return filter().should_include(m);
45}

◆ to_alias()

std::string clanguml::class_diagram::model::diagram::to_alias ( eid_t  id) const

Convert element id to PlantUML alias.

Todo:
This method does not belong here - refactor to PlantUML specific code.
Parameters
idId of the diagram element.
Returns
PlantUML alias.

Definition at line 211 of file diagram.cc.

212{
213 LOG_TRACE("Looking for alias for {}", id);
214
215 for (const auto &c : classes()) {
216 if (c.get().id() == id) {
217 return c.get().alias();
218 }
219 }
220
221 for (const auto &e : enums()) {
222 if (e.get().id() == id)
223 return e.get().alias();
224 }
225
226 for (const auto &c : concepts()) {
227 if (c.get().id() == id)
228 return c.get().alias();
229 }
230
231 for (const auto &c : objc_interfaces()) {
232 if (c.get().id() == id)
233 return c.get().alias();
234 }
235
236 throw error::uml_alias_missing(fmt::format("Missing alias for {}", id));
237}

◆ type()

common::model::diagram_t clanguml::class_diagram::model::diagram::type ( ) const
overridevirtual

Get the diagram model type - in this case class.

Returns
Type of class diagram.

Implements clanguml::common::model::diagram.

Definition at line 67 of file diagram.cc.

Member Data Documentation

◆ added_elements_

std::set<eid_t> clanguml::class_diagram::model::diagram::added_elements_
private

Definition at line 282 of file diagram.h.


The documentation for this class was generated from the following files: