33std::vector<std::pair<std::string, common::generators::graphml::property_type>>
38 defaults.emplace_back(
45 for (
const auto &p :
model()) {
46 if (
auto *pkg =
dynamic_cast<package *
>(p.get()); pkg) {
51 model().dynamic_apply(
52 p.get(), [&](
auto *el) { generate(*el, parent); });
59 const auto &uns =
config().using_namespace();
60 using namespace common::generators::graphml;
62 pugi::xml_node package_node;
63 pugi::xml_node graph_node;
65 if (
config().generate_packages()) {
68 if (!uns.starts_with({p.full_name(false)})) {
70 LOG_DBG(
"Generating package {}", name);
73 parent, p.
alias(), name, to_string(
config().package_type()));
78 for (
const auto &subpackage : p) {
79 if (
dynamic_cast<package *
>(subpackage.get()) !=
nullptr) {
80 const auto &sp =
dynamic_cast<package &
>(*subpackage);
82 if (
config().generate_packages()) {
90 model().dynamic_apply(subpackage.get(), [&](
auto *el) {
91 if (config().generate_packages()) {
92 generate(*el, graph_node);
102 if (config().generate_packages()) {
103 generate_notes(p, package_node);
107void generator::generate(
const class_ &c, graphml_node_t &parent)
const
109 using namespace common::generators::graphml;
111 std::string full_name;
112 if (!config().generate_fully_qualified_name())
117 auto class_node = make_node(parent, node_ids_.add(c.
alias()));
118 add_data(class_node,
"type", c.
type_name());
119 add_cdata(class_node,
"name", config().simplify_template_type(full_name));
121 add_data(class_node,
"stereotype",
"abstract");
124 add_data(class_node,
"stereotype",
"union");
126 add_data(class_node,
"is_template", to_string(c.
is_template()));
128 generate_link(class_node, c);
131void generator::generate(
const enum_ &e, graphml_node_t &parent)
const
133 using namespace common::generators::graphml;
135 std::string full_name;
136 if (!config().generate_fully_qualified_name())
141 auto node = make_node(parent, node_ids_.add(e.
alias()));
143 add_cdata(node,
"name", full_name);
144 generate_link(node, e);
147void generator::generate(
const concept_ &c, graphml_node_t &parent)
const
149 using namespace common::generators::graphml;
151 std::string full_name;
152 if (!config().generate_fully_qualified_name())
157 auto node = make_node(parent, node_ids_.add(c.
alias()));
159 add_cdata(node,
"name", full_name);
160 generate_link(node, c);
165 using namespace common::generators::graphml;
167 auto node = make_node(parent, node_ids_.add(c.
alias()));
170 generate_link(node, c);