0.6.0
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
class_diagram_generator.h
Go to the documentation of this file.
1/**
2 * @file src/class_diagram/generators/graphml/class_diagram_generator.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
29#include "config/config.h"
30#include "util/util.h"
31
32#include <glob/glob.hpp>
33
34#include <filesystem>
35#include <fstream>
36#include <iostream>
37#include <sstream>
38
40
43template <typename C, typename D>
45
56
57using namespace clanguml::util;
58
59/**
60 * @brief Class diagram GraphML generator
61 */
62class generator : public common_generator<diagram_config, diagram_model> {
63public:
65
67
68 std::vector<
69 std::pair<std::string, common::generators::graphml::property_type>>
70 node_property_names() const override;
71
72 /**
73 * Render class element into a GraphML node.
74 *
75 * @param c class diagram element
76 * @param parent GraphML node
77 */
78 void generate(const class_ &c, graphml_node_t &parent) const;
79
80 /**
81 * Render ObjC interface or protocol element into a GraphML node.
82 *
83 * @param c enum diagram element
84 * @param parent GraphML node
85 */
86 void generate(const objc_interface &c, graphml_node_t &parent) const;
87
88 /**
89 * Render enum element into a GraphML node.
90 *
91 * @param c enum diagram element
92 * @param parent GraphML node
93 */
94 void generate(const enum_ &c, graphml_node_t &parent) const;
95
96 /**
97 * Render concept element into a GraphML node.
98 *
99 * @param c concept diagram element
100 * @param parent JSON node
101 */
102 void generate(const concept_ &c, graphml_node_t &parent) const;
103
104 /**
105 * Render package element into a GraphML node.
106 *
107 * @param p package diagram element
108 * @param parent GraphML node
109 */
110 void generate(const package &p, graphml_node_t &parent) const override;
111
112 void generate_top_level_elements(graphml_node_t &parent) const override;
113};
114
115} // namespace clanguml::class_diagram::generators::graphml