0.6.0
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
src
class_diagram
generators
graphml
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
20
#include "
class_diagram/model/class.h
"
21
#include "
class_diagram/model/concept.h
"
22
#include "
class_diagram/model/diagram.h
"
23
#include "
class_diagram/model/enum.h
"
24
#include "
class_diagram/model/jinja_context.h
"
25
#include "
class_diagram/visitor/translation_unit_visitor.h
"
26
#include "
common/generators/graphml/generator.h
"
27
#include "
common/generators/nested_element_stack.h
"
28
#include "
common/model/relationship.h
"
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
39
namespace
clanguml::class_diagram::generators::graphml
{
40
41
using
diagram_config
=
clanguml::config::class_diagram
;
42
using
diagram_model
=
clanguml::class_diagram::model::diagram
;
43
template
<
typename
C,
typename
D>
44
using
common_generator
=
clanguml::common::generators::graphml::generator<C, D>
;
45
46
using
clanguml::class_diagram::model::class_
;
47
using
clanguml::class_diagram::model::class_element
;
48
using
clanguml::class_diagram::model::concept_
;
49
using
clanguml::class_diagram::model::enum_
;
50
using
clanguml::class_diagram::model::objc_interface
;
51
using
clanguml::common::generators::graphml::graphml_node_t
;
52
using
clanguml::common::model::access_t
;
53
using
clanguml::common::model::package
;
54
using
clanguml::common::model::relationship_t
;
55
using
common::jinja::jinja_context
;
56
57
using namespace
clanguml::util
;
58
59
/**
60
* @brief Class diagram GraphML generator
61
*/
62
class
generator
:
public
common_generator
<diagram_config, diagram_model> {
63
public
:
64
generator
(
diagram_config
&
config
,
diagram_model
&
model
);
65
66
using
common_generator
<
diagram_config
,
diagram_model
>
::generate
;
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
Copyright © 2022-present
Bartek Kryza
Generated by
1.9.7