Class representing an include diagram model. 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 |
common::model::diagram_t | type () const override |
Get the diagram model type - in this case include. | |
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. | |
void | add_file (std::unique_ptr< common::model::source_file > &&f) |
Add include diagram element, an include file. | |
template<typename ElementT > | |
opt_ref< ElementT > | find (const std::string &name) const |
Find an element in the diagram by name. | |
template<typename ElementT > | |
opt_ref< ElementT > | find (eid_t id) const |
Find an element in the diagram by id. | |
const common::reference_vector< source_file > & | files () const |
Get list of references to files in the diagram model. | |
opt_ref< diagram_element > | get_with_namespace (const std::string &name, const common::model::namespace_ &ns) const override |
Find diagram element with a specified name and path. | |
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< source_file > | |
void | for_all_elements (F &&f) |
void | for_all_elements (F &&f) const |
const element_view< T > & | view () const |
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) |
|
default |
|
delete |
|
default |
void clanguml::include_diagram::model::diagram::add_file | ( | std::unique_ptr< common::model::source_file > && | f | ) |
Add include diagram element, an include file.
f | Include diagram element |
Definition at line 44 of file diagram.cc.
|
overridevirtual |
Reimplemented from clanguml::common::model::diagram.
Definition at line 118 of file diagram.cc.
const common::reference_vector< common::model::source_file > & clanguml::include_diagram::model::diagram::files | ( | ) | const |
Get list of references to files in the diagram model.
Definition at line 93 of file diagram.cc.
opt_ref< ElementT > clanguml::include_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 ElementT
.
ElementT | Type of element (e.g. source_file) |
name | Fully qualified name of the element |
Definition at line 136 of file diagram.h.
opt_ref< ElementT > clanguml::include_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 ElementT
.
ElementT | Type of element (e.g. source_file) |
id | Id of the element |
Definition at line 153 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 32 of file diagram.cc.
|
overridevirtual |
Search for element in the diagram by id.
id | Element id. |
Implements clanguml::common::model::diagram.
Definition at line 38 of file diagram.cc.
|
overridevirtual |
Find diagram element with a specified name and path.
name | Name of the element |
ns | Path relative to the diagram |
Reimplemented from clanguml::common::model::diagram.
Definition at line 99 of file diagram.cc.
|
overridevirtual |
Check whether the diagram is empty.
Implements clanguml::common::model::diagram.
Definition at line 137 of file diagram.cc.
|
overridevirtual |
Get the diagram model type - in this case include.
Implements clanguml::common::model::diagram.
Definition at line 27 of file diagram.cc.