0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
src
class_diagram
model
class_parent.h
Go to the documentation of this file.
1
/**
2
* @file src/class_diagram/model/class_parent.h
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
#pragma once
19
20
#include "
common/clang_utils.h
"
21
#include "
common/model/enums.h
"
22
#include "
common/types.h
"
23
24
#include <string>
25
26
namespace
clanguml::class_diagram::model
{
27
28
using
clanguml::common::eid_t
;
29
30
/**
31
* @brief Class parent relationship model.
32
*
33
* @todo Consider refactoring this class to a regular relationship.
34
*/
35
class
class_parent
{
36
public
:
37
class_parent
() =
default
;
38
39
class_parent
(
const
std::string &
name
)
40
{
41
set_name
(
name
);
42
set_id
(
common::to_id
(
name
));
43
}
44
45
/**
46
* @brief Set the fully qualified name of class parent.
47
*
48
* @param name Fully qualified name of the parent class.
49
*/
50
void
set_name
(
const
std::string &
name
);
51
52
/**
53
* @brief Get the fully qualified name of class parent.
54
*
55
* @return Fully qualified name of the parent class.
56
*/
57
std::string
name
()
const
;
58
59
/**
60
* @brief Set the id of class parent.
61
*
62
* @param id Id of the parent class.
63
*/
64
void
set_id
(
eid_t
id
);
65
66
/**
67
* @brief Get the id of class parent.
68
*
69
* @return Id of the parent class.
70
*/
71
eid_t
id
() const noexcept;
72
73
/**
74
* @brief Set whether the parent is virtual.
75
*
76
* @param is_virtual True if the parent is virtual
77
*/
78
void
is_virtual
(
bool
is_virtual
);
79
80
/**
81
* @brief Get whether the parent is virtual.
82
*
83
* @return True, if the parent is virtual
84
*/
85
bool
is_virtual
() const;
86
87
/**
88
* @brief Set the parents access scope
89
*
90
* @param access Parents access scope
91
*/
92
void
set_access
(common::model::access_t
access
);
93
94
/**
95
* @brief Get parents access scope.
96
*
97
* @return Parents access scope.
98
*/
99
common::model::access_t
access
() const;
100
101
private:
102
eid_t
id_
{};
103
std::string
name_
;
104
bool
is_virtual_
{
false
};
105
common::model::access_t
access_
{
common::model::access_t::kPublic
};
106
};
107
}
// namespace clanguml::class_diagram::model
Copyright © 2022-present
Bartek Kryza
Generated by
1.9.7