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

Class representing any relationship other than inheritance. More...

Detailed Description

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 39 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 () 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
 
- 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_tcomment () 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
 

Private Attributes

relationship_t type_
 
eid_t destination_
 
std::string multiplicity_source_
 
std::string multiplicity_destination_
 
std::string label_
 
access_t access_
 

Friends

bool operator== (const relationship &l, const relationship &r)
 

Constructor & Destructor Documentation

◆ relationship()

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.

Parameters
typeType of relationship
destinationId of the relationship target
accessAccess scope of the relationship
labelRelationship label
multiplicity_sourceMultiplicity at the source
multiplicity_destinationMultiplicity at the destination

Definition at line 25 of file relationship.cc.

◆ ~relationship()

clanguml::common::model::relationship::~relationship ( )
overridedefault

Member Function Documentation

◆ access()

access_t clanguml::common::model::relationship::access ( ) const
noexcept

Get the relationship access scope (e.g. public).

Returns
Access scope

Definition at line 76 of file relationship.cc.

76{ return access_; }

◆ destination()

eid_t clanguml::common::model::relationship::destination ( ) const

Get the id of the target element of this relationship.

Returns
Target element id.

Definition at line 46 of file relationship.cc.

46{ return destination_; }

◆ label()

std::string clanguml::common::model::relationship::label ( ) const

Get the relationship label.

Returns
Relationoship label.

Definition at line 72 of file relationship.cc.

72{ return label_; }

◆ multiplicity_destination()

std::string clanguml::common::model::relationship::multiplicity_destination ( ) const

Set the relationship multiplicity at the destination.

Returns
Destination multiplicity.

Definition at line 65 of file relationship.cc.

66{
68}

◆ multiplicity_source()

std::string clanguml::common::model::relationship::multiplicity_source ( ) const

Set the relationship multiplicity at the source.

Returns
Source multiplicity.

Definition at line 54 of file relationship.cc.

55{
57}

◆ set_access()

void clanguml::common::model::relationship::set_access ( access_t  scope)
noexcept

Set the access scope for this relationship (e.g public)

Parameters
scopeAccess scope

Definition at line 74 of file relationship.cc.

74{ access_ = access; }

◆ set_destination()

void clanguml::common::model::relationship::set_destination ( eid_t  destination)

Set id of the diagram element which is the target of this relationship.

Parameters
destinationTarget element id.

Definition at line 41 of file relationship.cc.

42{
44}

◆ set_label()

void clanguml::common::model::relationship::set_label ( const std::string &  label)

Set relationship label.

Parameters
labelRelationship label.

Definition at line 70 of file relationship.cc.

70{ label_ = label; }

◆ set_multiplicity_destination()

void clanguml::common::model::relationship::set_multiplicity_destination ( const std::string &  multiplicity_destination)

Set the relationship multiplicity at the destination.

Parameters
multiplicity_destinationDestination multiplicity.

Definition at line 59 of file relationship.cc.

◆ set_multiplicity_source()

void clanguml::common::model::relationship::set_multiplicity_source ( const std::string &  multiplicity_source)

Set the relationship multiplicity at the source.

Parameters
multiplicity_sourceSource multiplicity.

Definition at line 48 of file relationship.cc.

◆ set_type()

void clanguml::common::model::relationship::set_type ( relationship_t  type)
noexcept

Set the type of relatinoship.

Parameters
typeType of relationship.

Definition at line 37 of file relationship.cc.

37{ type_ = type; }

◆ type()

relationship_t clanguml::common::model::relationship::type ( ) const
noexcept

Get the type of relatinoship.

Returns
Type of relationship.

Definition at line 39 of file relationship.cc.

39{ return type_; }

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const relationship l,
const relationship r 
)
friend

Definition at line 78 of file relationship.cc.

79{
80 return l.type() == r.type() && l.destination() == r.destination() &&
81 l.label() == r.label();
82}

Member Data Documentation

◆ access_

access_t clanguml::common::model::relationship::access_
private

Definition at line 153 of file relationship.h.

◆ destination_

eid_t clanguml::common::model::relationship::destination_
private

Definition at line 149 of file relationship.h.

◆ label_

std::string clanguml::common::model::relationship::label_
private

Definition at line 152 of file relationship.h.

◆ multiplicity_destination_

std::string clanguml::common::model::relationship::multiplicity_destination_
private

Definition at line 151 of file relationship.h.

◆ multiplicity_source_

std::string clanguml::common::model::relationship::multiplicity_source_
private

Definition at line 150 of file relationship.h.

◆ type_

relationship_t clanguml::common::model::relationship::type_
private

Definition at line 148 of file relationship.h.


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