Class representing a class diagram. More...
#include <diagram.h>
Public Member Functions | |
diagram ()=default | |
diagram (const diagram &)=delete | |
diagram (diagram &&)=default | |
diagram & | operator= (const diagram &)=delete |
diagram & | operator= (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_element > | get (const std::string &full_name) const override |
Search for element in the diagram by fully qualified name. | |
opt_ref< diagram_element > | get (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. | |
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 | |
diagram & | operator= (const diagram &)=delete |
diagram & | operator= (diagram &&) noexcept |
virtual | ~diagram () |
virtual diagram_t | type () const =0 |
Return type of the diagram. | |
virtual opt_ref< clanguml::common::model::diagram_element > | get (const std::string &full_name) const =0 |
virtual common::optional_ref< clanguml::common::model::diagram_element > | get (eid_t id) const =0 |
virtual common::optional_ref< clanguml::common::model::diagram_element > | get_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_filter & | filter () 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_trait & | operator= (const nested_trait &)=delete |
nested_trait & | operator= (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 > p) |
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 | begin () |
auto | end () |
auto | cbegin () const |
auto | cend () const |
auto | begin () const |
auto | end () const |
void | print_tree (const int level) const |
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) |
|
default |
|
delete |
|
default |
|
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.
ElementT | Type of diagram element. |
parent_path | Path to the parent package of the new diagram element. |
e | Diagram element to be added. |
Definition at line 204 of file diagram.h.
|
private |
Definition at line 365 of file diagram.h.
|
private |
Definition at line 332 of file diagram.h.
|
private |
Definition at line 281 of file diagram.h.
|
overridevirtual |
Reimplemented from clanguml::common::model::diagram.
Definition at line 270 of file diagram.cc.
const common::reference_vector< class_ > & clanguml::class_diagram::model::diagram::classes | ( | ) | const |
Get list of references to classes in the diagram model.
Definition at line 47 of file diagram.cc.
const common::reference_vector< concept_ > & clanguml::class_diagram::model::diagram::concepts | ( | ) | const |
Get list of references to concepts in the diagram model.
Definition at line 57 of file diagram.cc.
bool clanguml::class_diagram::model::diagram::contains | ( | const ElementT & | e | ) |
Check, if diagram contains a specific element.
ElementT | Type of diagram element (e.g. class_) |
e | Element to check |
Definition at line 272 of file diagram.h.
const common::reference_vector< ElementT > & clanguml::class_diagram::model::diagram::elements |
Get reference to vector of elements of specific type.
ElementT | Type of elements view |
const common::reference_vector< enum_ > & clanguml::class_diagram::model::diagram::enums | ( | ) | const |
Get list of references to enums in the diagram model.
Definition at line 52 of file diagram.cc.
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.
ElementT | Type of element (e.g. class_) |
name | String or regex pattern |
Definition at line 415 of file diagram.h.
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.
ElementT | Type of element (e.g. class_) |
name | Fully qualified name of the element |
Definition at line 398 of file diagram.h.
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.
ElementT | Type of element (e.g. class_) |
id | Id of the element |
Definition at line 433 of file diagram.h.
|
overridevirtual |
Search for element in the diagram by fully qualified name.
full_name | Fully qualified element name. |
Implements clanguml::common::model::diagram.
Definition at line 72 of file diagram.cc.
|
override |
Search for element in the diagram by id.
id | Element id. |
Definition at line 96 of file diagram.cc.
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.
parents | In and out parameter with the parent classes. |
Definition at line 158 of file diagram.cc.
|
override |
Check if diagram contains element by id.
id | Id of the element. |
Definition at line 186 of file diagram.cc.
|
overridevirtual |
Check whether the diagram is empty.
Implements clanguml::common::model::diagram.
Definition at line 294 of file diagram.cc.
const common::reference_vector< objc_interface > & clanguml::class_diagram::model::diagram::objc_interfaces | ( | ) | const |
Definition at line 62 of file diagram.cc.
void clanguml::class_diagram::model::diagram::remove_redundant_dependencies | ( | ) |
Remove redundant dependency relationships.
Definition at line 238 of file diagram.cc.
bool clanguml::class_diagram::model::diagram::should_include | ( | const class_member & | m | ) | const |
Whether a class_member should be included in the diagram.
m | Class member |
Definition at line 27 of file diagram.cc.
bool clanguml::class_diagram::model::diagram::should_include | ( | const class_method & | m | ) | const |
Whether a class_method should be included in the diagram.
m | Class method |
Definition at line 32 of file diagram.cc.
bool clanguml::class_diagram::model::diagram::should_include | ( | const objc_member & | m | ) | const |
Definition at line 37 of file diagram.cc.
bool clanguml::class_diagram::model::diagram::should_include | ( | const objc_method & | m | ) | const |
Definition at line 42 of file diagram.cc.
std::string clanguml::class_diagram::model::diagram::to_alias | ( | eid_t | id | ) | const |
Convert element id to PlantUML alias.
id | Id of the diagram element. |
Definition at line 210 of file diagram.cc.
|
overridevirtual |
Get the diagram model type - in this case class.
Implements clanguml::common::model::diagram.
Definition at line 67 of file diagram.cc.