Base class for standalone diagram elements. More...
Base class for standalone diagram elements.
This is a base cass of any standalone elements such as classes, structs, concepts, packages and so on participants and so on.
Definition at line 43 of file diagram_element.h.
#include <diagram_element.h>
Public Member Functions | |
diagram_element () | |
~diagram_element () override=default | |
const eid_t & | id () const |
Returns diagram element id. | |
void | set_id (eid_t id) |
std::optional< eid_t > | parent_element_id () const |
void | set_parent_element_id (eid_t id) |
virtual std::string | alias () const |
Return elements' diagram alias. | |
void | set_name (const std::string &name) |
std::string | name () const |
virtual std::string | type_name () const |
virtual std::string | full_name (bool) const |
Return the elements fully qualified name. | |
std::vector< relationship > & | relationships () |
const std::vector< relationship > & | relationships () const |
void | add_relationship (relationship &&cr) |
void | append (const decorated_element &e) |
virtual inja::json | context () const |
bool | is_nested () const |
void | nested (bool nested) |
bool | complete () const |
void | complete (bool completed) |
virtual void | apply_filter (const diagram_filter &filter, const std::set< eid_t > &removed) |
Public Member Functions inherited from clanguml::common::model::decorated_element | |
virtual | ~decorated_element ()=default |
bool | skip () const |
bool | skip_relationship () const |
std::pair< relationship_t, std::string > | get_relationship () const |
std::string | style_spec () const |
const std::vector< std::shared_ptr< decorators::decorator > > & | decorators () const |
void | add_decorators (const std::vector< std::shared_ptr< decorators::decorator > > &decorators) |
void | append (const decorated_element &de) |
std::optional< comment_t > | comment () const |
void | set_comment (const comment_t &c) |
virtual std::optional< std::string > | doxygen_link () const |
Public Member Functions inherited from clanguml::common::model::source_location | |
source_location ()=default | |
source_location (std::string f, unsigned int l) | |
const std::string & | file () const |
void | set_file (const std::string &file) |
const std::string & | file_relative () const |
void | set_file_relative (const std::string &file) |
const std::string & | translation_unit () const |
void | set_translation_unit (const std::string &translation_unit) |
unsigned int | line () const |
void | set_line (const unsigned line) |
unsigned int | column () const |
void | set_column (const unsigned column) |
unsigned int | location_id () const |
void | set_location_id (unsigned int h) |
Private Attributes | |
eid_t | id_ {} |
std::optional< eid_t > | parent_element_id_ {} |
std::string | name_ |
std::vector< relationship > | relationships_ |
bool | nested_ {false} |
bool | complete_ {false} |
Friends | |
bool | operator== (const diagram_element &l, const diagram_element &r) |
std::ostream & | operator<< (std::ostream &out, const diagram_element &rhs) |
|
default |
|
overridedefault |
void clanguml::common::model::diagram_element::add_relationship | ( | relationship && | cr | ) |
Add relationships, whose source is this element.
cr | Relationship to another diagram element. |
Definition at line 52 of file diagram_element.cc.
|
virtual |
Return elements' diagram alias.
Reimplemented in clanguml::sequence_diagram::model::method.
Definition at line 44 of file diagram_element.cc.
void clanguml::common::model::diagram_element::append | ( | const decorated_element & | e | ) |
Add element to the diagram.
e | Diagram element. |
Definition at line 79 of file diagram_element.cc.
|
virtual |
Reimplemented in clanguml::class_diagram::model::class_.
Definition at line 106 of file diagram_element.cc.
bool clanguml::common::model::diagram_element::complete | ( | ) | const |
Returns the diagrams completion status.
Definition at line 102 of file diagram_element.cc.
void clanguml::common::model::diagram_element::complete | ( | bool | completed | ) |
Set the diagrams completion status.
completed |
Definition at line 104 of file diagram_element.cc.
|
virtual |
Return elements inja JSON context.
Reimplemented in clanguml::common::model::element, and clanguml::common::model::source_file.
Definition at line 84 of file diagram_element.cc.
|
inlinevirtual |
Return the elements fully qualified name.
This method should be implemented in each subclass, and ensure that for instance it includes fully qualified namespace, template params, etc.
Reimplemented in clanguml::common::model::element, clanguml::common::model::package, clanguml::sequence_diagram::model::method, clanguml::class_diagram::model::class_, clanguml::class_diagram::model::concept_, clanguml::class_diagram::model::enum_, clanguml::sequence_diagram::model::class_, clanguml::sequence_diagram::model::function, clanguml::sequence_diagram::model::function_template, and clanguml::common::model::source_file.
Definition at line 120 of file diagram_element.h.
const eid_t & clanguml::common::model::diagram_element::id | ( | ) | const |
Returns diagram element id.
Each element in the diagram is uniquely identified by id. The id is currently calculated from the full string representation of the element, in order to be uniquely identifiable among multiple translation units.
Definition at line 30 of file diagram_element.cc.
bool clanguml::common::model::diagram_element::is_nested | ( | ) | const |
Whether this element is nested in another element.
Definition at line 98 of file diagram_element.cc.
|
inline |
Return diagram element name.
Definition at line 103 of file diagram_element.h.
void clanguml::common::model::diagram_element::nested | ( | bool | nested | ) |
std::optional< eid_t > clanguml::common::model::diagram_element::parent_element_id | ( | ) | const |
Get elements parent package id.
Definition at line 34 of file diagram_element.cc.
std::vector< relationship > & clanguml::common::model::diagram_element::relationships | ( | ) |
Return all relationships outgoing from this element.
Definition at line 69 of file diagram_element.cc.
const std::vector< relationship > & clanguml::common::model::diagram_element::relationships | ( | ) | const |
Return all relationships outgoing from this element.
Definition at line 74 of file diagram_element.cc.
void clanguml::common::model::diagram_element::set_id | ( | eid_t | id | ) |
|
inline |
Set diagram elements name.
name | Elements name. |
Definition at line 96 of file diagram_element.h.
void clanguml::common::model::diagram_element::set_parent_element_id | ( | eid_t | id | ) |
Set elements parent package id.
id | Id of parent package. |
Definition at line 39 of file diagram_element.cc.
|
inlinevirtual |
Return the type name of the diagram element.
Reimplemented in clanguml::class_diagram::model::class_, clanguml::class_diagram::model::concept_, clanguml::class_diagram::model::enum_, clanguml::common::model::package, clanguml::sequence_diagram::model::participant, clanguml::sequence_diagram::model::class_, clanguml::sequence_diagram::model::function, clanguml::sequence_diagram::model::method, and clanguml::sequence_diagram::model::function_template.
Definition at line 110 of file diagram_element.h.
|
friend |
Definition at line 124 of file diagram_element.cc.
|
friend |
Definition at line 119 of file diagram_element.cc.
|
private |
Definition at line 199 of file diagram_element.h.
|
private |
Definition at line 194 of file diagram_element.h.
|
private |
Definition at line 196 of file diagram_element.h.
|
private |
Definition at line 198 of file diagram_element.h.
|
private |
Definition at line 195 of file diagram_element.h.
|
private |
Definition at line 197 of file diagram_element.h.