0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
enum.h
Go to the documentation of this file.
1/**
2 * @file src/class_diagram/model/enum.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 "class.h"
21
22#include <string>
23#include <vector>
24
26
27/*
28 * @brief Diagram element representing an enum.
29 */
32public:
33 enum_(const common::model::namespace_ &using_namespaces);
34
35 enum_(const enum_ &) = delete;
36 enum_(enum_ &&) = delete;
37 enum_ &operator=(const enum_ &) = delete;
38 enum_ &operator=(enum_ &&) = delete;
39
40 std::string type_name() const override { return "enum"; }
41
42 friend bool operator==(const enum_ &l, const enum_ &r);
43
44 std::string full_name(bool relative = true) const override;
45
46 /**
47 * @brief Get the enums constants.
48 *
49 * @return Enums constants names list.
50 */
51 std::vector<std::string> &constants();
52
53 /**
54 * @brief Get the enums constants.
55 *
56 * @return Enums constants names list.
57 */
58 const std::vector<std::string> &constants() const;
59
60 /**
61 * @brief Get Doxygen link to documentation page for this element.
62 *
63 * @return Doxygen link for this element.
64 */
65 std::optional<std::string> doxygen_link() const override;
66
67private:
68 std::vector<std::string> constants_;
69};
70
71} // namespace clanguml::class_diagram::model