0.6.0
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
src
class_diagram
model
class_member_base.h
Go to the documentation of this file.
1
/**
2
* @file src/class_diagram/model/class_member_base.h
3
*
4
* Copyright (c) 2021-2025 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 "
class_element.h
"
21
22
#include <string>
23
24
namespace
clanguml::class_diagram::model
{
25
26
/**
27
* @brief Generic class member model.
28
*/
29
class
class_member_base
:
public
class_element
{
30
public
:
31
/**
32
* @brief Constructor.
33
*
34
* @param access Members access scope (e.g. public)
35
* @param name Members name.
36
* @param type Members type as string.
37
*/
38
class_member_base
(
common::model::access_t
access
,
const
std::string &
name
,
39
const
std::string &
type
);
40
41
~class_member_base
()
override
=
default
;
42
43
/**
44
* @brief Whether the member is static.
45
*
46
* @return True, if the member is static.
47
*/
48
bool
is_static
()
const
;
49
50
/**
51
* @brief Set members static status.
52
*
53
* @param is_static True, if the member is static.
54
*/
55
void
is_static
(
bool
is_static
);
56
57
/**
58
* @brief Set members destination multiplicity.
59
*
60
* @param m Optional multiplicity value
61
*/
62
void
set_destination_multiplicity
(std::optional<size_t> m);
63
64
/**
65
* @brief Get members destination multiplicity.
66
*
67
* @return Optional multiplicity value
68
*/
69
std::optional<size_t>
destination_multiplicity
()
const
;
70
71
private
:
72
bool
is_static_
{
false
};
73
std::optional<size_t>
destination_multiplicity_
{};
74
};
75
76
}
// namespace clanguml::class_diagram::model
Copyright © 2022-present
Bartek Kryza
Generated by
1.9.7