Class representing any relationship other than inheritance. More...
Class representing any relationship other than inheritance.
This class represents all kinds of relationships between diagram elements, except for inheritance which are handled in a special way (See clanguml::class_diagram::model::class_parent).
Definition at line 40 of file relationship.h.
#include <relationship.h>
Public Member Functions | |
relationship (relationship_t type, eid_t destination, access_t access=access_t::kPublic, std::string label="", std::string multiplicity_source="", std::string multiplicity_destination="") | |
relationship (eid_t destination, access_t access=access_t::kPublic, bool is_virtual=false) | |
~relationship () override=default | |
void | set_type (relationship_t type) noexcept |
relationship_t | type () const noexcept |
void | set_destination (eid_t destination) |
eid_t | destination () const |
void | set_multiplicity_source (const std::string &multiplicity_source) |
std::string | multiplicity_source () const |
void | set_multiplicity_destination (const std::string &multiplicity_destination) |
std::string | multiplicity_destination () const |
void | set_label (const std::string &label) |
std::string | label () const |
void | set_access (access_t scope) noexcept |
access_t | access () const noexcept |
bool | is_virtual () const |
void | set_virtual (bool iv) |
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::stylable_element | |
void | set_style (const std::string &style) |
std::optional< std::string > | style () 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 | |
relationship_t | type_ |
eid_t | destination_ |
std::string | multiplicity_source_ |
std::string | multiplicity_destination_ |
std::string | label_ |
access_t | access_ |
bool | is_virtual_ |
Friends | |
bool | operator== (const relationship &l, const relationship &r) |
clanguml::common::model::relationship::relationship | ( | relationship_t | type, |
eid_t | destination, | ||
access_t | access = access_t::kPublic , |
||
std::string | label = "" , |
||
std::string | multiplicity_source = "" , |
||
std::string | multiplicity_destination = "" |
||
) |
Constructor.
type | Type of relationship |
destination | Id of the relationship target |
access | Access scope of the relationship |
label | Relationship label |
multiplicity_source | Multiplicity at the source |
multiplicity_destination | Multiplicity at the destination |
Definition at line 25 of file relationship.cc.
clanguml::common::model::relationship::relationship | ( | eid_t | destination, |
access_t | access = access_t::kPublic , |
||
bool | is_virtual = false |
||
) |
Convenience constructor for extension relationships.
destination | Id of relationship target. |
access | Inheritance access (public, protected, private). |
is_virtual | Whether the inheritance is virtual. |
Definition at line 38 of file relationship.cc.
|
overridedefault |
|
noexcept |
Get the relationship access scope (e.g. public
).
Definition at line 83 of file relationship.cc.
eid_t clanguml::common::model::relationship::destination | ( | ) | const |
Get the id of the target element of this relationship.
Definition at line 53 of file relationship.cc.
bool clanguml::common::model::relationship::is_virtual | ( | ) | const |
Return true if an extension relationship is virtual.
Definition at line 85 of file relationship.cc.
std::string clanguml::common::model::relationship::label | ( | ) | const |
Get the relationship label.
Definition at line 79 of file relationship.cc.
std::string clanguml::common::model::relationship::multiplicity_destination | ( | ) | const |
Set the relationship multiplicity at the destination.
Definition at line 72 of file relationship.cc.
std::string clanguml::common::model::relationship::multiplicity_source | ( | ) | const |
Set the relationship multiplicity at the source.
Definition at line 61 of file relationship.cc.
|
noexcept |
Set the access scope for this relationship (e.g public
)
scope | Access scope |
Definition at line 81 of file relationship.cc.
void clanguml::common::model::relationship::set_destination | ( | eid_t | destination | ) |
Set id of the diagram element which is the target of this relationship.
destination | Target element id. |
Definition at line 48 of file relationship.cc.
void clanguml::common::model::relationship::set_label | ( | const std::string & | label | ) |
Set relationship label.
label | Relationship label. |
Definition at line 77 of file relationship.cc.
void clanguml::common::model::relationship::set_multiplicity_destination | ( | const std::string & | multiplicity_destination | ) |
Set the relationship multiplicity at the destination.
multiplicity_destination | Destination multiplicity. |
Definition at line 66 of file relationship.cc.
void clanguml::common::model::relationship::set_multiplicity_source | ( | const std::string & | multiplicity_source | ) |
Set the relationship multiplicity at the source.
multiplicity_source | Source multiplicity. |
Definition at line 55 of file relationship.cc.
|
noexcept |
Set the type of relatinoship.
type | Type of relationship. |
Definition at line 44 of file relationship.cc.
void clanguml::common::model::relationship::set_virtual | ( | bool | iv | ) |
Sets whether an extension relationship is virtual.
iv | True, if an extension relationship is virtual. |
Definition at line 87 of file relationship.cc.
|
noexcept |
Get the type of relatinoship.
Definition at line 46 of file relationship.cc.
|
friend |
Definition at line 93 of file relationship.cc.
|
private |
Definition at line 179 of file relationship.h.
|
private |
Definition at line 175 of file relationship.h.
|
private |
Definition at line 180 of file relationship.h.
|
private |
Definition at line 178 of file relationship.h.
|
private |
Definition at line 177 of file relationship.h.
|
private |
Definition at line 176 of file relationship.h.
|
private |
Definition at line 174 of file relationship.h.