0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
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
22
24 const std::string &name, const std::string &type)
25 : class_element{access, name, type}
26{
27}
28
30{
31 if (template_params().empty()) {
33 }
34 else {
35 std::stringstream template_params_str;
36 render_template_params(template_params_str, un, true);
38 fmt::format("{}{}", name(), template_params_str.str()));
39 }
40}
41
42std::string class_method::display_name() const { return display_name_; }
43
44void class_method::set_display_name(const std::string &display_name)
45{
47}
48
50
51void class_method::is_pure_virtual(bool is_pure_virtual)
52{
54}
55
56bool class_method::is_virtual() const { return is_virtual_; }
57
59
60bool class_method::is_const() const { return is_const_; }
61
62void class_method::is_const(bool is_const) { is_const_ = is_const; }
63
65
66void class_method::is_defaulted(bool is_defaulted)
67{
69}
70
71bool class_method::is_deleted() const { return is_deleted_; }
72
74
75bool class_method::is_static() const { return is_static_; }
76
77void class_method::is_static(bool is_static) { is_static_ = is_static; }
78
80
81void class_method::is_constexpr(bool is_constexpr)
82{
84}
85
87
88void class_method::is_consteval(bool is_consteval)
89{
91}
92
94
95void class_method::is_coroutine(bool is_coroutine)
96{
98}
99
101
103
105
106void class_method::is_constructor(bool is_constructor)
107{
109}
110
112
113void class_method::is_destructor(bool is_destructor)
114{
116}
117
119
120void class_method::is_move_assignment(bool is_move_assignment)
121{
123}
124
126
127void class_method::is_copy_assignment(bool is_copy_assignment)
128{
130}
131
133
135
136const std::vector<method_parameter> &class_method::parameters() const
137{
138 return parameters_;
139}
140
142{
143 parameters_.emplace_back(std::move(parameter));
144}
145
146} // namespace clanguml::class_diagram::model