0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
t00037 - Anonymous nested struct test case

Config

diagrams:
t00037_class:
type: class
generate_packages: true
glob:
- t00037.cc
using_namespace: clanguml::t00037
include:
namespaces:
- clanguml::t00037

Source code

File tests/t00037/t00037.cc

namespace clanguml {
namespace t00037 {
constexpr auto LENGTH{10ULL};
struct S {
double x;
double y;
};
class ST {
public:
struct {
double t;
double x;
double y;
double z;
} dimensions;
struct {
int len;
int flags;
}
#ifndef _MSC_VER
__attribute__((packed))
#endif
bars[LENGTH];
private:
struct {
double c{1.0};
double h{1.0};
} units;
S s[4][3][2];
};
struct A {
A()
{
st.dimensions.t = -1.0;
st.dimensions.x = 1.0;
st.dimensions.y = 1.0;
st.dimensions.z = 1.0;
}
ST st;
};
} // namespace t00037
} // namespace clanguml

Generated PlantUML diagrams

Generated Mermaid diagrams

Generated JSON models

{
"diagram_type": "class",
"elements": [
{
"bases": [],
"display_name": "S",
"id": "12092151151811100076",
"is_abstract": false,
"is_nested": false,
"is_struct": true,
"is_template": false,
"is_union": false,
"members": [
{
"access": "public",
"is_static": false,
"name": "x",
"source_location": {
"column": 12,
"file": "t00037.cc",
"line": 7,
"translation_unit": "t00037.cc"
},
"type": "double"
},
{
"access": "public",
"is_static": false,
"name": "y",
"source_location": {
"column": 12,
"file": "t00037.cc",
"line": 8,
"translation_unit": "t00037.cc"
},
"type": "double"
}
],
"methods": [],
"name": "S",
"namespace": "clanguml::t00037",
"source_location": {
"column": 8,
"file": "t00037.cc",
"line": 6,
"translation_unit": "t00037.cc"
},
"template_parameters": [],
"type": "class"
},
{
"bases": [],
"display_name": "ST",
"id": "89624331032310202",
"is_abstract": false,
"is_nested": false,
"is_struct": false,
"is_template": false,
"is_union": false,
"members": [
{
"access": "public",
"is_static": false,
"name": "dimensions",
"source_location": {
"column": 7,
"file": "t00037.cc",
"line": 18,
"translation_unit": "t00037.cc"
},
"type": "ST::(dimensions)"
},
{
"access": "public",
"is_static": false,
"name": "bars",
"source_location": {
"column": 5,
"file": "t00037.cc",
"line": 27,
"translation_unit": "t00037.cc"
},
"type": "ST::(bars)[10]"
},
{
"access": "private",
"is_static": false,
"name": "units",
"source_location": {
"column": 7,
"file": "t00037.cc",
"line": 33,
"translation_unit": "t00037.cc"
},
"type": "ST::(units)"
},
{
"access": "private",
"is_static": false,
"name": "s",
"source_location": {
"column": 7,
"file": "t00037.cc",
"line": 35,
"translation_unit": "t00037.cc"
},
"type": "S[4][3][2]"
}
],
"methods": [],
"name": "ST",
"namespace": "clanguml::t00037",
"source_location": {
"column": 7,
"file": "t00037.cc",
"line": 11,
"translation_unit": "t00037.cc"
},
"template_parameters": [],
"type": "class"
},
{
"bases": [],
"display_name": "ST::(dimensions)",
"id": "15846562543783208401",
"is_abstract": false,
"is_nested": true,
"is_struct": true,
"is_template": false,
"is_union": false,
"members": [
{
"access": "public",
"is_static": false,
"name": "t",
"source_location": {
"column": 16,
"file": "t00037.cc",
"line": 14,
"translation_unit": "t00037.cc"
},
"type": "double"
},
{
"access": "public",
"is_static": false,
"name": "x",
"source_location": {
"column": 16,
"file": "t00037.cc",
"line": 15,
"translation_unit": "t00037.cc"
},
"type": "double"
},
{
"access": "public",
"is_static": false,
"name": "y",
"source_location": {
"column": 16,
"file": "t00037.cc",
"line": 16,
"translation_unit": "t00037.cc"
},
"type": "double"
},
{
"access": "public",
"is_static": false,
"name": "z",
"source_location": {
"column": 16,
"file": "t00037.cc",
"line": 17,
"translation_unit": "t00037.cc"
},
"type": "double"
}
],
"methods": [],
"name": "ST::(dimensions)",
"namespace": "clanguml::t00037",
"source_location": {
"column": 5,
"file": "t00037.cc",
"line": 13,
"translation_unit": "t00037.cc"
},
"template_parameters": [],
"type": "class"
},
{
"bases": [],
"display_name": "ST::(bars)",
"id": "7016651489261202313",
"is_abstract": false,
"is_nested": true,
"is_struct": true,
"is_template": false,
"is_union": false,
"members": [
{
"access": "public",
"is_static": false,
"name": "len",
"source_location": {
"column": 13,
"file": "t00037.cc",
"line": 21,
"translation_unit": "t00037.cc"
},
"type": "int"
},
{
"access": "public",
"is_static": false,
"name": "flags",
"source_location": {
"column": 13,
"file": "t00037.cc",
"line": 22,
"translation_unit": "t00037.cc"
},
"type": "int"
}
],
"methods": [],
"name": "ST::(bars)",
"namespace": "clanguml::t00037",
"source_location": {
"column": 5,
"file": "t00037.cc",
"line": 20,
"translation_unit": "t00037.cc"
},
"template_parameters": [],
"type": "class"
},
{
"bases": [],
"display_name": "ST::(units)",
"id": "14489164071123227020",
"is_abstract": false,
"is_nested": true,
"is_struct": true,
"is_template": false,
"is_union": false,
"members": [
{
"access": "public",
"is_static": false,
"name": "c",
"source_location": {
"column": 16,
"file": "t00037.cc",
"line": 31,
"translation_unit": "t00037.cc"
},
"type": "double"
},
{
"access": "public",
"is_static": false,
"name": "h",
"source_location": {
"column": 16,
"file": "t00037.cc",
"line": 32,
"translation_unit": "t00037.cc"
},
"type": "double"
}
],
"methods": [],
"name": "ST::(units)",
"namespace": "clanguml::t00037",
"source_location": {
"column": 5,
"file": "t00037.cc",
"line": 30,
"translation_unit": "t00037.cc"
},
"template_parameters": [],
"type": "class"
},
{
"bases": [],
"display_name": "A",
"id": "10582353454193159633",
"is_abstract": false,
"is_nested": false,
"is_struct": true,
"is_template": false,
"is_union": false,
"members": [
{
"access": "public",
"is_static": false,
"name": "st",
"source_location": {
"column": 8,
"file": "t00037.cc",
"line": 47,
"translation_unit": "t00037.cc"
},
"type": "ST"
}
],
"methods": [
{
"access": "public",
"display_name": "A",
"is_const": false,
"is_consteval": false,
"is_constexpr": false,
"is_constructor": true,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
"is_noexcept": false,
"is_operator": false,
"is_pure_virtual": false,
"is_static": false,
"is_virtual": false,
"name": "A",
"parameters": [],
"source_location": {
"column": 5,
"file": "t00037.cc",
"line": 39,
"translation_unit": "t00037.cc"
},
"template_parameters": [],
"type": "void"
}
],
"name": "A",
"namespace": "clanguml::t00037",
"source_location": {
"column": 8,
"file": "t00037.cc",
"line": 38,
"translation_unit": "t00037.cc"
},
"template_parameters": [],
"type": "class"
}
],
"name": "t00037_class",
"package_type": "namespace",
"relationships": [
{
"access": "private",
"destination": "12092151151811100076",
"label": "s",
"multiplicity_destination": "24",
"source": "89624331032310202",
"type": "aggregation"
},
{
"access": "public",
"destination": "15846562543783208401",
"label": "dimensions",
"source": "89624331032310202",
"type": "aggregation"
},
{
"access": "public",
"destination": "7016651489261202313",
"label": "bars",
"multiplicity_destination": "10",
"source": "89624331032310202",
"type": "aggregation"
},
{
"access": "private",
"destination": "14489164071123227020",
"label": "units",
"source": "89624331032310202",
"type": "aggregation"
},
{
"access": "public",
"destination": "89624331032310202",
"label": "st",
"source": "10582353454193159633",
"type": "aggregation"
}
],
"using_namespace": "clanguml::t00037"
}