0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
src
class_diagram
model
class_method.cc
Go to the documentation of this file.
1
/**
2
* @file src/class_diagram/model/class_method.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 "
class_method.h
"
20
21
namespace
clanguml::class_diagram::model
{
22
23
class_method::class_method
(
common::model::access_t
access,
24
const
std::string &name,
const
std::string &type)
25
:
class_element
{access, name, type}
26
{
27
}
28
29
void
class_method::update
(
const
common::model::namespace_
&un)
30
{
31
if
(
template_params
().empty()) {
32
set_display_name
(
name
());
33
}
34
else
{
35
std::stringstream template_params_str;
36
render_template_params
(template_params_str, un,
true
);
37
set_display_name
(
38
fmt::format(
"{}{}"
,
name
(), template_params_str.str()));
39
}
40
}
41
42
std::string
class_method::display_name
()
const
{
return
display_name_
; }
43
44
void
class_method::set_display_name
(
const
std::string &display_name)
45
{
46
display_name_
=
display_name
;
47
}
48
49
bool
class_method::is_pure_virtual
()
const
{
return
is_pure_virtual_
; }
50
51
void
class_method::is_pure_virtual
(
bool
is_pure_virtual)
52
{
53
is_pure_virtual_
=
is_pure_virtual
;
54
}
55
56
bool
class_method::is_virtual
()
const
{
return
is_virtual_
; }
57
58
void
class_method::is_virtual
(
bool
is_virtual) {
is_virtual_
=
is_virtual
; }
59
60
bool
class_method::is_const
()
const
{
return
is_const_
; }
61
62
void
class_method::is_const
(
bool
is_const) {
is_const_
=
is_const
; }
63
64
bool
class_method::is_defaulted
()
const
{
return
is_defaulted_
; }
65
66
void
class_method::is_defaulted
(
bool
is_defaulted)
67
{
68
is_defaulted_
=
is_defaulted
;
69
}
70
71
bool
class_method::is_deleted
()
const
{
return
is_deleted_
; }
72
73
void
class_method::is_deleted
(
bool
is_deleted) {
is_deleted_
=
is_deleted
; }
74
75
bool
class_method::is_static
()
const
{
return
is_static_
; }
76
77
void
class_method::is_static
(
bool
is_static) {
is_static_
=
is_static
; }
78
79
bool
class_method::is_constexpr
()
const
{
return
is_constexpr_
; }
80
81
void
class_method::is_constexpr
(
bool
is_constexpr)
82
{
83
is_constexpr_
=
is_constexpr
;
84
}
85
86
bool
class_method::is_consteval
()
const
{
return
is_consteval_
; }
87
88
void
class_method::is_consteval
(
bool
is_consteval)
89
{
90
is_consteval_
=
is_consteval
;
91
}
92
93
bool
class_method::is_coroutine
()
const
{
return
is_coroutine_
; }
94
95
void
class_method::is_coroutine
(
bool
is_coroutine)
96
{
97
is_coroutine_
=
is_coroutine
;
98
}
99
100
bool
class_method::is_noexcept
()
const
{
return
is_noexcept_
; }
101
102
void
class_method::is_noexcept
(
bool
is_noexcept) {
is_noexcept_
=
is_noexcept
; }
103
104
bool
class_method::is_constructor
()
const
{
return
is_constructor_
; }
105
106
void
class_method::is_constructor
(
bool
is_constructor)
107
{
108
is_constructor_
=
is_constructor
;
109
}
110
111
bool
class_method::is_destructor
()
const
{
return
is_destructor_
; }
112
113
void
class_method::is_destructor
(
bool
is_destructor)
114
{
115
is_destructor_
=
is_destructor
;
116
}
117
118
bool
class_method::is_move_assignment
()
const
{
return
is_move_assignment_
; }
119
120
void
class_method::is_move_assignment
(
bool
is_move_assignment)
121
{
122
is_move_assignment_
=
is_move_assignment
;
123
}
124
125
bool
class_method::is_copy_assignment
()
const
{
return
is_copy_assignment_
; }
126
127
void
class_method::is_copy_assignment
(
bool
is_copy_assignment)
128
{
129
is_copy_assignment_
=
is_copy_assignment
;
130
}
131
132
bool
class_method::is_operator
()
const
{
return
is_operator_
; }
133
134
void
class_method::is_operator
(
bool
is_operator) {
is_operator_
=
is_operator
; }
135
136
const
std::vector<method_parameter> &
class_method::parameters
()
const
137
{
138
return
parameters_
;
139
}
140
141
void
class_method::add_parameter
(
method_parameter
&¶meter)
142
{
143
parameters_
.emplace_back(std::move(parameter));
144
}
145
146
}
// namespace clanguml::class_diagram::model
Copyright © 2022-present
Bartek Kryza
Generated by
1.9.7