0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
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
24
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
37void relationship::set_type(relationship_t type) noexcept { type_ = type; }
38
39relationship_t relationship::type() const noexcept { return type_; }
40
42{
44}
45
47
49 const std::string &multiplicity_source)
50{
52}
53
55{
57}
58
60 const std::string &multiplicity_destination)
61{
63}
64
66{
68}
69
70void relationship::set_label(const std::string &label) { label_ = label; }
71
72std::string relationship::label() const { return label_; }
73
74void relationship::set_access(access_t access) noexcept { access_ = access; }
75
76access_t relationship::access() const noexcept { return access_; }
77
78bool 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