0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
src
common
model
relationship.cc
Go to the documentation of this file.
1
/**
2
* @file src/common/model/relationship.cc
3
*
4
* Copyright (c) 2021-2024 Bartek Kryza <bkryza@gmail.com>
5
*
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
*/
18
19
#include "
relationship.h
"
20
21
#include <utility>
22
23
namespace
clanguml::common::model
{
24
25
relationship::relationship
(
relationship_t
type,
eid_t
destination,
26
access_t
access, std::string label, std::string multiplicity_source,
27
std::string multiplicity_destination)
28
: type_{type}
29
, destination_{destination}
30
, multiplicity_source_{
std
::move(multiplicity_source)}
31
, multiplicity_destination_{
std
::move(multiplicity_destination)}
32
, label_{
std
::move(label)}
33
, access_{access}
34
{
35
}
36
37
void
relationship::set_type
(
relationship_t
type)
noexcept
{ type_ = type; }
38
39
relationship_t
relationship::type
() const noexcept {
return
type_
; }
40
41
void
relationship::set_destination
(
eid_t
destination)
42
{
43
destination_
=
destination
;
44
}
45
46
eid_t
relationship::destination
()
const
{
return
destination_
; }
47
48
void
relationship::set_multiplicity_source
(
49
const
std::string &multiplicity_source)
50
{
51
multiplicity_source_
=
multiplicity_source
;
52
}
53
54
std::string
relationship::multiplicity_source
()
const
55
{
56
return
multiplicity_source_
;
57
}
58
59
void
relationship::set_multiplicity_destination
(
60
const
std::string &multiplicity_destination)
61
{
62
multiplicity_destination_
=
multiplicity_destination
;
63
}
64
65
std::string
relationship::multiplicity_destination
()
const
66
{
67
return
multiplicity_destination_
;
68
}
69
70
void
relationship::set_label
(
const
std::string &label) {
label_
=
label
; }
71
72
std::string
relationship::label
()
const
{
return
label_
; }
73
74
void
relationship::set_access
(
access_t
access)
noexcept
{ access_ = access; }
75
76
access_t
relationship::access
() const noexcept {
return
access_
; }
77
78
bool
operator==
(
const
relationship
&l,
const
relationship
&r)
79
{
80
return
l.
type
() == r.
type
() && l.
destination
() == r.
destination
() &&
81
l.
label
() == r.
label
();
82
}
83
}
// namespace clanguml::common::model
Copyright © 2022-present
Bartek Kryza
Generated by
1.9.7