From 3a772a9102657843d3f7779e857c04af301fd742 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 25 Mar 2023 18:18:31 +0100 Subject: [PATCH] Updated test cases documentation --- docs/test_cases/t00002.md | 439 +++++++++++++ docs/test_cases/t00002_class.svg | 36 +- docs/test_cases/t00003.md | 375 +++++++++++ docs/test_cases/t00003_class.svg | 46 +- docs/test_cases/t00004.md | 468 ++++++++++++++ docs/test_cases/t00004_class.svg | 76 +-- docs/test_cases/t00005.md | 480 ++++++++++++++ docs/test_cases/t00005_class.svg | 110 ++-- docs/test_cases/t00006.md | 668 ++++++++++++++++++++ docs/test_cases/t00006_class.svg | 132 ++-- docs/test_cases/t00007.md | 144 +++++ docs/test_cases/t00007_class.svg | 30 +- docs/test_cases/t00008.md | 422 +++++++++++++ docs/test_cases/t00008_class.svg | 68 +- docs/test_cases/t00009.md | 216 +++++++ docs/test_cases/t00009_class.svg | 32 +- docs/test_cases/t00010.md | 213 +++++++ docs/test_cases/t00010_class.svg | 34 +- docs/test_cases/t00011.md | 141 +++++ docs/test_cases/t00011_class.svg | 22 +- docs/test_cases/t00012.md | 507 +++++++++++++++ docs/test_cases/t00012_class.svg | 66 +- docs/test_cases/t00013.md | 709 +++++++++++++++++++++ docs/test_cases/t00013_class.svg | 82 +-- docs/test_cases/t00014.md | 941 ++++++++++++++++++++++++++++ docs/test_cases/t00014_class.svg | 116 ++-- docs/test_cases/t00015.md | 151 +++++ docs/test_cases/t00015_class.svg | 22 +- docs/test_cases/t00016.md | 210 +++++++ docs/test_cases/t00016_class.svg | 26 +- docs/test_cases/t00017.md | 538 ++++++++++++++++ docs/test_cases/t00017_class.svg | 66 +- docs/test_cases/t00018.md | 273 ++++++++ docs/test_cases/t00018_class.svg | 18 +- docs/test_cases/t00019.md | 479 ++++++++++++++ docs/test_cases/t00019_class.svg | 40 +- docs/test_cases/t00020.md | 513 +++++++++++++++ docs/test_cases/t00020_class.svg | 38 +- docs/test_cases/t00021.md | 501 +++++++++++++++ docs/test_cases/t00021_class.svg | 30 +- docs/test_cases/t00022.md | 185 ++++++ docs/test_cases/t00022_class.svg | 14 +- docs/test_cases/t00023.md | 269 ++++++++ docs/test_cases/t00023_class.svg | 26 +- docs/test_cases/t00024.md | 284 +++++++++ docs/test_cases/t00024_class.svg | 22 +- docs/test_cases/t00025.md | 307 +++++++++ docs/test_cases/t00025_class.svg | 34 +- docs/test_cases/t00026.md | 403 ++++++++++++ docs/test_cases/t00026_class.svg | 42 +- docs/test_cases/t00027.md | 587 +++++++++++++++++ docs/test_cases/t00027_class.svg | 58 +- docs/test_cases/t00028.md | 383 +++++++++++ docs/test_cases/t00028_class.svg | 82 +-- docs/test_cases/t00029.md | 236 +++++++ docs/test_cases/t00029_class.svg | 50 +- docs/test_cases/t00030.md | 244 ++++++++ docs/test_cases/t00030_class.svg | 46 +- docs/test_cases/t00031.md | 253 ++++++++ docs/test_cases/t00031_class.svg | 50 +- docs/test_cases/t00032.md | 378 +++++++++++ docs/test_cases/t00032_class.svg | 40 +- docs/test_cases/t00033.md | 335 ++++++++++ docs/test_cases/t00033_class.svg | 48 +- docs/test_cases/t00034.md | 255 ++++++++ docs/test_cases/t00034_class.svg | 38 +- docs/test_cases/t00035.md | 111 ++++ docs/test_cases/t00035_class.svg | 22 +- docs/test_cases/t00036.md | 188 ++++++ docs/test_cases/t00036_class.svg | 38 +- docs/test_cases/t00037.md | 220 +++++++ docs/test_cases/t00037_class.svg | 54 +- docs/test_cases/t00038.md | 477 ++++++++++++++ docs/test_cases/t00038_class.svg | 54 +- docs/test_cases/t00039.md | 571 +++++++++++++++++ docs/test_cases/t00039_class.svg | 78 +-- docs/test_cases/t00040.md | 222 +++++++ docs/test_cases/t00040_class.svg | 26 +- docs/test_cases/t00041.md | 331 ++++++++++ docs/test_cases/t00041_class.svg | 54 +- docs/test_cases/t00042.md | 230 +++++++ docs/test_cases/t00042_class.svg | 32 +- docs/test_cases/t00043.md | 484 ++++++++++++++ docs/test_cases/t00043_class.svg | 50 +- docs/test_cases/t00044.md | 157 +++++ docs/test_cases/t00044_class.svg | 18 +- docs/test_cases/t00045.md | 421 +++++++++++++ docs/test_cases/t00045_class.svg | 70 +-- docs/test_cases/t00046.md | 365 +++++++++++ docs/test_cases/t00046_class.svg | 64 +- docs/test_cases/t00047.md | 162 +++++ docs/test_cases/t00047_class.svg | 18 +- docs/test_cases/t00048.md | 349 +++++++++++ docs/test_cases/t00048_class.svg | 50 +- docs/test_cases/t00049.md | 258 ++++++++ docs/test_cases/t00049_class.svg | 32 +- docs/test_cases/t00050.md | 306 +++++++++ docs/test_cases/t00050_class.svg | 70 +-- docs/test_cases/t00051.md | 371 +++++++++++ docs/test_cases/t00051_class.svg | 30 +- docs/test_cases/t00052.md | 312 +++++++++ docs/test_cases/t00052_class.svg | 34 +- docs/test_cases/t00053.md | 336 ++++++++++ docs/test_cases/t00053_class.svg | 70 +-- docs/test_cases/t00054.md | 364 +++++++++++ docs/test_cases/t00054_class.svg | 78 +-- docs/test_cases/t00055.md | 211 +++++++ docs/test_cases/t00055_class.svg | 42 +- docs/test_cases/t00056.md | 535 ++++++++++++++++ docs/test_cases/t00056_class.svg | 94 +-- docs/test_cases/t00057.md | 446 +++++++++++++ docs/test_cases/t00057_class.svg | 114 ++-- docs/test_cases/t00058.md | 383 +++++++++++ docs/test_cases/t00058_class.svg | 48 +- docs/test_cases/t00059.md | 484 ++++++++++++++ docs/test_cases/t00059_class.svg | 50 +- docs/test_cases/t00060.md | 255 ++++++++ docs/test_cases/t00060_class.svg | 38 +- docs/test_cases/t20001.md | 179 ++++++ docs/test_cases/t20001_sequence.svg | 62 +- docs/test_cases/t20002.md | 122 ++++ docs/test_cases/t20002_sequence.svg | 48 +- docs/test_cases/t20003.md | 122 ++++ docs/test_cases/t20003_sequence.svg | 48 +- docs/test_cases/t20004.md | 308 +++++++++ docs/test_cases/t20004_sequence.svg | 120 ++-- docs/test_cases/t20005.md | 91 +++ docs/test_cases/t20005_sequence.svg | 36 +- docs/test_cases/t20006.md | 431 +++++++++++++ docs/test_cases/t20006_sequence.svg | 150 ++--- docs/test_cases/t20007.md | 122 ++++ docs/test_cases/t20007_sequence.svg | 48 +- docs/test_cases/t20008.md | 215 +++++++ docs/test_cases/t20008_sequence.svg | 84 +-- docs/test_cases/t20009.md | 215 +++++++ docs/test_cases/t20009_sequence.svg | 84 +-- docs/test_cases/t20010.md | 223 +++++++ docs/test_cases/t20010_sequence.svg | 72 +-- docs/test_cases/t20011.md | 216 +++++++ docs/test_cases/t20011_sequence.svg | 72 +-- docs/test_cases/t20012.md | 453 +++++++++++++ docs/test_cases/t20012_sequence.svg | 204 +++--- docs/test_cases/t20013.md | 179 ++++++ docs/test_cases/t20013_sequence.svg | 60 +- docs/test_cases/t20014.md | 188 ++++++ docs/test_cases/t20014_sequence.svg | 72 +-- docs/test_cases/t20015.md | 60 ++ docs/test_cases/t20015_sequence.svg | 24 +- docs/test_cases/t20016.md | 135 ++++ docs/test_cases/t20016_sequence.svg | 48 +- docs/test_cases/t20017.md | 157 +++++ docs/test_cases/t20017_sequence.svg | 48 +- docs/test_cases/t20018.md | 246 ++++++++ docs/test_cases/t20018_sequence.svg | 96 +-- docs/test_cases/t20019.md | 197 ++++++ docs/test_cases/t20019_sequence.svg | 84 +-- docs/test_cases/t20020.md | 399 ++++++++++++ docs/test_cases/t20020_sequence.svg | 118 ++-- docs/test_cases/t20021.md | 333 ++++++++++ docs/test_cases/t20021_sequence.svg | 106 ++-- docs/test_cases/t20022.md | 91 +++ docs/test_cases/t20022_sequence.svg | 36 +- docs/test_cases/t20023.md | 175 ++++++ docs/test_cases/t20023_sequence.svg | 50 +- docs/test_cases/t20024.md | 329 ++++++++++ docs/test_cases/t20024_sequence.svg | 88 +-- docs/test_cases/t20025.md | 113 ++++ docs/test_cases/t20025_sequence.svg | 42 +- docs/test_cases/t20026.md | 60 ++ docs/test_cases/t20026_sequence.svg | 24 +- docs/test_cases/t20027.md | 60 ++ docs/test_cases/t20027_sequence.svg | 24 +- docs/test_cases/t20028.md | 143 +++++ docs/test_cases/t20028_sequence.svg | 44 +- docs/test_cases/t20029.md | 235 +++++++ docs/test_cases/t20029_sequence.svg | 80 +-- docs/test_cases/t30001.md | 137 ++++ docs/test_cases/t30001_package.svg | 48 +- docs/test_cases/t30002.md | 364 +++++++++++ docs/test_cases/t30002_package.svg | 90 +-- docs/test_cases/t30003.md | 112 +++- docs/test_cases/t30003_package.svg | 26 +- docs/test_cases/t30004.md | 88 +++ docs/test_cases/t30004_package.svg | 30 +- docs/test_cases/t30005.md | 135 ++++ docs/test_cases/t30005_package.svg | 38 +- docs/test_cases/t30006.md | 61 ++ docs/test_cases/t30006_package.svg | 16 +- docs/test_cases/t30007.md | 74 +++ docs/test_cases/t30007_package.svg | 20 +- docs/test_cases/t30008.md | 152 +++++ docs/test_cases/t30008_package.svg | 34 +- docs/test_cases/t30009.md | 125 ++++ docs/test_cases/t30009_package.svg | 42 +- docs/test_cases/t40001.md | 113 ++++ docs/test_cases/t40001_include.svg | 30 +- docs/test_cases/t40002.md | 124 ++++ docs/test_cases/t40002_include.svg | 34 +- docs/test_cases/t40003.md | 176 ++++++ docs/test_cases/t40003_include.svg | 50 +- docs/test_cases/t90000.md | 1 + 201 files changed, 31256 insertions(+), 2757 deletions(-) diff --git a/docs/test_cases/t00002.md b/docs/test_cases/t00002.md index 9f8d5e49..7172d59a 100644 --- a/docs/test_cases/t00002.md +++ b/docs/test_cases/t00002.md @@ -116,3 +116,442 @@ private: ``` ## Generated UML diagrams ![t00002_class](./t00002_class.svg "Basic class inheritance") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "comment": { + "brief": [ + " This is class A\n" + ], + "formatted": "\\brief This is class A", + "paragraph": [ + " \n" + ], + "raw": "/// \\brief This is class A", + "text": "\n \n" + }, + "display_name": "clanguml::t00002::A", + "id": "987634239855407298", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "comment": { + "formatted": "Abstract foo_a", + "paragraph": [ + " Abstract foo_a\n" + ], + "raw": "/// Abstract foo_a", + "text": "\n Abstract foo_a\n" + }, + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "foo_a", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "comment": { + "formatted": "Abstract foo_c", + "paragraph": [ + " Abstract foo_c\n" + ], + "raw": "/// Abstract foo_c", + "text": "\n Abstract foo_c\n" + }, + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "foo_c", + "parameters": [], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00002", + "source_location": { + "file": "../../tests/t00002/t00002.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "987634239855407298", + "is_virtual": false, + "name": "clanguml::t00002::A" + } + ], + "comment": { + "brief": [ + " This is class B\n" + ], + "formatted": "\\brief This is class B", + "paragraph": [ + " \n" + ], + "raw": "/// \\brief This is class B", + "text": "\n \n" + }, + "display_name": "clanguml::t00002::B", + "id": "594234458687375950", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "foo_a", + "parameters": [], + "type": "void" + } + ], + "name": "B", + "namespace": "clanguml::t00002", + "source_location": { + "file": "../../tests/t00002/t00002.cc", + "line": 16 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "987634239855407298", + "is_virtual": false, + "name": "clanguml::t00002::A" + } + ], + "comment": { + "brief": [ + " This is class C - class C has a long comment\n" + ], + "formatted": "@brief This is class C - class C has a long comment\n\nVivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit,\neuismod libero facilisi aptent elementum felis blandit cursus gravida sociis\nerat ante, eleifend lectus nullam dapibus netus feugiat curae curabitur est\nad.", + "paragraph": [ + " \n", + " Vivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit,\n euismod libero facilisi aptent elementum felis blandit cursus gravida sociis\n erat ante, eleifend lectus nullam dapibus netus feugiat curae curabitur est\n ad.\n" + ], + "raw": "/// @brief This is class C - class C has a long comment\n///\n/// Vivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit,\n/// euismod libero facilisi aptent elementum felis blandit cursus gravida sociis\n/// erat ante, eleifend lectus nullam dapibus netus feugiat curae curabitur est\n/// ad.", + "text": "\n \n\n Vivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit,\n euismod libero facilisi aptent elementum felis blandit cursus gravida sociis\n erat ante, eleifend lectus nullam dapibus netus feugiat curae curabitur est\n ad.\n" + }, + "display_name": "clanguml::t00002::C", + "id": "1142499429598587507", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "comment": { + "formatted": "Do nothing unless override is provided", + "paragraph": [ + " Do nothing unless override is provided\n" + ], + "raw": "/// Do nothing unless override is provided", + "text": "\n Do nothing unless override is provided\n" + }, + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "foo_c", + "parameters": [], + "type": "void" + } + ], + "name": "C", + "namespace": "clanguml::t00002", + "source_location": { + "file": "../../tests/t00002/t00002.cc", + "line": 27 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "594234458687375950", + "is_virtual": false, + "name": "clanguml::t00002::B" + }, + { + "access": "public", + "id": "1142499429598587507", + "is_virtual": false, + "name": "clanguml::t00002::C" + } + ], + "comment": { + "formatted": "This is class D\nwhich is a little like B\nand a little like C", + "paragraph": [ + " This is class D\n which is a little like B\n and a little like C\n" + ], + "raw": "/// This is class D\n/// which is a little like B\n/// and a little like C", + "text": "\n This is class D\n which is a little like B\n and a little like C\n" + }, + "display_name": "clanguml::t00002::D", + "id": "60950494980414724", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "comment": { + "formatted": "All the A pointers", + "paragraph": [ + " All the A pointers\n" + ], + "raw": "/// All the A pointers", + "text": "\n All the A pointers\n" + }, + "is_static": false, + "name": "as", + "source_location": { + "file": "../../tests/t00002/t00002.cc", + "line": 58 + }, + "type": "std::vector" + } + ], + "methods": [ + { + "access": "public", + "comment": { + "formatted": "\n Forward foo_a\n ", + "paragraph": [ + " Forward foo_a\n" + ], + "raw": "/**\n * Forward foo_a\n */", + "text": "\n Forward foo_a\n" + }, + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "foo_a", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "comment": { + "formatted": "\n Forward foo_c\n ", + "paragraph": [ + " Forward foo_c\n" + ], + "raw": "/**\n * Forward foo_c\n */", + "text": "\n Forward foo_c\n" + }, + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "foo_c", + "parameters": [], + "type": "void" + } + ], + "name": "D", + "namespace": "clanguml::t00002", + "source_location": { + "file": "../../tests/t00002/t00002.cc", + "line": 36 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "594234458687375950", + "is_virtual": true, + "name": "clanguml::t00002::B" + }, + { + "access": "public", + "id": "1142499429598587507", + "is_virtual": true, + "name": "clanguml::t00002::C" + } + ], + "display_name": "clanguml::t00002::E", + "id": "2237886670308966220", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "comment": { + "formatted": "All the A pointers", + "paragraph": [ + " All the A pointers\n" + ], + "raw": "/// All the A pointers", + "text": "\n All the A pointers\n" + }, + "is_static": false, + "name": "as", + "source_location": { + "file": "../../tests/t00002/t00002.cc", + "line": 83 + }, + "type": "std::vector" + } + ], + "methods": [ + { + "access": "public", + "comment": { + "formatted": "\n Forward foo_a", + "paragraph": [ + " Forward foo_a\n" + ], + "raw": "///\n /// Forward foo_a\n ///", + "text": "\n Forward foo_a\n" + }, + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "foo_a", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "comment": { + "formatted": "\n Forward foo_c", + "paragraph": [ + " Forward foo_c\n" + ], + "raw": "///\n /// Forward foo_c\n ///", + "text": "\n Forward foo_c\n" + }, + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "foo_c", + "parameters": [], + "type": "void" + } + ], + "name": "E", + "namespace": "clanguml::t00002", + "source_location": { + "file": "../../tests/t00002/t00002.cc", + "line": 61 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00002_class", + "relationships": [ + { + "access": "public", + "destination": "987634239855407298", + "source": "594234458687375950", + "type": "extension" + }, + { + "access": "public", + "destination": "987634239855407298", + "source": "1142499429598587507", + "type": "extension" + }, + { + "access": "private", + "destination": "987634239855407298", + "label": "as", + "source": "60950494980414724", + "type": "association" + }, + { + "access": "public", + "destination": "594234458687375950", + "source": "60950494980414724", + "type": "extension" + }, + { + "access": "public", + "destination": "1142499429598587507", + "source": "60950494980414724", + "type": "extension" + }, + { + "access": "private", + "destination": "987634239855407298", + "label": "as", + "source": "2237886670308966220", + "type": "association" + }, + { + "access": "public", + "destination": "594234458687375950", + "source": "2237886670308966220", + "type": "extension" + }, + { + "access": "public", + "destination": "1142499429598587507", + "source": "2237886670308966220", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00002" +} +``` diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index 9633ace5..515dd8b0 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ foo_c() = 0 : void - - + + B @@ -31,8 +31,8 @@ foo_a() : void - - + + C @@ -41,18 +41,18 @@ foo_c() : void - - + + D - + - + as : std::vector<A *> @@ -60,18 +60,18 @@ foo_a() : void foo_c() : void - - + + E - + - + as : std::vector<A *> @@ -79,13 +79,13 @@ foo_a() : void foo_c() : void - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00003.md b/docs/test_cases/t00003.md index 0ef4a4d2..c7659a8b 100644 --- a/docs/test_cases/t00003.md +++ b/docs/test_cases/t00003.md @@ -79,3 +79,378 @@ int A::static_int = 1; ``` ## Generated UML diagrams ![t00003_class](./t00003_class.svg "Class field and methods") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00003::A", + "id": "1371951663534295727", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "public_member", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 34 + }, + "type": "int" + }, + { + "access": "protected", + "is_static": false, + "name": "protected_member", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 42 + }, + "type": "int" + }, + { + "access": "protected", + "is_static": false, + "name": "compare", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 44 + }, + "type": "std::function" + }, + { + "access": "private", + "is_static": false, + "name": "private_member", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 51 + }, + "type": "int" + }, + { + "access": "private", + "is_static": false, + "name": "a_", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 52 + }, + "type": "int" + }, + { + "access": "private", + "is_static": false, + "name": "b_", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 52 + }, + "type": "int" + }, + { + "access": "private", + "is_static": false, + "name": "c_", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 52 + }, + "type": "int" + }, + { + "access": "public", + "is_static": true, + "name": "static_int", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 35 + }, + "type": "int" + }, + { + "access": "public", + "is_static": true, + "name": "static_const_int", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 36 + }, + "type": "const int" + }, + { + "access": "public", + "is_static": true, + "name": "auto_member", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 37 + }, + "type": "const unsigned long" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "A", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "A", + "parameters": [ + { + "name": "i", + "type": "int" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "A", + "parameters": [ + { + "name": "", + "type": "clanguml::t00003::A &&" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "A", + "parameters": [ + { + "name": "", + "type": "const clanguml::t00003::A &" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "~A", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "basic_method", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": true, + "is_virtual": false, + "name": "static_method", + "parameters": [], + "type": "int" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "const_method", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "auto_method", + "parameters": [], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "double_int", + "parameters": [ + { + "name": "i", + "type": "const int" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "sum", + "parameters": [ + { + "name": "a", + "type": "const double" + }, + { + "name": "b", + "type": "const double" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "default_int", + "parameters": [ + { + "default_value": "12", + "name": "i", + "type": "int" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "default_string", + "parameters": [ + { + "name": "i", + "type": "int" + }, + { + "default_value": "\"abc\"", + "name": "s", + "type": "std::string" + } + ], + "type": "std::string" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": true, + "is_virtual": false, + "name": "create_from_int", + "parameters": [ + { + "name": "i", + "type": "int" + } + ], + "type": "clanguml::t00003::A" + }, + { + "access": "protected", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "protected_method", + "parameters": [], + "type": "void" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "private_method", + "parameters": [], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00003", + "source_location": { + "file": "../../tests/t00003/t00003.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00003_class", + "relationships": [], + "using_namespace": "clanguml::t00003" +} +``` diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index c8d275c1..af586036 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - + + A - + - + public_member : int - + - + protected_member : int - + - + private_member : int - + - + a_ : int - + - + b_ : int - + - + c_ : int - + - + static_int : int - + - + static_const_int : const int - + - + auto_member : const unsigned long @@ -112,11 +112,11 @@ protected_method() : void private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00004.md b/docs/test_cases/t00004.md index a20b9847..384d70cc 100644 --- a/docs/test_cases/t00004.md +++ b/docs/test_cases/t00004.md @@ -76,3 +76,471 @@ public: ``` ## Generated UML diagrams ![t00004_class](./t00004_class.svg "Nested classes and enums") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00004::B", + "id": "1232624428734051711", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 4 + }, + "template_parameters": [], + "type": "class" + }, + { + "constants": [ + "AA_1", + "AA_2", + "AA_3" + ], + "display_name": "clanguml::t00004::B::AA", + "id": "1630205507215126623", + "is_nested": true, + "name": "B::AA", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 6 + }, + "type": "enum" + }, + { + "bases": [], + "display_name": "clanguml::t00004::A", + "id": "1552274940876611774", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo2", + "parameters": [], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00004::A::AA", + "id": "1742499843727859552", + "is_abstract": false, + "is_nested": true, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A::AA", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 13 + }, + "template_parameters": [], + "type": "class" + }, + { + "constants": [ + "Green", + "Yellow", + "Red" + ], + "display_name": "clanguml::t00004::A::AA::Lights", + "id": "590936874508841244", + "is_nested": true, + "name": "A::AA::Lights", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 15 + }, + "type": "enum" + }, + { + "bases": [], + "display_name": "clanguml::t00004::A::AA::AAA", + "id": "1430186633004282131", + "is_abstract": false, + "is_nested": true, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A::AA::AAA", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00004::C::B", + "id": "287819369330075965", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C::B", + "namespace": "clanguml::t00004", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00004::C", + "id": "2278328177727440136", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "t", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 25 + }, + "type": "T" + }, + { + "access": "public", + "is_static": false, + "name": "b_int", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 37 + }, + "type": "B" + } + ], + "methods": [], + "name": "C", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 23 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00004::C::AA", + "id": "623940132897927654", + "is_abstract": false, + "is_nested": true, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C::AA", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 27 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00004::C::AA::AAA", + "id": "1597801087286500866", + "is_abstract": false, + "is_nested": true, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C::AA::AAA", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 28 + }, + "template_parameters": [], + "type": "class" + }, + { + "constants": [ + "CCC_1", + "CCC_2" + ], + "display_name": "clanguml::t00004::C::AA::CCC", + "id": "81819202639599734", + "is_nested": true, + "name": "C::AA::CCC", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 30 + }, + "type": "enum" + }, + { + "bases": [], + "display_name": "clanguml::t00004::C::B", + "id": "1381298335849583950", + "is_abstract": false, + "is_nested": true, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 34 + }, + "type": "V" + } + ], + "methods": [], + "name": "C::B", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 33 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "V", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "constants": [ + "CC_1", + "CC_2" + ], + "display_name": "clanguml::t00004::C::CC", + "id": "2037378936100378699", + "is_nested": true, + "name": "C::CC", + "namespace": "clanguml::t00004", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 39 + }, + "type": "enum" + }, + { + "bases": [], + "display_name": "clanguml::t00004::detail::D", + "id": "612133170877135796", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00004::detail", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 43 + }, + "template_parameters": [], + "type": "class" + }, + { + "constants": [ + "AA_1", + "AA_2", + "AA_3" + ], + "display_name": "clanguml::t00004::detail::D::AA", + "id": "1572080057917630922", + "is_nested": true, + "name": "D::AA", + "namespace": "clanguml::t00004::detail", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 45 + }, + "type": "enum" + }, + { + "bases": [], + "display_name": "clanguml::t00004::detail::D::DD", + "id": "600916232677555492", + "is_abstract": false, + "is_nested": true, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D::DD", + "namespace": "clanguml::t00004::detail", + "source_location": { + "file": "../../tests/t00004/t00004.cc", + "line": 47 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00004_class", + "relationships": [ + { + "access": "public", + "destination": "1232624428734051711", + "source": "1630205507215126623", + "type": "containment" + }, + { + "access": "public", + "destination": "1552274940876611774", + "source": "1742499843727859552", + "type": "containment" + }, + { + "access": "public", + "destination": "1742499843727859552", + "source": "590936874508841244", + "type": "containment" + }, + { + "access": "public", + "destination": "1742499843727859552", + "source": "1430186633004282131", + "type": "containment" + }, + { + "access": "public", + "destination": "1381298335849583950", + "source": "287819369330075965", + "type": "instantiation" + }, + { + "access": "public", + "destination": "287819369330075965", + "label": "b_int", + "source": "2278328177727440136", + "type": "aggregation" + }, + { + "access": "public", + "destination": "2278328177727440136", + "source": "623940132897927654", + "type": "containment" + }, + { + "access": "public", + "destination": "623940132897927654", + "source": "1597801087286500866", + "type": "containment" + }, + { + "access": "public", + "destination": "623940132897927654", + "source": "81819202639599734", + "type": "containment" + }, + { + "access": "public", + "destination": "2278328177727440136", + "source": "1381298335849583950", + "type": "containment" + }, + { + "access": "public", + "destination": "2278328177727440136", + "source": "2037378936100378699", + "type": "containment" + }, + { + "access": "public", + "destination": "612133170877135796", + "source": "1572080057917630922", + "type": "containment" + }, + { + "access": "public", + "destination": "612133170877135796", + "source": "600916232677555492", + "type": "containment" + } + ], + "using_namespace": "clanguml::t00004" +} +``` diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index 5056564a..40b69332 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + B::AA @@ -28,8 +28,8 @@ AA_3 - - + + A @@ -40,16 +40,16 @@ foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -59,15 +59,15 @@ Red - - + + A::AA::AAA - + C::B @@ -75,8 +75,8 @@ int - - + + C @@ -84,39 +84,39 @@ T - + - + t : T - + - + b_int : B<int> - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -125,8 +125,8 @@ CCC_2 - - + + C::B @@ -134,16 +134,16 @@ V - + - + b : V - - + + C::CC @@ -152,16 +152,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -171,8 +171,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00005.md b/docs/test_cases/t00005.md index 7e566ae1..c06bf9bc 100644 --- a/docs/test_cases/t00005.md +++ b/docs/test_cases/t00005.md @@ -66,3 +66,483 @@ public: ``` ## Generated UML diagrams ![t00005_class](./t00005_class.svg "Basic class field relationships") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00005::A", + "id": "96355893895780319", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 3 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::B", + "id": "1909425857334087541", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 5 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::C", + "id": "968176384460064907", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::D", + "id": "1735599590836186693", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::E", + "id": "887960136921844658", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::F", + "id": "772719357856231772", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "F", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 13 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::G", + "id": "979147885884736437", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 15 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::H", + "id": "1440673301054236675", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "H", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::I", + "id": "109681731550086430", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "I", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 19 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::J", + "id": "338330011969650325", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "J", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 21 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::K", + "id": "2179119389830432509", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "K", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 23 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00005::R", + "id": "630692407373144211", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "some_int", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 27 + }, + "type": "int" + }, + { + "access": "public", + "is_static": false, + "name": "some_int_pointer", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 28 + }, + "type": "int *" + }, + { + "access": "public", + "is_static": false, + "name": "some_int_pointer_pointer", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 29 + }, + "type": "int **" + }, + { + "access": "public", + "is_static": false, + "name": "some_int_reference", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 30 + }, + "type": "int &" + }, + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 31 + }, + "type": "clanguml::t00005::A" + }, + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 32 + }, + "type": "clanguml::t00005::B *" + }, + { + "access": "public", + "is_static": false, + "name": "c", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 33 + }, + "type": "clanguml::t00005::C &" + }, + { + "access": "public", + "is_static": false, + "name": "d", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 34 + }, + "type": "const clanguml::t00005::D *" + }, + { + "access": "public", + "is_static": false, + "name": "e", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 35 + }, + "type": "const clanguml::t00005::E &" + }, + { + "access": "public", + "is_static": false, + "name": "f", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 36 + }, + "type": "clanguml::t00005::F &&" + }, + { + "access": "public", + "is_static": false, + "name": "g", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 37 + }, + "type": "clanguml::t00005::G **" + }, + { + "access": "public", + "is_static": false, + "name": "h", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 38 + }, + "type": "clanguml::t00005::H ***" + }, + { + "access": "public", + "is_static": false, + "name": "i", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 39 + }, + "type": "clanguml::t00005::I *&" + }, + { + "access": "public", + "is_static": false, + "name": "j", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 40 + }, + "type": "volatile clanguml::t00005::J *" + }, + { + "access": "public", + "is_static": false, + "name": "k", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 41 + }, + "type": "clanguml::t00005::K *" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00005", + "source_location": { + "file": "../../tests/t00005/t00005.cc", + "line": 25 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00005_class", + "relationships": [ + { + "access": "public", + "destination": "96355893895780319", + "label": "a", + "source": "630692407373144211", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1909425857334087541", + "label": "b", + "source": "630692407373144211", + "type": "association" + }, + { + "access": "public", + "destination": "968176384460064907", + "label": "c", + "source": "630692407373144211", + "type": "association" + }, + { + "access": "public", + "destination": "1735599590836186693", + "label": "d", + "source": "630692407373144211", + "type": "association" + }, + { + "access": "public", + "destination": "887960136921844658", + "label": "e", + "source": "630692407373144211", + "type": "association" + }, + { + "access": "public", + "destination": "772719357856231772", + "label": "f", + "source": "630692407373144211", + "type": "aggregation" + }, + { + "access": "public", + "destination": "979147885884736437", + "label": "g", + "source": "630692407373144211", + "type": "association" + }, + { + "access": "public", + "destination": "1440673301054236675", + "label": "h", + "source": "630692407373144211", + "type": "association" + }, + { + "access": "public", + "destination": "109681731550086430", + "label": "i", + "source": "630692407373144211", + "type": "association" + }, + { + "access": "public", + "destination": "338330011969650325", + "label": "j", + "source": "630692407373144211", + "type": "association" + }, + { + "access": "public", + "destination": "2179119389830432509", + "label": "k", + "source": "630692407373144211", + "type": "association" + } + ], + "using_namespace": "clanguml::t00005" +} +``` diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index 0fa870af..a682e90a 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,204 +9,204 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & - + - + a : A - + - + b : B * - + - + c : C & - + - + d : const D * - + - + e : const E & - + - + f : F && - + - + g : G ** - + - + h : H *** - + - + i : I *& - + - + j : volatile J * - + - + k : K * diff --git a/docs/test_cases/t00006.md b/docs/test_cases/t00006.md index 7711000b..6899b131 100644 --- a/docs/test_cases/t00006.md +++ b/docs/test_cases/t00006.md @@ -90,3 +90,671 @@ public: ``` ## Generated UML diagrams ![t00006_class](./t00006_class.svg "Class field relationships inferred from templates") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00006::A", + "id": "989095304444672400", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::B", + "id": "648285260245005311", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::C", + "id": "323304333007297774", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::D", + "id": "1006912399043633492", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 13 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::E", + "id": "1092550394020578978", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 15 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::F", + "id": "965398761810782236", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "F", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::G", + "id": "1764732000887030464", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 19 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::H", + "id": "1669285599837552146", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "H", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 21 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::I", + "id": "2234750598599000377", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "I", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 23 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::J", + "id": "1335933649375465369", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "J", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 25 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::K", + "id": "1603190364864080123", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "K", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 27 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::L", + "id": "305487238408320046", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "L", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 29 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::M", + "id": "1664744512423723275", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "M", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 31 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::N", + "id": "950210019792152600", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "N", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 33 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::NN", + "id": "1662349735899726224", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "NN", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 35 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::NNN", + "id": "1963145075481599858", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "NNN", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 37 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::custom_container", + "id": "916380191954937631", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "data", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 41 + }, + "type": "std::vector" + } + ], + "methods": [], + "name": "custom_container", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 39 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::custom_container", + "id": "50153113082434858", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "custom_container", + "namespace": "clanguml::t00006", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00006::E" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00006::R", + "id": "303025561016882526", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 46 + }, + "type": "std::vector" + }, + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 47 + }, + "type": "std::vector" + }, + { + "access": "public", + "is_static": false, + "name": "c", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 49 + }, + "type": "std::map" + }, + { + "access": "public", + "is_static": false, + "name": "d", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 50 + }, + "type": "std::map" + }, + { + "access": "public", + "is_static": false, + "name": "e", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 52 + }, + "type": "custom_container" + }, + { + "access": "public", + "is_static": false, + "name": "f", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 54 + }, + "type": "std::vector>" + }, + { + "access": "public", + "is_static": false, + "name": "g", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 55 + }, + "type": "std::map>" + }, + { + "access": "public", + "is_static": false, + "name": "h", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 57 + }, + "type": "std::array" + }, + { + "access": "public", + "is_static": false, + "name": "i", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 58 + }, + "type": "std::array" + }, + { + "access": "public", + "is_static": false, + "name": "j", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 60 + }, + "type": "clanguml::t00006::J[10]" + }, + { + "access": "public", + "is_static": false, + "name": "k", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 61 + }, + "type": "clanguml::t00006::K *[20]" + }, + { + "access": "public", + "is_static": false, + "name": "lm", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 63 + }, + "type": "std::vector>" + }, + { + "access": "public", + "is_static": false, + "name": "ns", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 65 + }, + "type": "std::tuple" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00006", + "source_location": { + "file": "../../tests/t00006/t00006.cc", + "line": 44 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00006_class", + "relationships": [ + { + "access": "public", + "destination": "1092550394020578978", + "source": "50153113082434858", + "type": "dependency" + }, + { + "access": "public", + "destination": "916380191954937631", + "source": "50153113082434858", + "type": "instantiation" + }, + { + "access": "public", + "destination": "989095304444672400", + "label": "a", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "648285260245005311", + "label": "b", + "source": "303025561016882526", + "type": "association" + }, + { + "access": "public", + "destination": "323304333007297774", + "label": "c", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1006912399043633492", + "label": "d", + "source": "303025561016882526", + "type": "association" + }, + { + "access": "public", + "destination": "50153113082434858", + "label": "e", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "965398761810782236", + "label": "f", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1764732000887030464", + "label": "g", + "source": "303025561016882526", + "type": "association" + }, + { + "access": "public", + "destination": "1669285599837552146", + "label": "h", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "2234750598599000377", + "label": "i", + "source": "303025561016882526", + "type": "association" + }, + { + "access": "public", + "destination": "1335933649375465369", + "label": "j", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1603190364864080123", + "label": "k", + "source": "303025561016882526", + "type": "association" + }, + { + "access": "public", + "destination": "305487238408320046", + "label": "lm", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1664744512423723275", + "label": "lm", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "950210019792152600", + "label": "ns", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1662349735899726224", + "label": "ns", + "source": "303025561016882526", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1963145075481599858", + "label": "ns", + "source": "303025561016882526", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00006" +} +``` diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index 65171aaa..664ab90c 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -146,15 +146,15 @@ T - + - + data : std::vector<T> - + custom_container @@ -162,102 +162,102 @@ E - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B *> - + - + c : std::map<int,C> - + - + d : std::map<int,D *> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G *>> - + - + h : std::array<H,10> - + - + i : std::array<I *,5> - + - + j : J[10] - + - + k : K *[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00007.md b/docs/test_cases/t00007.md index 2864b1c6..5bbb83a5 100644 --- a/docs/test_cases/t00007.md +++ b/docs/test_cases/t00007.md @@ -40,3 +40,147 @@ public: ``` ## Generated UML diagrams ![t00007_class](./t00007_class.svg "Smart pointers") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00007::A", + "id": "98876622534017019", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00007", + "source_location": { + "file": "../../tests/t00007/t00007.cc", + "line": 5 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00007::B", + "id": "696381312773707784", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00007", + "source_location": { + "file": "../../tests/t00007/t00007.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00007::C", + "id": "972031178679364068", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00007", + "source_location": { + "file": "../../tests/t00007/t00007.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00007::R", + "id": "66905874721300157", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00007/t00007.cc", + "line": 13 + }, + "type": "std::unique_ptr" + }, + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00007/t00007.cc", + "line": 14 + }, + "type": "std::shared_ptr" + }, + { + "access": "public", + "is_static": false, + "name": "c", + "source_location": { + "file": "../../tests/t00007/t00007.cc", + "line": 15 + }, + "type": "std::weak_ptr" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00007", + "source_location": { + "file": "../../tests/t00007/t00007.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00007_class", + "relationships": [ + { + "access": "public", + "destination": "98876622534017019", + "label": "a", + "source": "66905874721300157", + "type": "aggregation" + }, + { + "access": "public", + "destination": "696381312773707784", + "label": "b", + "source": "66905874721300157", + "type": "association" + }, + { + "access": "public", + "destination": "972031178679364068", + "label": "c", + "source": "66905874721300157", + "type": "association" + } + ], + "using_namespace": "clanguml::t00007" +} +``` diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 19d91b9b..bc7b3aca 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00008.md b/docs/test_cases/t00008.md index 078627e1..27f8892f 100644 --- a/docs/test_cases/t00008.md +++ b/docs/test_cases/t00008.md @@ -73,3 +73,425 @@ template <> struct E::nested_template { ``` ## Generated UML diagrams ![t00008_class](./t00008_class.svg "Template and template template relationships") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00008::A", + "id": "1657660300852090121", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "value", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 11 + }, + "type": "T" + }, + { + "access": "public", + "is_static": false, + "name": "pointer", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 12 + }, + "type": "T *" + }, + { + "access": "public", + "is_static": false, + "name": "reference", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 13 + }, + "type": "T &" + }, + { + "access": "public", + "is_static": false, + "name": "values", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 14 + }, + "type": "std::vector

" + }, + { + "access": "public", + "is_static": false, + "name": "ints", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 15 + }, + "type": "std::array" + }, + { + "access": "public", + "is_static": false, + "name": "comparator", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 17 + }, + "type": "clanguml::t00008::CMP" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00008", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 9 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "default": "T", + "is_variadic": false, + "kind": "template_type", + "name": "P", + "template_parameters": [] + }, + { + "default": "nullptr", + "is_variadic": false, + "kind": "non_type_template", + "template_parameters": [], + "type": "clanguml::t00008::CMP" + }, + { + "default": "3", + "is_variadic": false, + "kind": "non_type_template", + "name": "N", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00008::Vector", + "id": "1677407014842680311", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "values", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 21 + }, + "type": "std::vector" + } + ], + "methods": [], + "name": "Vector", + "namespace": "clanguml::t00008", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 20 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00008::B>", + "id": "1968575752686868237", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "template_template", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 25 + }, + "type": "C" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00008", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 24 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_template_type", + "name": "C<>", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00008::B", + "id": "1449136415707203971", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00008", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "clanguml::t00008::Vector", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00008::D", + "id": "1562396858816419857", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "ints", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 29 + }, + "type": "B" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "add", + "parameters": [ + { + "name": "i", + "type": "int" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "D", + "parameters": [ + { + "name": "", + "type": "std::tuple *" + } + ], + "type": "void" + } + ], + "name": "D", + "namespace": "clanguml::t00008", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 28 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00008::E", + "id": "1787658457052431115", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00008", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 36 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00008::E::nested_template", + "id": "1549419203490064906", + "is_abstract": false, + "is_nested": true, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": true, + "is_virtual": false, + "name": "get", + "parameters": [ + { + "name": "d", + "type": "ET *" + } + ], + "type": "clanguml::t00008::E::nested_template::DT *" + } + ], + "name": "E::nested_template", + "namespace": "clanguml::t00008", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 37 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "ET", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00008::E::nested_template", + "id": "33637089897037832", + "is_abstract": false, + "is_nested": true, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E::nested_template", + "namespace": "clanguml::t00008", + "source_location": { + "file": "../../tests/t00008/t00008.cc", + "line": 44 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "char" + } + ], + "type": "class" + } + ], + "name": "t00008_class", + "relationships": [ + { + "access": "public", + "destination": "1968575752686868237", + "source": "1449136415707203971", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1449136415707203971", + "label": "ints", + "source": "1562396858816419857", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1787658457052431115", + "source": "1549419203490064906", + "type": "containment" + }, + { + "access": "public", + "destination": "1787658457052431115", + "source": "33637089897037832", + "type": "containment" + }, + { + "access": "public", + "destination": "1549419203490064906", + "source": "33637089897037832", + "type": "instantiation" + } + ], + "using_namespace": "clanguml::t00008" +} +``` diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index 3056b44d..a185794a 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,51 +18,51 @@ T,P=T,CMP=nullptr,int N=3 - + - + value : T - + - + pointer : T * - + - + reference : T & - + - + values : std::vector<P> - + - + ints : std::array<int,N> - + - + comparator : CMP - - + + Vector @@ -70,16 +70,16 @@ T - + - + values : std::vector<T> - - + + B @@ -87,15 +87,15 @@ T,C<> - + - + template_template : C<T> - + B @@ -103,18 +103,18 @@ int,Vector - - + + D - + - + ints : B<int,Vector> @@ -122,16 +122,16 @@ add(int i) : void D<Items...>(std::tuple<Items...> * ) : void - - + + E - - + + E::nested_template @@ -142,8 +142,8 @@ get(ET * d) : E::nested_template::DT * - - + + E::nested_template diff --git a/docs/test_cases/t00009.md b/docs/test_cases/t00009.md index 6b372686..559635b3 100644 --- a/docs/test_cases/t00009.md +++ b/docs/test_cases/t00009.md @@ -41,3 +41,219 @@ public: ``` ## Generated UML diagrams ![t00009_class](./t00009_class.svg "Template instantiation") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00009::A", + "id": "412228989111660105", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "value", + "source_location": { + "file": "../../tests/t00009/t00009.cc", + "line": 9 + }, + "type": "T" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00009", + "source_location": { + "file": "../../tests/t00009/t00009.cc", + "line": 7 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00009::A", + "id": "1894387438043499", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00009", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00009::A", + "id": "1340793233843139195", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00009", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00009::A>", + "id": "1370808797762248850", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00009", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "std::vector" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00009::B", + "id": "176239714450247310", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "aint", + "source_location": { + "file": "../../tests/t00009/t00009.cc", + "line": 14 + }, + "type": "A" + }, + { + "access": "public", + "is_static": false, + "name": "astring", + "source_location": { + "file": "../../tests/t00009/t00009.cc", + "line": 15 + }, + "type": "A *" + }, + { + "access": "public", + "is_static": false, + "name": "avector", + "source_location": { + "file": "../../tests/t00009/t00009.cc", + "line": 16 + }, + "type": "A> &" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00009", + "source_location": { + "file": "../../tests/t00009/t00009.cc", + "line": 12 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00009_class", + "relationships": [ + { + "access": "public", + "destination": "412228989111660105", + "source": "1894387438043499", + "type": "instantiation" + }, + { + "access": "public", + "destination": "412228989111660105", + "source": "1340793233843139195", + "type": "instantiation" + }, + { + "access": "public", + "destination": "412228989111660105", + "source": "1370808797762248850", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1894387438043499", + "label": "aint", + "source": "176239714450247310", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1340793233843139195", + "label": "astring", + "source": "176239714450247310", + "type": "association" + }, + { + "access": "public", + "destination": "1370808797762248850", + "label": "avector", + "source": "176239714450247310", + "type": "association" + } + ], + "using_namespace": "clanguml::t00009" +} +``` diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 21629ef9..58f0d7a1 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,15 +18,15 @@ T - + - + value : T - + A @@ -34,7 +34,7 @@ int - + A @@ -42,7 +42,7 @@ std::string - + A @@ -50,32 +50,32 @@ std::vector<std::string> - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00010.md b/docs/test_cases/t00010.md index 1f8d9377..259e2445 100644 --- a/docs/test_cases/t00010.md +++ b/docs/test_cases/t00010.md @@ -45,3 +45,216 @@ public: ``` ## Generated UML diagrams ![t00010_class](./t00010_class.svg "Basic template instantiation") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00010::A", + "id": "2222216618904514099", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "first", + "source_location": { + "file": "../../tests/t00010/t00010.cc", + "line": 9 + }, + "type": "T" + }, + { + "access": "public", + "is_static": false, + "name": "second", + "source_location": { + "file": "../../tests/t00010/t00010.cc", + "line": 10 + }, + "type": "P" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00010", + "source_location": { + "file": "../../tests/t00010/t00010.cc", + "line": 7 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "P", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00010::A", + "id": "1861520693741915300", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00010", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "T" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00010::B", + "id": "2303611426082708583", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "astring", + "source_location": { + "file": "../../tests/t00010/t00010.cc", + "line": 15 + }, + "type": "A" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00010", + "source_location": { + "file": "../../tests/t00010/t00010.cc", + "line": 13 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00010::B", + "id": "1498376939480949099", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00010", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00010::C", + "id": "1880966578968892571", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "aintstring", + "source_location": { + "file": "../../tests/t00010/t00010.cc", + "line": 20 + }, + "type": "B" + } + ], + "methods": [], + "name": "C", + "namespace": "clanguml::t00010", + "source_location": { + "file": "../../tests/t00010/t00010.cc", + "line": 18 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00010_class", + "relationships": [ + { + "access": "public", + "destination": "2222216618904514099", + "source": "1861520693741915300", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1861520693741915300", + "label": "astring", + "source": "2303611426082708583", + "type": "aggregation" + }, + { + "access": "public", + "destination": "2303611426082708583", + "source": "1498376939480949099", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1498376939480949099", + "label": "aintstring", + "source": "1880966578968892571", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00010" +} +``` diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index df030bc2..47e73499 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,22 +18,22 @@ T,P - + - + first : T - + - + second : P - + A @@ -41,8 +41,8 @@ T,std::string - - + + B @@ -50,15 +50,15 @@ T - + - + astring : A<T,std::string> - + B @@ -66,18 +66,18 @@ int - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00011.md b/docs/test_cases/t00011.md index 0c792259..d2da0251 100644 --- a/docs/test_cases/t00011.md +++ b/docs/test_cases/t00011.md @@ -54,3 +54,144 @@ public: ``` ## Generated UML diagrams ![t00011_class](./t00011_class.svg "Friend relationships") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00011::D", + "id": "1150639902748052276", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "value", + "source_location": { + "file": "../../tests/t00011/t00011.cc", + "line": 11 + }, + "type": "T" + } + ], + "methods": [], + "name": "D", + "namespace": "clanguml::t00011", + "source_location": { + "file": "../../tests/t00011/t00011.cc", + "line": 10 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00011::A", + "id": "1420516952857803719", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00011", + "source_location": { + "file": "../../tests/t00011/t00011.cc", + "line": 14 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00011::B", + "id": "1687427603952049829", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "m_a", + "source_location": { + "file": "../../tests/t00011/t00011.cc", + "line": 29 + }, + "type": "clanguml::t00011::A *" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [], + "type": "void" + } + ], + "name": "B", + "namespace": "clanguml::t00011", + "source_location": { + "file": "../../tests/t00011/t00011.cc", + "line": 26 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00011_class", + "relationships": [ + { + "access": "public", + "destination": "1687427603952049829", + "label": "<>", + "source": "1420516952857803719", + "type": "friendship" + }, + { + "access": "public", + "destination": "1420516952857803719", + "label": "m_a", + "source": "1687427603952049829", + "type": "association" + } + ], + "using_namespace": "clanguml::t00011" +} +``` diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 69e902f1..d059675c 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -18,16 +18,16 @@ T - + - + value : T - - + + A @@ -36,18 +36,18 @@ foo() : void - - + + B - + - + m_a : A * diff --git a/docs/test_cases/t00012.md b/docs/test_cases/t00012.md index 36ba1629..ec28a58c 100644 --- a/docs/test_cases/t00012.md +++ b/docs/test_cases/t00012.md @@ -61,3 +61,510 @@ class R { ``` ## Generated UML diagrams ![t00012_class](./t00012_class.svg "Advanced template instantiations") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00012::A", + "id": "1773299890023132282", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "value", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 12 + }, + "type": "T" + }, + { + "access": "private", + "is_static": false, + "name": "values", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 13 + }, + "type": "std::variant" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00012", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 11 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": true, + "kind": "template_type", + "name": "Ts...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00012::B", + "id": "2061171077567279746", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "ints", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 17 + }, + "type": "std::array" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00012", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 16 + }, + "template_parameters": [ + { + "is_variadic": true, + "kind": "non_type_template", + "name": "Is", + "template_parameters": [], + "type": "int..." + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00012::C", + "id": "627809578407650629", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "ints", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 21 + }, + "type": "std::array" + } + ], + "methods": [], + "name": "C", + "namespace": "clanguml::t00012", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 20 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": true, + "kind": "non_type_template", + "name": "Is", + "template_parameters": [], + "type": "int..." + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00012::A", + "id": "286972398942005457", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00012", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "float" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00012::A", + "id": "299466181098300963", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00012", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "bool" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00012::B<3,2,1>", + "id": "489063277971613593", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00012", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "3" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "2" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "1" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00012::B<1,1,1,1>", + "id": "14232362483200599", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00012", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "1" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "1" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "1" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "1" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00012::C>>>,3,3,3>", + "id": "1478239414632239754", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00012", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "std::vector" + } + ], + "type": "std::vector" + } + ], + "type": "std::vector" + } + ], + "type": "std::map" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "3" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "3" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "3" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00012::R", + "id": "559263385732885469", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "a1", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 25 + }, + "type": "A" + }, + { + "access": "private", + "is_static": false, + "name": "a2", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 26 + }, + "type": "A" + }, + { + "access": "private", + "is_static": false, + "name": "b1", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 28 + }, + "type": "B<3,2,1>" + }, + { + "access": "private", + "is_static": false, + "name": "b2", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 29 + }, + "type": "B<1,1,1,1>" + }, + { + "access": "private", + "is_static": false, + "name": "c1", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 33 + }, + "type": "C>>>,3,3,3>" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00012", + "source_location": { + "file": "../../tests/t00012/t00012.cc", + "line": 24 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00012_class", + "relationships": [ + { + "access": "public", + "destination": "1773299890023132282", + "source": "286972398942005457", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1773299890023132282", + "source": "299466181098300963", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2061171077567279746", + "source": "489063277971613593", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2061171077567279746", + "source": "14232362483200599", + "type": "instantiation" + }, + { + "access": "public", + "destination": "627809578407650629", + "source": "1478239414632239754", + "type": "instantiation" + }, + { + "access": "private", + "destination": "286972398942005457", + "label": "a1", + "source": "559263385732885469", + "type": "aggregation" + }, + { + "access": "private", + "destination": "299466181098300963", + "label": "a2", + "source": "559263385732885469", + "type": "aggregation" + }, + { + "access": "private", + "destination": "489063277971613593", + "label": "b1", + "source": "559263385732885469", + "type": "aggregation" + }, + { + "access": "private", + "destination": "14232362483200599", + "label": "b2", + "source": "559263385732885469", + "type": "aggregation" + }, + { + "access": "private", + "destination": "1478239414632239754", + "label": "c1", + "source": "559263385732885469", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00012" +} +``` diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index 415f4e3c..64719ffb 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T,Ts... - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,14 +60,14 @@ - + - + ints : std::array<T,sizeof...(Is)> - + A @@ -75,7 +75,7 @@ int,std::string,float - + A @@ -83,7 +83,7 @@ int,std::string,bool - + B @@ -91,7 +91,7 @@ 3,2,1 - + B @@ -99,7 +99,7 @@ 1,1,1,1 - + C @@ -107,50 +107,50 @@ std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3 - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00013.md b/docs/test_cases/t00013.md index 9e7cf9fb..a60e8de4 100644 --- a/docs/test_cases/t00013.md +++ b/docs/test_cases/t00013.md @@ -89,3 +89,712 @@ private: ``` ## Generated UML diagrams ![t00013_class](./t00013_class.svg "Template instantiation relationships") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "ABCD::F", + "id": "952770730316239752", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "f", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 8 + }, + "type": "T" + } + ], + "methods": [], + "name": "F", + "namespace": "ABCD", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 7 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "ABCD::F", + "id": "2304215469403389354", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "F", + "namespace": "ABCD", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::A", + "id": "519995486237427479", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 15 + }, + "type": "int" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00013", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 14 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::B", + "id": "1177487653597650440", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 19 + }, + "type": "int" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00013", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 18 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::C", + "id": "1028245818073128358", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "c", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 23 + }, + "type": "int" + } + ], + "methods": [], + "name": "C", + "namespace": "clanguml::t00013", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 22 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::D", + "id": "409373870621931875", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "d", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 29 + }, + "type": "int" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "print", + "parameters": [ + { + "name": "r", + "type": "clanguml::t00013::R *" + } + ], + "type": "void" + } + ], + "name": "D", + "namespace": "clanguml::t00013", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 28 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::E", + "id": "864055993755439230", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "e", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 34 + }, + "type": "T" + } + ], + "methods": [], + "name": "E", + "namespace": "clanguml::t00013", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 33 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::G", + "id": "205927019127027617", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "g", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 38 + }, + "type": "T" + }, + { + "access": "public", + "is_static": false, + "name": "args", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 39 + }, + "type": "std::tuple" + } + ], + "methods": [], + "name": "G", + "namespace": "clanguml::t00013", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 37 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": true, + "kind": "template_type", + "name": "Args...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::E", + "id": "1977486318799565722", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00013", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::G", + "id": "1526733274613822014", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00013", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "float" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::E", + "id": "531523220915557686", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00013", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00013::R", + "id": "2198686676355573844", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "gintstring", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 60 + }, + "type": "G" + }, + { + "access": "private", + "is_static": false, + "name": "estring", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 63 + }, + "type": "E" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_a", + "parameters": [ + { + "name": "a", + "type": "clanguml::t00013::A *" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_b", + "parameters": [ + { + "name": "b", + "type": "clanguml::t00013::B &" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_const_b", + "parameters": [ + { + "name": "b", + "type": "const clanguml::t00013::B &" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_c", + "parameters": [ + { + "name": "c", + "type": "clanguml::t00013::C" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_d", + "parameters": [ + { + "name": "d", + "type": "clanguml::t00013::D &&" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_d2", + "parameters": [ + { + "name": "d", + "type": "clanguml::t00013::D &&" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_int_e", + "parameters": [ + { + "name": "e", + "type": "const clanguml::t00013::E &" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_int_e2", + "parameters": [ + { + "name": "e", + "type": "clanguml::t00013::E &" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_int_f", + "parameters": [ + { + "name": "f", + "type": "const ABCD::F &" + } + ], + "type": "int" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_e", + "parameters": [ + { + "name": "e", + "type": "E" + } + ], + "type": "T" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_f", + "parameters": [ + { + "name": "f", + "type": "const F &" + } + ], + "type": "T" + } + ], + "name": "R", + "namespace": "clanguml::t00013", + "source_location": { + "file": "../../tests/t00013/t00013.cc", + "line": 43 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00013_class", + "relationships": [ + { + "access": "public", + "destination": "952770730316239752", + "source": "2304215469403389354", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2198686676355573844", + "source": "409373870621931875", + "type": "dependency" + }, + { + "access": "public", + "destination": "864055993755439230", + "source": "1977486318799565722", + "type": "instantiation" + }, + { + "access": "public", + "destination": "205927019127027617", + "source": "1526733274613822014", + "type": "instantiation" + }, + { + "access": "public", + "destination": "864055993755439230", + "source": "531523220915557686", + "type": "instantiation" + }, + { + "access": "public", + "destination": "519995486237427479", + "source": "2198686676355573844", + "type": "dependency" + }, + { + "access": "public", + "destination": "1177487653597650440", + "source": "2198686676355573844", + "type": "dependency" + }, + { + "access": "public", + "destination": "1028245818073128358", + "source": "2198686676355573844", + "type": "dependency" + }, + { + "access": "public", + "destination": "409373870621931875", + "source": "2198686676355573844", + "type": "dependency" + }, + { + "access": "public", + "destination": "1977486318799565722", + "source": "2198686676355573844", + "type": "dependency" + }, + { + "access": "public", + "destination": "2304215469403389354", + "source": "2198686676355573844", + "type": "dependency" + }, + { + "access": "public", + "destination": "864055993755439230", + "source": "2198686676355573844", + "type": "dependency" + }, + { + "access": "public", + "destination": "952770730316239752", + "source": "2198686676355573844", + "type": "dependency" + }, + { + "access": "public", + "destination": "1526733274613822014", + "label": "gintstring", + "source": "2198686676355573844", + "type": "aggregation" + }, + { + "access": "private", + "destination": "531523220915557686", + "label": "estring", + "source": "2198686676355573844", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00013" +} +``` diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index 10405d04..b9c163dd 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -18,15 +18,15 @@ T - + - + f : T - + ABCD::F @@ -34,70 +34,70 @@ int - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + d : int print(R * r) : void - - + + E @@ -105,16 +105,16 @@ T - + - + e : T - - + + G @@ -122,22 +122,22 @@ T,Args... - + - + g : T - + - + args : std::tuple<Args...> - + E @@ -145,7 +145,7 @@ int - + G @@ -153,7 +153,7 @@ int,float,std::string - + E @@ -161,25 +161,25 @@ std::string - - + + R - + - + gintstring : G<int,float,std::string> - + - + estring : E<std::string> diff --git a/docs/test_cases/t00014.md b/docs/test_cases/t00014.md index 7280649a..d9b1201d 100644 --- a/docs/test_cases/t00014.md +++ b/docs/test_cases/t00014.md @@ -104,3 +104,944 @@ public: ``` ## Generated UML diagrams ![t00014_class](./t00014_class.svg "Alias template instantiation") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "765890579167335652", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "t", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 22 + }, + "type": "T" + }, + { + "access": "public", + "is_static": false, + "name": "p", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 23 + }, + "type": "P" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 21 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "P", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::B", + "id": "934136012292043506", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "value", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 27 + }, + "type": "std::string" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00014", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 26 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "2186387853087008570", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "T" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A>", + "id": "947292733740993297", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "T" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "std::unique_ptr" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "1700006390494465667", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "long" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "T" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "2017665567517853203", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "double" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "T" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "906557320263235873", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "long" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "U" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "378898020828430636", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "long" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "bool" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "2082013375525130414", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "double" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "bool" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "51978493292659230", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "long" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "float" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "197769253782961588", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "double" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "float" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "895940711566401184", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "bool" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A>", + "id": "1751732625010742161", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "float" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "std::unique_ptr" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "887121441210847583", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "1119452495635561975", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "640294848489463071", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "char" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::A", + "id": "139599686499155694", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00014", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "wchar_t" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00014::R", + "id": "1192822659863756768", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "bapair", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 58 + }, + "type": "PairPairBA" + }, + { + "access": "private", + "is_static": false, + "name": "abool", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 60 + }, + "type": "APtr" + }, + { + "access": "private", + "is_static": false, + "name": "aboolfloat", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 61 + }, + "type": "AAPtr" + }, + { + "access": "private", + "is_static": false, + "name": "afloat", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 62 + }, + "type": "ASharedPtr" + }, + { + "access": "private", + "is_static": false, + "name": "boolstring", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 63 + }, + "type": "A" + }, + { + "access": "private", + "is_static": false, + "name": "floatstring", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 64 + }, + "type": "AStringPtr" + }, + { + "access": "private", + "is_static": false, + "name": "intstring", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 65 + }, + "type": "clanguml::t00014::AIntString" + }, + { + "access": "private", + "is_static": false, + "name": "stringstring", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 66 + }, + "type": "clanguml::t00014::AStringString" + }, + { + "access": "private", + "is_static": false, + "name": "bstringstring", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 67 + }, + "type": "clanguml::t00014::BStringString" + }, + { + "access": "protected", + "is_static": false, + "name": "bs", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 70 + }, + "type": "clanguml::t00014::BVector" + }, + { + "access": "public", + "is_static": false, + "name": "bs2", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 73 + }, + "type": "clanguml::t00014::BVector2" + }, + { + "access": "public", + "is_static": false, + "name": "cb", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 74 + }, + "type": "SimpleCallback" + }, + { + "access": "public", + "is_static": false, + "name": "gcb", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 75 + }, + "type": "GenericCallback" + }, + { + "access": "public", + "is_static": false, + "name": "vcb", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 76 + }, + "type": "clanguml::t00014::VoidCallback" + }, + { + "access": "public", + "is_static": false, + "name": "vps", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 77 + }, + "type": "VectorPtr" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00014", + "source_location": { + "file": "../../tests/t00014/t00014.cc", + "line": 55 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00014_class", + "relationships": [ + { + "access": "public", + "destination": "765890579167335652", + "source": "2186387853087008570", + "type": "instantiation" + }, + { + "access": "public", + "destination": "765890579167335652", + "source": "947292733740993297", + "type": "instantiation" + }, + { + "access": "public", + "destination": "765890579167335652", + "source": "1700006390494465667", + "type": "instantiation" + }, + { + "access": "public", + "destination": "765890579167335652", + "source": "2017665567517853203", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1700006390494465667", + "source": "906557320263235873", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1700006390494465667", + "source": "378898020828430636", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2017665567517853203", + "source": "2082013375525130414", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1700006390494465667", + "source": "51978493292659230", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2017665567517853203", + "source": "197769253782961588", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2186387853087008570", + "source": "895940711566401184", + "type": "instantiation" + }, + { + "access": "public", + "destination": "947292733740993297", + "source": "1751732625010742161", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2186387853087008570", + "source": "887121441210847583", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2186387853087008570", + "source": "1119452495635561975", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2186387853087008570", + "source": "640294848489463071", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2186387853087008570", + "source": "139599686499155694", + "type": "instantiation" + }, + { + "access": "public", + "destination": "378898020828430636", + "source": "1192822659863756768", + "type": "dependency" + }, + { + "access": "private", + "destination": "934136012292043506", + "label": "bapair", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "private", + "destination": "378898020828430636", + "label": "bapair", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "public", + "destination": "2082013375525130414", + "source": "1192822659863756768", + "type": "dependency" + }, + { + "access": "private", + "destination": "2082013375525130414", + "label": "abool", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "public", + "destination": "51978493292659230", + "source": "1192822659863756768", + "type": "dependency" + }, + { + "access": "private", + "destination": "2082013375525130414", + "label": "aboolfloat", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "private", + "destination": "51978493292659230", + "label": "aboolfloat", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "public", + "destination": "197769253782961588", + "source": "1192822659863756768", + "type": "dependency" + }, + { + "access": "private", + "destination": "197769253782961588", + "label": "afloat", + "source": "1192822659863756768", + "type": "association" + }, + { + "access": "private", + "destination": "895940711566401184", + "label": "boolstring", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "private", + "destination": "1751732625010742161", + "label": "floatstring", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "private", + "destination": "887121441210847583", + "label": "intstring", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "private", + "destination": "1119452495635561975", + "label": "stringstring", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "private", + "destination": "1119452495635561975", + "label": "bstringstring", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "protected", + "destination": "934136012292043506", + "label": "bs", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "public", + "destination": "934136012292043506", + "label": "bs2", + "source": "1192822659863756768", + "type": "aggregation" + }, + { + "access": "public", + "destination": "640294848489463071", + "source": "1192822659863756768", + "type": "dependency" + }, + { + "access": "public", + "destination": "139599686499155694", + "source": "1192822659863756768", + "type": "dependency" + }, + { + "access": "public", + "destination": "934136012292043506", + "label": "vps", + "source": "1192822659863756768", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00014" +} +``` diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index 0e8c833e..1d599019 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,37 +18,37 @@ T,P - + - + t : T - + - + p : P - - + + B - + - + value : std::string - + A @@ -56,7 +56,7 @@ T,std::string - + A @@ -64,7 +64,7 @@ T,std::unique_ptr<std::string> - + A @@ -72,7 +72,7 @@ long,T - + A @@ -80,7 +80,7 @@ double,T - + A @@ -88,7 +88,7 @@ long,U - + A @@ -96,7 +96,7 @@ long,bool - + A @@ -104,7 +104,7 @@ double,bool - + A @@ -112,7 +112,7 @@ long,float - + A @@ -120,7 +120,7 @@ double,float - + A @@ -128,7 +128,7 @@ bool,std::string - + A @@ -136,7 +136,7 @@ float,std::unique_ptr<std::string> - + A @@ -144,7 +144,7 @@ int,std::string - + A @@ -152,7 +152,7 @@ std::string,std::string - + A @@ -160,7 +160,7 @@ char,std::string - + A @@ -168,116 +168,116 @@ wchar_t,std::string - - + + R - + - + bapair : PairPairBA<bool> - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + boolstring : A<bool,std::string> - + - + floatstring : AStringPtr<float> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + bstringstring : BStringString - + - + bs : BVector - + - + bs2 : BVector2 - + - + cb : SimpleCallback<ACharString> - + - + gcb : GenericCallback<R::AWCharString> - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00015.md b/docs/test_cases/t00015.md index 96fafa5b..e889e22b 100644 --- a/docs/test_cases/t00015.md +++ b/docs/test_cases/t00015.md @@ -49,3 +49,154 @@ class B : public ns1::ns2::Anon { }; ``` ## Generated UML diagrams ![t00015_class](./t00015_class.svg "Namespace fun") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00015::ns1::A", + "id": "1410694888805149453", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00015::ns1", + "source_location": { + "file": "../../tests/t00015/t00015.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00015::ns1::ns2_v0_9_0::A", + "id": "485552648049088863", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00015::ns1::ns2_v0_9_0", + "source_location": { + "file": "../../tests/t00015/t00015.cc", + "line": 10 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1410694888805149453", + "is_virtual": false, + "name": "clanguml::t00015::ns1::A" + } + ], + "display_name": "clanguml::t00015::ns1::Anon", + "id": "1060731132374575329", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Anon", + "namespace": "clanguml::t00015::ns1", + "source_location": { + "file": "../../tests/t00015/t00015.cc", + "line": 14 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1410694888805149453", + "is_virtual": false, + "name": "t00015::ns1::A" + } + ], + "display_name": "clanguml::t00015::ns3::ns1::ns2::Anon", + "id": "1797521288354158629", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Anon", + "namespace": "clanguml::t00015::ns3::ns1::ns2", + "source_location": { + "file": "../../tests/t00015/t00015.cc", + "line": 21 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1797521288354158629", + "is_virtual": false, + "name": "ns1::ns2::Anon" + } + ], + "display_name": "clanguml::t00015::ns3::B", + "id": "870882387819356092", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00015::ns3", + "source_location": { + "file": "../../tests/t00015/t00015.cc", + "line": 24 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00015_class", + "relationships": [ + { + "access": "public", + "destination": "1410694888805149453", + "source": "1060731132374575329", + "type": "extension" + }, + { + "access": "public", + "destination": "1410694888805149453", + "source": "1797521288354158629", + "type": "extension" + }, + { + "access": "public", + "destination": "1797521288354158629", + "source": "870882387819356092", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00015" +} +``` diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index aceec1bf..b62eecb8 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00016.md b/docs/test_cases/t00016.md index 74dfed28..39c12c24 100644 --- a/docs/test_cases/t00016.md +++ b/docs/test_cases/t00016.md @@ -50,3 +50,213 @@ template <> struct is_numeric { ``` ## Generated UML diagrams ![t00016_class](./t00016_class.svg "Unnamed enums and empty templates") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00016::is_numeric<>", + "id": "214045147845616983", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "value", + "type": "enum" + } + ], + "methods": [], + "name": "is_numeric", + "namespace": "clanguml::t00016", + "source_location": { + "file": "../../tests/t00016/t00016.cc", + "line": 4 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00016::is_numeric", + "id": "95618295648274199", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "is_numeric", + "namespace": "clanguml::t00016", + "source_location": { + "file": "../../tests/t00016/t00016.cc", + "line": 8 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "float" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00016::is_numeric", + "id": "979129381790761728", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "is_numeric", + "namespace": "clanguml::t00016", + "source_location": { + "file": "../../tests/t00016/t00016.cc", + "line": 12 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "char" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00016::is_numeric", + "id": "2090787690027341836", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "is_numeric", + "namespace": "clanguml::t00016", + "source_location": { + "file": "../../tests/t00016/t00016.cc", + "line": 16 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "unsigned int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00016::is_numeric", + "id": "500603075237446075", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "is_numeric", + "namespace": "clanguml::t00016", + "source_location": { + "file": "../../tests/t00016/t00016.cc", + "line": 20 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00016::is_numeric", + "id": "2111316837513419920", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "is_numeric", + "namespace": "clanguml::t00016", + "source_location": { + "file": "../../tests/t00016/t00016.cc", + "line": 24 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "bool" + } + ], + "type": "class" + } + ], + "name": "t00016_class", + "relationships": [ + { + "access": "public", + "destination": "214045147845616983", + "source": "95618295648274199", + "type": "instantiation" + }, + { + "access": "public", + "destination": "214045147845616983", + "source": "979129381790761728", + "type": "instantiation" + }, + { + "access": "public", + "destination": "214045147845616983", + "source": "2090787690027341836", + "type": "instantiation" + }, + { + "access": "public", + "destination": "214045147845616983", + "source": "500603075237446075", + "type": "instantiation" + }, + { + "access": "public", + "destination": "214045147845616983", + "source": "2111316837513419920", + "type": "instantiation" + } + ], + "using_namespace": "clanguml::t00016" +} +``` diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index 1e3195b3..3b9f2aa4 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric<> @@ -19,8 +19,8 @@ value : enum - - + + is_numeric @@ -29,8 +29,8 @@ - - + + is_numeric @@ -39,8 +39,8 @@ - - + + is_numeric @@ -49,8 +49,8 @@ - - + + is_numeric @@ -59,8 +59,8 @@ - - + + is_numeric diff --git a/docs/test_cases/t00017.md b/docs/test_cases/t00017.md index b5dc2913..338ff12e 100644 --- a/docs/test_cases/t00017.md +++ b/docs/test_cases/t00017.md @@ -78,3 +78,541 @@ private: ``` ## Generated UML diagrams ![t00017_class](./t00017_class.svg "Test include relations also as members flag") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00017::A", + "id": "121332093434690887", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 5 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::B", + "id": "1424864837456200487", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::C", + "id": "2151170391844743478", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::D", + "id": "1378112127131766972", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::E", + "id": "1535300935831802489", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 13 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::F", + "id": "1803800465279710134", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "F", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 15 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::G", + "id": "1135797791892670246", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::H", + "id": "1243547836571712317", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "H", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 19 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::I", + "id": "387733199705628658", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "I", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 21 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::J", + "id": "747991828672433537", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "J", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 23 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::K", + "id": "1783571342994833467", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "K", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 25 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00017::R", + "id": "287495916564113342", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "some_int", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 38 + }, + "type": "int" + }, + { + "access": "private", + "is_static": false, + "name": "some_int_pointer", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 39 + }, + "type": "int *" + }, + { + "access": "private", + "is_static": false, + "name": "some_int_pointer_pointer", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 40 + }, + "type": "int **" + }, + { + "access": "private", + "is_static": false, + "name": "some_int_reference", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 41 + }, + "type": "int &" + }, + { + "access": "private", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 42 + }, + "type": "clanguml::t00017::A" + }, + { + "access": "private", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 43 + }, + "type": "clanguml::t00017::B *" + }, + { + "access": "private", + "is_static": false, + "name": "c", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 44 + }, + "type": "clanguml::t00017::C &" + }, + { + "access": "private", + "is_static": false, + "name": "d", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 45 + }, + "type": "const clanguml::t00017::D *" + }, + { + "access": "private", + "is_static": false, + "name": "e", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 46 + }, + "type": "const clanguml::t00017::E &" + }, + { + "access": "private", + "is_static": false, + "name": "f", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 47 + }, + "type": "clanguml::t00017::F &&" + }, + { + "access": "private", + "is_static": false, + "name": "g", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 48 + }, + "type": "clanguml::t00017::G **" + }, + { + "access": "private", + "is_static": false, + "name": "h", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 49 + }, + "type": "clanguml::t00017::H ***" + }, + { + "access": "private", + "is_static": false, + "name": "i", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 50 + }, + "type": "clanguml::t00017::I *&" + }, + { + "access": "private", + "is_static": false, + "name": "j", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 51 + }, + "type": "volatile clanguml::t00017::J *" + }, + { + "access": "private", + "is_static": false, + "name": "k", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 52 + }, + "type": "clanguml::t00017::K *" + } + ], + "methods": [ + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "R", + "parameters": [ + { + "name": "some_int", + "type": "int &" + }, + { + "name": "cc", + "type": "clanguml::t00017::C &" + }, + { + "name": "ee", + "type": "const clanguml::t00017::E &" + }, + { + "name": "ff", + "type": "clanguml::t00017::F &&" + }, + { + "name": "ii", + "type": "clanguml::t00017::I *&" + } + ], + "type": "void" + } + ], + "name": "R", + "namespace": "clanguml::t00017", + "source_location": { + "file": "../../tests/t00017/t00017.cc", + "line": 27 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00017_class", + "relationships": [ + { + "access": "public", + "destination": "2151170391844743478", + "source": "287495916564113342", + "type": "dependency" + }, + { + "access": "public", + "destination": "1535300935831802489", + "source": "287495916564113342", + "type": "dependency" + }, + { + "access": "public", + "destination": "1803800465279710134", + "source": "287495916564113342", + "type": "dependency" + }, + { + "access": "public", + "destination": "387733199705628658", + "source": "287495916564113342", + "type": "dependency" + }, + { + "access": "private", + "destination": "121332093434690887", + "label": "a", + "source": "287495916564113342", + "type": "aggregation" + }, + { + "access": "private", + "destination": "1424864837456200487", + "label": "b", + "source": "287495916564113342", + "type": "association" + }, + { + "access": "private", + "destination": "2151170391844743478", + "label": "c", + "source": "287495916564113342", + "type": "association" + }, + { + "access": "private", + "destination": "1378112127131766972", + "label": "d", + "source": "287495916564113342", + "type": "association" + }, + { + "access": "private", + "destination": "1535300935831802489", + "label": "e", + "source": "287495916564113342", + "type": "association" + }, + { + "access": "private", + "destination": "1803800465279710134", + "label": "f", + "source": "287495916564113342", + "type": "aggregation" + }, + { + "access": "private", + "destination": "1135797791892670246", + "label": "g", + "source": "287495916564113342", + "type": "association" + }, + { + "access": "private", + "destination": "1243547836571712317", + "label": "h", + "source": "287495916564113342", + "type": "association" + }, + { + "access": "private", + "destination": "387733199705628658", + "label": "i", + "source": "287495916564113342", + "type": "association" + }, + { + "access": "private", + "destination": "747991828672433537", + "label": "j", + "source": "287495916564113342", + "type": "association" + }, + { + "access": "private", + "destination": "1783571342994833467", + "label": "k", + "source": "287495916564113342", + "type": "association" + } + ], + "using_namespace": "clanguml::t00017" +} +``` diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 3aa8f097..1e558c9c 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,127 +9,127 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00018.md b/docs/test_cases/t00018.md index b8880439..a10f4112 100644 --- a/docs/test_cases/t00018.md +++ b/docs/test_cases/t00018.md @@ -135,3 +135,276 @@ void widget::draw(const clanguml::t00018::widget &w) ``` ## Generated UML diagrams ![t00018_class](./t00018_class.svg "Pimpl pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00018::impl::widget", + "id": "130502639682787993", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "n", + "source_location": { + "file": "../../tests/t00018/t00018_impl.h", + "line": 10 + }, + "type": "int" + } + ], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "draw", + "parameters": [ + { + "name": "w", + "type": "const clanguml::t00018::widget &" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "draw", + "parameters": [ + { + "name": "w", + "type": "const clanguml::t00018::widget &" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "widget", + "parameters": [ + { + "name": "n", + "type": "int" + } + ], + "type": "void" + } + ], + "name": "widget", + "namespace": "clanguml::t00018::impl", + "source_location": { + "file": "../../tests/t00018/t00018_impl.h", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00018::widget", + "id": "1005661284373854088", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "pImpl", + "source_location": { + "file": "../../tests/t00018/t00018.h", + "line": 18 + }, + "type": "std::unique_ptr" + } + ], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "draw", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "draw", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "shown", + "parameters": [], + "type": "bool" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "widget", + "parameters": [ + { + "name": "", + "type": "int" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "~widget", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "widget", + "parameters": [ + { + "name": "", + "type": "clanguml::t00018::widget &&" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "widget", + "parameters": [ + { + "name": "", + "type": "const clanguml::t00018::widget &" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "operator=", + "parameters": [ + { + "name": "", + "type": "clanguml::t00018::widget &&" + } + ], + "type": "clanguml::t00018::widget &" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "operator=", + "parameters": [ + { + "name": "", + "type": "const clanguml::t00018::widget &" + } + ], + "type": "clanguml::t00018::widget &" + } + ], + "name": "widget", + "namespace": "clanguml::t00018", + "source_location": { + "file": "../../tests/t00018/t00018.h", + "line": 17 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00018_class", + "relationships": [ + { + "access": "public", + "destination": "1005661284373854088", + "source": "130502639682787993", + "type": "dependency" + }, + { + "access": "private", + "destination": "130502639682787993", + "label": "pImpl", + "source": "1005661284373854088", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00018" +} +``` diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index c2f5fa62..807dc8c1 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,18 +9,18 @@ - - + + impl::widget - + - + n : int @@ -30,18 +30,18 @@ draw(const widget & w) : void widget(int n) : void - - + + widget - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00019.md b/docs/test_cases/t00019.md index 846f5c6b..9491757b 100644 --- a/docs/test_cases/t00019.md +++ b/docs/test_cases/t00019.md @@ -152,3 +152,482 @@ class Base { ``` ## Generated UML diagrams ![t00019_class](./t00019_class.svg "Layercake pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00019::Base", + "id": "261668487476634123", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "private", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "Base", + "parameters": [], + "type": "void" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "~Base", + "parameters": [], + "type": "void" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m1", + "parameters": [], + "type": "int" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m2", + "parameters": [], + "type": "std::string" + } + ], + "name": "Base", + "namespace": "clanguml::t00019", + "source_location": { + "file": "../../tests/t00019/t00019_base.h", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00019::Layer1", + "id": "902631298537519271", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m1", + "parameters": [], + "type": "int" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m2", + "parameters": [], + "type": "std::string" + } + ], + "name": "Layer1", + "namespace": "clanguml::t00019", + "source_location": { + "file": "../../tests/t00019/t00019_layer1.h", + "line": 9 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "LowerLayer", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00019::Layer2", + "id": "1115150925302580647", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "private", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "all_calls_count", + "parameters": [], + "type": "int" + } + ], + "name": "Layer2", + "namespace": "clanguml::t00019", + "source_location": { + "file": "../../tests/t00019/t00019_layer2.h", + "line": 6 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "LowerLayer", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00019::Layer3", + "id": "1853410560073854945", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "m_m1_calls", + "source_location": { + "file": "../../tests/t00019/t00019_layer3.h", + "line": 29 + }, + "type": "int" + }, + { + "access": "private", + "is_static": false, + "name": "m_m2_calls", + "source_location": { + "file": "../../tests/t00019/t00019_layer3.h", + "line": 30 + }, + "type": "int" + } + ], + "methods": [ + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m1", + "parameters": [], + "type": "int" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m2", + "parameters": [], + "type": "std::string" + }, + { + "access": "private", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m1_calls", + "parameters": [], + "type": "int" + }, + { + "access": "private", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m2_calls", + "parameters": [], + "type": "int" + } + ], + "name": "Layer3", + "namespace": "clanguml::t00019", + "source_location": { + "file": "../../tests/t00019/t00019_layer3.h", + "line": 8 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "LowerLayer", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "261668487476634123", + "is_virtual": false, + "name": "clanguml::t00019::Base" + } + ], + "display_name": "clanguml::t00019::Layer3", + "id": "972890420743280319", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Layer3", + "namespace": "clanguml::t00019", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00019::Base" + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "972890420743280319", + "is_virtual": false, + "name": "clanguml::t00019::Layer3" + } + ], + "display_name": "clanguml::t00019::Layer2>", + "id": "129784999866998870", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Layer2", + "namespace": "clanguml::t00019", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00019::Base" + } + ], + "type": "clanguml::t00019::Layer3" + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "129784999866998870", + "is_virtual": false, + "name": "clanguml::t00019::Layer2>" + } + ], + "display_name": "clanguml::t00019::Layer1>>", + "id": "659076058325663708", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Layer1", + "namespace": "clanguml::t00019", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00019::Base" + } + ], + "type": "clanguml::t00019::Layer3" + } + ], + "type": "clanguml::t00019::Layer2" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00019::A", + "id": "1015164998787089197", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "layers", + "source_location": { + "file": "../../tests/t00019/t00019.cc", + "line": 13 + }, + "type": "std::unique_ptr>>>" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00019", + "source_location": { + "file": "../../tests/t00019/t00019.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00019_class", + "relationships": [ + { + "access": "public", + "destination": "261668487476634123", + "source": "972890420743280319", + "type": "dependency" + }, + { + "access": "public", + "destination": "1853410560073854945", + "source": "972890420743280319", + "type": "instantiation" + }, + { + "access": "public", + "destination": "261668487476634123", + "source": "972890420743280319", + "type": "extension" + }, + { + "access": "public", + "destination": "972890420743280319", + "source": "129784999866998870", + "type": "dependency" + }, + { + "access": "public", + "destination": "1115150925302580647", + "source": "129784999866998870", + "type": "instantiation" + }, + { + "access": "public", + "destination": "972890420743280319", + "source": "129784999866998870", + "type": "extension" + }, + { + "access": "public", + "destination": "129784999866998870", + "source": "659076058325663708", + "type": "dependency" + }, + { + "access": "public", + "destination": "902631298537519271", + "source": "659076058325663708", + "type": "instantiation" + }, + { + "access": "public", + "destination": "129784999866998870", + "source": "659076058325663708", + "type": "extension" + }, + { + "access": "public", + "destination": "659076058325663708", + "source": "1015164998787089197", + "type": "dependency" + }, + { + "access": "public", + "destination": "659076058325663708", + "label": "layers", + "source": "1015164998787089197", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00019" +} +``` diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index fb79a242..9c24a0d2 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Base @@ -25,8 +25,8 @@ m2() : std::string - - + + Layer1 @@ -39,8 +39,8 @@ m2() : std::string - - + + Layer2 @@ -51,8 +51,8 @@ all_calls_count() const : int - - + + Layer3 @@ -60,18 +60,18 @@ LowerLayer - + - + m_m1_calls : int - + - + m_m2_calls : int @@ -83,7 +83,7 @@ m1_calls() const : int m2_calls() const : int - + Layer3 @@ -91,7 +91,7 @@ Base - + Layer2 @@ -99,7 +99,7 @@ Layer3<Base> - + Layer1 @@ -107,18 +107,18 @@ Layer2<Layer3<Base>> - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00020.md b/docs/test_cases/t00020.md index 462db2a6..3a2425a2 100644 --- a/docs/test_cases/t00020.md +++ b/docs/test_cases/t00020.md @@ -98,3 +98,516 @@ public: ``` ## Generated UML diagrams ![t00020_class](./t00020_class.svg "Abstract factory pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00020::ProductA", + "id": "425267229659464944", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "~ProductA", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "sell", + "parameters": [ + { + "name": "price", + "type": "int" + } + ], + "type": "bool" + } + ], + "name": "ProductA", + "namespace": "clanguml::t00020", + "source_location": { + "file": "../../tests/t00020/t00020.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "425267229659464944", + "is_virtual": false, + "name": "clanguml::t00020::ProductA" + } + ], + "display_name": "clanguml::t00020::ProductA1", + "id": "1756496029797864207", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "sell", + "parameters": [ + { + "name": "price", + "type": "int" + } + ], + "type": "bool" + } + ], + "name": "ProductA1", + "namespace": "clanguml::t00020", + "source_location": { + "file": "../../tests/t00020/t00020.cc", + "line": 12 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "425267229659464944", + "is_virtual": false, + "name": "clanguml::t00020::ProductA" + } + ], + "display_name": "clanguml::t00020::ProductA2", + "id": "1531708592885216981", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "sell", + "parameters": [ + { + "name": "price", + "type": "int" + } + ], + "type": "bool" + } + ], + "name": "ProductA2", + "namespace": "clanguml::t00020", + "source_location": { + "file": "../../tests/t00020/t00020.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00020::ProductB", + "id": "2235759006374865842", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "~ProductB", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "buy", + "parameters": [ + { + "name": "price", + "type": "int" + } + ], + "type": "bool" + } + ], + "name": "ProductB", + "namespace": "clanguml::t00020", + "source_location": { + "file": "../../tests/t00020/t00020.cc", + "line": 22 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2235759006374865842", + "is_virtual": false, + "name": "clanguml::t00020::ProductB" + } + ], + "display_name": "clanguml::t00020::ProductB1", + "id": "1465493024233223845", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "buy", + "parameters": [ + { + "name": "price", + "type": "int" + } + ], + "type": "bool" + } + ], + "name": "ProductB1", + "namespace": "clanguml::t00020", + "source_location": { + "file": "../../tests/t00020/t00020.cc", + "line": 28 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2235759006374865842", + "is_virtual": false, + "name": "clanguml::t00020::ProductB" + } + ], + "display_name": "clanguml::t00020::ProductB2", + "id": "2154665562370057871", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "buy", + "parameters": [ + { + "name": "price", + "type": "int" + } + ], + "type": "bool" + } + ], + "name": "ProductB2", + "namespace": "clanguml::t00020", + "source_location": { + "file": "../../tests/t00020/t00020.cc", + "line": 33 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00020::AbstractFactory", + "id": "1705546469218961425", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "make_a", + "parameters": [], + "type": "std::unique_ptr" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "make_b", + "parameters": [], + "type": "std::unique_ptr" + } + ], + "name": "AbstractFactory", + "namespace": "clanguml::t00020", + "source_location": { + "file": "../../tests/t00020/t00020.cc", + "line": 38 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1705546469218961425", + "is_virtual": false, + "name": "clanguml::t00020::AbstractFactory" + } + ], + "display_name": "clanguml::t00020::Factory1", + "id": "692346848484854107", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "make_a", + "parameters": [], + "type": "std::unique_ptr" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "make_b", + "parameters": [], + "type": "std::unique_ptr" + } + ], + "name": "Factory1", + "namespace": "clanguml::t00020", + "source_location": { + "file": "../../tests/t00020/t00020.cc", + "line": 44 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1705546469218961425", + "is_virtual": false, + "name": "clanguml::t00020::AbstractFactory" + } + ], + "display_name": "clanguml::t00020::Factory2", + "id": "1566325870805013023", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "make_a", + "parameters": [], + "type": "std::unique_ptr" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "make_b", + "parameters": [], + "type": "std::unique_ptr" + } + ], + "name": "Factory2", + "namespace": "clanguml::t00020", + "source_location": { + "file": "../../tests/t00020/t00020.cc", + "line": 57 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00020_class", + "relationships": [ + { + "access": "public", + "destination": "425267229659464944", + "source": "1756496029797864207", + "type": "extension" + }, + { + "access": "public", + "destination": "425267229659464944", + "source": "1531708592885216981", + "type": "extension" + }, + { + "access": "public", + "destination": "2235759006374865842", + "source": "1465493024233223845", + "type": "extension" + }, + { + "access": "public", + "destination": "2235759006374865842", + "source": "2154665562370057871", + "type": "extension" + }, + { + "access": "public", + "destination": "425267229659464944", + "source": "1705546469218961425", + "type": "dependency" + }, + { + "access": "public", + "destination": "2235759006374865842", + "source": "1705546469218961425", + "type": "dependency" + }, + { + "access": "public", + "destination": "425267229659464944", + "source": "692346848484854107", + "type": "dependency" + }, + { + "access": "public", + "destination": "2235759006374865842", + "source": "692346848484854107", + "type": "dependency" + }, + { + "access": "public", + "destination": "1705546469218961425", + "source": "692346848484854107", + "type": "extension" + }, + { + "access": "public", + "destination": "425267229659464944", + "source": "1566325870805013023", + "type": "dependency" + }, + { + "access": "public", + "destination": "2235759006374865842", + "source": "1566325870805013023", + "type": "dependency" + }, + { + "access": "public", + "destination": "1705546469218961425", + "source": "1566325870805013023", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00020" +} +``` diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index 8d0285cf..2b37a08a 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ProductA @@ -21,8 +21,8 @@ sell(int price) const = 0 : bool - - + + ProductA1 @@ -31,8 +31,8 @@ sell(int price) const : bool - - + + ProductA2 @@ -41,8 +41,8 @@ sell(int price) const : bool - - + + ProductB @@ -53,8 +53,8 @@ buy(int price) const = 0 : bool - - + + ProductB1 @@ -63,8 +63,8 @@ buy(int price) const : bool - - + + ProductB2 @@ -73,8 +73,8 @@ buy(int price) const : bool - - + + AbstractFactory @@ -85,8 +85,8 @@ make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 @@ -97,8 +97,8 @@ make_b() const : std::unique_ptr<ProductB> - - + + Factory2 diff --git a/docs/test_cases/t00021.md b/docs/test_cases/t00021.md index 0d431d17..b9a2038d 100644 --- a/docs/test_cases/t00021.md +++ b/docs/test_cases/t00021.md @@ -72,3 +72,504 @@ public: ``` ## Generated UML diagrams ![t00021_class](./t00021_class.svg "Visitor pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00021::Visitor", + "id": "1668671110672744395", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "~Visitor", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "visit_A", + "parameters": [ + { + "name": "item", + "type": "const clanguml::t00021::A &" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "visit_B", + "parameters": [ + { + "name": "item", + "type": "const clanguml::t00021::B &" + } + ], + "type": "void" + } + ], + "name": "Visitor", + "namespace": "clanguml::t00021", + "source_location": { + "file": "../../tests/t00021/t00021.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1668671110672744395", + "is_virtual": false, + "name": "clanguml::t00021::Visitor" + } + ], + "display_name": "clanguml::t00021::Visitor1", + "id": "1028369219400401946", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "visit_A", + "parameters": [ + { + "name": "item", + "type": "const clanguml::t00021::A &" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "visit_B", + "parameters": [ + { + "name": "item", + "type": "const clanguml::t00021::B &" + } + ], + "type": "void" + } + ], + "name": "Visitor1", + "namespace": "clanguml::t00021", + "source_location": { + "file": "../../tests/t00021/t00021.cc", + "line": 16 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1668671110672744395", + "is_virtual": false, + "name": "clanguml::t00021::Visitor" + } + ], + "display_name": "clanguml::t00021::Visitor2", + "id": "1710373315476287130", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "visit_A", + "parameters": [ + { + "name": "item", + "type": "const clanguml::t00021::A &" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "visit_B", + "parameters": [ + { + "name": "item", + "type": "const clanguml::t00021::B &" + } + ], + "type": "void" + } + ], + "name": "Visitor2", + "namespace": "clanguml::t00021", + "source_location": { + "file": "../../tests/t00021/t00021.cc", + "line": 22 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1668671110672744395", + "is_virtual": false, + "name": "clanguml::t00021::Visitor" + } + ], + "display_name": "clanguml::t00021::Visitor3", + "id": "1399026228179178025", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "visit_A", + "parameters": [ + { + "name": "item", + "type": "const clanguml::t00021::A &" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "visit_B", + "parameters": [ + { + "name": "item", + "type": "const clanguml::t00021::B &" + } + ], + "type": "void" + } + ], + "name": "Visitor3", + "namespace": "clanguml::t00021", + "source_location": { + "file": "../../tests/t00021/t00021.cc", + "line": 28 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00021::Item", + "id": "1491568826758947722", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "~Item", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "accept", + "parameters": [ + { + "name": "visitor", + "type": "const clanguml::t00021::Visitor &" + } + ], + "type": "void" + } + ], + "name": "Item", + "namespace": "clanguml::t00021", + "source_location": { + "file": "../../tests/t00021/t00021.cc", + "line": 34 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1491568826758947722", + "is_virtual": false, + "name": "clanguml::t00021::Item" + } + ], + "display_name": "clanguml::t00021::A", + "id": "1494142745564026823", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "accept", + "parameters": [ + { + "name": "visitor", + "type": "const clanguml::t00021::Visitor &" + } + ], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00021", + "source_location": { + "file": "../../tests/t00021/t00021.cc", + "line": 40 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1491568826758947722", + "is_virtual": false, + "name": "clanguml::t00021::Item" + } + ], + "display_name": "clanguml::t00021::B", + "id": "1452948650450999568", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "accept", + "parameters": [ + { + "name": "visitor", + "type": "const clanguml::t00021::Visitor &" + } + ], + "type": "void" + } + ], + "name": "B", + "namespace": "clanguml::t00021", + "source_location": { + "file": "../../tests/t00021/t00021.cc", + "line": 45 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00021_class", + "relationships": [ + { + "access": "public", + "destination": "1494142745564026823", + "source": "1668671110672744395", + "type": "dependency" + }, + { + "access": "public", + "destination": "1452948650450999568", + "source": "1668671110672744395", + "type": "dependency" + }, + { + "access": "public", + "destination": "1494142745564026823", + "source": "1028369219400401946", + "type": "dependency" + }, + { + "access": "public", + "destination": "1452948650450999568", + "source": "1028369219400401946", + "type": "dependency" + }, + { + "access": "public", + "destination": "1668671110672744395", + "source": "1028369219400401946", + "type": "extension" + }, + { + "access": "public", + "destination": "1494142745564026823", + "source": "1710373315476287130", + "type": "dependency" + }, + { + "access": "public", + "destination": "1452948650450999568", + "source": "1710373315476287130", + "type": "dependency" + }, + { + "access": "public", + "destination": "1668671110672744395", + "source": "1710373315476287130", + "type": "extension" + }, + { + "access": "public", + "destination": "1494142745564026823", + "source": "1399026228179178025", + "type": "dependency" + }, + { + "access": "public", + "destination": "1452948650450999568", + "source": "1399026228179178025", + "type": "dependency" + }, + { + "access": "public", + "destination": "1668671110672744395", + "source": "1399026228179178025", + "type": "extension" + }, + { + "access": "public", + "destination": "1668671110672744395", + "source": "1491568826758947722", + "type": "dependency" + }, + { + "access": "public", + "destination": "1668671110672744395", + "source": "1494142745564026823", + "type": "dependency" + }, + { + "access": "public", + "destination": "1491568826758947722", + "source": "1494142745564026823", + "type": "extension" + }, + { + "access": "public", + "destination": "1668671110672744395", + "source": "1452948650450999568", + "type": "dependency" + }, + { + "access": "public", + "destination": "1491568826758947722", + "source": "1452948650450999568", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00021" +} +``` diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 4aaa781f..a51a7eb4 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Visitor @@ -23,8 +23,8 @@ visit_B(const B & item) const = 0 : void - - + + Visitor1 @@ -35,8 +35,8 @@ visit_B(const B & item) const : void - - + + Visitor2 @@ -47,8 +47,8 @@ visit_B(const B & item) const : void - - + + Visitor3 @@ -59,8 +59,8 @@ visit_B(const B & item) const : void - - + + Item @@ -71,8 +71,8 @@ accept(const Visitor & visitor) const = 0 : void - - + + A @@ -81,8 +81,8 @@ accept(const Visitor & visitor) const : void - - + + B diff --git a/docs/test_cases/t00022.md b/docs/test_cases/t00022.md index 17101292..4aec1a19 100644 --- a/docs/test_cases/t00022.md +++ b/docs/test_cases/t00022.md @@ -53,3 +53,188 @@ protected: ``` ## Generated UML diagrams ![t00022_class](./t00022_class.svg "Template method pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00022::A", + "id": "2012435893382068755", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "template_method", + "parameters": [], + "type": "void" + }, + { + "access": "protected", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "method1", + "parameters": [], + "type": "void" + }, + { + "access": "protected", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "method2", + "parameters": [], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00022", + "source_location": { + "file": "../../tests/t00022/t00022.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2012435893382068755", + "is_virtual": false, + "name": "clanguml::t00022::A" + } + ], + "display_name": "clanguml::t00022::A1", + "id": "2282061426381077447", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "protected", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "method1", + "parameters": [], + "type": "void" + }, + { + "access": "protected", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "method2", + "parameters": [], + "type": "void" + } + ], + "name": "A1", + "namespace": "clanguml::t00022", + "source_location": { + "file": "../../tests/t00022/t00022.cc", + "line": 19 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2012435893382068755", + "is_virtual": false, + "name": "clanguml::t00022::A" + } + ], + "display_name": "clanguml::t00022::A2", + "id": "158819862916671538", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "protected", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "method1", + "parameters": [], + "type": "void" + }, + { + "access": "protected", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "method2", + "parameters": [], + "type": "void" + } + ], + "name": "A2", + "namespace": "clanguml::t00022", + "source_location": { + "file": "../../tests/t00022/t00022.cc", + "line": 25 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00022_class", + "relationships": [ + { + "access": "public", + "destination": "2012435893382068755", + "source": "2282061426381077447", + "type": "extension" + }, + { + "access": "public", + "destination": "2012435893382068755", + "source": "158819862916671538", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00022" +} +``` diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index 77149e2a..d3fd3698 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -23,8 +23,8 @@ method2() = 0 : void - - + + A1 @@ -35,8 +35,8 @@ method2() : void - - + + A2 diff --git a/docs/test_cases/t00023.md b/docs/test_cases/t00023.md index b7a5dadf..ea52e1d9 100644 --- a/docs/test_cases/t00023.md +++ b/docs/test_cases/t00023.md @@ -62,3 +62,272 @@ private: ``` ## Generated UML diagrams ![t00023_class](./t00023_class.svg "Strategy pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00023::Strategy", + "id": "1469857696438841976", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "~Strategy", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "algorithm", + "parameters": [], + "type": "void" + } + ], + "name": "Strategy", + "namespace": "clanguml::t00023", + "source_location": { + "file": "../../tests/t00023/t00023.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1469857696438841976", + "is_virtual": false, + "name": "clanguml::t00023::Strategy" + } + ], + "display_name": "clanguml::t00023::StrategyA", + "id": "1245533075819635385", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "algorithm", + "parameters": [], + "type": "void" + } + ], + "name": "StrategyA", + "namespace": "clanguml::t00023", + "source_location": { + "file": "../../tests/t00023/t00023.cc", + "line": 12 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1469857696438841976", + "is_virtual": false, + "name": "clanguml::t00023::Strategy" + } + ], + "display_name": "clanguml::t00023::StrategyB", + "id": "264986406899645", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "algorithm", + "parameters": [], + "type": "void" + } + ], + "name": "StrategyB", + "namespace": "clanguml::t00023", + "source_location": { + "file": "../../tests/t00023/t00023.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1469857696438841976", + "is_virtual": false, + "name": "clanguml::t00023::Strategy" + } + ], + "display_name": "clanguml::t00023::StrategyC", + "id": "174795176193483089", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "algorithm", + "parameters": [], + "type": "void" + } + ], + "name": "StrategyC", + "namespace": "clanguml::t00023", + "source_location": { + "file": "../../tests/t00023/t00023.cc", + "line": 22 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00023::Context", + "id": "2038594012979479050", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "m_strategy", + "source_location": { + "file": "../../tests/t00023/t00023.cc", + "line": 37 + }, + "type": "std::unique_ptr" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "Context", + "parameters": [ + { + "name": "strategy", + "type": "std::unique_ptr" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "apply", + "parameters": [], + "type": "void" + } + ], + "name": "Context", + "namespace": "clanguml::t00023", + "source_location": { + "file": "../../tests/t00023/t00023.cc", + "line": 27 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00023_class", + "relationships": [ + { + "access": "public", + "destination": "1469857696438841976", + "source": "1245533075819635385", + "type": "extension" + }, + { + "access": "public", + "destination": "1469857696438841976", + "source": "264986406899645", + "type": "extension" + }, + { + "access": "public", + "destination": "1469857696438841976", + "source": "174795176193483089", + "type": "extension" + }, + { + "access": "public", + "destination": "1469857696438841976", + "source": "2038594012979479050", + "type": "dependency" + }, + { + "access": "private", + "destination": "1469857696438841976", + "label": "m_strategy", + "source": "2038594012979479050", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00023" +} +``` diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index 8bc7e504..292bed26 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Strategy @@ -21,8 +21,8 @@ algorithm() = 0 : void - - + + StrategyA @@ -31,8 +31,8 @@ algorithm() : void - - + + StrategyB @@ -41,8 +41,8 @@ algorithm() : void - - + + StrategyC @@ -51,18 +51,18 @@ algorithm() : void - - + + Context - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00024.md b/docs/test_cases/t00024.md index 18210cfa..dafe2158 100644 --- a/docs/test_cases/t00024.md +++ b/docs/test_cases/t00024.md @@ -61,3 +61,287 @@ private: ``` ## Generated UML diagrams ![t00024_class](./t00024_class.svg "Proxy pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00024::Target", + "id": "1116408959993110019", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "~Target", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "m1", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "m2", + "parameters": [], + "type": "void" + } + ], + "name": "Target", + "namespace": "clanguml::t00024", + "source_location": { + "file": "../../tests/t00024/t00024.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1116408959993110019", + "is_virtual": false, + "name": "clanguml::t00024::Target" + } + ], + "display_name": "clanguml::t00024::Target1", + "id": "669517069151826610", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m1", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m2", + "parameters": [], + "type": "void" + } + ], + "name": "Target1", + "namespace": "clanguml::t00024", + "source_location": { + "file": "../../tests/t00024/t00024.cc", + "line": 14 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1116408959993110019", + "is_virtual": false, + "name": "clanguml::t00024::Target" + } + ], + "display_name": "clanguml::t00024::Target2", + "id": "1210513233906695933", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m1", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m2", + "parameters": [], + "type": "void" + } + ], + "name": "Target2", + "namespace": "clanguml::t00024", + "source_location": { + "file": "../../tests/t00024/t00024.cc", + "line": 20 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1116408959993110019", + "is_virtual": false, + "name": "clanguml::t00024::Target" + } + ], + "display_name": "clanguml::t00024::Proxy", + "id": "594707401639991215", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "m_target", + "source_location": { + "file": "../../tests/t00024/t00024.cc", + "line": 36 + }, + "type": "std::shared_ptr" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "Proxy", + "parameters": [ + { + "name": "target", + "type": "std::shared_ptr" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m1", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "m2", + "parameters": [], + "type": "void" + } + ], + "name": "Proxy", + "namespace": "clanguml::t00024", + "source_location": { + "file": "../../tests/t00024/t00024.cc", + "line": 26 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00024_class", + "relationships": [ + { + "access": "public", + "destination": "1116408959993110019", + "source": "669517069151826610", + "type": "extension" + }, + { + "access": "public", + "destination": "1116408959993110019", + "source": "1210513233906695933", + "type": "extension" + }, + { + "access": "public", + "destination": "1116408959993110019", + "source": "594707401639991215", + "type": "dependency" + }, + { + "access": "private", + "destination": "1116408959993110019", + "label": "m_target", + "source": "594707401639991215", + "type": "association" + }, + { + "access": "public", + "destination": "1116408959993110019", + "source": "594707401639991215", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00024" +} +``` diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 3d5979e3..147ee095 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target @@ -23,8 +23,8 @@ m2() = 0 : void - - + + Target1 @@ -35,8 +35,8 @@ m2() : void - - + + Target2 @@ -47,18 +47,18 @@ m2() : void - - + + Proxy - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00025.md b/docs/test_cases/t00025.md index 25c1ebdd..9e8ad51a 100644 --- a/docs/test_cases/t00025.md +++ b/docs/test_cases/t00025.md @@ -59,3 +59,310 @@ public: ``` ## Generated UML diagrams ![t00025_class](./t00025_class.svg "Template proxy pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00025::Target1", + "id": "1573849034571194138", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m1", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m2", + "parameters": [], + "type": "void" + } + ], + "name": "Target1", + "namespace": "clanguml::t00025", + "source_location": { + "file": "../../tests/t00025/t00025.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00025::Target2", + "id": "751896409461834669", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m1", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m2", + "parameters": [], + "type": "void" + } + ], + "name": "Target2", + "namespace": "clanguml::t00025", + "source_location": { + "file": "../../tests/t00025/t00025.cc", + "line": 12 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00025::Proxy", + "id": "1483353300536405088", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "m_target", + "source_location": { + "file": "../../tests/t00025/t00025.cc", + "line": 28 + }, + "type": "std::shared_ptr" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "Proxy", + "parameters": [ + { + "name": "target", + "type": "std::shared_ptr" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m1", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "m2", + "parameters": [], + "type": "void" + } + ], + "name": "Proxy", + "namespace": "clanguml::t00025", + "source_location": { + "file": "../../tests/t00025/t00025.cc", + "line": 18 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00025::Proxy", + "id": "1644966842838139424", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Proxy", + "namespace": "clanguml::t00025", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00025::Target1" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00025::Proxy", + "id": "1190103100236298763", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Proxy", + "namespace": "clanguml::t00025", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00025::Target2" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00025::ProxyHolder", + "id": "1906317303950647748", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "proxy1", + "source_location": { + "file": "../../tests/t00025/t00025.cc", + "line": 33 + }, + "type": "Proxy" + }, + { + "access": "public", + "is_static": false, + "name": "proxy2", + "source_location": { + "file": "../../tests/t00025/t00025.cc", + "line": 34 + }, + "type": "Proxy" + } + ], + "methods": [], + "name": "ProxyHolder", + "namespace": "clanguml::t00025", + "source_location": { + "file": "../../tests/t00025/t00025.cc", + "line": 31 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00025_class", + "relationships": [ + { + "access": "public", + "destination": "1573849034571194138", + "source": "1644966842838139424", + "type": "dependency" + }, + { + "access": "public", + "destination": "1483353300536405088", + "source": "1644966842838139424", + "type": "instantiation" + }, + { + "access": "public", + "destination": "751896409461834669", + "source": "1190103100236298763", + "type": "dependency" + }, + { + "access": "public", + "destination": "1483353300536405088", + "source": "1190103100236298763", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1644966842838139424", + "label": "proxy1", + "source": "1906317303950647748", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1190103100236298763", + "label": "proxy2", + "source": "1906317303950647748", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00025" +} +``` diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index 6e2cff91..e06c209d 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Target1 @@ -21,8 +21,8 @@ m2() : void - - + + Target2 @@ -33,8 +33,8 @@ m2() : void - - + + Proxy @@ -42,11 +42,11 @@ T - + - + m_target : std::shared_ptr<T> @@ -56,7 +56,7 @@ m1() : void m2() : void - + Proxy @@ -64,7 +64,7 @@ Target1 - + Proxy @@ -72,25 +72,25 @@ Target2 - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00026.md b/docs/test_cases/t00026.md index 3e5b3729..6ca8c99f 100644 --- a/docs/test_cases/t00026.md +++ b/docs/test_cases/t00026.md @@ -80,3 +80,406 @@ struct StringMemento { ``` ## Generated UML diagrams ![t00026_class](./t00026_class.svg "Template memento pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00026::Memento", + "id": "1241204213727905390", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "m_value", + "source_location": { + "file": "../../tests/t00026/t00026.cc", + "line": 18 + }, + "type": "T" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "Memento", + "parameters": [ + { + "name": "v", + "type": "T &&" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "value", + "parameters": [], + "type": "T" + } + ], + "name": "Memento", + "namespace": "clanguml::t00026", + "source_location": { + "file": "../../tests/t00026/t00026.cc", + "line": 8 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00026::Originator", + "id": "1324770803720816727", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "m_value", + "source_location": { + "file": "../../tests/t00026/t00026.cc", + "line": 37 + }, + "type": "T" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "Originator", + "parameters": [ + { + "name": "v", + "type": "T &&" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "memoize_value", + "parameters": [], + "type": "Memento" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "load", + "parameters": [ + { + "name": "m", + "type": "const Memento &" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "print", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "set", + "parameters": [ + { + "name": "v", + "type": "T &&" + } + ], + "type": "void" + } + ], + "name": "Originator", + "namespace": "clanguml::t00026", + "source_location": { + "file": "../../tests/t00026/t00026.cc", + "line": 21 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00026::Caretaker", + "id": "2032715387182792204", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "m_mementos", + "source_location": { + "file": "../../tests/t00026/t00026.cc", + "line": 50 + }, + "type": "std::unordered_map>" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "state", + "parameters": [ + { + "name": "n", + "type": "const std::string &" + } + ], + "type": "Memento &" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "set_state", + "parameters": [ + { + "name": "s", + "type": "const std::string &" + }, + { + "name": "m", + "type": "Memento &&" + } + ], + "type": "void" + } + ], + "name": "Caretaker", + "namespace": "clanguml::t00026", + "source_location": { + "file": "../../tests/t00026/t00026.cc", + "line": 40 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00026::Caretaker", + "id": "1708482137721157489", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Caretaker", + "namespace": "clanguml::t00026", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00026::Originator", + "id": "1014247960805363560", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Originator", + "namespace": "clanguml::t00026", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00026::StringMemento", + "id": "851750942915129289", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "caretaker", + "source_location": { + "file": "../../tests/t00026/t00026.cc", + "line": 54 + }, + "type": "Caretaker" + }, + { + "access": "public", + "is_static": false, + "name": "originator", + "source_location": { + "file": "../../tests/t00026/t00026.cc", + "line": 55 + }, + "type": "Originator" + } + ], + "methods": [], + "name": "StringMemento", + "namespace": "clanguml::t00026", + "source_location": { + "file": "../../tests/t00026/t00026.cc", + "line": 53 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00026_class", + "relationships": [ + { + "access": "public", + "destination": "1241204213727905390", + "source": "1324770803720816727", + "type": "dependency" + }, + { + "access": "public", + "destination": "1241204213727905390", + "source": "2032715387182792204", + "type": "dependency" + }, + { + "access": "private", + "destination": "1241204213727905390", + "label": "m_mementos", + "source": "2032715387182792204", + "type": "aggregation" + }, + { + "access": "public", + "destination": "2032715387182792204", + "source": "1708482137721157489", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1324770803720816727", + "source": "1014247960805363560", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1708482137721157489", + "label": "caretaker", + "source": "851750942915129289", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1014247960805363560", + "label": "originator", + "source": "851750942915129289", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00026" +} +``` diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index 82641929..82741827 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,11 +18,11 @@ T - + - + m_value : T @@ -30,8 +30,8 @@ Memento<T>(T && v) : void value() const : T - - + + Originator @@ -39,11 +39,11 @@ T - + - + m_value : T @@ -57,8 +57,8 @@ print() const : void set(T && v) : void - - + + Caretaker @@ -66,11 +66,11 @@ T - + - + m_mementos : std::unordered_map<std::string,Memento<T>> @@ -78,7 +78,7 @@ state(const std::string & n) : Memento<T> & set_state(const std::string & s, Memento<T> && m) : void - + Caretaker @@ -86,7 +86,7 @@ std::string - + Originator @@ -94,25 +94,25 @@ std::string - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00027.md b/docs/test_cases/t00027.md index e94a8eee..08a7deb1 100644 --- a/docs/test_cases/t00027.md +++ b/docs/test_cases/t00027.md @@ -77,3 +77,590 @@ struct Window { ``` ## Generated UML diagrams ![t00027_class](./t00027_class.svg "Template decorator pattern") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00027::Shape", + "id": "1593092483959332221", + "is_abstract": true, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "display", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": true, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "~Shape", + "parameters": [], + "type": "void" + } + ], + "name": "Shape", + "namespace": "clanguml::t00027", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00027::Line", + "id": "1568932879061562228", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Line", + "namespace": "clanguml::t00027", + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1593092483959332221", + "is_virtual": false, + "name": "clanguml::t00027::Shape" + }, + { + "access": "public", + "id": "2184609081997324211", + "is_virtual": false, + "name": "T>" + } + ], + "display_name": "clanguml::t00027::Line...>", + "id": "142374082478337852", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "display", + "parameters": [], + "type": "void" + } + ], + "name": "Line", + "namespace": "clanguml::t00027", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 15 + }, + "template_parameters": [ + { + "is_variadic": true, + "kind": "template_template_type", + "name": "T<>...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00027::Text", + "id": "1833467466291294724", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Text", + "namespace": "clanguml::t00027", + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1593092483959332221", + "is_virtual": false, + "name": "clanguml::t00027::Shape" + }, + { + "access": "public", + "id": "2247508827463056747", + "is_virtual": false, + "name": "T>" + } + ], + "display_name": "clanguml::t00027::Text...>", + "id": "1114634647721878603", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "display", + "parameters": [], + "type": "void" + } + ], + "name": "Text", + "namespace": "clanguml::t00027", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 25 + }, + "template_parameters": [ + { + "is_variadic": true, + "kind": "template_template_type", + "name": "T<>...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00027::ShapeDecorator", + "id": "2049188825706164566", + "is_abstract": true, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "display", + "parameters": [], + "type": "void" + } + ], + "name": "ShapeDecorator", + "namespace": "clanguml::t00027", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 34 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2049188825706164566", + "is_virtual": false, + "name": "clanguml::t00027::ShapeDecorator" + } + ], + "display_name": "clanguml::t00027::Color", + "id": "1473536569433029444", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "display", + "parameters": [], + "type": "void" + } + ], + "name": "Color", + "namespace": "clanguml::t00027", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 38 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2049188825706164566", + "is_virtual": false, + "name": "clanguml::t00027::ShapeDecorator" + } + ], + "display_name": "clanguml::t00027::Weight", + "id": "2049455532387561338", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "display", + "parameters": [], + "type": "void" + } + ], + "name": "Weight", + "namespace": "clanguml::t00027", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 43 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00027::Line", + "id": "2082936326417164202", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Line", + "namespace": "clanguml::t00027", + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "clanguml::t00027::Color", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "clanguml::t00027::Weight", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00027::Line", + "id": "675132943535054947", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Line", + "namespace": "clanguml::t00027", + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "clanguml::t00027::Color", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00027::Text", + "id": "1678874302644303776", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Text", + "namespace": "clanguml::t00027", + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "clanguml::t00027::Color", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "clanguml::t00027::Weight", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00027::Text", + "id": "1887786688778664182", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Text", + "namespace": "clanguml::t00027", + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "clanguml::t00027::Color", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00027::Window", + "id": "1373544984027721472", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "border", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 49 + }, + "type": "Line" + }, + { + "access": "public", + "is_static": false, + "name": "divider", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 50 + }, + "type": "Line" + }, + { + "access": "public", + "is_static": false, + "name": "title", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 51 + }, + "type": "Text" + }, + { + "access": "public", + "is_static": false, + "name": "description", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 52 + }, + "type": "Text" + } + ], + "methods": [], + "name": "Window", + "namespace": "clanguml::t00027", + "source_location": { + "file": "../../tests/t00027/t00027.cc", + "line": 48 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00027_class", + "relationships": [ + { + "access": "public", + "destination": "142374082478337852", + "source": "1568932879061562228", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1593092483959332221", + "source": "142374082478337852", + "type": "extension" + }, + { + "access": "public", + "destination": "2184609081997324211", + "source": "142374082478337852", + "type": "extension" + }, + { + "access": "public", + "destination": "1114634647721878603", + "source": "1833467466291294724", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1593092483959332221", + "source": "1114634647721878603", + "type": "extension" + }, + { + "access": "public", + "destination": "2247508827463056747", + "source": "1114634647721878603", + "type": "extension" + }, + { + "access": "public", + "destination": "2049188825706164566", + "source": "1473536569433029444", + "type": "extension" + }, + { + "access": "public", + "destination": "2049188825706164566", + "source": "2049455532387561338", + "type": "extension" + }, + { + "access": "public", + "destination": "142374082478337852", + "source": "2082936326417164202", + "type": "instantiation" + }, + { + "access": "public", + "destination": "142374082478337852", + "source": "675132943535054947", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1114634647721878603", + "source": "1678874302644303776", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1114634647721878603", + "source": "1887786688778664182", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2082936326417164202", + "label": "border", + "source": "1373544984027721472", + "type": "aggregation" + }, + { + "access": "public", + "destination": "675132943535054947", + "label": "divider", + "source": "1373544984027721472", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1678874302644303776", + "label": "title", + "source": "1373544984027721472", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1887786688778664182", + "label": "description", + "source": "1373544984027721472", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00027" +} +``` diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index cadd73ad..4d963ed1 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Shape @@ -21,14 +21,14 @@ ~Shape() = default : void - + Line - - + + Line @@ -39,14 +39,14 @@ display() : void - + Text - - + + Text @@ -57,8 +57,8 @@ display() : void - - + + ShapeDecorator @@ -67,8 +67,8 @@ display() = 0 : void - - + + Color @@ -79,8 +79,8 @@ display() : void - - + + Weight @@ -91,7 +91,7 @@ display() : void - + Line @@ -99,7 +99,7 @@ Color,Weight - + Line @@ -107,7 +107,7 @@ Color - + Text @@ -115,7 +115,7 @@ Color,Weight - + Text @@ -123,39 +123,39 @@ Color - - + + Window - + - + border : Line<Color,Weight> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> - + - + description : Text<Color> diff --git a/docs/test_cases/t00028.md b/docs/test_cases/t00028.md index 35ad898c..652039eb 100644 --- a/docs/test_cases/t00028.md +++ b/docs/test_cases/t00028.md @@ -86,3 +86,386 @@ class R { ``` ## Generated UML diagrams ![t00028_class](./t00028_class.svg "PlantUML note decorator test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "comment": { + "formatted": "\\uml{note[top] A class note.}", + "raw": "/// \\uml{note[top] A class note.}" + }, + "display_name": "clanguml::t00028::A", + "id": "1519850480962783588", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00028", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "comment": { + "formatted": "\\uml{note[] B class note.}", + "raw": "/// \\uml{note[] B class note.}" + }, + "display_name": "clanguml::t00028::B", + "id": "1980597091567213070", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00028", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "comment": { + "formatted": "\n @uml{note:t00028_class[bottom] C class note.}\n This is class C.", + "raw": "///\n/// @uml{note:t00028_class[bottom] C class note.}\n/// This is class C." + }, + "display_name": "clanguml::t00028::C", + "id": "984577258575112753", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00028", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 16 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "comment": { + "formatted": "\\uml{note\nD\nclass\nnote.}", + "raw": "/// \\uml{note\n/// D\n/// class\n/// note.}" + }, + "display_name": "clanguml::t00028::D", + "id": "1263778658518784070", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00028", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 22 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "comment": { + "formatted": "\\uml{note E template class note.}", + "raw": "/// \\uml{note E template class note.}" + }, + "display_name": "clanguml::t00028::E", + "id": "1014136565447389473", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "param", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 26 + }, + "type": "T" + } + ], + "methods": [], + "name": "E", + "namespace": "clanguml::t00028", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 25 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "comment": { + "formatted": "\\uml{note:other_diagram[left] G class note.}", + "raw": "/// \\uml{note:other_diagram[left] G class note.}" + }, + "display_name": "clanguml::t00028::G", + "id": "764713728396057122", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00028", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 30 + }, + "template_parameters": [], + "type": "class" + }, + { + "comment": { + "formatted": "@uml{note[ bottom ] F enum note.}", + "raw": "/// @uml{note[ bottom ] F enum note.}" + }, + "constants": [ + "one", + "two", + "three" + ], + "display_name": "clanguml::t00028::F", + "id": "589227897266388677", + "is_nested": false, + "name": "F", + "namespace": "clanguml::t00028", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 33 + }, + "type": "enum" + }, + { + "bases": [], + "display_name": "clanguml::t00028::E", + "id": "1949673179441298667", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00028", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "comment": { + "formatted": "\\uml{note[right] R class note.}", + "raw": "/// \\uml{note[right] R class note.}" + }, + "display_name": "clanguml::t00028::R", + "id": "1189142882239313116", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "private", + "comment": { + "formatted": "\\uml{note[left] R contains an instance of A.}", + "raw": "/// \\uml{note[left] R contains an instance of A.}" + }, + "is_static": false, + "name": "aaa", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 43 + }, + "type": "clanguml::t00028::A" + }, + { + "access": "private", + "comment": { + "formatted": "\\uml{note:other_diagram[right] R contains an pointer to B.}", + "raw": "/// \\uml{note:other_diagram[right] R contains an pointer to B.}" + }, + "is_static": false, + "name": "bbb", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 46 + }, + "type": "clanguml::t00028::B *" + }, + { + "access": "private", + "is_static": false, + "name": "ccc", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 48 + }, + "type": "clanguml::t00028::C &" + }, + { + "access": "private", + "is_static": false, + "name": "ddd", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 50 + }, + "type": "std::vector>" + }, + { + "access": "private", + "is_static": false, + "name": "eee", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 52 + }, + "type": "E" + }, + { + "access": "private", + "is_static": false, + "name": "ggg", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 54 + }, + "type": "clanguml::t00028::G **" + } + ], + "methods": [ + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "R", + "parameters": [ + { + "name": "c", + "type": "clanguml::t00028::C &" + } + ], + "type": "void" + } + ], + "name": "R", + "namespace": "clanguml::t00028", + "source_location": { + "file": "../../tests/t00028/t00028.cc", + "line": 36 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00028_class", + "relationships": [ + { + "access": "public", + "destination": "1014136565447389473", + "source": "1949673179441298667", + "type": "instantiation" + }, + { + "access": "public", + "destination": "984577258575112753", + "source": "1189142882239313116", + "type": "dependency" + }, + { + "access": "private", + "destination": "1519850480962783588", + "label": "aaa", + "source": "1189142882239313116", + "type": "aggregation" + }, + { + "access": "private", + "destination": "1980597091567213070", + "label": "bbb", + "source": "1189142882239313116", + "type": "association" + }, + { + "access": "private", + "destination": "984577258575112753", + "label": "ccc", + "source": "1189142882239313116", + "type": "association" + }, + { + "access": "private", + "destination": "1263778658518784070", + "label": "ddd", + "source": "1189142882239313116", + "type": "aggregation" + }, + { + "access": "private", + "destination": "1949673179441298667", + "label": "eee", + "source": "1189142882239313116", + "type": "aggregation" + }, + { + "access": "private", + "destination": "764713728396057122", + "label": "ggg", + "source": "1189142882239313116", + "type": "association" + } + ], + "using_namespace": "clanguml::t00028" +} +``` diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index a0fc906d..b2a939e7 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - + A class note. - - + + B - + B class note. - - + + C - + C class note. - - + + D - + D class note. - - + + E @@ -64,27 +64,27 @@ T - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,10 +94,10 @@ three - + F enum note. - + E @@ -105,65 +105,65 @@ int - - + + R - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** R(C & c) : void - + R class note. - + R contains an instance of A. - + Reference to C. diff --git a/docs/test_cases/t00029.md b/docs/test_cases/t00029.md index fd3386b0..f050f6b1 100644 --- a/docs/test_cases/t00029.md +++ b/docs/test_cases/t00029.md @@ -69,3 +69,239 @@ struct R { ``` ## Generated UML diagrams ![t00029_class](./t00029_class.svg "PlantUML skip decorator test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00029::A", + "id": "1970994826766369014", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00029", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00029::C", + "id": "543766389270348470", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "param", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 13 + }, + "type": "T" + } + ], + "methods": [], + "name": "C", + "namespace": "clanguml::t00029", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 12 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "constants": [ + "one", + "two", + "three" + ], + "display_name": "clanguml::t00029::E", + "id": "1936873082456592219", + "is_nested": false, + "name": "E", + "namespace": "clanguml::t00029", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 21 + }, + "type": "enum" + }, + { + "bases": [], + "display_name": "clanguml::t00029::G1", + "id": "1980718063838190763", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G1", + "namespace": "clanguml::t00029", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 26 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00029::G2", + "id": "2204627213593766591", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G2", + "namespace": "clanguml::t00029", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 28 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00029::G3", + "id": "767180516665070631", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G3", + "namespace": "clanguml::t00029", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 30 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00029::G4", + "id": "715074622924270214", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G4", + "namespace": "clanguml::t00029", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 32 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00029::R", + "id": "348749731659902910", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "g1", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 35 + }, + "type": "clanguml::t00029::G1" + }, + { + "access": "public", + "comment": { + "formatted": "\\uml{skiprelationship}", + "raw": "/// \\uml{skiprelationship}" + }, + "is_static": false, + "name": "g3", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 41 + }, + "type": "clanguml::t00029::G3 &" + }, + { + "access": "public", + "is_static": false, + "name": "g4", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 43 + }, + "type": "std::shared_ptr" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00029", + "source_location": { + "file": "../../tests/t00029/t00029.cc", + "line": 34 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00029_class", + "relationships": [ + { + "access": "public", + "destination": "1980718063838190763", + "label": "g1", + "source": "348749731659902910", + "type": "aggregation" + }, + { + "access": "public", + "destination": "715074622924270214", + "label": "g4", + "source": "348749731659902910", + "type": "association" + } + ], + "using_namespace": "clanguml::t00029" +} +``` diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index 37ac1cd7..52a0ca38 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -26,16 +26,16 @@ T - + - + param : T - - + + E @@ -45,64 +45,64 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00030.md b/docs/test_cases/t00030.md index 235fc4c2..363006df 100644 --- a/docs/test_cases/t00030.md +++ b/docs/test_cases/t00030.md @@ -57,3 +57,247 @@ struct R { ``` ## Generated UML diagrams ![t00030_class](./t00030_class.svg "PlantUML relationship decorators test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00030::A", + "id": "64769484767514424", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00030", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00030::B", + "id": "156923198106222307", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00030", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00030::C", + "id": "1651557398557662399", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00030", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00030::D", + "id": "1089781072752262158", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00030", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 13 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00030::E", + "id": "425964641881054607", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00030", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 15 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00030::R", + "id": "263468735940481091", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "comment": { + "formatted": "@uml{association[]}", + "raw": "/// @uml{association[]}" + }, + "is_static": false, + "name": "aaa", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 19 + }, + "type": "clanguml::t00030::A" + }, + { + "access": "public", + "comment": { + "formatted": "@uml{composition[0..1:1..*]}", + "raw": "/// @uml{composition[0..1:1..*]}" + }, + "is_static": false, + "name": "bbb", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 22 + }, + "type": "std::vector" + }, + { + "access": "public", + "comment": { + "formatted": "@uml{aggregation[0..1:1..5]}", + "raw": "/// @uml{aggregation[0..1:1..5]}" + }, + "is_static": false, + "name": "ccc", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 25 + }, + "type": "std::vector" + }, + { + "access": "public", + "comment": { + "formatted": "@uml{association[:1]}", + "raw": "/// @uml{association[:1]}" + }, + "is_static": false, + "name": "ddd", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 28 + }, + "type": "clanguml::t00030::D" + }, + { + "access": "public", + "comment": { + "formatted": "@uml{aggregation[:1]}", + "raw": "/// @uml{aggregation[:1]}" + }, + "is_static": false, + "name": "eee", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 31 + }, + "type": "clanguml::t00030::E *" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00030", + "source_location": { + "file": "../../tests/t00030/t00030.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00030_class", + "relationships": [ + { + "access": "public", + "destination": "64769484767514424", + "label": "aaa", + "source": "263468735940481091", + "type": "association" + }, + { + "access": "public", + "destination": "156923198106222307", + "label": "bbb", + "multiplicity_destination": "1..*", + "multiplicity_source": "0..1", + "source": "263468735940481091", + "type": "composition" + }, + { + "access": "public", + "destination": "1651557398557662399", + "label": "ccc", + "multiplicity_destination": "1..5", + "multiplicity_source": "0..1", + "source": "263468735940481091", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1089781072752262158", + "label": "ddd", + "multiplicity_destination": "1", + "source": "263468735940481091", + "type": "association" + }, + { + "access": "public", + "destination": "425964641881054607", + "label": "eee", + "multiplicity_destination": "1", + "source": "263468735940481091", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00030" +} +``` diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index 9f96f86d..d3656053 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,86 +9,86 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + - + eee : E * diff --git a/docs/test_cases/t00031.md b/docs/test_cases/t00031.md index bc874f5a..d45fc832 100644 --- a/docs/test_cases/t00031.md +++ b/docs/test_cases/t00031.md @@ -58,3 +58,256 @@ struct R { ``` ## Generated UML diagrams ![t00031_class](./t00031_class.svg "PlantUML style decorator test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "comment": { + "formatted": "@uml{style[#back:lightgreen|yellow;header:blue/red]}", + "raw": "/// @uml{style[#back:lightgreen|yellow;header:blue/red]}" + }, + "display_name": "clanguml::t00031::A", + "id": "847775539502907247", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00031", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "comment": { + "formatted": "@uml{style[#line.dotted:blue]}", + "raw": "/// @uml{style[#line.dotted:blue]}" + }, + "constants": [ + "one", + "two", + "three" + ], + "display_name": "clanguml::t00031::B", + "id": "1441796358326382179", + "is_nested": false, + "name": "B", + "namespace": "clanguml::t00031", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 11 + }, + "type": "enum" + }, + { + "bases": [], + "comment": { + "formatted": "@uml{style[#pink;line:red;line.bold;text:red]}", + "raw": "/// @uml{style[#pink;line:red;line.bold;text:red]}" + }, + "display_name": "clanguml::t00031::C", + "id": "116209144733282955", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "ttt", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 15 + }, + "type": "T" + } + ], + "methods": [], + "name": "C", + "namespace": "clanguml::t00031", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 14 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00031::D", + "id": "2266534344475505157", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00031", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 18 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00031::C", + "id": "208700529175860645", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00031", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00031::R", + "id": "484712092364868032", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "comment": { + "formatted": "@uml{style[#red,dashed,thickness=2]}", + "raw": "/// @uml{style[#red,dashed,thickness=2]}" + }, + "is_static": false, + "name": "aaa", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 22 + }, + "type": "clanguml::t00031::A *" + }, + { + "access": "public", + "comment": { + "formatted": "@uml{composition}\n@uml{style[#green,dashed,thickness=4]}", + "raw": "/// @uml{composition}\n /// @uml{style[#green,dashed,thickness=4]}" + }, + "is_static": false, + "name": "bbb", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 26 + }, + "type": "std::vector" + }, + { + "access": "public", + "comment": { + "formatted": "@uml{style[#blue,dotted,thickness=8]}", + "raw": "/// @uml{style[#blue,dotted,thickness=8]}" + }, + "is_static": false, + "name": "ccc", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 29 + }, + "type": "C" + }, + { + "access": "public", + "comment": { + "formatted": "@uml{style[#blue,plain,thickness=16]}", + "raw": "/// @uml{style[#blue,plain,thickness=16]}" + }, + "is_static": false, + "name": "ddd", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 32 + }, + "type": "clanguml::t00031::D *" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00031", + "source_location": { + "file": "../../tests/t00031/t00031.cc", + "line": 20 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00031_class", + "relationships": [ + { + "access": "public", + "destination": "116209144733282955", + "source": "208700529175860645", + "type": "instantiation" + }, + { + "access": "public", + "destination": "847775539502907247", + "label": "aaa", + "source": "484712092364868032", + "type": "association" + }, + { + "access": "public", + "destination": "1441796358326382179", + "label": "bbb", + "source": "484712092364868032", + "type": "composition" + }, + { + "access": "public", + "destination": "208700529175860645", + "label": "ccc", + "source": "484712092364868032", + "type": "aggregation" + }, + { + "access": "public", + "destination": "2266534344475505157", + "label": "ddd", + "source": "484712092364868032", + "type": "association" + } + ], + "using_namespace": "clanguml::t00031" +} +``` diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index 5ada614f..facc4534 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -47,23 +47,23 @@ T - + - + ttt : T - - + + D - + C @@ -71,39 +71,39 @@ int - - + + R - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00032.md b/docs/test_cases/t00032.md index 4e75128e..1525a0b6 100644 --- a/docs/test_cases/t00032.md +++ b/docs/test_cases/t00032.md @@ -58,3 +58,381 @@ struct R { ``` ## Generated UML diagrams ![t00032_class](./t00032_class.svg "Class template with template base classes test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00032::Base", + "id": "1619396229227632210", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Base", + "namespace": "clanguml::t00032", + "source_location": { + "file": "../../tests/t00032/t00032.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00032::TBase", + "id": "543776954602127752", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "TBase", + "namespace": "clanguml::t00032", + "source_location": { + "file": "../../tests/t00032/t00032.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00032::A", + "id": "687909853333071234", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "operator()", + "parameters": [], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00032", + "source_location": { + "file": "../../tests/t00032/t00032.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00032::B", + "id": "737235057776029746", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "operator()", + "parameters": [], + "type": "void" + } + ], + "name": "B", + "namespace": "clanguml::t00032", + "source_location": { + "file": "../../tests/t00032/t00032.cc", + "line": 15 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00032::C", + "id": "1497964256865073382", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "operator()", + "parameters": [], + "type": "void" + } + ], + "name": "C", + "namespace": "clanguml::t00032", + "source_location": { + "file": "../../tests/t00032/t00032.cc", + "line": 19 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1619396229227632210", + "is_virtual": false, + "name": "clanguml::t00032::Base" + } + ], + "display_name": "clanguml::t00032::Overload", + "id": "1463422997970691679", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "counter", + "source_location": { + "file": "../../tests/t00032/t00032.cc", + "line": 26 + }, + "type": "L" + } + ], + "methods": [], + "name": "Overload", + "namespace": "clanguml::t00032", + "source_location": { + "file": "../../tests/t00032/t00032.cc", + "line": 24 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "L", + "template_parameters": [] + }, + { + "is_variadic": true, + "kind": "template_type", + "name": "Ts...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "543776954602127752", + "is_virtual": false, + "name": "clanguml::t00032::TBase" + }, + { + "access": "public", + "id": "687909853333071234", + "is_virtual": false, + "name": "clanguml::t00032::A" + }, + { + "access": "public", + "id": "737235057776029746", + "is_virtual": false, + "name": "clanguml::t00032::B" + }, + { + "access": "public", + "id": "1497964256865073382", + "is_virtual": false, + "name": "clanguml::t00032::C" + } + ], + "display_name": "clanguml::t00032::Overload", + "id": "1706455047176879286", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Overload", + "namespace": "clanguml::t00032", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00032::TBase" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00032::A" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00032::B" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00032::C" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00032::R", + "id": "85539867332573320", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "overload", + "source_location": { + "file": "../../tests/t00032/t00032.cc", + "line": 32 + }, + "type": "Overload" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00032", + "source_location": { + "file": "../../tests/t00032/t00032.cc", + "line": 31 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00032_class", + "relationships": [ + { + "access": "public", + "destination": "1619396229227632210", + "source": "1463422997970691679", + "type": "extension" + }, + { + "access": "public", + "destination": "543776954602127752", + "source": "1706455047176879286", + "type": "dependency" + }, + { + "access": "public", + "destination": "687909853333071234", + "source": "1706455047176879286", + "type": "dependency" + }, + { + "access": "public", + "destination": "737235057776029746", + "source": "1706455047176879286", + "type": "dependency" + }, + { + "access": "public", + "destination": "1497964256865073382", + "source": "1706455047176879286", + "type": "dependency" + }, + { + "access": "public", + "destination": "1463422997970691679", + "source": "1706455047176879286", + "type": "instantiation" + }, + { + "access": "public", + "destination": "543776954602127752", + "source": "1706455047176879286", + "type": "extension" + }, + { + "access": "public", + "destination": "687909853333071234", + "source": "1706455047176879286", + "type": "extension" + }, + { + "access": "public", + "destination": "737235057776029746", + "source": "1706455047176879286", + "type": "extension" + }, + { + "access": "public", + "destination": "1497964256865073382", + "source": "1706455047176879286", + "type": "extension" + }, + { + "access": "public", + "destination": "1706455047176879286", + "label": "overload", + "source": "85539867332573320", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00032" +} +``` diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index 12fc21eb..e77c395a 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - + + Base - - + + TBase - - + + A @@ -35,8 +35,8 @@ operator()() : void - - + + B @@ -45,8 +45,8 @@ operator()() : void - - + + C @@ -55,8 +55,8 @@ operator()() : void - - + + Overload @@ -64,15 +64,15 @@ T,L,Ts... - + - + counter : L - + Overload @@ -80,18 +80,18 @@ TBase,int,A,B,C - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00033.md b/docs/test_cases/t00033.md index 800398db..afce35dc 100644 --- a/docs/test_cases/t00033.md +++ b/docs/test_cases/t00033.md @@ -50,3 +50,338 @@ struct R { ``` ## Generated UML diagrams ![t00033_class](./t00033_class.svg "Nested template instantiation dependency test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00033::A", + "id": "2036031998980633871", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "aaa", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 8 + }, + "type": "T" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00033", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 7 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00033::B", + "id": "765515233845859023", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "bbb", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 12 + }, + "type": "T" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00033", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 11 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00033::C", + "id": "1436835384265552869", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "ccc", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 16 + }, + "type": "T" + } + ], + "methods": [], + "name": "C", + "namespace": "clanguml::t00033", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 15 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00033::D", + "id": "2199581366769423637", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "ddd", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 20 + }, + "type": "int" + } + ], + "methods": [], + "name": "D", + "namespace": "clanguml::t00033", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 19 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00033::C", + "id": "1609446044604054241", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00033", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00033::D" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00033::B>>", + "id": "384927316081978893", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00033", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00033::D" + } + ], + "type": "clanguml::t00033::C" + } + ], + "type": "std::unique_ptr" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00033::A>>>", + "id": "1747493965420341251", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00033", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00033::D" + } + ], + "type": "clanguml::t00033::C" + } + ], + "type": "std::unique_ptr" + } + ], + "type": "clanguml::t00033::B" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00033::R", + "id": "1866392706312766470", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "abc", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 24 + }, + "type": "A>>>" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00033", + "source_location": { + "file": "../../tests/t00033/t00033.cc", + "line": 23 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00033_class", + "relationships": [ + { + "access": "public", + "destination": "2199581366769423637", + "source": "1609446044604054241", + "type": "dependency" + }, + { + "access": "public", + "destination": "1436835384265552869", + "source": "1609446044604054241", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1609446044604054241", + "source": "384927316081978893", + "type": "dependency" + }, + { + "access": "public", + "destination": "765515233845859023", + "source": "384927316081978893", + "type": "instantiation" + }, + { + "access": "public", + "destination": "384927316081978893", + "source": "1747493965420341251", + "type": "dependency" + }, + { + "access": "public", + "destination": "2036031998980633871", + "source": "1747493965420341251", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1747493965420341251", + "label": "abc", + "source": "1866392706312766470", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00033" +} +``` diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index 38853689..09e71d53 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + aaa : T - - + + B @@ -35,16 +35,16 @@ T - + - + bbb : T - - + + C @@ -52,30 +52,30 @@ T - + - + ccc : T - - + + D - + - + ddd : int - + C @@ -83,7 +83,7 @@ D - + B @@ -91,7 +91,7 @@ std::unique_ptr<C<D>> - + A @@ -99,18 +99,18 @@ B<std::unique_ptr<C<D>>> - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00034.md b/docs/test_cases/t00034.md index 5e2acd46..15da7587 100644 --- a/docs/test_cases/t00034.md +++ b/docs/test_cases/t00034.md @@ -76,3 +76,258 @@ struct R { ``` ## Generated UML diagrams ![t00034_class](./t00034_class.svg "Template metaprogramming type function test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00034::Void", + "id": "1704456490210873213", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "operator==", + "parameters": [ + { + "name": "", + "type": "const clanguml::t00034::Void &" + } + ], + "type": "bool" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "operator!=", + "parameters": [ + { + "name": "", + "type": "const clanguml::t00034::Void &" + } + ], + "type": "bool" + } + ], + "name": "Void", + "namespace": "clanguml::t00034", + "source_location": { + "file": "../../tests/t00034/t00034.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00034::lift_void", + "id": "867472442996685316", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [], + "methods": [], + "name": "lift_void", + "namespace": "clanguml::t00034", + "source_location": { + "file": "../../tests/t00034/t00034.cc", + "line": 16 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00034::lift_void", + "id": "126450862226197239", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "lift_void", + "namespace": "clanguml::t00034", + "source_location": { + "file": "../../tests/t00034/t00034.cc", + "line": 20 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "void" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00034::drop_void", + "id": "1578745816100337706", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [], + "methods": [], + "name": "drop_void", + "namespace": "clanguml::t00034", + "source_location": { + "file": "../../tests/t00034/t00034.cc", + "line": 33 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00034::drop_void", + "id": "1849836134504075115", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "drop_void", + "namespace": "clanguml::t00034", + "source_location": { + "file": "../../tests/t00034/t00034.cc", + "line": 37 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00034::Void" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00034::A", + "id": "1383912907884688827", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00034", + "source_location": { + "file": "../../tests/t00034/t00034.cc", + "line": 43 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00034::R", + "id": "1713991735741265309", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "la", + "source_location": { + "file": "../../tests/t00034/t00034.cc", + "line": 46 + }, + "type": "lift_void_t *" + }, + { + "access": "public", + "is_static": false, + "name": "lv", + "source_location": { + "file": "../../tests/t00034/t00034.cc", + "line": 47 + }, + "type": "lift_void_t *" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00034", + "source_location": { + "file": "../../tests/t00034/t00034.cc", + "line": 45 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00034_class", + "relationships": [ + { + "access": "public", + "destination": "867472442996685316", + "source": "126450862226197239", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1578745816100337706", + "source": "1849836134504075115", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1383912907884688827", + "label": "la", + "source": "1713991735741265309", + "type": "association" + } + ], + "using_namespace": "clanguml::t00034" +} +``` diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index 23e59f9b..f02f85e3 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Void @@ -21,8 +21,8 @@ operator!=(const Void & ) const : bool - - + + lift_void @@ -31,8 +31,8 @@ - - + + lift_void @@ -41,8 +41,8 @@ - - + + drop_void @@ -51,8 +51,8 @@ - - + + drop_void @@ -61,33 +61,33 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00035.md b/docs/test_cases/t00035.md index e8acaa28..b2220472 100644 --- a/docs/test_cases/t00035.md +++ b/docs/test_cases/t00035.md @@ -43,3 +43,114 @@ struct Right { }; ``` ## Generated UML diagrams ![t00035_class](./t00035_class.svg "PlantUML class diagram layout hints test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00035::Top", + "id": "2241062883697294772", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Top", + "namespace": "clanguml::t00035", + "source_location": { + "file": "../../tests/t00035/t00035.cc", + "line": 4 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00035::Left", + "id": "242562856080127946", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Left", + "namespace": "clanguml::t00035", + "source_location": { + "file": "../../tests/t00035/t00035.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00035::Center", + "id": "1933304541849408421", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Center", + "namespace": "clanguml::t00035", + "source_location": { + "file": "../../tests/t00035/t00035.cc", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00035::Bottom", + "id": "1646691079607377420", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Bottom", + "namespace": "clanguml::t00035", + "source_location": { + "file": "../../tests/t00035/t00035.cc", + "line": 10 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00035::Right", + "id": "200121820090372322", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "Right", + "namespace": "clanguml::t00035", + "source_location": { + "file": "../../tests/t00035/t00035.cc", + "line": 12 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00035_class", + "relationships": [], + "using_namespace": "clanguml::t00035" +} +``` diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index 48572509..46fdda44 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00036.md b/docs/test_cases/t00036.md index 82661f6c..cda15954 100644 --- a/docs/test_cases/t00036.md +++ b/docs/test_cases/t00036.md @@ -56,3 +56,191 @@ struct C { }; ``` ## Generated UML diagrams ![t00036_class](./t00036_class.svg "Class diagram with namespaces generated as packages") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "display_name": "clanguml::t00036::ns1", + "elements": [ + { + "constants": [ + "blue", + "yellow" + ], + "display_name": "clanguml::t00036::ns1::E", + "id": "2144761953049158478", + "is_nested": false, + "name": "E", + "namespace": "clanguml::t00036::ns1", + "source_location": { + "file": "../../tests/t00036/t00036.cc", + "line": 6 + }, + "type": "enum" + }, + { + "display_name": "clanguml::t00036::ns1::ns11", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00036::ns1::ns11::A", + "id": "571573305652194946", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00036/t00036.cc", + "line": 11 + }, + "type": "T" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00036::ns1::ns11", + "source_location": { + "file": "../../tests/t00036/t00036.cc", + "line": 10 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "display_name": "clanguml::t00036::ns1::ns11::ns111", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00036::ns1::ns11::ns111::B", + "id": "1964031933563607376", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a_int", + "source_location": { + "file": "../../tests/t00036/t00036.cc", + "line": 17 + }, + "type": "A" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00036::ns1::ns11::ns111", + "source_location": { + "file": "../../tests/t00036/t00036.cc", + "line": 16 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "ns111", + "type": "namespace" + }, + { + "bases": [], + "display_name": "clanguml::t00036::ns1::ns11::A", + "id": "1832710427462319797", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00036::ns1::ns11", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + } + ], + "name": "ns11", + "type": "namespace" + } + ], + "name": "ns1", + "type": "namespace" + }, + { + "display_name": "clanguml::t00036::ns2", + "elements": [ + { + "display_name": "clanguml::t00036::ns2::ns22", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00036::ns2::ns22::C", + "id": "2038956882066165590", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00036::ns2::ns22", + "source_location": { + "file": "../../tests/t00036/t00036.cc", + "line": 28 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "ns22", + "type": "namespace" + } + ], + "name": "ns2", + "type": "namespace" + } + ], + "name": "t00036_class", + "relationships": [ + { + "access": "public", + "destination": "1832710427462319797", + "label": "a_int", + "source": "1964031933563607376", + "type": "aggregation" + }, + { + "access": "public", + "destination": "571573305652194946", + "source": "1832710427462319797", + "type": "instantiation" + } + ], + "using_namespace": "clanguml::t00036" +} +``` diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index 9764d5ee..4f66b033 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -43,15 +43,15 @@ T - + - + a : T - + A @@ -59,23 +59,23 @@ int - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00037.md b/docs/test_cases/t00037.md index 0f251d01..013df5a3 100644 --- a/docs/test_cases/t00037.md +++ b/docs/test_cases/t00037.md @@ -55,3 +55,223 @@ struct A { ``` ## Generated UML diagrams ![t00037_class](./t00037_class.svg "Anonymous nested struct test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00037::ST", + "id": "11203041379038775", + "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": { + "file": "../../tests/t00037/t00037.cc", + "line": 11 + }, + "type": "ST##(anonymous_662)" + }, + { + "access": "private", + "is_static": false, + "name": "units", + "source_location": { + "file": "../../tests/t00037/t00037.cc", + "line": 17 + }, + "type": "ST##(anonymous_792)" + } + ], + "methods": [], + "name": "ST", + "namespace": "clanguml::t00037", + "source_location": { + "file": "../../tests/t00037/t00037.cc", + "line": 4 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00037::ST::(dimensions)", + "id": "1980820317972901050", + "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": { + "file": "../../tests/t00037/t00037.cc", + "line": 7 + }, + "type": "double" + }, + { + "access": "public", + "is_static": false, + "name": "x", + "source_location": { + "file": "../../tests/t00037/t00037.cc", + "line": 8 + }, + "type": "double" + }, + { + "access": "public", + "is_static": false, + "name": "y", + "source_location": { + "file": "../../tests/t00037/t00037.cc", + "line": 9 + }, + "type": "double" + }, + { + "access": "public", + "is_static": false, + "name": "z", + "source_location": { + "file": "../../tests/t00037/t00037.cc", + "line": 10 + }, + "type": "double" + } + ], + "methods": [], + "name": "ST::(dimensions)", + "namespace": "clanguml::t00037", + "source_location": { + "file": "../../tests/t00037/t00037.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00037::ST::(units)", + "id": "1811145508890403377", + "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": { + "file": "../../tests/t00037/t00037.cc", + "line": 15 + }, + "type": "double" + }, + { + "access": "public", + "is_static": false, + "name": "h", + "source_location": { + "file": "../../tests/t00037/t00037.cc", + "line": 16 + }, + "type": "double" + } + ], + "methods": [], + "name": "ST::(units)", + "namespace": "clanguml::t00037", + "source_location": { + "file": "../../tests/t00037/t00037.cc", + "line": 14 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00037::A", + "id": "1322794181774144954", + "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": { + "file": "../../tests/t00037/t00037.cc", + "line": 29 + }, + "type": "clanguml::t00037::ST" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "A", + "parameters": [], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00037", + "source_location": { + "file": "../../tests/t00037/t00037.cc", + "line": 20 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00037_class", + "relationships": [ + { + "access": "public", + "destination": "1980820317972901050", + "label": "dimensions", + "source": "11203041379038775", + "type": "aggregation" + }, + { + "access": "private", + "destination": "1811145508890403377", + "label": "units", + "source": "11203041379038775", + "type": "aggregation" + }, + { + "access": "public", + "destination": "11203041379038775", + "label": "st", + "source": "1322794181774144954", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00037" +} +``` diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 98c6f40c..0ae3edcf 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,98 +9,98 @@ - - + + ST - + - + dimensions : ST::(anonymous_662) - + - + units : ST::(anonymous_792) - - + + ST::(dimensions) - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + ST::(units) - + - + c : double - + - + h : double - - + + A - + - + st : ST diff --git a/docs/test_cases/t00038.md b/docs/test_cases/t00038.md index 850e0e30..9024497c 100644 --- a/docs/test_cases/t00038.md +++ b/docs/test_cases/t00038.md @@ -74,3 +74,480 @@ struct map", + "id": "1917560728132448300", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [], + "methods": [], + "name": "map", + "namespace": "clanguml::t00038", + "source_location": { + "file": "../../tests/t00038/t00038.cc", + "line": 30 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1642222718760881014", + "is_virtual": false, + "name": "thirdparty::ns1::E" + } + ], + "display_name": "clanguml::t00038::map>", + "id": "1664022047310891203", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "map", + "namespace": "clanguml::t00038", + "source_location": { + "file": "../../tests/t00038/t00038.cc", + "line": 34 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "thirdparty::ns1::color_t" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "thirdparty::ns1::color_t::red" + } + ], + "type": "std::integral_constant" + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "790040432414172612", + "is_virtual": false, + "name": "clanguml::t00038::A" + } + ], + "display_name": "clanguml::t00038::map>", + "id": "307700801045535833", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "map", + "namespace": "clanguml::t00038", + "source_location": { + "file": "../../tests/t00038/t00038.cc", + "line": 37 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00038::property_t" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00038::property_t::property_a" + } + ], + "type": "std::integral_constant" + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1295970068907562690", + "is_virtual": false, + "name": "clanguml::t00038::B" + } + ], + "display_name": "clanguml::t00038::map>>", + "id": "548231528417484191", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "map", + "namespace": "clanguml::t00038", + "source_location": { + "file": "../../tests/t00038/t00038.cc", + "line": 41 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00038::property_t" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00038::property_t::property_b" + } + ], + "type": "std::integral_constant" + } + ], + "type": "std::vector" + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "154510361779680983", + "is_virtual": false, + "name": "clanguml::t00038::C" + } + ], + "display_name": "clanguml::t00038::map>>>", + "id": "1510200402118706005", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "map", + "namespace": "clanguml::t00038", + "source_location": { + "file": "../../tests/t00038/t00038.cc", + "line": 46 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00038::key_t" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00038::property_t" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00038::property_t::property_c" + } + ], + "type": "std::integral_constant" + } + ], + "type": "std::vector" + } + ], + "type": "std::map" + } + ], + "type": "class" + } + ], + "name": "t00038_class", + "relationships": [ + { + "access": "public", + "destination": "566782399856868761", + "source": "1664022047310891203", + "type": "dependency" + }, + { + "access": "public", + "destination": "1917560728132448300", + "source": "1664022047310891203", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1642222718760881014", + "source": "1664022047310891203", + "type": "extension" + }, + { + "access": "public", + "destination": "7376951310260829", + "source": "307700801045535833", + "type": "dependency" + }, + { + "access": "public", + "destination": "1917560728132448300", + "source": "307700801045535833", + "type": "instantiation" + }, + { + "access": "public", + "destination": "790040432414172612", + "source": "307700801045535833", + "type": "extension" + }, + { + "access": "public", + "destination": "7376951310260829", + "source": "548231528417484191", + "type": "dependency" + }, + { + "access": "public", + "destination": "1917560728132448300", + "source": "548231528417484191", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1295970068907562690", + "source": "548231528417484191", + "type": "extension" + }, + { + "access": "public", + "destination": "137163683637529037", + "source": "1510200402118706005", + "type": "dependency" + }, + { + "access": "public", + "destination": "7376951310260829", + "source": "1510200402118706005", + "type": "dependency" + }, + { + "access": "public", + "destination": "1917560728132448300", + "source": "1510200402118706005", + "type": "instantiation" + }, + { + "access": "public", + "destination": "154510361779680983", + "source": "1510200402118706005", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00038" +} +``` diff --git a/docs/test_cases/t00038_class.svg b/docs/test_cases/t00038_class.svg index 5a3ec793..e30d120a 100644 --- a/docs/test_cases/t00038_class.svg +++ b/docs/test_cases/t00038_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,8 +88,8 @@ - - + + map @@ -98,8 +98,8 @@ - - + + map @@ -108,8 +108,8 @@ - - + + map @@ -118,8 +118,8 @@ - - + + map diff --git a/docs/test_cases/t00039.md b/docs/test_cases/t00039.md index 28f54d8c..3f4eb548 100644 --- a/docs/test_cases/t00039.md +++ b/docs/test_cases/t00039.md @@ -89,3 +89,574 @@ template struct FFF : public FF { ``` ## Generated UML diagrams ![t00039_class](./t00039_class.svg "Subclass class diagram filter test") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00039::C", + "id": "241234977032861936", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00039", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00039::D", + "id": "1975187139659616784", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00039", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00039::E", + "id": "1959131184346890363", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00039", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 10 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "241234977032861936", + "is_virtual": false, + "name": "clanguml::t00039::C" + }, + { + "access": "public", + "id": "1975187139659616784", + "is_virtual": false, + "name": "clanguml::t00039::D" + } + ], + "display_name": "clanguml::t00039::CD", + "id": "850483622527996929", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "CD", + "namespace": "clanguml::t00039", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 16 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1975187139659616784", + "is_virtual": false, + "name": "clanguml::t00039::D" + }, + { + "access": "public", + "id": "1959131184346890363", + "is_virtual": false, + "name": "clanguml::t00039::E" + } + ], + "display_name": "clanguml::t00039::DE", + "id": "1316022308303681160", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "DE", + "namespace": "clanguml::t00039", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 18 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "241234977032861936", + "is_virtual": false, + "name": "clanguml::t00039::C" + }, + { + "access": "public", + "id": "1975187139659616784", + "is_virtual": false, + "name": "clanguml::t00039::D" + }, + { + "access": "public", + "id": "1959131184346890363", + "is_virtual": false, + "name": "clanguml::t00039::E" + } + ], + "display_name": "clanguml::t00039::CDE", + "id": "1877487144594774465", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "CDE", + "namespace": "clanguml::t00039", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 20 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00039::A", + "id": "1051171525946759825", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00039", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 22 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1051171525946759825", + "is_virtual": false, + "name": "clanguml::t00039::A" + } + ], + "display_name": "clanguml::t00039::AA", + "id": "1761969273600680013", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "AA", + "namespace": "clanguml::t00039", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 24 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1761969273600680013", + "is_virtual": false, + "name": "clanguml::t00039::AA" + } + ], + "display_name": "clanguml::t00039::AAA", + "id": "2158483243842147804", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 27 + }, + "type": "clanguml::t00039::B *" + } + ], + "methods": [], + "name": "AAA", + "namespace": "clanguml::t00039", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 26 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2158483243842147804", + "is_virtual": true, + "name": "clanguml::t00039::AAA" + } + ], + "display_name": "clanguml::t00039::ns2::AAAA", + "id": "1857294881176816154", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "AAAA", + "namespace": "clanguml::t00039::ns2", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 31 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00039::ns3::F", + "id": "955785395599769805", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "t", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 40 + }, + "type": "T *" + } + ], + "methods": [], + "name": "F", + "namespace": "clanguml::t00039::ns3", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 39 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "955785395599769805", + "is_virtual": false, + "name": "F" + } + ], + "display_name": "clanguml::t00039::ns3::FF", + "id": "1321996888067531304", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "m", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 44 + }, + "type": "M *" + } + ], + "methods": [], + "name": "FF", + "namespace": "clanguml::t00039::ns3", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 43 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "M", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "955785395599769805", + "is_virtual": false, + "name": "F" + } + ], + "display_name": "clanguml::t00039::ns3::FE", + "id": "2008055732881129924", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "m", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 48 + }, + "type": "M *" + } + ], + "methods": [], + "name": "FE", + "namespace": "clanguml::t00039::ns3", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 47 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "M", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1321996888067531304", + "is_virtual": false, + "name": "FF" + } + ], + "display_name": "clanguml::t00039::ns3::FFF", + "id": "1617455840736919039", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "n", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 52 + }, + "type": "N *" + } + ], + "methods": [], + "name": "FFF", + "namespace": "clanguml::t00039::ns3", + "source_location": { + "file": "../../tests/t00039/t00039.cc", + "line": 51 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "M", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "N", + "template_parameters": [] + } + ], + "type": "class" + } + ], + "name": "t00039_class", + "relationships": [ + { + "access": "public", + "destination": "241234977032861936", + "source": "850483622527996929", + "type": "extension" + }, + { + "access": "public", + "destination": "1975187139659616784", + "source": "850483622527996929", + "type": "extension" + }, + { + "access": "public", + "destination": "1975187139659616784", + "source": "1316022308303681160", + "type": "extension" + }, + { + "access": "public", + "destination": "1959131184346890363", + "source": "1316022308303681160", + "type": "extension" + }, + { + "access": "public", + "destination": "241234977032861936", + "source": "1877487144594774465", + "type": "extension" + }, + { + "access": "public", + "destination": "1975187139659616784", + "source": "1877487144594774465", + "type": "extension" + }, + { + "access": "public", + "destination": "1959131184346890363", + "source": "1877487144594774465", + "type": "extension" + }, + { + "access": "public", + "destination": "1051171525946759825", + "source": "1761969273600680013", + "type": "extension" + }, + { + "access": "public", + "destination": "247983380974491424", + "label": "b", + "source": "2158483243842147804", + "type": "association" + }, + { + "access": "public", + "destination": "1761969273600680013", + "source": "2158483243842147804", + "type": "extension" + }, + { + "access": "public", + "destination": "2158483243842147804", + "source": "1857294881176816154", + "type": "extension" + }, + { + "access": "public", + "destination": "955785395599769805", + "source": "1321996888067531304", + "type": "extension" + }, + { + "access": "public", + "destination": "955785395599769805", + "source": "2008055732881129924", + "type": "extension" + }, + { + "access": "public", + "destination": "1321996888067531304", + "source": "1617455840736919039", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00039" +} +``` diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index c2f7d303..5fd6e339 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B * - - + + ns2::AAAA - - + + ns3::F @@ -105,16 +105,16 @@ T - + - + t : T * - - + + ns3::FF @@ -122,16 +122,16 @@ T,M - + - + m : M * - - + + ns3::FE @@ -139,16 +139,16 @@ T,M - + - + m : M * - - + + ns3::FFF @@ -156,11 +156,11 @@ T,M,N - + - + n : N * diff --git a/docs/test_cases/t00040.md b/docs/test_cases/t00040.md index 717561b9..744b2123 100644 --- a/docs/test_cases/t00040.md +++ b/docs/test_cases/t00040.md @@ -65,3 +65,225 @@ struct R { ``` ## Generated UML diagrams ![t00040_class](./t00040_class.svg "Relationship and access filter test") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00040::A", + "id": "307580006083737677", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "protected", + "is_static": false, + "name": "ii_", + "source_location": { + "file": "../../tests/t00040/t00040.cc", + "line": 10 + }, + "type": "int" + }, + { + "access": "private", + "is_static": false, + "name": "hidden_a_", + "source_location": { + "file": "../../tests/t00040/t00040.cc", + "line": 15 + }, + "type": "int" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_a", + "parameters": [], + "type": "int" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00040", + "source_location": { + "file": "../../tests/t00040/t00040.cc", + "line": 5 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "307580006083737677", + "is_virtual": false, + "name": "clanguml::t00040::A" + } + ], + "display_name": "clanguml::t00040::AA", + "id": "534115812779766127", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "AA", + "namespace": "clanguml::t00040", + "source_location": { + "file": "../../tests/t00040/t00040.cc", + "line": 18 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "534115812779766127", + "is_virtual": false, + "name": "clanguml::t00040::AA" + } + ], + "display_name": "clanguml::t00040::AAA", + "id": "745371908432158369", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00040/t00040.cc", + "line": 25 + }, + "type": "clanguml::t00040::B *" + }, + { + "access": "private", + "is_static": false, + "name": "hidden_aaa_", + "source_location": { + "file": "../../tests/t00040/t00040.cc", + "line": 28 + }, + "type": "int" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_aaa", + "parameters": [], + "type": "int" + } + ], + "name": "AAA", + "namespace": "clanguml::t00040", + "source_location": { + "file": "../../tests/t00040/t00040.cc", + "line": 22 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00040::R", + "id": "1539035020975101539", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [ + { + "name": "a", + "type": "clanguml::t00040::A *" + } + ], + "type": "void" + } + ], + "name": "R", + "namespace": "clanguml::t00040", + "source_location": { + "file": "../../tests/t00040/t00040.cc", + "line": 31 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00040_class", + "relationships": [ + { + "access": "public", + "destination": "307580006083737677", + "source": "534115812779766127", + "type": "extension" + }, + { + "access": "public", + "destination": "534115812779766127", + "source": "745371908432158369", + "type": "extension" + }, + { + "access": "public", + "destination": "307580006083737677", + "source": "1539035020975101539", + "type": "dependency" + } + ], + "using_namespace": "clanguml::t00040" +} +``` diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index e38717b0..03a18891 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - + + A - + - + ii_ : int get_a() : int - - + + AA - - + + AAA - + - + b : B * get_aaa() : int - - + + R diff --git a/docs/test_cases/t00041.md b/docs/test_cases/t00041.md index 01ec9d8d..64df9137 100644 --- a/docs/test_cases/t00041.md +++ b/docs/test_cases/t00041.md @@ -76,3 +76,334 @@ struct NM : public N { }; ``` ## Generated UML diagrams ![t00041_class](./t00041_class.svg "Context diagram filter test") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00041::R", + "id": "775317088453163919", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "R", + "namespace": "clanguml::t00041", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00041::D", + "id": "1798851434286108347", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "rr", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 14 + }, + "type": "clanguml::t00041::RR *" + } + ], + "methods": [], + "name": "D", + "namespace": "clanguml::t00041", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 13 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00041::E", + "id": "2158730167547707264", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00041", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00041::F", + "id": "430600213408545846", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "F", + "namespace": "clanguml::t00041", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 19 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "775317088453163919", + "is_virtual": false, + "name": "clanguml::t00041::R" + } + ], + "display_name": "clanguml::t00041::RR", + "id": "175608867682236642", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "e", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 28 + }, + "type": "clanguml::t00041::E *" + }, + { + "access": "public", + "is_static": false, + "name": "f", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 29 + }, + "type": "clanguml::t00041::F *" + }, + { + "access": "public", + "is_static": false, + "name": "g", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 30 + }, + "type": "detail::G *" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [ + { + "name": "h", + "type": "clanguml::t00041::H *" + } + ], + "type": "void" + } + ], + "name": "RR", + "namespace": "clanguml::t00041", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 27 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "175608867682236642", + "is_virtual": false, + "name": "clanguml::t00041::RR" + } + ], + "display_name": "clanguml::t00041::RRR", + "id": "819254010294444715", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "RRR", + "namespace": "clanguml::t00041", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 35 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00041::ns1::N", + "id": "220253364661036147", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "N", + "namespace": "clanguml::t00041::ns1", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 38 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "220253364661036147", + "is_virtual": false, + "name": "clanguml::t00041::ns1::N" + } + ], + "display_name": "clanguml::t00041::ns1::NN", + "id": "618038667214398895", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "NN", + "namespace": "clanguml::t00041::ns1", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 40 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "220253364661036147", + "is_virtual": false, + "name": "clanguml::t00041::ns1::N" + } + ], + "display_name": "clanguml::t00041::ns1::NM", + "id": "1206750351408617127", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "NM", + "namespace": "clanguml::t00041::ns1", + "source_location": { + "file": "../../tests/t00041/t00041.cc", + "line": 42 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00041_class", + "relationships": [ + { + "access": "public", + "destination": "175608867682236642", + "label": "rr", + "source": "1798851434286108347", + "type": "association" + }, + { + "access": "public", + "destination": "648827958379389524", + "source": "175608867682236642", + "type": "dependency" + }, + { + "access": "public", + "destination": "2158730167547707264", + "label": "e", + "source": "175608867682236642", + "type": "association" + }, + { + "access": "public", + "destination": "430600213408545846", + "label": "f", + "source": "175608867682236642", + "type": "association" + }, + { + "access": "public", + "destination": "775317088453163919", + "source": "175608867682236642", + "type": "extension" + }, + { + "access": "public", + "destination": "175608867682236642", + "source": "819254010294444715", + "type": "extension" + }, + { + "access": "public", + "destination": "220253364661036147", + "source": "618038667214398895", + "type": "extension" + }, + { + "access": "public", + "destination": "220253364661036147", + "source": "1206750351408617127", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00041" +} +``` diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index 6e80efb7..bc96a619 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,102 +9,102 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + e : E * - + - + f : F * - + - + g : detail::G * foo(H * h) : void - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00042.md b/docs/test_cases/t00042.md index 65bf767e..228b9a48 100644 --- a/docs/test_cases/t00042.md +++ b/docs/test_cases/t00042.md @@ -61,3 +61,233 @@ struct R { ``` ## Generated UML diagrams ![t00042_class](./t00042_class.svg "Specialization class template diagram filter test") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00042::A", + "id": "462160951579835462", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00042/t00042.cc", + "line": 6 + }, + "type": "T" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00042", + "source_location": { + "file": "../../tests/t00042/t00042.cc", + "line": 5 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00042::A", + "id": "1422802342059669545", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00042", + "source_location": { + "file": "../../tests/t00042/t00042.cc", + "line": 9 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "void" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00042::B", + "id": "1414456934388678010", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00042/t00042.cc", + "line": 14 + }, + "type": "T" + }, + { + "access": "public", + "is_static": false, + "name": "bb", + "source_location": { + "file": "../../tests/t00042/t00042.cc", + "line": 15 + }, + "type": "K" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00042", + "source_location": { + "file": "../../tests/t00042/t00042.cc", + "line": 13 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "K", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00042::A", + "id": "364538479078826988", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00042", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "double" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00042::A", + "id": "496773262538580186", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00042", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00042::B", + "id": "1833471931530161359", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00042", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "float" + } + ], + "type": "class" + } + ], + "name": "t00042_class", + "relationships": [ + { + "access": "public", + "destination": "462160951579835462", + "source": "1422802342059669545", + "type": "instantiation" + }, + { + "access": "public", + "destination": "462160951579835462", + "source": "364538479078826988", + "type": "instantiation" + }, + { + "access": "public", + "destination": "462160951579835462", + "source": "496773262538580186", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1414456934388678010", + "source": "1833471931530161359", + "type": "instantiation" + } + ], + "using_namespace": "clanguml::t00042" +} +``` diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index fdfc3357..5ad739eb 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,16 +18,16 @@ T - + - + a : T - - + + A @@ -36,8 +36,8 @@ - - + + B @@ -45,22 +45,22 @@ T,K - + - + b : T - + - + bb : K - + A @@ -68,7 +68,7 @@ double - + A @@ -76,7 +76,7 @@ std::string - + B diff --git a/docs/test_cases/t00043.md b/docs/test_cases/t00043.md index 5f6aa811..0075df73 100644 --- a/docs/test_cases/t00043.md +++ b/docs/test_cases/t00043.md @@ -80,3 +80,487 @@ struct J { ``` ## Generated UML diagrams ![t00043_class](./t00043_class.svg "Dependants and dependencies class diagram filter test") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "display_name": "clanguml::t00043::dependants", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00043::dependants::A", + "id": "1454679300998460550", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00043::dependants", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 4 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00043::dependants::B", + "id": "1972977265990430931", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "b", + "parameters": [ + { + "name": "a", + "type": "clanguml::t00043::dependants::A *" + } + ], + "type": "void" + } + ], + "name": "B", + "namespace": "clanguml::t00043::dependants", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00043::dependants::BB", + "id": "1906291555025945295", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "bb", + "parameters": [ + { + "name": "a", + "type": "clanguml::t00043::dependants::A *" + } + ], + "type": "void" + } + ], + "name": "BB", + "namespace": "clanguml::t00043::dependants", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 10 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00043::dependants::C", + "id": "823759225351121534", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "c", + "parameters": [ + { + "name": "b", + "type": "clanguml::t00043::dependants::B *" + } + ], + "type": "void" + } + ], + "name": "C", + "namespace": "clanguml::t00043::dependants", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 14 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00043::dependants::D", + "id": "2277976215348279426", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "d", + "parameters": [ + { + "name": "c", + "type": "clanguml::t00043::dependants::C *" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "dd", + "parameters": [ + { + "name": "bb", + "type": "clanguml::t00043::dependants::BB *" + } + ], + "type": "void" + } + ], + "name": "D", + "namespace": "clanguml::t00043::dependants", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 18 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00043::dependants::E", + "id": "1694685540293810116", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "e", + "parameters": [ + { + "name": "d", + "type": "clanguml::t00043::dependants::D *" + } + ], + "type": "void" + } + ], + "name": "E", + "namespace": "clanguml::t00043::dependants", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 23 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "dependants", + "type": "namespace" + }, + { + "display_name": "clanguml::t00043::dependencies", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00043::dependencies::G", + "id": "736400571183204899", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00043::dependencies", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 32 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00043::dependencies::GG", + "id": "1522297681294871411", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "GG", + "namespace": "clanguml::t00043::dependencies", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 34 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00043::dependencies::H", + "id": "1534191494825314170", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "h", + "parameters": [ + { + "name": "g", + "type": "clanguml::t00043::dependencies::G *" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "hh", + "parameters": [ + { + "name": "gg", + "type": "clanguml::t00043::dependencies::GG *" + } + ], + "type": "void" + } + ], + "name": "H", + "namespace": "clanguml::t00043::dependencies", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 36 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00043::dependencies::I", + "id": "97422543769740359", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "i", + "parameters": [ + { + "name": "h", + "type": "clanguml::t00043::dependencies::H *" + } + ], + "type": "void" + } + ], + "name": "I", + "namespace": "clanguml::t00043::dependencies", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 45 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00043::dependencies::J", + "id": "1498530043106438011", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "i", + "parameters": [ + { + "name": "i", + "type": "clanguml::t00043::dependencies::I *" + } + ], + "type": "void" + } + ], + "name": "J", + "namespace": "clanguml::t00043::dependencies", + "source_location": { + "file": "../../tests/t00043/t00043.cc", + "line": 49 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "dependencies", + "type": "namespace" + } + ], + "name": "t00043_class", + "relationships": [ + { + "access": "public", + "destination": "1454679300998460550", + "source": "1972977265990430931", + "type": "dependency" + }, + { + "access": "public", + "destination": "1454679300998460550", + "source": "1906291555025945295", + "type": "dependency" + }, + { + "access": "public", + "destination": "1972977265990430931", + "source": "823759225351121534", + "type": "dependency" + }, + { + "access": "public", + "destination": "823759225351121534", + "source": "2277976215348279426", + "type": "dependency" + }, + { + "access": "public", + "destination": "1906291555025945295", + "source": "2277976215348279426", + "type": "dependency" + }, + { + "access": "public", + "destination": "2277976215348279426", + "source": "1694685540293810116", + "type": "dependency" + }, + { + "access": "public", + "destination": "736400571183204899", + "source": "1534191494825314170", + "type": "dependency" + }, + { + "access": "public", + "destination": "1522297681294871411", + "source": "1534191494825314170", + "type": "dependency" + }, + { + "access": "public", + "destination": "1534191494825314170", + "source": "97422543769740359", + "type": "dependency" + }, + { + "access": "public", + "destination": "97422543769740359", + "source": "1498530043106438011", + "type": "dependency" + } + ], + "using_namespace": "clanguml::t00043" +} +``` diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index 151d49ca..2aeb44aa 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - + dependants - + dependencies - - + + A - - + + B @@ -33,8 +33,8 @@ b(dependants::A * a) : void - - + + BB @@ -43,8 +43,8 @@ bb(dependants::A * a) : void - - + + C @@ -53,8 +53,8 @@ c(dependants::B * b) : void - - + + D @@ -65,8 +65,8 @@ dd(dependants::BB * bb) : void - - + + E @@ -75,24 +75,24 @@ e(dependants::D * d) : void - - + + G - - + + GG - - + + H @@ -103,8 +103,8 @@ hh(dependencies::GG * gg) : void - - + + I @@ -113,8 +113,8 @@ i(dependencies::H * h) : void - - + + J diff --git a/docs/test_cases/t00044.md b/docs/test_cases/t00044.md index 8ca9b898..37c66420 100644 --- a/docs/test_cases/t00044.md +++ b/docs/test_cases/t00044.md @@ -56,3 +56,160 @@ sink sink1{int_handler}; ``` ## Generated UML diagrams ![t00044_class](./t00044_class.svg "Test case for inner type aliases with parent class template args") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00044::sink>", + "id": "1813783008369291713", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "sink", + "namespace": "clanguml::t00044", + "source_location": { + "file": "../../tests/t00044/t00044.cc", + "line": 10 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "type-parameter-0-2" + } + ], + "type": "clanguml::t00044::signal_handler" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00044::signal_handler", + "id": "1591729735727316875", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "signal_handler", + "namespace": "clanguml::t00044", + "source_location": { + "file": "../../tests/t00044/t00044.cc", + "line": 24 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "Ret(Args...)", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "A", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00044::signal_handler", + "id": "276594465967577895", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [], + "name": "signal_handler", + "namespace": "clanguml::t00044", + "source_location": { + "file": "../../tests/t00044/t00044.cc", + "line": 7 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "A", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00044::sink", + "id": "1759724482769288325", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [], + "name": "sink", + "namespace": "clanguml::t00044", + "source_location": { + "file": "../../tests/t00044/t00044.cc", + "line": 5 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + } + ], + "name": "t00044_class", + "relationships": [ + { + "access": "public", + "destination": "1759724482769288325", + "source": "1813783008369291713", + "type": "instantiation" + }, + { + "access": "public", + "destination": "276594465967577895", + "source": "1591729735727316875", + "type": "instantiation" + } + ], + "using_namespace": "clanguml::t00044" +} +``` diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index 24b17829..383fe537 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + sink @@ -19,8 +19,8 @@ - - + + signal_handler @@ -29,8 +29,8 @@ - - + + signal_handler @@ -39,8 +39,8 @@ - - + + sink diff --git a/docs/test_cases/t00045.md b/docs/test_cases/t00045.md index b3d0c1fe..eeb254af 100644 --- a/docs/test_cases/t00045.md +++ b/docs/test_cases/t00045.md @@ -62,3 +62,424 @@ public: ``` ## Generated UML diagrams ![t00045_class](./t00045_class.svg "Test case for root namespace handling") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "A", + "id": "864916647665253425", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 1 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "AA", + "id": "386872828559902182", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "AA", + "namespace": "", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 3 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "AAA", + "id": "54164402597771463", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "AAA", + "namespace": "", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 5 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "AAAA", + "id": "375905626569465019", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "t", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 8 + }, + "type": "T" + } + ], + "methods": [], + "name": "AAAA", + "namespace": "", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 7 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "ns1::A", + "id": "619642232943663499", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "ns1", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 13 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "ns1::ns2::A", + "id": "2207007194029669343", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2207007194029669343", + "is_virtual": false, + "name": "ns1::ns2::A" + } + ], + "display_name": "ns1::ns2::B", + "id": "204051985124373077", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 19 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "619642232943663499", + "is_virtual": false, + "name": "ns1::A" + } + ], + "display_name": "ns1::ns2::C", + "id": "1837009554564742531", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 21 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2207007194029669343", + "is_virtual": false, + "name": "ns1::ns2::A" + } + ], + "display_name": "ns1::ns2::D", + "id": "2029929560931799980", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 23 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "864916647665253425", + "is_virtual": false, + "name": "A" + } + ], + "display_name": "ns1::ns2::E", + "id": "2305358535757579772", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 25 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "ns1::ns2::AAA", + "id": "1731264248793686366", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "AAA", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 27 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "ns1::ns2::R", + "id": "974430595320588991", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 31 + }, + "type": "ns1::ns2::A *" + }, + { + "access": "public", + "is_static": false, + "name": "ns1_a", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 32 + }, + "type": "ns1::A *" + }, + { + "access": "public", + "is_static": false, + "name": "ns1_ns2_a", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 33 + }, + "type": "ns1::ns2::A *" + }, + { + "access": "public", + "is_static": false, + "name": "root_a", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 34 + }, + "type": "::A *" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [ + { + "name": "aa", + "type": "::AA &" + } + ], + "type": "void" + } + ], + "name": "R", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00045/t00045.cc", + "line": 29 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00045_class", + "relationships": [ + { + "access": "public", + "destination": "2207007194029669343", + "source": "204051985124373077", + "type": "extension" + }, + { + "access": "public", + "destination": "619642232943663499", + "source": "1837009554564742531", + "type": "extension" + }, + { + "access": "public", + "destination": "2207007194029669343", + "source": "2029929560931799980", + "type": "extension" + }, + { + "access": "public", + "destination": "864916647665253425", + "source": "2305358535757579772", + "type": "extension" + }, + { + "access": "public", + "destination": "386872828559902182", + "source": "974430595320588991", + "type": "dependency" + }, + { + "access": "public", + "destination": "2207007194029669343", + "label": "a", + "source": "974430595320588991", + "type": "association" + }, + { + "access": "public", + "destination": "619642232943663499", + "label": "ns1_a", + "source": "974430595320588991", + "type": "association" + }, + { + "access": "public", + "destination": "2207007194029669343", + "label": "ns1_ns2_a", + "source": "974430595320588991", + "type": "association" + }, + { + "access": "public", + "destination": "864916647665253425", + "label": "root_a", + "source": "974430595320588991", + "type": "association" + }, + { + "access": "public", + "destination": "54164402597771463", + "label": "<>", + "source": "974430595320588991", + "type": "friendship" + } + ] +} +``` diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index a1546c15..d1c17cb5 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - + + A - - + + AA - - + + AAA - - + + AAAA @@ -42,103 +42,103 @@ T - + - + t : T - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::AAA - - + + ns1::ns2::R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00046.md b/docs/test_cases/t00046.md index 1b531293..84d0df44 100644 --- a/docs/test_cases/t00046.md +++ b/docs/test_cases/t00046.md @@ -55,3 +55,368 @@ public: ``` ## Generated UML diagrams ![t00046_class](./t00046_class.svg "Test case for root namespace handling with packages") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "display_name": "__gnu_cxx", + "name": "__gnu_cxx", + "type": "namespace" + }, + { + "bases": [], + "display_name": "A", + "id": "864916647665253425", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 4 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "AA", + "id": "386872828559902182", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "AA", + "namespace": "", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "display_name": "ns1", + "elements": [ + { + "bases": [], + "display_name": "ns1::A", + "id": "619642232943663499", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "ns1", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 10 + }, + "template_parameters": [], + "type": "class" + }, + { + "display_name": "ns1::ns2", + "elements": [ + { + "bases": [], + "display_name": "ns1::ns2::A", + "id": "2207007194029669343", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 14 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2207007194029669343", + "is_virtual": false, + "name": "ns1::ns2::A" + } + ], + "display_name": "ns1::ns2::B", + "id": "204051985124373077", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 16 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "619642232943663499", + "is_virtual": false, + "name": "ns1::A" + } + ], + "display_name": "ns1::ns2::C", + "id": "1837009554564742531", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 18 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "2207007194029669343", + "is_virtual": false, + "name": "ns1::ns2::A" + } + ], + "display_name": "ns1::ns2::D", + "id": "2029929560931799980", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 20 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "864916647665253425", + "is_virtual": false, + "name": "A" + } + ], + "display_name": "ns1::ns2::E", + "id": "2305358535757579772", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 22 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "ns1::ns2::R", + "id": "974430595320588991", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 26 + }, + "type": "ns1::ns2::A *" + }, + { + "access": "public", + "is_static": false, + "name": "ns1_a", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 27 + }, + "type": "ns1::A *" + }, + { + "access": "public", + "is_static": false, + "name": "ns1_ns2_a", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 28 + }, + "type": "ns1::ns2::A *" + }, + { + "access": "public", + "is_static": false, + "name": "root_a", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 29 + }, + "type": "::A *" + }, + { + "access": "public", + "is_static": false, + "name": "i", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 30 + }, + "type": "std::vector" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [ + { + "name": "aa", + "type": "::AA &" + } + ], + "type": "void" + } + ], + "name": "R", + "namespace": "ns1::ns2", + "source_location": { + "file": "../../tests/t00046/t00046.cc", + "line": 24 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "ns2", + "type": "namespace" + } + ], + "name": "ns1", + "type": "namespace" + } + ], + "name": "t00046_class", + "relationships": [ + { + "access": "public", + "destination": "2207007194029669343", + "source": "204051985124373077", + "type": "extension" + }, + { + "access": "public", + "destination": "619642232943663499", + "source": "1837009554564742531", + "type": "extension" + }, + { + "access": "public", + "destination": "2207007194029669343", + "source": "2029929560931799980", + "type": "extension" + }, + { + "access": "public", + "destination": "864916647665253425", + "source": "2305358535757579772", + "type": "extension" + }, + { + "access": "public", + "destination": "386872828559902182", + "source": "974430595320588991", + "type": "dependency" + }, + { + "access": "public", + "destination": "2207007194029669343", + "label": "a", + "source": "974430595320588991", + "type": "association" + }, + { + "access": "public", + "destination": "619642232943663499", + "label": "ns1_a", + "source": "974430595320588991", + "type": "association" + }, + { + "access": "public", + "destination": "2207007194029669343", + "label": "ns1_ns2_a", + "source": "974430595320588991", + "type": "association" + }, + { + "access": "public", + "destination": "864916647665253425", + "label": "root_a", + "source": "974430595320588991", + "type": "association" + } + ] +} +``` diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index 52da4a40..2ec4900a 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - + ns1 - + ns2 - + __gnu_cxx - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + a : ns1::ns2::A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - + - + i : std::vector<std::uint8_t> foo(AA & aa) : void - - + + A - - + + AA diff --git a/docs/test_cases/t00047.md b/docs/test_cases/t00047.md index ce7656a0..bc8b76b7 100644 --- a/docs/test_cases/t00047.md +++ b/docs/test_cases/t00047.md @@ -45,3 +45,165 @@ using conditional = typename conditional_t::type; ``` ## Generated UML diagrams ![t00047_class](./t00047_class.svg "Test case for recursive variadic template") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00047::conditional_t", + "id": "47394280824625133", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "conditional_t", + "namespace": "clanguml::t00047", + "source_location": { + "file": "../../tests/t00047/t00047.cc", + "line": 8 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "Else", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00047::conditional_t", + "id": "599782159389775809", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "conditional_t", + "namespace": "clanguml::t00047", + "source_location": { + "file": "../../tests/t00047/t00047.cc", + "line": 13 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::true_type" + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "Result", + "template_parameters": [] + }, + { + "is_variadic": true, + "kind": "template_type", + "name": "Tail...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00047::conditional_t", + "id": "824938194184364511", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "conditional_t", + "namespace": "clanguml::t00047", + "source_location": { + "file": "../../tests/t00047/t00047.cc", + "line": 18 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::false_type" + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "Result", + "template_parameters": [] + }, + { + "is_variadic": true, + "kind": "template_type", + "name": "Tail...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00047::conditional_t", + "id": "1673692992642087414", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [], + "methods": [], + "name": "conditional_t", + "namespace": "clanguml::t00047", + "source_location": { + "file": "../../tests/t00047/t00047.cc", + "line": 6 + }, + "template_parameters": [ + { + "is_variadic": true, + "kind": "template_type", + "name": "Ts...", + "template_parameters": [] + } + ], + "type": "class" + } + ], + "name": "t00047_class", + "relationships": [ + { + "access": "public", + "destination": "1673692992642087414", + "source": "47394280824625133", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1673692992642087414", + "source": "599782159389775809", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1673692992642087414", + "source": "824938194184364511", + "type": "instantiation" + } + ], + "using_namespace": "clanguml::t00047" +} +``` diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index 291ef34a..354cefea 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + conditional_t @@ -19,8 +19,8 @@ - - + + conditional_t @@ -29,8 +29,8 @@ - - + + conditional_t @@ -39,8 +39,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00048.md b/docs/test_cases/t00048.md index 9a78f499..d8c4cfbe 100644 --- a/docs/test_cases/t00048.md +++ b/docs/test_cases/t00048.md @@ -122,3 +122,352 @@ template struct BaseTemplate { ``` ## Generated UML diagrams ![t00048_class](./t00048_class.svg "Test case for unique entity id with multiple translation units") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00048::Base", + "id": "10200626899013233", + "is_abstract": true, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "base", + "source_location": { + "file": "../../tests/t00048/t00048.h", + "line": 7 + }, + "type": "int" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "foo", + "parameters": [], + "type": "void" + } + ], + "name": "Base", + "namespace": "clanguml::t00048", + "source_location": { + "file": "../../tests/t00048/t00048.h", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00048::BaseTemplate", + "id": "630197772543569536", + "is_abstract": true, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "base", + "source_location": { + "file": "../../tests/t00048/t00048.h", + "line": 13 + }, + "type": "T" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": true, + "is_static": false, + "is_virtual": true, + "name": "foo", + "parameters": [], + "type": "void" + } + ], + "name": "BaseTemplate", + "namespace": "clanguml::t00048", + "source_location": { + "file": "../../tests/t00048/t00048.h", + "line": 12 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "10200626899013233", + "is_virtual": false, + "name": "clanguml::t00048::Base" + } + ], + "display_name": "clanguml::t00048::B", + "id": "59336049758992190", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00048/b_t00048.h", + "line": 9 + }, + "type": "int" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "foo", + "parameters": [], + "type": "void" + } + ], + "name": "B", + "namespace": "clanguml::t00048", + "source_location": { + "file": "../../tests/t00048/b_t00048.h", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "630197772543569536", + "is_virtual": false, + "name": "BaseTemplate" + } + ], + "display_name": "clanguml::t00048::BTemplate", + "id": "1635850649347735305", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00048/b_t00048.h", + "line": 15 + }, + "type": "T" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [], + "type": "void" + } + ], + "name": "BTemplate", + "namespace": "clanguml::t00048", + "source_location": { + "file": "../../tests/t00048/b_t00048.h", + "line": 14 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "10200626899013233", + "is_virtual": false, + "name": "clanguml::t00048::Base" + } + ], + "display_name": "clanguml::t00048::A", + "id": "199333691834211223", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00048/a_t00048.h", + "line": 9 + }, + "type": "int" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": true, + "name": "foo", + "parameters": [], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00048", + "source_location": { + "file": "../../tests/t00048/a_t00048.h", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "630197772543569536", + "is_virtual": false, + "name": "BaseTemplate" + } + ], + "display_name": "clanguml::t00048::ATemplate", + "id": "1025697108404463905", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00048/a_t00048.h", + "line": 15 + }, + "type": "T" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "foo", + "parameters": [], + "type": "void" + } + ], + "name": "ATemplate", + "namespace": "clanguml::t00048", + "source_location": { + "file": "../../tests/t00048/a_t00048.h", + "line": 14 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + } + ], + "name": "t00048_class", + "relationships": [ + { + "access": "public", + "destination": "10200626899013233", + "source": "59336049758992190", + "type": "extension" + }, + { + "access": "public", + "destination": "630197772543569536", + "source": "1635850649347735305", + "type": "extension" + }, + { + "access": "public", + "destination": "10200626899013233", + "source": "199333691834211223", + "type": "extension" + }, + { + "access": "public", + "destination": "630197772543569536", + "source": "1025697108404463905", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00048" +} +``` diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index 48029937..e8b4fca0 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + Base - + - + base : int foo() = 0 : void - - + + BaseTemplate @@ -35,35 +35,35 @@ T - + - + base : T foo() = 0 : void - - + + B - + - + b : int foo() : void - - + + BTemplate @@ -71,35 +71,35 @@ T - + - + b : T foo() : void - - + + A - + - + a : int foo() : void - - + + ATemplate @@ -107,11 +107,11 @@ T - + - + a : T diff --git a/docs/test_cases/t00049.md b/docs/test_cases/t00049.md index ba4bfbe2..2b2ffc70 100644 --- a/docs/test_cases/t00049.md +++ b/docs/test_cases/t00049.md @@ -48,3 +48,261 @@ struct R { ``` ## Generated UML diagrams ![t00049_class](./t00049_class.svg "Test case configurable type aliases") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00049::A", + "id": "372971769516871577", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00049/t00049.cc", + "line": 8 + }, + "type": "T" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_a", + "parameters": [], + "type": "T &" + } + ], + "name": "A", + "namespace": "clanguml::t00049", + "source_location": { + "file": "../../tests/t00049/t00049.cc", + "line": 7 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00049::A", + "id": "654829353386288443", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00049", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "intmap" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00049::A", + "id": "973058255816844469", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00049", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "thestring" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00049::A", + "id": "562074851310302010", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00049", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "string_vector" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00049::R", + "id": "2288024073053091226", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a_string", + "source_location": { + "file": "../../tests/t00049/t00049.cc", + "line": 14 + }, + "type": "A>" + }, + { + "access": "public", + "is_static": false, + "name": "a_vector_string", + "source_location": { + "file": "../../tests/t00049/t00049.cc", + "line": 15 + }, + "type": "A>" + }, + { + "access": "public", + "is_static": false, + "name": "a_int_map", + "source_location": { + "file": "../../tests/t00049/t00049.cc", + "line": 16 + }, + "type": "A>" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_int_map", + "parameters": [], + "type": "clanguml::t00049::A>" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "set_int_map", + "parameters": [ + { + "name": "int_map", + "type": "clanguml::t00049::A> &&" + } + ], + "type": "void" + } + ], + "name": "R", + "namespace": "clanguml::t00049", + "source_location": { + "file": "../../tests/t00049/t00049.cc", + "line": 13 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00049_class", + "relationships": [ + { + "access": "public", + "destination": "372971769516871577", + "source": "654829353386288443", + "type": "instantiation" + }, + { + "access": "public", + "destination": "372971769516871577", + "source": "973058255816844469", + "type": "instantiation" + }, + { + "access": "public", + "destination": "372971769516871577", + "source": "562074851310302010", + "type": "instantiation" + }, + { + "access": "public", + "destination": "654829353386288443", + "source": "2288024073053091226", + "type": "dependency" + }, + { + "access": "public", + "destination": "973058255816844469", + "label": "a_string", + "source": "2288024073053091226", + "type": "aggregation" + }, + { + "access": "public", + "destination": "562074851310302010", + "label": "a_vector_string", + "source": "2288024073053091226", + "type": "aggregation" + }, + { + "access": "public", + "destination": "654829353386288443", + "label": "a_int_map", + "source": "2288024073053091226", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00049" +} +``` diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index 92482219..1f800654 100644 --- a/docs/test_cases/t00049_class.svg +++ b/docs/test_cases/t00049_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,17 +18,17 @@ T - + - + a : T get_a() : T & - + A @@ -36,7 +36,7 @@ intmap - + A @@ -44,7 +44,7 @@ thestring - + A @@ -52,32 +52,32 @@ string_vector - - + + R - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> - + - + a_int_map : A<intmap> diff --git a/docs/test_cases/t00050.md b/docs/test_cases/t00050.md index 7110fa96..046d4a41 100644 --- a/docs/test_cases/t00050.md +++ b/docs/test_cases/t00050.md @@ -182,3 +182,309 @@ class NoComment { }; ``` ## Generated UML diagrams ![t00050_class](./t00050_class.svg "Test case for generating notes from comments using jinja templates") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "comment": { + "formatted": "Lorem ipsum dolor sit", + "paragraph": [ + " Lorem ipsum dolor sit\n" + ], + "raw": "/// Lorem ipsum dolor sit", + "text": "\n Lorem ipsum dolor sit\n" + }, + "display_name": "clanguml::t00050::A", + "id": "1885563213397742674", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00050", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "comment": { + "brief": [ + " Lorem ipsum\n" + ], + "formatted": "\n \\brief Lorem ipsum\n\n Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n tellus ligula porttitor metus.\n\n \\todo 1. Write meaningful comment\n \\todo 2. Write tests\n \\todo 3. Implement\n ", + "paragraph": [ + " \n", + " Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n tellus ligula porttitor metus.\n", + " \n" + ], + "raw": "/**\n * \\brief Lorem ipsum\n *\n * Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n * vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n * Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n * integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n * tellus ligula porttitor metus.\n *\n * \\todo 1. Write meaningful comment\n * \\todo 2. Write tests\n * \\todo 3. Implement\n */", + "text": "\n \n\n Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n tellus ligula porttitor metus.\n\n \n", + "todo": [ + " 1. Write meaningful comment\n \n", + " 2. Write tests\n \n", + " 3. Implement\n" + ] + }, + "display_name": "clanguml::t00050::B", + "id": "500262098409836244", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00050", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 24 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "comment": { + "brief": [ + " Long comment example\n" + ], + "formatted": "\\brief Long comment example\n\nLorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\nvehicula class ultricies mollis dictumst, aenean non a in donec nulla.\nPhasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\ninteger placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\ntellus ligula porttitor metus.\n\nVivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit,\neuismod libero facilisi aptent elementum felis blandit cursus gravida sociis\nerat ante, eleifend lectus nullam dapibus netus feugiat curae curabitur est\nad. Massa curae fringilla porttitor quam sollicitudin iaculis aptent leo\nligula euismod dictumst, orci penatibus mauris eros etiam praesent erat\nvolutpat posuere hac. Metus fringilla nec ullamcorper odio aliquam lacinia\nconubia mauris tempor, etiam ultricies proin quisque lectus sociis id\ntristique, integer phasellus taciti pretium adipiscing tortor sagittis\nligula.\n\nMollis pretium lorem primis senectus habitasse lectus scelerisque\ndonec, ultricies tortor suspendisse adipiscing fusce morbi volutpat\npellentesque, consectetur mi risus molestie curae malesuada cum. Dignissim\nlacus convallis massa mauris enim ad mattis magnis senectus montes, mollis\ntaciti phasellus accumsan bibendum semper blandit suspendisse faucibus nibh\nest, metus lobortis morbi cras magna vivamus per risus fermentum. Dapibus\nimperdiet praesent magnis ridiculus congue gravida curabitur dictum\nsagittis, enim et magna sit inceptos sodales parturient pharetra mollis,\naenean vel nostra tellus commodo pretium sapien sociosqu.", + "paragraph": [ + " \n", + " Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n tellus ligula porttitor metus.\n", + " Vivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit,\n euismod libero facilisi aptent elementum felis blandit cursus gravida sociis\n erat ante, eleifend lectus nullam dapibus netus feugiat curae curabitur est\n ad. Massa curae fringilla porttitor quam sollicitudin iaculis aptent leo\n ligula euismod dictumst, orci penatibus mauris eros etiam praesent erat\n volutpat posuere hac. Metus fringilla nec ullamcorper odio aliquam lacinia\n conubia mauris tempor, etiam ultricies proin quisque lectus sociis id\n tristique, integer phasellus taciti pretium adipiscing tortor sagittis\n ligula.\n", + " Mollis pretium lorem primis senectus habitasse lectus scelerisque\n donec, ultricies tortor suspendisse adipiscing fusce morbi volutpat\n pellentesque, consectetur mi risus molestie curae malesuada cum. Dignissim\n lacus convallis massa mauris enim ad mattis magnis senectus montes, mollis\n taciti phasellus accumsan bibendum semper blandit suspendisse faucibus nibh\n est, metus lobortis morbi cras magna vivamus per risus fermentum. Dapibus\n imperdiet praesent magnis ridiculus congue gravida curabitur dictum\n sagittis, enim et magna sit inceptos sodales parturient pharetra mollis,\n aenean vel nostra tellus commodo pretium sapien sociosqu.\n" + ], + "raw": "/// \\brief Long comment example\n///\n/// Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n/// vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n/// Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n/// integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n/// tellus ligula porttitor metus.\n///\n/// Vivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit,\n/// euismod libero facilisi aptent elementum felis blandit cursus gravida sociis\n/// erat ante, eleifend lectus nullam dapibus netus feugiat curae curabitur est\n/// ad. Massa curae fringilla porttitor quam sollicitudin iaculis aptent leo\n/// ligula euismod dictumst, orci penatibus mauris eros etiam praesent erat\n/// volutpat posuere hac. Metus fringilla nec ullamcorper odio aliquam lacinia\n/// conubia mauris tempor, etiam ultricies proin quisque lectus sociis id\n/// tristique, integer phasellus taciti pretium adipiscing tortor sagittis\n/// ligula.\n///\n/// Mollis pretium lorem primis senectus habitasse lectus scelerisque\n/// donec, ultricies tortor suspendisse adipiscing fusce morbi volutpat\n/// pellentesque, consectetur mi risus molestie curae malesuada cum. Dignissim\n/// lacus convallis massa mauris enim ad mattis magnis senectus montes, mollis\n/// taciti phasellus accumsan bibendum semper blandit suspendisse faucibus nibh\n/// est, metus lobortis morbi cras magna vivamus per risus fermentum. Dapibus\n/// imperdiet praesent magnis ridiculus congue gravida curabitur dictum\n/// sagittis, enim et magna sit inceptos sodales parturient pharetra mollis,\n/// aenean vel nostra tellus commodo pretium sapien sociosqu.", + "text": "\n \n\n Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n tellus ligula porttitor metus.\n\n Vivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit,\n euismod libero facilisi aptent elementum felis blandit cursus gravida sociis\n erat ante, eleifend lectus nullam dapibus netus feugiat curae curabitur est\n ad. Massa curae fringilla porttitor quam sollicitudin iaculis aptent leo\n ligula euismod dictumst, orci penatibus mauris eros etiam praesent erat\n volutpat posuere hac. Metus fringilla nec ullamcorper odio aliquam lacinia\n conubia mauris tempor, etiam ultricies proin quisque lectus sociis id\n tristique, integer phasellus taciti pretium adipiscing tortor sagittis\n ligula.\n\n Mollis pretium lorem primis senectus habitasse lectus scelerisque\n donec, ultricies tortor suspendisse adipiscing fusce morbi volutpat\n pellentesque, consectetur mi risus molestie curae malesuada cum. Dignissim\n lacus convallis massa mauris enim ad mattis magnis senectus montes, mollis\n taciti phasellus accumsan bibendum semper blandit suspendisse faucibus nibh\n est, metus lobortis morbi cras magna vivamus per risus fermentum. Dapibus\n imperdiet praesent magnis ridiculus congue gravida curabitur dictum\n sagittis, enim et magna sit inceptos sodales parturient pharetra mollis,\n aenean vel nostra tellus commodo pretium sapien sociosqu.\n" + }, + "display_name": "clanguml::t00050::C", + "id": "1663081653671078922", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00050", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 53 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "comment": { + "formatted": "Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\nvehicula class ultricies mollis dictumst, aenean non a in donec nulla.\nPhasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\ninteger placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\ntellus ligula porttitor metus.\n\n\\todo Implement...", + "paragraph": [ + " Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n tellus ligula porttitor metus.\n", + " \n" + ], + "raw": "/// Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n/// vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n/// Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n/// integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n/// tellus ligula porttitor metus.\n///\n/// \\todo Implement...", + "text": "\n Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis\n vehicula class ultricies mollis dictumst, aenean non a in donec nulla.\n Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,\n integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora\n tellus ligula porttitor metus.\n\n \n", + "todo": [ + " Implement...\n" + ] + }, + "display_name": "clanguml::t00050::utils::D", + "id": "1492514566602019299", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00050::utils", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 65 + }, + "template_parameters": [], + "type": "class" + }, + { + "comment": { + "formatted": "Mollis pretium lorem primis", + "paragraph": [ + " Mollis pretium lorem primis\n" + ], + "raw": "/// Mollis pretium lorem primis", + "text": "\n Mollis pretium lorem primis\n" + }, + "constants": [ + "E1", + "E2", + "E3" + ], + "display_name": "clanguml::t00050::E", + "id": "2027344031570117998", + "is_nested": false, + "name": "E", + "namespace": "clanguml::t00050", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 70 + }, + "type": "enum" + }, + { + "bases": [], + "comment": { + "brief": [ + " Simple array wrapper.\n" + ], + "formatted": "\\brief Simple array wrapper.\n\nThis class is just for testing tparam parsing, it serves no other\npurpose.\n\n\\tparam T Type of array elements.\n\\tparam V Type of regular element.\n\\tparam N Size of T array.", + "paragraph": [ + " \n", + " This class is just for testing tparam parsing, it serves no other\n purpose.\n", + " \n" + ], + "raw": "/// \\brief Simple array wrapper.\n///\n/// This class is just for testing tparam parsing, it serves no other\n/// purpose.\n///\n/// \\tparam T Type of array elements.\n/// \\tparam V Type of regular element.\n/// \\tparam N Size of T array.\n///", + "text": "\n \n\n This class is just for testing tparam parsing, it serves no other\n purpose.\n\n \n", + "tparam": [ + { + "description": " Type of array elements.\n \n", + "name": "T" + }, + { + "description": " Type of regular element.\n \n", + "name": "V" + }, + { + "description": " Size of T array.\n", + "name": "N" + } + ] + }, + "display_name": "clanguml::t00050::F", + "id": "793698410848959592", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "private", + "is_static": false, + "name": "t", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 82 + }, + "type": "T[N]" + }, + { + "access": "private", + "is_static": false, + "name": "v", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 83 + }, + "type": "V" + } + ], + "methods": [], + "name": "F", + "namespace": "clanguml::t00050", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 81 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "V", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "non_type_template", + "name": "N", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "comment": { + "formatted": "This is a short description of class G.\n\nThis is an intermediate description of class G.\n\nThis is a long description of class G.", + "paragraph": [ + " This is a short description of class G.\n", + " This is an intermediate description of class G.\n", + " This is a long description of class G.\n" + ], + "raw": "/// This is a short description of class G.\n///\n/// This is an intermediate description of class G.\n///\n/// This is a long description of class G.", + "text": "\n This is a short description of class G.\n\n This is an intermediate description of class G.\n\n This is a long description of class G.\n" + }, + "display_name": "clanguml::t00050::G", + "id": "449485154531299941", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00050", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 91 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00050::NoComment", + "id": "1832693799357996932", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "NoComment", + "namespace": "clanguml::t00050", + "source_location": { + "file": "../../tests/t00050/t00050.cc", + "line": 93 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00050_class", + "relationships": [], + "using_namespace": "clanguml::t00050" +} +``` diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index ff20ac50..1941b0b9 100644 --- a/docs/test_cases/t00050_class.svg +++ b/docs/test_cases/t00050_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + utils::D - - + + E @@ -52,8 +52,8 @@ E3 - - + + F @@ -61,44 +61,44 @@ T,V,int N - + - + t : T[N] - + - + v : V - - + + G - - + + NoComment - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula class ultricies mollis dictumst, aenean non a in donec nulla. @@ -125,50 +125,50 @@ imperdiet praesent magnis ridiculus congue gravida curabitur dictum sagittis, enim et magna sit inceptos sodales parturient pharetra mollis, aenean vel nostra tellus commodo pretium sapien sociosqu. - + This is a short description of class G. - + This is an intermediate description of class G. - + This is a long description of class G. - + Lorem ipsum - + TODO 1. Write meaningful comment - + TODO 2. Write tests - + TODO 3. Implement - + Long comment example - + TODO Implement... - + Simple array wrapper. - + Template parameters diff --git a/docs/test_cases/t00051.md b/docs/test_cases/t00051.md index cb6b1e66..27937a57 100644 --- a/docs/test_cases/t00051.md +++ b/docs/test_cases/t00051.md @@ -84,3 +84,374 @@ A::custom_thread2 A::start_thread2() ``` ## Generated UML diagrams ![t00051_class](./t00051_class.svg "Test case for relative paths in lambda names") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [ + { + "access": "private", + "id": "1911564114172366679", + "is_virtual": false, + "name": "std::thread" + } + ], + "display_name": "clanguml::t00051::B", + "id": "486675674447050206", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "f_", + "source_location": { + "file": "../../tests/t00051/t00051.cc", + "line": 16 + }, + "type": "F" + }, + { + "access": "public", + "is_static": false, + "name": "ff_", + "source_location": { + "file": "../../tests/t00051/t00051.cc", + "line": 17 + }, + "type": "FF" + } + ], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "B", + "parameters": [ + { + "name": "f", + "type": "F &&" + }, + { + "name": "ff", + "type": "FF &&" + } + ], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "f", + "parameters": [], + "type": "void" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "ff", + "parameters": [], + "type": "void" + } + ], + "name": "B", + "namespace": "clanguml::t00051", + "source_location": { + "file": "../../tests/t00051/t00051.cc", + "line": 6 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "F", + "template_parameters": [] + }, + { + "default": "F", + "is_variadic": false, + "kind": "template_type", + "name": "FF", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "private", + "id": "1911564114172366679", + "is_virtual": false, + "name": "std::thread" + } + ], + "display_name": "clanguml::t00051::B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)>", + "id": "129489662928342298", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00051", + "source_location": { + "file": "../../tests/t00051/t00051.cc", + "line": 6 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "(lambda at ../../tests/t00051/t00051.cc:43:18)" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "(lambda at ../../tests/t00051/t00051.cc:43:27)" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00051::A", + "id": "1064663612772326174", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": true, + "is_virtual": false, + "name": "start_thread1", + "parameters": [], + "type": "clanguml::t00051::A::custom_thread1" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": true, + "is_virtual": false, + "name": "start_thread2", + "parameters": [], + "type": "clanguml::t00051::A::custom_thread2" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "start_thread3", + "parameters": [], + "type": "clanguml::t00051::B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)>" + }, + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_function", + "parameters": [], + "type": "(lambda at ../../tests/t00051/t00051.cc:48:16)" + } + ], + "name": "A", + "namespace": "clanguml::t00051", + "source_location": { + "file": "../../tests/t00051/t00051.cc", + "line": 20 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "private", + "id": "1911564114172366679", + "is_virtual": false, + "name": "std::thread" + } + ], + "display_name": "clanguml::t00051::A::custom_thread1", + "id": "267762118222214764", + "is_abstract": false, + "is_nested": true, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "custom_thread1", + "parameters": [ + { + "name": "f", + "type": "Function &&" + }, + { + "name": "args", + "type": "Args &&..." + } + ], + "type": "void" + } + ], + "name": "A::custom_thread1", + "namespace": "clanguml::t00051", + "source_location": { + "file": "../../tests/t00051/t00051.cc", + "line": 23 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "private", + "id": "1911564114172366679", + "is_virtual": false, + "name": "std::thread" + } + ], + "display_name": "clanguml::t00051::A::custom_thread2", + "id": "728501319748477470", + "is_abstract": false, + "is_nested": true, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "thread", + "parameters": [ + { + "name": "", + "type": "(lambda at ../../tests/t00051/t00051.cc:59:27) &&" + } + ], + "type": "void" + } + ], + "name": "A::custom_thread2", + "namespace": "clanguml::t00051", + "source_location": { + "file": "../../tests/t00051/t00051.cc", + "line": 35 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00051_class", + "relationships": [ + { + "access": "private", + "destination": "1911564114172366679", + "source": "486675674447050206", + "type": "extension" + }, + { + "access": "public", + "destination": "486675674447050206", + "source": "129489662928342298", + "type": "instantiation" + }, + { + "access": "private", + "destination": "1911564114172366679", + "source": "129489662928342298", + "type": "extension" + }, + { + "access": "public", + "destination": "129489662928342298", + "source": "1064663612772326174", + "type": "dependency" + }, + { + "access": "public", + "destination": "1064663612772326174", + "source": "267762118222214764", + "type": "containment" + }, + { + "access": "private", + "destination": "1911564114172366679", + "source": "267762118222214764", + "type": "extension" + }, + { + "access": "public", + "destination": "1064663612772326174", + "source": "728501319748477470", + "type": "containment" + }, + { + "access": "private", + "destination": "1911564114172366679", + "source": "728501319748477470", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00051" +} +``` diff --git a/docs/test_cases/t00051_class.svg b/docs/test_cases/t00051_class.svg index df0ab88a..ce6fa271 100644 --- a/docs/test_cases/t00051_class.svg +++ b/docs/test_cases/t00051_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + B @@ -18,18 +18,18 @@ F,FF=F - + - + f_ : F - + - + ff_ : FF @@ -39,16 +39,16 @@ f() : void ff() : void - - + + B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> - - + + A @@ -63,8 +63,8 @@ get_function() : (lambda at ../../tests/t00051/t00051.cc:48:16) - - + + A::custom_thread1 @@ -73,8 +73,8 @@ custom_thread1<Function,Args...>(Function && f, Args &&... args) : void - - + + A::custom_thread2 diff --git a/docs/test_cases/t00052.md b/docs/test_cases/t00052.md index 206f049e..e4edb209 100644 --- a/docs/test_cases/t00052.md +++ b/docs/test_cases/t00052.md @@ -55,3 +55,315 @@ struct R { ``` ## Generated UML diagrams ![t00052_class](./t00052_class.svg "Test case for template methods rendering") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00052::A", + "id": "2200853067459698271", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "a", + "parameters": [ + { + "name": "p", + "type": "T" + } + ], + "type": "T" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "aa", + "parameters": [ + { + "name": "f", + "type": "F &&" + }, + { + "name": "q", + "type": "Q" + } + ], + "type": "void" + } + ], + "name": "A", + "namespace": "clanguml::t00052", + "source_location": { + "file": "../../tests/t00052/t00052.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00052::B", + "id": "1737293776724790064", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "b", + "parameters": [ + { + "name": "t", + "type": "T" + } + ], + "type": "T" + }, + { + "access": "public", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "bb", + "parameters": [ + { + "name": "f", + "type": "F &&" + }, + { + "name": "t", + "type": "T" + } + ], + "type": "T" + } + ], + "name": "B", + "namespace": "clanguml::t00052", + "source_location": { + "file": "../../tests/t00052/t00052.cc", + "line": 13 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00052::C", + "id": "687756639884832524", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "private", + "is_const": false, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "c", + "parameters": [ + { + "name": "p", + "type": "P" + } + ], + "type": "T" + } + ], + "name": "C", + "namespace": "clanguml::t00052", + "source_location": { + "file": "../../tests/t00052/t00052.cc", + "line": 20 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00052::B", + "id": "1043027222809675776", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00052", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00052::C", + "id": "492968837554438176", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00052", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00052::R", + "id": "1157978668683299226", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00052/t00052.cc", + "line": 30 + }, + "type": "clanguml::t00052::A" + }, + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00052/t00052.cc", + "line": 31 + }, + "type": "B" + }, + { + "access": "public", + "is_static": false, + "name": "c", + "source_location": { + "file": "../../tests/t00052/t00052.cc", + "line": 32 + }, + "type": "C" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00052", + "source_location": { + "file": "../../tests/t00052/t00052.cc", + "line": 29 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00052_class", + "relationships": [ + { + "access": "public", + "destination": "1737293776724790064", + "source": "1043027222809675776", + "type": "instantiation" + }, + { + "access": "public", + "destination": "687756639884832524", + "source": "492968837554438176", + "type": "instantiation" + }, + { + "access": "public", + "destination": "2200853067459698271", + "label": "a", + "source": "1157978668683299226", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1043027222809675776", + "label": "b", + "source": "1157978668683299226", + "type": "aggregation" + }, + { + "access": "public", + "destination": "492968837554438176", + "label": "c", + "source": "1157978668683299226", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00052" +} +``` diff --git a/docs/test_cases/t00052_class.svg b/docs/test_cases/t00052_class.svg index fc42ddc9..edb6b1d6 100644 --- a/docs/test_cases/t00052_class.svg +++ b/docs/test_cases/t00052_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ aa<F,Q>(F && f, Q q) : void - - + + B @@ -35,8 +35,8 @@ bb<F>(F && f, T t) : T - - + + C @@ -47,7 +47,7 @@ c<P>(P p) : T - + B @@ -55,7 +55,7 @@ int - + C @@ -63,32 +63,32 @@ int - - + + R - + - + a : A - + - + b : B<int> - + - + c : C<int> diff --git a/docs/test_cases/t00053.md b/docs/test_cases/t00053.md index 24e04454..a157614e 100644 --- a/docs/test_cases/t00053.md +++ b/docs/test_cases/t00053.md @@ -52,3 +52,339 @@ enum class j { jjj }; ``` ## Generated UML diagrams ![t00053_class](./t00053_class.svg "Test case for `together` layout hint in class diagram") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00053::a", + "id": "347629837292519144", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "a", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 3 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::b", + "id": "1376344645244260547", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "b", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 4 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::c", + "id": "504463801094568803", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "c", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 5 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::d", + "id": "1264455164862224089", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "d", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::e", + "id": "907921963776939609", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "e", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::f", + "id": "1421289128664274084", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "f", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::g", + "id": "200227126708762001", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "g", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::A", + "id": "322642841130459425", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::B", + "id": "876623970071162908", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 12 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::C", + "id": "1248473990784124468", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 13 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::D", + "id": "470228045297785394", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 14 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::E", + "id": "1038384764221361257", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 15 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::F", + "id": "530253748811039667", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "F", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 16 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00053::G", + "id": "1031614323468823578", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 17 + }, + "template_parameters": [], + "type": "class" + }, + { + "constants": [ + "hhh" + ], + "display_name": "clanguml::t00053::h", + "id": "190978367074032185", + "is_nested": false, + "name": "h", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 19 + }, + "type": "enum" + }, + { + "constants": [ + "iii" + ], + "display_name": "clanguml::t00053::i", + "id": "1473214620883985930", + "is_nested": false, + "name": "i", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 20 + }, + "type": "enum" + }, + { + "constants": [ + "jjj" + ], + "display_name": "clanguml::t00053::j", + "id": "965083605473661435", + "is_nested": false, + "name": "j", + "namespace": "clanguml::t00053", + "source_location": { + "file": "../../tests/t00053/t00053.cc", + "line": 21 + }, + "type": "enum" + } + ], + "name": "t00053_class", + "relationships": [], + "using_namespace": "clanguml::t00053" +} +``` diff --git a/docs/test_cases/t00053_class.svg b/docs/test_cases/t00053_class.svg index d47d42e5..69100fba 100644 --- a/docs/test_cases/t00053_class.svg +++ b/docs/test_cases/t00053_class.svg @@ -1,6 +1,6 @@ - + @@ -9,72 +9,72 @@ - - + + A - - + + C - - + + E - - + + F - - + + a - - + + c - - + + e - - + + f - - + + h @@ -82,8 +82,8 @@ hhh - - + + j @@ -91,56 +91,56 @@ jjj - - + + b - - + + d - - + + g - - + + B - - + + D - - + + G - - + + i diff --git a/docs/test_cases/t00054.md b/docs/test_cases/t00054.md index 4563343c..cd368dc6 100644 --- a/docs/test_cases/t00054.md +++ b/docs/test_cases/t00054.md @@ -66,3 +66,367 @@ enum class j { jjj }; ``` ## Generated UML diagrams ![t00054_class](./t00054_class.svg "Test case for `together` layout hint in class diagram with rendered namespaces") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00054::a", + "id": "1158868779503074564", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "a", + "namespace": "clanguml::t00054", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 3 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00054::b", + "id": "252416999805673718", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "b", + "namespace": "clanguml::t00054", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 4 + }, + "template_parameters": [], + "type": "class" + }, + { + "display_name": "clanguml::t00054::detail", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00054::detail::c", + "id": "1168031834662719964", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "c", + "namespace": "clanguml::t00054::detail", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00054::detail::d", + "id": "1569559620782547158", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "d", + "namespace": "clanguml::t00054::detail", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00054::detail::e", + "id": "2037550833462858827", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "e", + "namespace": "clanguml::t00054::detail", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "detail", + "type": "namespace" + }, + { + "bases": [], + "display_name": "clanguml::t00054::f", + "id": "2123626454198320938", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "f", + "namespace": "clanguml::t00054", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00054::g", + "id": "595494794840378320", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "g", + "namespace": "clanguml::t00054", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 12 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00054::A", + "id": "917656824503504804", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00054", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 14 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00054::B", + "id": "1235773045370563004", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00054", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 15 + }, + "template_parameters": [], + "type": "class" + }, + { + "display_name": "clanguml::t00054::detail2", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00054::detail2::C", + "id": "540054955081677892", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00054::detail2", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 18 + }, + "template_parameters": [], + "type": "class" + }, + { + "display_name": "clanguml::t00054::detail2::detail3", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00054::detail2::detail3::D", + "id": "1266390196945323478", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00054::detail2::detail3", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 20 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00054::detail2::detail3::E", + "id": "134928214982255105", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00054::detail2::detail3", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 21 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "detail3", + "type": "namespace" + }, + { + "bases": [], + "display_name": "clanguml::t00054::detail2::F", + "id": "446694692150903211", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "F", + "namespace": "clanguml::t00054::detail2", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 23 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "detail2", + "type": "namespace" + }, + { + "bases": [], + "display_name": "clanguml::t00054::G", + "id": "1365815261671395853", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00054", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 25 + }, + "template_parameters": [], + "type": "class" + }, + { + "display_name": "clanguml::t00054::detail4", + "elements": [ + { + "constants": [ + "hhh" + ], + "display_name": "clanguml::t00054::detail4::h", + "id": "1592677999268391183", + "is_nested": false, + "name": "h", + "namespace": "clanguml::t00054::detail4", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 28 + }, + "type": "enum" + }, + { + "constants": [ + "iii" + ], + "display_name": "clanguml::t00054::detail4::i", + "id": "441521323390223397", + "is_nested": false, + "name": "i", + "namespace": "clanguml::t00054::detail4", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 29 + }, + "type": "enum" + }, + { + "constants": [ + "jjj" + ], + "display_name": "clanguml::t00054::detail4::j", + "id": "499334434426587347", + "is_nested": false, + "name": "j", + "namespace": "clanguml::t00054::detail4", + "source_location": { + "file": "../../tests/t00054/t00054.cc", + "line": 30 + }, + "type": "enum" + } + ], + "name": "detail4", + "type": "namespace" + } + ], + "name": "t00054_class", + "relationships": [], + "using_namespace": "clanguml::t00054" +} +``` diff --git a/docs/test_cases/t00054_class.svg b/docs/test_cases/t00054_class.svg index 58d8752f..79817306 100644 --- a/docs/test_cases/t00054_class.svg +++ b/docs/test_cases/t00054_class.svg @@ -1,6 +1,6 @@ - + @@ -9,116 +9,116 @@ - + detail - + detail2 - + detail3 - + detail4 - - + + d - - + + a - - + + c - - + + e - - + + C - - + + F - - + + D - - + + E - - + + A - - + + B - - + + f - - + + G - - + + h @@ -127,8 +127,8 @@ hhh - - + + i @@ -137,8 +137,8 @@ iii - - + + j @@ -147,16 +147,16 @@ jjj - - + + b - - + + g diff --git a/docs/test_cases/t00055.md b/docs/test_cases/t00055.md index 6ba7921e..fb1813d5 100644 --- a/docs/test_cases/t00055.md +++ b/docs/test_cases/t00055.md @@ -39,3 +39,214 @@ struct J { }; ``` ## Generated UML diagrams ![t00055_class](./t00055_class.svg "Test case for `row` and `column` layout hints") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00055::A", + "id": "1697191682863715554", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 3 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00055::B", + "id": "188599859894721517", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 4 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00055::C", + "id": "625177137967392996", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 5 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00055::D", + "id": "1046415640323289221", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00055::E", + "id": "702117239243796422", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "E", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00055::F", + "id": "1511375015718046137", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "F", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 8 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00055::G", + "id": "651600874645139639", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "G", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 9 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00055::H", + "id": "374142601071476038", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "H", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 10 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00055::I", + "id": "295372236079742697", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "I", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00055::J", + "id": "769231292718551090", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "J", + "namespace": "clanguml::t00055", + "source_location": { + "file": "../../tests/t00055/t00055.cc", + "line": 12 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00055_class", + "relationships": [], + "using_namespace": "clanguml::t00055" +} +``` diff --git a/docs/test_cases/t00055_class.svg b/docs/test_cases/t00055_class.svg index 1fc2307b..b2164e3b 100644 --- a/docs/test_cases/t00055_class.svg +++ b/docs/test_cases/t00055_class.svg @@ -1,6 +1,6 @@ - + @@ -9,80 +9,80 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J diff --git a/docs/test_cases/t00056.md b/docs/test_cases/t00056.md index 188159cb..0c6b7439 100644 --- a/docs/test_cases/t00056.md +++ b/docs/test_cases/t00056.md @@ -113,3 +113,538 @@ struct F { ``` ## Generated UML diagrams ![t00056_class](./t00056_class.svg "Basic C++20 concepts test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "display_name": "clanguml::t00056::greater_than_simple", + "id": "902541696362244204", + "name": "greater_than_simple", + "namespace": "clanguml::t00056", + "parameters": [], + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 7 + }, + "statements": [], + "type": "concept" + }, + { + "display_name": "clanguml::t00056::greater_than_with_requires", + "id": "1830716585637735576", + "name": "greater_than_with_requires", + "namespace": "clanguml::t00056", + "parameters": [ + { + "name": "clanguml::t00056::l", + "type": "T" + }, + { + "name": "clanguml::t00056::r", + "type": "P" + } + ], + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 10 + }, + "statements": [ + "sizeof (l) > sizeof (r)" + ], + "type": "concept" + }, + { + "display_name": "clanguml::t00056::max_four_bytes", + "id": "385255522691733325", + "name": "max_four_bytes", + "namespace": "clanguml::t00056", + "parameters": [], + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 15 + }, + "statements": [], + "type": "concept" + }, + { + "display_name": "clanguml::t00056::iterable", + "id": "392540961352249242", + "name": "iterable", + "namespace": "clanguml::t00056", + "parameters": [ + { + "name": "clanguml::t00056::container", + "type": "T" + } + ], + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 19 + }, + "statements": [ + "container.begin()", + "container.end()" + ], + "type": "concept" + }, + { + "display_name": "clanguml::t00056::has_value_type", + "id": "1850394311226276678", + "name": "has_value_type", + "namespace": "clanguml::t00056", + "parameters": [], + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 26 + }, + "statements": [ + "typename T::value_type" + ], + "type": "concept" + }, + { + "display_name": "clanguml::t00056::convertible_to_string", + "id": "137304962071054497", + "name": "convertible_to_string", + "namespace": "clanguml::t00056", + "parameters": [ + { + "name": "clanguml::t00056::s", + "type": "T" + } + ], + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 29 + }, + "statements": [ + "std::string{s}", + "{std::to_string(s)} noexcept", + "{std::to_string(s)} -> std::same_as" + ], + "type": "concept" + }, + { + "display_name": "clanguml::t00056::iterable_with_value_type", + "id": "1043398062146751019", + "name": "iterable_with_value_type", + "namespace": "clanguml::t00056", + "parameters": [], + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 45 + }, + "statements": [], + "type": "concept" + }, + { + "display_name": "clanguml::t00056::iterable_or_small_value_type", + "id": "866345615551223718", + "name": "iterable_or_small_value_type", + "namespace": "clanguml::t00056", + "parameters": [], + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 48 + }, + "statements": [], + "type": "concept" + }, + { + "bases": [], + "display_name": "clanguml::t00056::A", + "id": "1418333499545421661", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 53 + }, + "type": "T" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00056", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 52 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00056::B", + "id": "1814355496814977880", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 60 + }, + "type": "T" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00056", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 59 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00056::C", + "id": "1512618198241549089", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "c", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 70 + }, + "type": "T" + } + ], + "methods": [], + "name": "C", + "namespace": "clanguml::t00056", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 69 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00056::D", + "id": "1635109601630198093", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00056", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 75 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T1", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "T2", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "T3", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "T4", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "T5", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00056::E", + "id": "1429225801945621089", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "e1", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 80 + }, + "type": "T1" + }, + { + "access": "public", + "is_static": false, + "name": "e2", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 81 + }, + "type": "T2" + }, + { + "access": "public", + "is_static": false, + "name": "e3", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 82 + }, + "type": "T3" + } + ], + "methods": [], + "name": "E", + "namespace": "clanguml::t00056", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 79 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T1", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "T2", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "T3", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00056::F", + "id": "856301122972546034", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "f1", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 88 + }, + "type": "T1" + }, + { + "access": "public", + "is_static": false, + "name": "f2", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 89 + }, + "type": "T2" + }, + { + "access": "public", + "is_static": false, + "name": "f3", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 90 + }, + "type": "T3" + } + ], + "methods": [], + "name": "F", + "namespace": "clanguml::t00056", + "source_location": { + "file": "../../tests/t00056/t00056.cc", + "line": 87 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T1", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "T2", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "T3", + "template_parameters": [] + } + ], + "type": "class" + } + ], + "name": "t00056_class", + "relationships": [ + { + "destination": "385255522691733325", + "label": "T", + "source": "137304962071054497", + "type": "constraint" + }, + { + "destination": "392540961352249242", + "label": "T", + "source": "1043398062146751019", + "type": "constraint" + }, + { + "destination": "1850394311226276678", + "label": "T", + "source": "1043398062146751019", + "type": "constraint" + }, + { + "destination": "1043398062146751019", + "label": "T", + "source": "866345615551223718", + "type": "constraint" + }, + { + "destination": "385255522691733325", + "label": "T", + "source": "866345615551223718", + "type": "constraint" + }, + { + "destination": "385255522691733325", + "label": "T", + "source": "1418333499545421661", + "type": "constraint" + }, + { + "destination": "866345615551223718", + "label": "T", + "source": "1814355496814977880", + "type": "constraint" + }, + { + "destination": "137304962071054497", + "label": "T", + "source": "1512618198241549089", + "type": "constraint" + }, + { + "destination": "392540961352249242", + "label": "T1", + "source": "1635109601630198093", + "type": "constraint" + }, + { + "destination": "392540961352249242", + "label": "T3", + "source": "1635109601630198093", + "type": "constraint" + }, + { + "destination": "385255522691733325", + "label": "T2", + "source": "1635109601630198093", + "type": "constraint" + }, + { + "destination": "385255522691733325", + "label": "T5", + "source": "1635109601630198093", + "type": "constraint" + }, + { + "destination": "1830716585637735576", + "label": "T1,T3", + "source": "1429225801945621089", + "type": "constraint" + }, + { + "destination": "902541696362244204", + "label": "T1,T3", + "source": "856301122972546034", + "type": "constraint" + } + ], + "using_namespace": "clanguml::t00056" +} +``` diff --git a/docs/test_cases/t00056_class.svg b/docs/test_cases/t00056_class.svg index f27bfd7c..fccb4a32 100644 --- a/docs/test_cases/t00056_class.svg +++ b/docs/test_cases/t00056_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + «concept» @@ -20,8 +20,8 @@ - - + + «concept» @@ -33,8 +33,8 @@ sizeof (l) > sizeof (r) - - + + «concept» @@ -44,8 +44,8 @@ - - + + «concept» @@ -58,8 +58,8 @@ container.begin() container.end() - - + + «concept» @@ -71,8 +71,8 @@ typename T::value_type - - + + «concept» @@ -86,8 +86,8 @@ {std::to_string(s)} noexcept {std::to_string(s)} -> std::same_as<std::string> - - + + «concept» @@ -97,8 +97,8 @@ - - + + «concept» @@ -108,8 +108,8 @@ - - + + A @@ -117,16 +117,16 @@ max_four_bytes T - + - + a : T - - + + B @@ -134,16 +134,16 @@ T - + - + b : T - - + + C @@ -151,16 +151,16 @@ convertible_to_string T - + - + c : T - - + + D @@ -169,8 +169,8 @@ - - + + E @@ -178,30 +178,30 @@ T1,T2,T3 - + - + e1 : T1 - + - + e2 : T2 - + - + e3 : T3 - - + + F @@ -209,25 +209,25 @@ T1,T2,T3 - + - + f1 : T1 - + - + f2 : T2 - + - + f3 : T3 diff --git a/docs/test_cases/t00057.md b/docs/test_cases/t00057.md index d61678a6..1d9f60ba 100644 --- a/docs/test_cases/t00057.md +++ b/docs/test_cases/t00057.md @@ -56,3 +56,449 @@ struct t00057_R { ``` ## Generated UML diagrams ![t00057_class](./t00057_class.svg "Test case C99/C11 translation units with structs and unions") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "t00057_A", + "id": "940295970488928395", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a1", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 4 + }, + "type": "int" + } + ], + "methods": [], + "name": "t00057_A", + "namespace": "", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 3 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "t00057_B", + "id": "1030391494410415852", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "b1", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 8 + }, + "type": "int" + } + ], + "methods": [], + "name": "t00057_B", + "namespace": "", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 7 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "t00057_C", + "id": "388213894542327772", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "c1", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 12 + }, + "type": "int" + } + ], + "methods": [], + "name": "t00057_C", + "namespace": "", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 11 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "t00057_D", + "id": "784667124248020371", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": true, + "members": [ + { + "access": "public", + "is_static": false, + "name": "d1", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 16 + }, + "type": "int" + }, + { + "access": "public", + "is_static": false, + "name": "d2", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 17 + }, + "type": "float" + } + ], + "methods": [], + "name": "t00057_D", + "namespace": "", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 15 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "t00057_E", + "id": "682873132844345324", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "e", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 21 + }, + "type": "int" + }, + { + "access": "public", + "is_static": false, + "name": "coordinates", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 25 + }, + "type": "t00057_E##(anonymous_739)" + }, + { + "access": "public", + "is_static": false, + "name": "height", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 29 + }, + "type": "t00057_E##(anonymous_807)" + } + ], + "methods": [], + "name": "t00057_E", + "namespace": "", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 20 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "t00057_E::(coordinates)", + "id": "161676142413826748", + "is_abstract": false, + "is_nested": true, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "x", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 23 + }, + "type": "int" + }, + { + "access": "public", + "is_static": false, + "name": "y", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 24 + }, + "type": "int" + } + ], + "methods": [], + "name": "t00057_E::(coordinates)", + "namespace": "", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 22 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "t00057_E::(height)", + "id": "2265335931722752750", + "is_abstract": false, + "is_nested": true, + "is_struct": false, + "is_template": false, + "is_union": true, + "members": [ + { + "access": "public", + "is_static": false, + "name": "z", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 27 + }, + "type": "int" + }, + { + "access": "public", + "is_static": false, + "name": "t", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 28 + }, + "type": "double" + } + ], + "methods": [], + "name": "t00057_E::(height)", + "namespace": "", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 26 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "t00057_R", + "id": "370583978606928327", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 33 + }, + "type": "struct t00057_A" + }, + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 34 + }, + "type": "t00057_B" + }, + { + "access": "public", + "is_static": false, + "name": "c", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 35 + }, + "type": "struct t00057_C *" + }, + { + "access": "public", + "is_static": false, + "name": "d", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 36 + }, + "type": "union t00057_D" + }, + { + "access": "public", + "is_static": false, + "name": "e", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 37 + }, + "type": "struct t00057_E *" + }, + { + "access": "public", + "is_static": false, + "name": "f", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 38 + }, + "type": "struct t00057_F *" + } + ], + "methods": [], + "name": "t00057_R", + "namespace": "", + "source_location": { + "file": "../../tests/t00057/t00057.c", + "line": 32 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "t00057_F", + "id": "85797106299568719", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "f1", + "source_location": { + "file": "../../tests/t00057/src/t00057_impl.c", + "line": 4 + }, + "type": "int" + } + ], + "methods": [], + "name": "t00057_F", + "namespace": "", + "source_location": { + "file": "../../tests/t00057/include/t00057.h", + "line": 3 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00057_class", + "relationships": [ + { + "access": "public", + "destination": "161676142413826748", + "label": "coordinates", + "source": "682873132844345324", + "type": "aggregation" + }, + { + "access": "public", + "destination": "2265335931722752750", + "label": "height", + "source": "682873132844345324", + "type": "aggregation" + }, + { + "access": "public", + "destination": "940295970488928395", + "label": "a", + "source": "370583978606928327", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1030391494410415852", + "label": "b", + "source": "370583978606928327", + "type": "aggregation" + }, + { + "access": "public", + "destination": "388213894542327772", + "label": "c", + "source": "370583978606928327", + "type": "association" + }, + { + "access": "public", + "destination": "784667124248020371", + "label": "d", + "source": "370583978606928327", + "type": "aggregation" + }, + { + "access": "public", + "destination": "682873132844345324", + "label": "e", + "source": "370583978606928327", + "type": "association" + }, + { + "access": "public", + "destination": "85797106299568719", + "label": "f", + "source": "370583978606928327", + "type": "association" + } + ] +} +``` diff --git a/docs/test_cases/t00057_class.svg b/docs/test_cases/t00057_class.svg index 9b424947..0fbc57ea 100644 --- a/docs/test_cases/t00057_class.svg +++ b/docs/test_cases/t00057_class.svg @@ -1,6 +1,6 @@ - + @@ -9,210 +9,210 @@ - - + + t00057_A - + - + a1 : int - - + + t00057_B - + - + b1 : int - - + + t00057_C - + - + c1 : int - - + + «union» t00057_D - + - + d1 : int - + - + d2 : float - - + + t00057_E - + - + e : int - + - + coordinates : t00057_E::(anonymous_739) - + - + height : t00057_E::(anonymous_807) - - + + t00057_E::(coordinates) - + - + x : int - + - + y : int - - + + «union» t00057_E::(height) - + - + z : int - + - + t : double - - + + t00057_R - + - + a : struct t00057_A - + - + b : t00057_B - + - + c : struct t00057_C * - + - + d : union t00057_D - + - + e : struct t00057_E * - + - + f : struct t00057_F * - - + + t00057_F - + - + f1 : int diff --git a/docs/test_cases/t00058.md b/docs/test_cases/t00058.md index 2a967e55..d32cc43b 100644 --- a/docs/test_cases/t00058.md +++ b/docs/test_cases/t00058.md @@ -67,3 +67,386 @@ struct R { ``` ## Generated UML diagrams ![t00058_class](./t00058_class.svg "Test case for concepts with variadic parameters and type aliases") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00058::first_type", + "id": "39461943261269692", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [], + "methods": [], + "name": "first_type", + "namespace": "clanguml::t00058", + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 11 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": true, + "kind": "template_type", + "name": "Args...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "display_name": "clanguml::t00058::same_as_first_type", + "id": "1725820236573641307", + "name": "same_as_first_type", + "namespace": "clanguml::t00058", + "parameters": [], + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 22 + }, + "statements": [], + "type": "concept" + }, + { + "bases": [], + "display_name": "clanguml::t00058::A", + "id": "798619347004821702", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "a", + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 28 + }, + "type": "std::vector" + } + ], + "methods": [], + "name": "A", + "namespace": "clanguml::t00058", + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 27 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": true, + "kind": "template_type", + "name": "Args...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00058::B", + "id": "420594889696591405", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "b", + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 34 + }, + "type": "std::vector" + }, + { + "access": "public", + "is_static": false, + "name": "bb", + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 35 + }, + "type": "P" + } + ], + "methods": [], + "name": "B", + "namespace": "clanguml::t00058", + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 33 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "P", + "template_parameters": [] + }, + { + "is_variadic": true, + "kind": "template_type", + "name": "Args...", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00058::A", + "id": "1724002183455178980", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00058", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "double" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00058::A", + "id": "1372381231906520278", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00058", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00058::B>", + "id": "290383080560130133", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00058", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "std::string" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "double" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "int" + } + ], + "type": "clanguml::t00058::A" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00058::R", + "id": "1015108159699260009", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "aa", + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 39 + }, + "type": "A" + }, + { + "access": "public", + "is_static": false, + "name": "bb", + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 40 + }, + "type": "B>" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00058", + "source_location": { + "file": "../../tests/t00058/t00058.cc", + "line": 38 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00058_class", + "relationships": [ + { + "destination": "1725820236573641307", + "label": "T,Args...", + "source": "798619347004821702", + "type": "constraint" + }, + { + "destination": "1725820236573641307", + "label": "T,Args...", + "source": "420594889696591405", + "type": "constraint" + }, + { + "access": "public", + "destination": "798619347004821702", + "source": "1724002183455178980", + "type": "instantiation" + }, + { + "access": "public", + "destination": "798619347004821702", + "source": "1372381231906520278", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1372381231906520278", + "source": "290383080560130133", + "type": "dependency" + }, + { + "access": "public", + "destination": "420594889696591405", + "source": "290383080560130133", + "type": "instantiation" + }, + { + "access": "public", + "destination": "1724002183455178980", + "label": "aa", + "source": "1015108159699260009", + "type": "aggregation" + }, + { + "access": "public", + "destination": "290383080560130133", + "label": "bb", + "source": "1015108159699260009", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00058" +} +``` diff --git a/docs/test_cases/t00058_class.svg b/docs/test_cases/t00058_class.svg index 99b869c8..b079a2dc 100644 --- a/docs/test_cases/t00058_class.svg +++ b/docs/test_cases/t00058_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + first_type @@ -19,8 +19,8 @@ - - + + «concept» @@ -30,8 +30,8 @@ - - + + A @@ -39,16 +39,16 @@ T,Args... - + - + a : std::vector<T> - - + + B @@ -56,22 +56,22 @@ T,P,Args... - + - + b : std::vector<T> - + - + bb : P - + A @@ -79,7 +79,7 @@ int,int,double,std::string - + A @@ -87,7 +87,7 @@ int,int - + B @@ -95,25 +95,25 @@ int,std::string,int,double,A<int,int> - - + + R - + - + aa : A<int,int,double,std::string> - + - + bb : B<int,std::string,int,double,A<int,int>> diff --git a/docs/test_cases/t00059.md b/docs/test_cases/t00059.md index aedaf7fa..1cb7b46c 100644 --- a/docs/test_cases/t00059.md +++ b/docs/test_cases/t00059.md @@ -76,3 +76,487 @@ struct R { ``` ## Generated UML diagrams ![t00059_class](./t00059_class.svg "Non-virtual abstract factory pattern using concepts test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "display_name": "clanguml::t00059::fruit_c", + "id": "1926201868069460340", + "name": "fruit_c", + "namespace": "clanguml::t00059", + "parameters": [ + { + "name": "clanguml::t00059::t", + "type": "T" + } + ], + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 7 + }, + "statements": [ + "T{}", + "t.get_name()" + ], + "type": "concept" + }, + { + "display_name": "clanguml::t00059::apple_c", + "id": "1932582371736186409", + "name": "apple_c", + "namespace": "clanguml::t00059", + "parameters": [ + { + "name": "clanguml::t00059::t", + "type": "T" + } + ], + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 13 + }, + "statements": [ + "t.get_sweetness()" + ], + "type": "concept" + }, + { + "display_name": "clanguml::t00059::orange_c", + "id": "1483904441065806133", + "name": "orange_c", + "namespace": "clanguml::t00059", + "parameters": [ + { + "name": "clanguml::t00059::t", + "type": "T" + } + ], + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 16 + }, + "statements": [ + "t.get_bitterness()" + ], + "type": "concept" + }, + { + "bases": [], + "display_name": "clanguml::t00059::gala_apple", + "id": "399997161214328320", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_name", + "parameters": [], + "type": "std::string" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_sweetness", + "parameters": [], + "type": "float" + } + ], + "name": "gala_apple", + "namespace": "clanguml::t00059", + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 18 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00059::empire_apple", + "id": "660406972347773654", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_name", + "parameters": [], + "type": "std::string" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_sweetness", + "parameters": [], + "type": "float" + } + ], + "name": "empire_apple", + "namespace": "clanguml::t00059", + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 24 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00059::lima_orange", + "id": "1649295452510454080", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_name", + "parameters": [], + "type": "std::string" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_bitterness", + "parameters": [], + "type": "float" + } + ], + "name": "lima_orange", + "namespace": "clanguml::t00059", + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 30 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00059::valencia_orange", + "id": "802727760415733923", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_name", + "parameters": [], + "type": "std::string" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "get_bitterness", + "parameters": [], + "type": "float" + } + ], + "name": "valencia_orange", + "namespace": "clanguml::t00059", + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 36 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00059::fruit_factory", + "id": "2301786483822933456", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": true, + "is_union": false, + "members": [], + "methods": [ + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "create_apple", + "parameters": [], + "type": "TA" + }, + { + "access": "public", + "is_const": true, + "is_defaulted": false, + "is_implicit": false, + "is_pure_virtual": false, + "is_static": false, + "is_virtual": false, + "name": "create_orange", + "parameters": [], + "type": "TO" + } + ], + "name": "fruit_factory", + "namespace": "clanguml::t00059", + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 42 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "TA", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "TO", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00059::fruit_factory", + "id": "551278102444647278", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "fruit_factory", + "namespace": "clanguml::t00059", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00059::gala_apple" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00059::valencia_orange" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00059::fruit_factory", + "id": "536390279563541226", + "is_abstract": false, + "is_nested": false, + "is_struct": false, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "fruit_factory", + "namespace": "clanguml::t00059", + "template_parameters": [ + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00059::empire_apple" + }, + { + "is_variadic": false, + "kind": "argument", + "template_parameters": [], + "type": "clanguml::t00059::lima_orange" + } + ], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00059::R", + "id": "1128300671453354325", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "factory_1", + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 52 + }, + "type": "clanguml::t00059::fruit_factory_1" + }, + { + "access": "public", + "is_static": false, + "name": "factory_2", + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 53 + }, + "type": "clanguml::t00059::fruit_factory_2" + } + ], + "methods": [], + "name": "R", + "namespace": "clanguml::t00059", + "source_location": { + "file": "../../tests/t00059/t00059.cc", + "line": 51 + }, + "template_parameters": [], + "type": "class" + } + ], + "name": "t00059_class", + "relationships": [ + { + "destination": "1926201868069460340", + "label": "T", + "source": "1932582371736186409", + "type": "constraint" + }, + { + "destination": "1926201868069460340", + "label": "T", + "source": "1483904441065806133", + "type": "constraint" + }, + { + "destination": "1932582371736186409", + "label": "TA", + "source": "2301786483822933456", + "type": "constraint" + }, + { + "destination": "1483904441065806133", + "label": "TO", + "source": "2301786483822933456", + "type": "constraint" + }, + { + "access": "public", + "destination": "399997161214328320", + "source": "551278102444647278", + "type": "dependency" + }, + { + "access": "public", + "destination": "802727760415733923", + "source": "551278102444647278", + "type": "dependency" + }, + { + "access": "public", + "destination": "2301786483822933456", + "source": "551278102444647278", + "type": "instantiation" + }, + { + "access": "public", + "destination": "660406972347773654", + "source": "536390279563541226", + "type": "dependency" + }, + { + "access": "public", + "destination": "1649295452510454080", + "source": "536390279563541226", + "type": "dependency" + }, + { + "access": "public", + "destination": "2301786483822933456", + "source": "536390279563541226", + "type": "instantiation" + }, + { + "access": "public", + "destination": "551278102444647278", + "label": "factory_1", + "source": "1128300671453354325", + "type": "aggregation" + }, + { + "access": "public", + "destination": "536390279563541226", + "label": "factory_2", + "source": "1128300671453354325", + "type": "aggregation" + } + ], + "using_namespace": "clanguml::t00059" +} +``` diff --git a/docs/test_cases/t00059_class.svg b/docs/test_cases/t00059_class.svg index c784af76..8059e4aa 100644 --- a/docs/test_cases/t00059_class.svg +++ b/docs/test_cases/t00059_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + «concept» @@ -23,8 +23,8 @@ T{} t.get_name() - - + + «concept» @@ -36,8 +36,8 @@ t.get_sweetness() - - + + «concept» @@ -49,8 +49,8 @@ t.get_bitterness() - - + + gala_apple @@ -61,8 +61,8 @@ get_sweetness() const : float - - + + empire_apple @@ -73,8 +73,8 @@ get_sweetness() const : float - - + + lima_orange @@ -85,8 +85,8 @@ get_bitterness() const : float - - + + valencia_orange @@ -97,8 +97,8 @@ get_bitterness() const : float - - + + fruit_factory @@ -111,7 +111,7 @@ create_orange() const : TO - + fruit_factory @@ -119,7 +119,7 @@ gala_apple,valencia_orange - + fruit_factory @@ -127,25 +127,25 @@ empire_apple,lima_orange - - + + R - + - + factory_1 : fruit_factory_1 - + - + factory_2 : fruit_factory_2 diff --git a/docs/test_cases/t00060.md b/docs/test_cases/t00060.md index a2ebd074..f5fddcb4 100644 --- a/docs/test_cases/t00060.md +++ b/docs/test_cases/t00060.md @@ -43,3 +43,258 @@ template struct H : public G { ``` ## Generated UML diagrams ![t00060_class](./t00060_class.svg "Parents (base classes) diagram filter test case") +## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [ + { + "bases": [], + "display_name": "clanguml::t00060::A", + "id": "1373615549846303472", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "A", + "namespace": "clanguml::t00060", + "source_location": { + "file": "../../tests/t00060/t00060.cc", + "line": 3 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1373615549846303472", + "is_virtual": false, + "name": "clanguml::t00060::A" + } + ], + "display_name": "clanguml::t00060::B", + "id": "479650368930934571", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "B", + "namespace": "clanguml::t00060", + "source_location": { + "file": "../../tests/t00060/t00060.cc", + "line": 4 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1373615549846303472", + "is_virtual": false, + "name": "clanguml::t00060::A" + } + ], + "display_name": "clanguml::t00060::C", + "id": "1827660844127264787", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "C", + "namespace": "clanguml::t00060", + "source_location": { + "file": "../../tests/t00060/t00060.cc", + "line": 5 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "479650368930934571", + "is_virtual": false, + "name": "clanguml::t00060::B" + }, + { + "access": "public", + "id": "1827660844127264787", + "is_virtual": false, + "name": "clanguml::t00060::C" + } + ], + "display_name": "clanguml::t00060::D", + "id": "1629687372290281981", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": false, + "is_union": false, + "members": [], + "methods": [], + "name": "D", + "namespace": "clanguml::t00060", + "source_location": { + "file": "../../tests/t00060/t00060.cc", + "line": 6 + }, + "template_parameters": [], + "type": "class" + }, + { + "bases": [], + "display_name": "clanguml::t00060::G", + "id": "1877304825033069517", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "g", + "source_location": { + "file": "../../tests/t00060/t00060.cc", + "line": 11 + }, + "type": "T" + } + ], + "methods": [], + "name": "G", + "namespace": "clanguml::t00060", + "source_location": { + "file": "../../tests/t00060/t00060.cc", + "line": 10 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + } + ], + "type": "class" + }, + { + "bases": [ + { + "access": "public", + "id": "1877304825033069517", + "is_virtual": false, + "name": "G" + } + ], + "display_name": "clanguml::t00060::H", + "id": "1881610349123495638", + "is_abstract": false, + "is_nested": false, + "is_struct": true, + "is_template": true, + "is_union": false, + "members": [ + { + "access": "public", + "is_static": false, + "name": "h", + "source_location": { + "file": "../../tests/t00060/t00060.cc", + "line": 15 + }, + "type": "G" + }, + { + "access": "public", + "is_static": false, + "name": "hh", + "source_location": { + "file": "../../tests/t00060/t00060.cc", + "line": 16 + }, + "type": "P" + } + ], + "methods": [], + "name": "H", + "namespace": "clanguml::t00060", + "source_location": { + "file": "../../tests/t00060/t00060.cc", + "line": 14 + }, + "template_parameters": [ + { + "is_variadic": false, + "kind": "template_type", + "name": "T", + "template_parameters": [] + }, + { + "is_variadic": false, + "kind": "template_type", + "name": "P", + "template_parameters": [] + } + ], + "type": "class" + } + ], + "name": "t00060_class", + "relationships": [ + { + "access": "public", + "destination": "1373615549846303472", + "source": "479650368930934571", + "type": "extension" + }, + { + "access": "public", + "destination": "1373615549846303472", + "source": "1827660844127264787", + "type": "extension" + }, + { + "access": "public", + "destination": "479650368930934571", + "source": "1629687372290281981", + "type": "extension" + }, + { + "access": "public", + "destination": "1827660844127264787", + "source": "1629687372290281981", + "type": "extension" + }, + { + "access": "public", + "destination": "1877304825033069517", + "label": "h", + "source": "1881610349123495638", + "type": "aggregation" + }, + { + "access": "public", + "destination": "1877304825033069517", + "source": "1881610349123495638", + "type": "extension" + } + ], + "using_namespace": "clanguml::t00060" +} +``` diff --git a/docs/test_cases/t00060_class.svg b/docs/test_cases/t00060_class.svg index ce46cf35..187676ce 100644 --- a/docs/test_cases/t00060_class.svg +++ b/docs/test_cases/t00060_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + D - - + + G @@ -50,16 +50,16 @@ T - + - + g : T - - + + H @@ -67,18 +67,18 @@ T,P - + - + h : G<T> - + - + hh : P diff --git a/docs/test_cases/t20001.md b/docs/test_cases/t20001.md index 65e31390..6ff7f716 100644 --- a/docs/test_cases/t20001.md +++ b/docs/test_cases/t20001.md @@ -103,3 +103,182 @@ int tmain() ``` ## Generated UML diagrams ![t20001_sequence](./t20001_sequence.svg "Basic sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20001_sequence", + "participants": [ + { + "id": "622672604730036140", + "name": "clanguml::t20001::tmain()", + "source_location": { + "file": "../../tests/t20001/t20001.cc", + "line": 61 + }, + "type": "function" + }, + { + "id": "1771943546649183134", + "name": "clanguml::t20001::A", + "source_location": { + "file": "../../tests/t20001/t20001.cc", + "line": 13 + }, + "type": "class" + }, + { + "id": "272433898507800600", + "name": "clanguml::t20001::B", + "source_location": { + "file": "../../tests/t20001/t20001.cc", + "line": 36 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "622672604730036140", + "activity_name": "clanguml::t20001::tmain()", + "participant_id": "622672604730036140", + "participant_name": "clanguml::t20001::tmain()" + }, + "name": "add(int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20001/t20001.cc", + "line": 66 + }, + "to": { + "activity_id": "1131549932713395402", + "activity_name": "clanguml::t20001::A::add(int,int)", + "participant_id": "1771943546649183134", + "participant_name": "clanguml::t20001::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "622672604730036140", + "activity_name": "clanguml::t20001::tmain()", + "participant_id": "622672604730036140", + "participant_name": "clanguml::t20001::tmain()" + }, + "name": "wrap_add3(int,int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20001/t20001.cc", + "line": 68 + }, + "to": { + "activity_id": "642550151323208936", + "activity_name": "clanguml::t20001::B::wrap_add3(int,int,int)", + "participant_id": "272433898507800600", + "participant_name": "clanguml::t20001::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "642550151323208936", + "activity_name": "clanguml::t20001::B::wrap_add3(int,int,int)", + "participant_id": "272433898507800600", + "participant_name": "clanguml::t20001::B" + }, + "name": "add3(int,int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20001/t20001.cc", + "line": 52 + }, + "to": { + "activity_id": "2090436635449419593", + "activity_name": "clanguml::t20001::A::add3(int,int,int)", + "participant_id": "1771943546649183134", + "participant_name": "clanguml::t20001::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2090436635449419593", + "activity_name": "clanguml::t20001::A::add3(int,int,int)", + "participant_id": "1771943546649183134", + "participant_name": "clanguml::t20001::A" + }, + "name": "add(int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20001/t20001.cc", + "line": 25 + }, + "to": { + "activity_id": "1131549932713395402", + "activity_name": "clanguml::t20001::A::add(int,int)", + "participant_id": "1771943546649183134", + "participant_name": "clanguml::t20001::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2090436635449419593", + "activity_name": "clanguml::t20001::A::add3(int,int,int)", + "participant_id": "1771943546649183134", + "participant_name": "clanguml::t20001::A" + }, + "name": "log_result(int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20001/t20001.cc", + "line": 26 + }, + "to": { + "activity_id": "1205947631808952097", + "activity_name": "clanguml::t20001::A::log_result(int)", + "participant_id": "1771943546649183134", + "participant_name": "clanguml::t20001::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "642550151323208936", + "activity_name": "clanguml::t20001::B::wrap_add3(int,int,int)", + "participant_id": "272433898507800600", + "participant_name": "clanguml::t20001::B" + }, + "name": "log_result(int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20001/t20001.cc", + "line": 53 + }, + "to": { + "activity_id": "1205947631808952097", + "activity_name": "clanguml::t20001::A::log_result(int)", + "participant_id": "1771943546649183134", + "participant_name": "clanguml::t20001::A" + }, + "type": "message" + } + ], + "start_from": { + "id": 622672604730036140, + "location": "clanguml::t20001::tmain()" + } + } + ], + "using_namespace": "clanguml::t20001" +} +``` diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index 9e01b57e..9ec5af81 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,59 +9,59 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - + + + + + + + + add(int,int) - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -72,7 +72,7 @@ - + @@ -81,14 +81,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20002.md b/docs/test_cases/t20002.md index 65f8c51e..dd0e9567 100644 --- a/docs/test_cases/t20002.md +++ b/docs/test_cases/t20002.md @@ -40,3 +40,125 @@ void m1() { m2(); } ``` ## Generated UML diagrams ![t20002_sequence](./t20002_sequence.svg "Free function sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20002_sequence", + "participants": [ + { + "id": "1619421429271064154", + "name": "clanguml::t20002::m1()", + "source_location": { + "file": "../../tests/t20002/t20002.cc", + "line": 14 + }, + "type": "function" + }, + { + "id": "1575240232156112674", + "name": "clanguml::t20002::m2()", + "source_location": { + "file": "../../tests/t20002/t20002.cc", + "line": 12 + }, + "type": "function" + }, + { + "id": "1838809176089209580", + "name": "clanguml::t20002::m3()", + "source_location": { + "file": "../../tests/t20002/t20002.cc", + "line": 10 + }, + "type": "function" + }, + { + "id": "63715062711218534", + "name": "clanguml::t20002::m4()", + "source_location": { + "file": "../../tests/t20002/t20002.cc", + "line": 8 + }, + "type": "function" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1619421429271064154", + "activity_name": "clanguml::t20002::m1()", + "participant_id": "1619421429271064154", + "participant_name": "clanguml::t20002::m1()" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20002/t20002.cc", + "line": 14 + }, + "to": { + "activity_id": "1575240232156112674", + "activity_name": "clanguml::t20002::m2()", + "participant_id": "1575240232156112674", + "participant_name": "clanguml::t20002::m2()" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1575240232156112674", + "activity_name": "clanguml::t20002::m2()", + "participant_id": "1575240232156112674", + "participant_name": "clanguml::t20002::m2()" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20002/t20002.cc", + "line": 12 + }, + "to": { + "activity_id": "1838809176089209580", + "activity_name": "clanguml::t20002::m3()", + "participant_id": "1838809176089209580", + "participant_name": "clanguml::t20002::m3()" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1838809176089209580", + "activity_name": "clanguml::t20002::m3()", + "participant_id": "1838809176089209580", + "participant_name": "clanguml::t20002::m3()" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20002/t20002.cc", + "line": 10 + }, + "to": { + "activity_id": "63715062711218534", + "activity_name": "clanguml::t20002::m4()", + "participant_id": "63715062711218534", + "participant_name": "clanguml::t20002::m4()" + }, + "type": "message" + } + ], + "start_from": { + "id": 1619421429271064154, + "location": "clanguml::t20002::m1()" + } + } + ], + "using_namespace": "clanguml::t20002" +} +``` diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index 5fa454fb..f77ca2a9 100644 --- a/docs/test_cases/t20002_sequence.svg +++ b/docs/test_cases/t20002_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1() - + m1() - - + + m2() - + m2() - - + + m3() - + m3() - - + + m4() - + m4() - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20003.md b/docs/test_cases/t20003.md index f38f01e6..d4b5241e 100644 --- a/docs/test_cases/t20003.md +++ b/docs/test_cases/t20003.md @@ -36,3 +36,125 @@ template void m1(T p) { m2(p); } ``` ## Generated UML diagrams ![t20003_sequence](./t20003_sequence.svg "Function template sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20003_sequence", + "participants": [ + { + "id": "469205740799240869", + "name": "clanguml::t20003::m1(T)", + "source_location": { + "file": "../../tests/t20003/t20003.cc", + "line": 10 + }, + "type": "function_template" + }, + { + "id": "1502957449367040488", + "name": "clanguml::t20003::m2(T)", + "source_location": { + "file": "../../tests/t20003/t20003.cc", + "line": 8 + }, + "type": "function_template" + }, + { + "id": "613477682313507585", + "name": "clanguml::t20003::m3(T)", + "source_location": { + "file": "../../tests/t20003/t20003.cc", + "line": 6 + }, + "type": "function_template" + }, + { + "id": "619960023608507925", + "name": "clanguml::t20003::m4(T)", + "source_location": { + "file": "../../tests/t20003/t20003.cc", + "line": 4 + }, + "type": "function_template" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "469205740799240869", + "activity_name": "clanguml::t20003::m1(T)", + "participant_id": "469205740799240869", + "participant_name": "clanguml::t20003::m1(T)" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20003/t20003.cc", + "line": 10 + }, + "to": { + "activity_id": "1502957449367040488", + "activity_name": "clanguml::t20003::m2(T)", + "participant_id": "1502957449367040488", + "participant_name": "clanguml::t20003::m2(T)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1502957449367040488", + "activity_name": "clanguml::t20003::m2(T)", + "participant_id": "1502957449367040488", + "participant_name": "clanguml::t20003::m2(T)" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20003/t20003.cc", + "line": 8 + }, + "to": { + "activity_id": "613477682313507585", + "activity_name": "clanguml::t20003::m3(T)", + "participant_id": "613477682313507585", + "participant_name": "clanguml::t20003::m3(T)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "613477682313507585", + "activity_name": "clanguml::t20003::m3(T)", + "participant_id": "613477682313507585", + "participant_name": "clanguml::t20003::m3(T)" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20003/t20003.cc", + "line": 6 + }, + "to": { + "activity_id": "619960023608507925", + "activity_name": "clanguml::t20003::m4(T)", + "participant_id": "619960023608507925", + "participant_name": "clanguml::t20003::m4(T)" + }, + "type": "message" + } + ], + "start_from": { + "id": 469205740799240869, + "location": "clanguml::t20003::m1(T)" + } + } + ], + "using_namespace": "clanguml::t20003" +} +``` diff --git a/docs/test_cases/t20003_sequence.svg b/docs/test_cases/t20003_sequence.svg index a24732b3..a000e488 100644 --- a/docs/test_cases/t20003_sequence.svg +++ b/docs/test_cases/t20003_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1<T>(T) - + m1<T>(T) - - + + m2<T>(T) - + m2<T>(T) - - + + m3<T>(T) - + m3<T>(T) - - + + m4<T>(T) - + m4<T>(T) - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20004.md b/docs/test_cases/t20004.md index 6d9fdd8d..7e61a578 100644 --- a/docs/test_cases/t20004.md +++ b/docs/test_cases/t20004.md @@ -72,3 +72,311 @@ int main() ``` ## Generated UML diagrams ![t20004_sequence](./t20004_sequence.svg "Function template instantiation sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20004_sequence", + "participants": [ + { + "id": "2299662004367884401", + "name": "clanguml::t20004::main()", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 38 + }, + "type": "function" + }, + { + "id": "138925040763435897", + "name": "clanguml::t20004::m1(float)", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 26 + }, + "type": "function_template" + }, + { + "id": "1239083518717603720", + "name": "clanguml::t20004::m1(unsigned long)", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 28 + }, + "type": "function_template" + }, + { + "id": "376599675205498367", + "name": "clanguml::t20004::m4(unsigned long)", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 10 + }, + "type": "function_template" + }, + { + "id": "1845817984839618223", + "name": "clanguml::t20004::m1(std::string)", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 33 + }, + "type": "function_template" + }, + { + "id": "1735054254122948614", + "name": "clanguml::t20004::m2(std::string)", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 19 + }, + "type": "function_template" + }, + { + "id": "121663532044911922", + "name": "clanguml::t20004::m1(int)", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 24 + }, + "type": "function_template" + }, + { + "id": "1475362124497386656", + "name": "clanguml::t20004::m2(int)", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 17 + }, + "type": "function_template" + }, + { + "id": "734999226157549914", + "name": "clanguml::t20004::m3(int)", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 15 + }, + "type": "function_template" + }, + { + "id": "1006390865908497562", + "name": "clanguml::t20004::m4(int)", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 8 + }, + "type": "function_template" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "2299662004367884401", + "activity_name": "clanguml::t20004::main()", + "participant_id": "2299662004367884401", + "participant_name": "clanguml::t20004::main()" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 40 + }, + "to": { + "activity_id": "138925040763435897", + "activity_name": "clanguml::t20004::m1(float)", + "participant_id": "138925040763435897", + "participant_name": "clanguml::t20004::m1(float)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2299662004367884401", + "activity_name": "clanguml::t20004::main()", + "participant_id": "2299662004367884401", + "participant_name": "clanguml::t20004::main()" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 42 + }, + "to": { + "activity_id": "1239083518717603720", + "activity_name": "clanguml::t20004::m1(unsigned long)", + "participant_id": "1239083518717603720", + "participant_name": "clanguml::t20004::m1(unsigned long)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1239083518717603720", + "activity_name": "clanguml::t20004::m1(unsigned long)", + "participant_id": "1239083518717603720", + "participant_name": "clanguml::t20004::m1(unsigned long)" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 30 + }, + "to": { + "activity_id": "376599675205498367", + "activity_name": "clanguml::t20004::m4(unsigned long)", + "participant_id": "376599675205498367", + "participant_name": "clanguml::t20004::m4(unsigned long)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2299662004367884401", + "activity_name": "clanguml::t20004::main()", + "participant_id": "2299662004367884401", + "participant_name": "clanguml::t20004::main()" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 44 + }, + "to": { + "activity_id": "1845817984839618223", + "activity_name": "clanguml::t20004::m1(std::string)", + "participant_id": "1845817984839618223", + "participant_name": "clanguml::t20004::m1(std::string)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1845817984839618223", + "activity_name": "clanguml::t20004::m1(std::string)", + "participant_id": "1845817984839618223", + "participant_name": "clanguml::t20004::m1(std::string)" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 35 + }, + "to": { + "activity_id": "1735054254122948614", + "activity_name": "clanguml::t20004::m2(std::string)", + "participant_id": "1735054254122948614", + "participant_name": "clanguml::t20004::m2(std::string)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2299662004367884401", + "activity_name": "clanguml::t20004::main()", + "participant_id": "2299662004367884401", + "participant_name": "clanguml::t20004::main()" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 46 + }, + "to": { + "activity_id": "121663532044911922", + "activity_name": "clanguml::t20004::m1(int)", + "participant_id": "121663532044911922", + "participant_name": "clanguml::t20004::m1(int)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "121663532044911922", + "activity_name": "clanguml::t20004::m1(int)", + "participant_id": "121663532044911922", + "participant_name": "clanguml::t20004::m1(int)" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 24 + }, + "to": { + "activity_id": "1475362124497386656", + "activity_name": "clanguml::t20004::m2(int)", + "participant_id": "1475362124497386656", + "participant_name": "clanguml::t20004::m2(int)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1475362124497386656", + "activity_name": "clanguml::t20004::m2(int)", + "participant_id": "1475362124497386656", + "participant_name": "clanguml::t20004::m2(int)" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 17 + }, + "to": { + "activity_id": "734999226157549914", + "activity_name": "clanguml::t20004::m3(int)", + "participant_id": "734999226157549914", + "participant_name": "clanguml::t20004::m3(int)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "734999226157549914", + "activity_name": "clanguml::t20004::m3(int)", + "participant_id": "734999226157549914", + "participant_name": "clanguml::t20004::m3(int)" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20004/t20004.cc", + "line": 15 + }, + "to": { + "activity_id": "1006390865908497562", + "activity_name": "clanguml::t20004::m4(int)", + "participant_id": "1006390865908497562", + "participant_name": "clanguml::t20004::m4(int)" + }, + "type": "message" + } + ], + "start_from": { + "id": 2299662004367884401, + "location": "clanguml::t20004::main()" + } + } + ], + "using_namespace": "clanguml::t20004" +} +``` diff --git a/docs/test_cases/t20004_sequence.svg b/docs/test_cases/t20004_sequence.svg index fd57b6f7..9449b5f1 100644 --- a/docs/test_cases/t20004_sequence.svg +++ b/docs/test_cases/t20004_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -29,87 +29,87 @@ - - + + main() - + main() - - + + m1<float>(float) - + m1<float>(float) - - + + m1<unsigned long>(unsigned long) - + m1<unsigned long>(unsigned long) - - + + m4<unsigned long>(unsigned long) - + m4<unsigned long>(unsigned long) - - + + m1<std::string>(std::string) - + m1<std::string>(std::string) - - + + m2<std::string>(std::string) - + m2<std::string>(std::string) - - + + m1<int>(int) - + m1<int>(int) - - + + m2<int>(int) - + m2<int>(int) - - + + m3<int>(int) - + m3<int>(int) - - + + m4<int>(int) - + m4<int>(int) - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -117,11 +117,11 @@ - + - + @@ -129,19 +129,19 @@ - + - + - + - + diff --git a/docs/test_cases/t20005.md b/docs/test_cases/t20005.md index d3d4e8c9..dea3b4ad 100644 --- a/docs/test_cases/t20005.md +++ b/docs/test_cases/t20005.md @@ -43,3 +43,94 @@ template struct C { ``` ## Generated UML diagrams ![t20005_sequence](./t20005_sequence.svg "Class template basic sequence diagram") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20005_sequence", + "participants": [ + { + "id": "365569130532127604", + "name": "clanguml::t20005::C", + "source_location": { + "file": "../../tests/t20005/t20005.cc", + "line": 14 + }, + "type": "class" + }, + { + "id": "666000829532846850", + "name": "clanguml::t20005::B", + "source_location": { + "file": "../../tests/t20005/t20005.cc", + "line": 8 + }, + "type": "class" + }, + { + "id": "1278330455625941185", + "name": "clanguml::t20005::A", + "source_location": { + "file": "../../tests/t20005/t20005.cc", + "line": 4 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "578718872965404973", + "activity_name": "clanguml::t20005::C::c(T)", + "participant_id": "365569130532127604", + "participant_name": "clanguml::t20005::C" + }, + "name": "b(T)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20005/t20005.cc", + "line": 15 + }, + "to": { + "activity_id": "870466496899932117", + "activity_name": "clanguml::t20005::B::b(T)", + "participant_id": "666000829532846850", + "participant_name": "clanguml::t20005::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "870466496899932117", + "activity_name": "clanguml::t20005::B::b(T)", + "participant_id": "666000829532846850", + "participant_name": "clanguml::t20005::B" + }, + "name": "a(T)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20005/t20005.cc", + "line": 9 + }, + "to": { + "activity_id": "124853455814403745", + "activity_name": "clanguml::t20005::A::a(T)", + "participant_id": "1278330455625941185", + "participant_name": "clanguml::t20005::A" + }, + "type": "message" + } + ], + "start_from": { + "id": 578718872965404973, + "location": "clanguml::t20005::C::c(T)" + } + } + ], + "using_namespace": "clanguml::t20005" +} +``` diff --git a/docs/test_cases/t20005_sequence.svg b/docs/test_cases/t20005_sequence.svg index e6ecf1ba..9bc92713 100644 --- a/docs/test_cases/t20005_sequence.svg +++ b/docs/test_cases/t20005_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - + + + - - + + C<T> - + C<T> - - + + B<T> - + B<T> - - + + A<T> - + A<T> - - - + + + c(T) - + b(T) - + a(T) diff --git a/docs/test_cases/t20006.md b/docs/test_cases/t20006.md index 6f766f95..46365896 100644 --- a/docs/test_cases/t20006.md +++ b/docs/test_cases/t20006.md @@ -101,3 +101,434 @@ void tmain() ``` ## Generated UML diagrams ![t20006_sequence](./t20006_sequence.svg "Class template specialization basic sequence diagram") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20006_sequence", + "participants": [ + { + "id": "363965584448680958", + "name": "clanguml::t20006::tmain()", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 57 + }, + "type": "function" + }, + { + "id": "2197760498261923035", + "name": "clanguml::t20006::B", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 11 + }, + "type": "class" + }, + { + "id": "596484796124829039", + "name": "clanguml::t20006::A", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "2102622661983365981", + "name": "clanguml::t20006::B", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 16 + }, + "type": "class" + }, + { + "id": "413459875415381273", + "name": "clanguml::t20006::A", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "264392653889863384", + "name": "clanguml::t20006::BB", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 26 + }, + "type": "class" + }, + { + "id": "1903567228894636312", + "name": "clanguml::t20006::AA", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 21 + }, + "type": "class" + }, + { + "id": "2269742833301555472", + "name": "clanguml::t20006::BB", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 33 + }, + "type": "class" + }, + { + "id": "1743503037360505162", + "name": "clanguml::t20006::BB", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 45 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "363965584448680958", + "activity_name": "clanguml::t20006::tmain()", + "participant_id": "363965584448680958", + "participant_name": "clanguml::t20006::tmain()" + }, + "name": "b(int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 62 + }, + "to": { + "activity_id": "250247217888843587", + "activity_name": "clanguml::t20006::B::b(int)", + "participant_id": "2197760498261923035", + "participant_name": "clanguml::t20006::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "250247217888843587", + "activity_name": "clanguml::t20006::B::b(int)", + "participant_id": "2197760498261923035", + "participant_name": "clanguml::t20006::B" + }, + "name": "a1(int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 12 + }, + "to": { + "activity_id": "196390487987395669", + "activity_name": "clanguml::t20006::A::a1(int)", + "participant_id": "596484796124829039", + "participant_name": "clanguml::t20006::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "363965584448680958", + "activity_name": "clanguml::t20006::tmain()", + "participant_id": "363965584448680958", + "participant_name": "clanguml::t20006::tmain()" + }, + "name": "b(std::string)", + "return_type": "std::string", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 63 + }, + "to": { + "activity_id": "13049632552871157", + "activity_name": "clanguml::t20006::B::b(std::string)", + "participant_id": "2102622661983365981", + "participant_name": "clanguml::t20006::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "13049632552871157", + "activity_name": "clanguml::t20006::B::b(std::string)", + "participant_id": "2102622661983365981", + "participant_name": "clanguml::t20006::B" + }, + "name": "a2(std::string)", + "return_type": "class std::basic_string", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 17 + }, + "to": { + "activity_id": "11762588624112907", + "activity_name": "clanguml::t20006::A::a2(std::string)", + "participant_id": "413459875415381273", + "participant_name": "clanguml::t20006::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "363965584448680958", + "activity_name": "clanguml::t20006::tmain()", + "participant_id": "363965584448680958", + "participant_name": "clanguml::t20006::tmain()" + }, + "name": "bb1(int,int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 70 + }, + "to": { + "activity_id": "1213865121829347654", + "activity_name": "clanguml::t20006::BB::bb1(int,int)", + "participant_id": "264392653889863384", + "participant_name": "clanguml::t20006::BB" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1213865121829347654", + "activity_name": "clanguml::t20006::BB::bb1(int,int)", + "participant_id": "264392653889863384", + "participant_name": "clanguml::t20006::BB" + }, + "name": "aa1(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 27 + }, + "to": { + "activity_id": "1235428163990670191", + "activity_name": "clanguml::t20006::AA::aa1(int)", + "participant_id": "1903567228894636312", + "participant_name": "clanguml::t20006::AA" + }, + "type": "message" + }, + { + "from": { + "activity_id": "363965584448680958", + "activity_name": "clanguml::t20006::tmain()", + "participant_id": "363965584448680958", + "participant_name": "clanguml::t20006::tmain()" + }, + "name": "bb2(int,int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 71 + }, + "to": { + "activity_id": "361650123916792854", + "activity_name": "clanguml::t20006::BB::bb2(int,int)", + "participant_id": "264392653889863384", + "participant_name": "clanguml::t20006::BB" + }, + "type": "message" + }, + { + "from": { + "activity_id": "361650123916792854", + "activity_name": "clanguml::t20006::BB::bb2(int,int)", + "participant_id": "264392653889863384", + "participant_name": "clanguml::t20006::BB" + }, + "name": "aa2(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 28 + }, + "to": { + "activity_id": "582097827335267290", + "activity_name": "clanguml::t20006::AA::aa2(int)", + "participant_id": "1903567228894636312", + "participant_name": "clanguml::t20006::AA" + }, + "type": "message" + }, + { + "from": { + "activity_id": "363965584448680958", + "activity_name": "clanguml::t20006::tmain()", + "participant_id": "363965584448680958", + "participant_name": "clanguml::t20006::tmain()" + }, + "name": "bb1(int,std::string)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 73 + }, + "to": { + "activity_id": "1062874005712014125", + "activity_name": "clanguml::t20006::BB::bb1(int,std::string)", + "participant_id": "2269742833301555472", + "participant_name": "clanguml::t20006::BB" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1062874005712014125", + "activity_name": "clanguml::t20006::BB::bb1(int,std::string)", + "participant_id": "2269742833301555472", + "participant_name": "clanguml::t20006::BB" + }, + "name": "aa2(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 34 + }, + "to": { + "activity_id": "582097827335267290", + "activity_name": "clanguml::t20006::AA::aa2(int)", + "participant_id": "1903567228894636312", + "participant_name": "clanguml::t20006::AA" + }, + "type": "message" + }, + { + "from": { + "activity_id": "363965584448680958", + "activity_name": "clanguml::t20006::tmain()", + "participant_id": "363965584448680958", + "participant_name": "clanguml::t20006::tmain()" + }, + "name": "bb2(int,std::string)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 74 + }, + "to": { + "activity_id": "787705189994778234", + "activity_name": "clanguml::t20006::BB::bb2(int,std::string)", + "participant_id": "2269742833301555472", + "participant_name": "clanguml::t20006::BB" + }, + "type": "message" + }, + { + "from": { + "activity_id": "787705189994778234", + "activity_name": "clanguml::t20006::BB::bb2(int,std::string)", + "participant_id": "2269742833301555472", + "participant_name": "clanguml::t20006::BB" + }, + "name": "aa1(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 35 + }, + "to": { + "activity_id": "1235428163990670191", + "activity_name": "clanguml::t20006::AA::aa1(int)", + "participant_id": "1903567228894636312", + "participant_name": "clanguml::t20006::AA" + }, + "type": "message" + }, + { + "from": { + "activity_id": "363965584448680958", + "activity_name": "clanguml::t20006::tmain()", + "participant_id": "363965584448680958", + "participant_name": "clanguml::t20006::tmain()" + }, + "name": "bb1(int,float)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 76 + }, + "to": { + "activity_id": "1463188845572485713", + "activity_name": "clanguml::t20006::BB::bb1(int,float)", + "participant_id": "1743503037360505162", + "participant_name": "clanguml::t20006::BB" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1463188845572485713", + "activity_name": "clanguml::t20006::BB::bb1(int,float)", + "participant_id": "1743503037360505162", + "participant_name": "clanguml::t20006::BB" + }, + "name": "bb2(int,float)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 46 + }, + "to": { + "activity_id": "732362671329401903", + "activity_name": "clanguml::t20006::BB::bb2(int,float)", + "participant_id": "1743503037360505162", + "participant_name": "clanguml::t20006::BB" + }, + "type": "message" + }, + { + "from": { + "activity_id": "732362671329401903", + "activity_name": "clanguml::t20006::BB::bb2(int,float)", + "participant_id": "1743503037360505162", + "participant_name": "clanguml::t20006::BB" + }, + "name": "aa2(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20006/t20006.cc", + "line": 47 + }, + "to": { + "activity_id": "582097827335267290", + "activity_name": "clanguml::t20006::AA::aa2(int)", + "participant_id": "1903567228894636312", + "participant_name": "clanguml::t20006::AA" + }, + "type": "message" + } + ], + "start_from": { + "id": 363965584448680958, + "location": "clanguml::t20006::tmain()" + } + } + ], + "using_namespace": "clanguml::t20006" +} +``` diff --git a/docs/test_cases/t20006_sequence.svg b/docs/test_cases/t20006_sequence.svg index 01f4bdf4..c9b07bdc 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -34,82 +34,82 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -118,12 +118,12 @@ - + b(std::string) - + a2(std::string) @@ -132,59 +132,59 @@ - + bb1(int,int) - + aa1(int) - + bb2(int,int) - + aa2(int) - + bb1(int,std::string) - + aa2(int) - + bb2(int,std::string) - + aa1(int) - + bb1(int,float) - + bb2(int,float) - + aa2(int) diff --git a/docs/test_cases/t20007.md b/docs/test_cases/t20007.md index 37f55b34..f00e6272 100644 --- a/docs/test_cases/t20007.md +++ b/docs/test_cases/t20007.md @@ -47,3 +47,125 @@ void tmain() ``` ## Generated UML diagrams ![t20007_sequence](./t20007_sequence.svg "Class template variadic argument list sequence diagram") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20007_sequence", + "participants": [ + { + "id": "622662006747239840", + "name": "clanguml::t20007::tmain()", + "source_location": { + "file": "../../tests/t20007/t20007.cc", + "line": 11 + }, + "type": "function" + }, + { + "id": "1742497005509009302", + "name": "clanguml::t20007::Adder", + "source_location": { + "file": "../../tests/t20007/t20007.cc", + "line": 7 + }, + "type": "class" + }, + { + "id": "599640474306956868", + "name": "clanguml::t20007::Adder", + "source_location": { + "file": "../../tests/t20007/t20007.cc", + "line": 7 + }, + "type": "class" + }, + { + "id": "228191787514523926", + "name": "clanguml::t20007::Adder", + "source_location": { + "file": "../../tests/t20007/t20007.cc", + "line": 7 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "622662006747239840", + "activity_name": "clanguml::t20007::tmain()", + "participant_id": "622662006747239840", + "participant_name": "clanguml::t20007::tmain()" + }, + "name": "add(int &&,int &&)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20007/t20007.cc", + "line": 19 + }, + "to": { + "activity_id": "438133719207269065", + "activity_name": "clanguml::t20007::Adder::add(int &&,int &&)", + "participant_id": "1742497005509009302", + "participant_name": "clanguml::t20007::Adder" + }, + "type": "message" + }, + { + "from": { + "activity_id": "622662006747239840", + "activity_name": "clanguml::t20007::tmain()", + "participant_id": "622662006747239840", + "participant_name": "clanguml::t20007::tmain()" + }, + "name": "add(int &&,float &&,double &&)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20007/t20007.cc", + "line": 20 + }, + "to": { + "activity_id": "9522724767688870", + "activity_name": "clanguml::t20007::Adder::add(int &&,float &&,double &&)", + "participant_id": "599640474306956868", + "participant_name": "clanguml::t20007::Adder" + }, + "type": "message" + }, + { + "from": { + "activity_id": "622662006747239840", + "activity_name": "clanguml::t20007::tmain()", + "participant_id": "622662006747239840", + "participant_name": "clanguml::t20007::tmain()" + }, + "name": "add(std::string &&,std::string &&,std::string &&)", + "return_type": "class std::basic_string", + "scope": "normal", + "source_location": { + "file": "../../tests/t20007/t20007.cc", + "line": 21 + }, + "to": { + "activity_id": "384866641042941480", + "activity_name": "clanguml::t20007::Adder::add(std::string &&,std::string &&,std::string &&)", + "participant_id": "228191787514523926", + "participant_name": "clanguml::t20007::Adder" + }, + "type": "message" + } + ], + "start_from": { + "id": 622662006747239840, + "location": "clanguml::t20007::tmain()" + } + } + ], + "using_namespace": "clanguml::t20007" +} +``` diff --git a/docs/test_cases/t20007_sequence.svg b/docs/test_cases/t20007_sequence.svg index 931fac7a..6c6e56fb 100644 --- a/docs/test_cases/t20007_sequence.svg +++ b/docs/test_cases/t20007_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + Adder<int,int> - + Adder<int,int> - - + + Adder<int,float,double> - + Adder<int,float,double> - - + + Adder<std::string,std::string,std::string> - + Adder<std::string,std::string,std::string> - - - - - + + + + + add(int &&,int &&) - + add(int &&,float &&,double &&) - + add(std::string &&,std::string &&,std::string &&) diff --git a/docs/test_cases/t20008.md b/docs/test_cases/t20008.md index e2ca37a0..033e8431 100644 --- a/docs/test_cases/t20008.md +++ b/docs/test_cases/t20008.md @@ -65,3 +65,218 @@ void tmain() ``` ## Generated UML diagrams ![t20008_sequence](./t20008_sequence.svg "Constexpr if sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20008_sequence", + "participants": [ + { + "id": "1180776240543224244", + "name": "clanguml::t20008::tmain()", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 30 + }, + "type": "function" + }, + { + "id": "1906510289157013670", + "name": "clanguml::t20008::B", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 13 + }, + "type": "class" + }, + { + "id": "1376149084762923197", + "name": "clanguml::t20008::A", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 7 + }, + "type": "class" + }, + { + "id": "867098551202196741", + "name": "clanguml::t20008::B", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 13 + }, + "type": "class" + }, + { + "id": "144833378017373200", + "name": "clanguml::t20008::A", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 7 + }, + "type": "class" + }, + { + "id": "927702553742507923", + "name": "clanguml::t20008::B", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 13 + }, + "type": "class" + }, + { + "id": "390605614583363778", + "name": "clanguml::t20008::A", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 7 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1180776240543224244", + "activity_name": "clanguml::t20008::tmain()", + "participant_id": "1180776240543224244", + "participant_name": "clanguml::t20008::tmain()" + }, + "name": "b(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 38 + }, + "to": { + "activity_id": "379850145437051189", + "activity_name": "clanguml::t20008::B::b(int)", + "participant_id": "1906510289157013670", + "participant_name": "clanguml::t20008::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "379850145437051189", + "activity_name": "clanguml::t20008::B::b(int)", + "participant_id": "1906510289157013670", + "participant_name": "clanguml::t20008::B" + }, + "name": "a1(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 19 + }, + "to": { + "activity_id": "2066363630174644719", + "activity_name": "clanguml::t20008::A::a1(int)", + "participant_id": "1376149084762923197", + "participant_name": "clanguml::t20008::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1180776240543224244", + "activity_name": "clanguml::t20008::tmain()", + "participant_id": "1180776240543224244", + "participant_name": "clanguml::t20008::tmain()" + }, + "name": "b(const char *)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 39 + }, + "to": { + "activity_id": "1347162523481637780", + "activity_name": "clanguml::t20008::B::b(const char *)", + "participant_id": "867098551202196741", + "participant_name": "clanguml::t20008::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1347162523481637780", + "activity_name": "clanguml::t20008::B::b(const char *)", + "participant_id": "867098551202196741", + "participant_name": "clanguml::t20008::B" + }, + "name": "a2(const char *)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 22 + }, + "to": { + "activity_id": "718650834962275580", + "activity_name": "clanguml::t20008::A::a2(const char *)", + "participant_id": "144833378017373200", + "participant_name": "clanguml::t20008::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1180776240543224244", + "activity_name": "clanguml::t20008::tmain()", + "participant_id": "1180776240543224244", + "participant_name": "clanguml::t20008::tmain()" + }, + "name": "b(std::string)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 40 + }, + "to": { + "activity_id": "1286410946666951254", + "activity_name": "clanguml::t20008::B::b(std::string)", + "participant_id": "927702553742507923", + "participant_name": "clanguml::t20008::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1286410946666951254", + "activity_name": "clanguml::t20008::B::b(std::string)", + "participant_id": "927702553742507923", + "participant_name": "clanguml::t20008::B" + }, + "name": "a3(std::string)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20008/t20008.cc", + "line": 25 + }, + "to": { + "activity_id": "1404594247101138737", + "activity_name": "clanguml::t20008::A::a3(std::string)", + "participant_id": "390605614583363778", + "participant_name": "clanguml::t20008::A" + }, + "type": "message" + } + ], + "start_from": { + "id": 1180776240543224244, + "location": "clanguml::t20008::tmain()" + } + } + ], + "using_namespace": "clanguml::t20008" +} +``` diff --git a/docs/test_cases/t20008_sequence.svg b/docs/test_cases/t20008_sequence.svg index 90eb3492..3082972e 100644 --- a/docs/test_cases/t20008_sequence.svg +++ b/docs/test_cases/t20008_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<const char *> - + B<const char *> - - + + A<const char *> - + A<const char *> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - - - - - - - + + + + + + + + b(int) - + a1(int) - + b(const char *) - + a2(const char *) - + b(std::string) - + a3(std::string) diff --git a/docs/test_cases/t20009.md b/docs/test_cases/t20009.md index e73dcf56..03b914e8 100644 --- a/docs/test_cases/t20009.md +++ b/docs/test_cases/t20009.md @@ -51,3 +51,218 @@ void tmain() ``` ## Generated UML diagrams ![t20009_sequence](./t20009_sequence.svg "Smart pointer dereference call expression test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20009_sequence", + "participants": [ + { + "id": "791066686606379857", + "name": "clanguml::t20009::tmain()", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 18 + }, + "type": "function" + }, + { + "id": "450813573860627679", + "name": "clanguml::t20009::B", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 10 + }, + "type": "class" + }, + { + "id": "1197403810800583218", + "name": "clanguml::t20009::A", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "2002310682025149090", + "name": "clanguml::t20009::B", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 10 + }, + "type": "class" + }, + { + "id": "1228498754558363121", + "name": "clanguml::t20009::A", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "1461902328659683203", + "name": "clanguml::t20009::B", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 10 + }, + "type": "class" + }, + { + "id": "1243520246309441967", + "name": "clanguml::t20009::A", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 6 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "791066686606379857", + "activity_name": "clanguml::t20009::tmain()", + "participant_id": "791066686606379857", + "participant_name": "clanguml::t20009::tmain()" + }, + "name": "b(std::string)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 24 + }, + "to": { + "activity_id": "1960266381909090879", + "activity_name": "clanguml::t20009::B::b(std::string)", + "participant_id": "450813573860627679", + "participant_name": "clanguml::t20009::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1960266381909090879", + "activity_name": "clanguml::t20009::B::b(std::string)", + "participant_id": "450813573860627679", + "participant_name": "clanguml::t20009::B" + }, + "name": "a(std::string)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 11 + }, + "to": { + "activity_id": "1716775846967761286", + "activity_name": "clanguml::t20009::A::a(std::string)", + "participant_id": "1197403810800583218", + "participant_name": "clanguml::t20009::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "791066686606379857", + "activity_name": "clanguml::t20009::tmain()", + "participant_id": "791066686606379857", + "participant_name": "clanguml::t20009::tmain()" + }, + "name": "b(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 25 + }, + "to": { + "activity_id": "660557928399203634", + "activity_name": "clanguml::t20009::B::b(int)", + "participant_id": "2002310682025149090", + "participant_name": "clanguml::t20009::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "660557928399203634", + "activity_name": "clanguml::t20009::B::b(int)", + "participant_id": "2002310682025149090", + "participant_name": "clanguml::t20009::B" + }, + "name": "a(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 11 + }, + "to": { + "activity_id": "2030629454810805092", + "activity_name": "clanguml::t20009::A::a(int)", + "participant_id": "1228498754558363121", + "participant_name": "clanguml::t20009::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "791066686606379857", + "activity_name": "clanguml::t20009::tmain()", + "participant_id": "791066686606379857", + "participant_name": "clanguml::t20009::tmain()" + }, + "name": "b(float)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 26 + }, + "to": { + "activity_id": "367805163135583282", + "activity_name": "clanguml::t20009::B::b(float)", + "participant_id": "1461902328659683203", + "participant_name": "clanguml::t20009::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "367805163135583282", + "activity_name": "clanguml::t20009::B::b(float)", + "participant_id": "1461902328659683203", + "participant_name": "clanguml::t20009::B" + }, + "name": "a(float)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20009/t20009.cc", + "line": 11 + }, + "to": { + "activity_id": "1643733911490581293", + "activity_name": "clanguml::t20009::A::a(float)", + "participant_id": "1243520246309441967", + "participant_name": "clanguml::t20009::A" + }, + "type": "message" + } + ], + "start_from": { + "id": 791066686606379857, + "location": "clanguml::t20009::tmain()" + } + } + ], + "using_namespace": "clanguml::t20009" +} +``` diff --git a/docs/test_cases/t20009_sequence.svg b/docs/test_cases/t20009_sequence.svg index ddf296cb..228e46bc 100644 --- a/docs/test_cases/t20009_sequence.svg +++ b/docs/test_cases/t20009_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<float> - + B<float> - - + + A<float> - + A<float> - - - - - - - - + + + + + + + + b(std::string) - + a(std::string) - + b(int) - + a(int) - + b(float) - + a(float) diff --git a/docs/test_cases/t20010.md b/docs/test_cases/t20010.md index 0a067b96..c9d3ece1 100644 --- a/docs/test_cases/t20010.md +++ b/docs/test_cases/t20010.md @@ -61,3 +61,226 @@ void tmain() ``` ## Generated UML diagrams ![t20010_sequence](./t20010_sequence.svg "Container sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20010_sequence", + "participants": [ + { + "id": "1364660609791735244", + "name": "clanguml::t20010::tmain()", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 28 + }, + "type": "function" + }, + { + "id": "2154977200904210115", + "name": "clanguml::t20010::B", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 16 + }, + "type": "class" + }, + { + "id": "102070351492425113", + "name": "clanguml::t20010::A", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 9 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1364660609791735244", + "activity_name": "clanguml::t20010::tmain()", + "participant_id": "1364660609791735244", + "participant_name": "clanguml::t20010::tmain()" + }, + "name": "b1()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 32 + }, + "to": { + "activity_id": "343626060927491836", + "activity_name": "clanguml::t20010::B::b1()", + "participant_id": "2154977200904210115", + "participant_name": "clanguml::t20010::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "343626060927491836", + "activity_name": "clanguml::t20010::B::b1()", + "participant_id": "2154977200904210115", + "participant_name": "clanguml::t20010::B" + }, + "name": "a1()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 17 + }, + "to": { + "activity_id": "981184681827469850", + "activity_name": "clanguml::t20010::A::a1()", + "participant_id": "102070351492425113", + "participant_name": "clanguml::t20010::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1364660609791735244", + "activity_name": "clanguml::t20010::tmain()", + "participant_id": "1364660609791735244", + "participant_name": "clanguml::t20010::tmain()" + }, + "name": "b2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 33 + }, + "to": { + "activity_id": "1633031113603062043", + "activity_name": "clanguml::t20010::B::b2()", + "participant_id": "2154977200904210115", + "participant_name": "clanguml::t20010::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1633031113603062043", + "activity_name": "clanguml::t20010::B::b2()", + "participant_id": "2154977200904210115", + "participant_name": "clanguml::t20010::B" + }, + "name": "a2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 18 + }, + "to": { + "activity_id": "664370880632146592", + "activity_name": "clanguml::t20010::A::a2()", + "participant_id": "102070351492425113", + "participant_name": "clanguml::t20010::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1364660609791735244", + "activity_name": "clanguml::t20010::tmain()", + "participant_id": "1364660609791735244", + "participant_name": "clanguml::t20010::tmain()" + }, + "name": "b3()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 34 + }, + "to": { + "activity_id": "786218543654309692", + "activity_name": "clanguml::t20010::B::b3()", + "participant_id": "2154977200904210115", + "participant_name": "clanguml::t20010::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "786218543654309692", + "activity_name": "clanguml::t20010::B::b3()", + "participant_id": "2154977200904210115", + "participant_name": "clanguml::t20010::B" + }, + "name": "a3()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 19 + }, + "to": { + "activity_id": "2145739294823015899", + "activity_name": "clanguml::t20010::A::a3()", + "participant_id": "102070351492425113", + "participant_name": "clanguml::t20010::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1364660609791735244", + "activity_name": "clanguml::t20010::tmain()", + "participant_id": "1364660609791735244", + "participant_name": "clanguml::t20010::tmain()" + }, + "name": "b4()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 35 + }, + "to": { + "activity_id": "1866068965397702666", + "activity_name": "clanguml::t20010::B::b4()", + "participant_id": "2154977200904210115", + "participant_name": "clanguml::t20010::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1866068965397702666", + "activity_name": "clanguml::t20010::B::b4()", + "participant_id": "2154977200904210115", + "participant_name": "clanguml::t20010::B" + }, + "name": "a4()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20010/t20010.cc", + "line": 20 + }, + "to": { + "activity_id": "1224936485834400821", + "activity_name": "clanguml::t20010::A::a4()", + "participant_id": "102070351492425113", + "participant_name": "clanguml::t20010::A" + }, + "type": "message" + } + ], + "start_from": { + "id": 1364660609791735244, + "location": "clanguml::t20010::tmain()" + } + } + ], + "using_namespace": "clanguml::t20010" +} +``` diff --git a/docs/test_cases/t20010_sequence.svg b/docs/test_cases/t20010_sequence.svg index 020e4ec8..f6da7b82 100644 --- a/docs/test_cases/t20010_sequence.svg +++ b/docs/test_cases/t20010_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A - + A - - - - - - - - - - + + + + + + + + + + b1() - + a1() - + b2() - + a2() - + b3() - + a3() - + b4() - + a4() diff --git a/docs/test_cases/t20011.md b/docs/test_cases/t20011.md index 3c9f43ef..cd14b480 100644 --- a/docs/test_cases/t20011.md +++ b/docs/test_cases/t20011.md @@ -53,3 +53,219 @@ void tmain() ``` ## Generated UML diagrams ![t20011_sequence](./t20011_sequence.svg "Recursive calls sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20011_sequence", + "participants": [ + { + "id": "1866210527166391126", + "name": "clanguml::t20011::tmain()", + "source_location": { + "file": "../../tests/t20011/t20011.cc", + "line": 22 + }, + "type": "function" + }, + { + "id": "816061502062128285", + "name": "clanguml::t20011::A", + "source_location": { + "file": "../../tests/t20011/t20011.cc", + "line": 4 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1866210527166391126", + "activity_name": "clanguml::t20011::tmain()", + "participant_id": "1866210527166391126", + "participant_name": "clanguml::t20011::tmain()" + }, + "name": "a(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20011/t20011.cc", + "line": 26 + }, + "to": { + "activity_id": "1647578261840204206", + "activity_name": "clanguml::t20011::A::a(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "type": "message" + }, + { + "activity_id": "1647578261840204206", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "1647578261840204206", + "activity_name": "clanguml::t20011::A::a(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "name": "a(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20011/t20011.cc", + "line": 8 + }, + "to": { + "activity_id": "1647578261840204206", + "activity_name": "clanguml::t20011::A::a(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "type": "message" + } + ], + "type": "consequent" + } + ], + "name": "if", + "type": "alt" + }, + { + "from": { + "activity_id": "1866210527166391126", + "activity_name": "clanguml::t20011::tmain()", + "participant_id": "1866210527166391126", + "participant_name": "clanguml::t20011::tmain()" + }, + "name": "b(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20011/t20011.cc", + "line": 28 + }, + "to": { + "activity_id": "305456175818875420", + "activity_name": "clanguml::t20011::A::b(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "305456175818875420", + "activity_name": "clanguml::t20011::A::b(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "name": "c(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20011/t20011.cc", + "line": 11 + }, + "to": { + "activity_id": "963268672079901211", + "activity_name": "clanguml::t20011::A::c(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "963268672079901211", + "activity_name": "clanguml::t20011::A::c(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "name": "d(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20011/t20011.cc", + "line": 12 + }, + "to": { + "activity_id": "1874311762268001137", + "activity_name": "clanguml::t20011::A::d(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "type": "message" + }, + { + "activity_id": "1874311762268001137", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "1874311762268001137", + "activity_name": "clanguml::t20011::A::d(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "name": "b(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20011/t20011.cc", + "line": 16 + }, + "to": { + "activity_id": "305456175818875420", + "activity_name": "clanguml::t20011::A::b(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1874311762268001137", + "activity_name": "clanguml::t20011::A::d(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "name": "a(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20011/t20011.cc", + "line": 18 + }, + "to": { + "activity_id": "1647578261840204206", + "activity_name": "clanguml::t20011::A::a(int)", + "participant_id": "816061502062128285", + "participant_name": "clanguml::t20011::A" + }, + "type": "message" + } + ], + "type": "consequent" + } + ], + "name": "if", + "type": "alt" + } + ], + "start_from": { + "id": 1866210527166391126, + "location": "clanguml::t20011::tmain()" + } + } + ], + "using_namespace": "clanguml::t20011" +} +``` diff --git a/docs/test_cases/t20011_sequence.svg b/docs/test_cases/t20011_sequence.svg index 13bf80a0..66ec6fdb 100644 --- a/docs/test_cases/t20011_sequence.svg +++ b/docs/test_cases/t20011_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - + + + + + + + + + + a(int) @@ -52,26 +52,26 @@ alt - + a(int) - + b(int) - + c(int) - + @@ -81,14 +81,14 @@ alt - + b(int) - + @@ -98,7 +98,7 @@ alt - + diff --git a/docs/test_cases/t20012.md b/docs/test_cases/t20012.md index a874e7a7..ffe5f498 100644 --- a/docs/test_cases/t20012.md +++ b/docs/test_cases/t20012.md @@ -126,3 +126,456 @@ void tmain() ``` ## Generated UML diagrams ![t20012_sequence](./t20012_sequence.svg "Lambda expression call sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20012_sequence", + "participants": [ + { + "id": "893699278278125827", + "name": "clanguml::t20012::tmain()", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 58 + }, + "type": "function" + }, + { + "id": "871571755123349249", + "name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:66:20)", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 66 + }, + "type": "class" + }, + { + "id": "1798184226128732119", + "name": "clanguml::t20012::A", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 9 + }, + "type": "class" + }, + { + "id": "1893469899260202653", + "name": "clanguml::t20012::B", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 17 + }, + "type": "class" + }, + { + "id": "516948909715002916", + "name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:79:20)", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 79 + }, + "type": "class" + }, + { + "id": "2071958121786360262", + "name": "clanguml::t20012::C", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 27 + }, + "type": "class" + }, + { + "id": "1639905845562724067", + "name": "clanguml::t20012::R", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 47 + }, + "type": "class" + }, + { + "id": "105322683015690128", + "name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:85:9)", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 85 + }, + "type": "class" + }, + { + "id": "1627226326147373737", + "name": "clanguml::t20012::D", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 35 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "893699278278125827", + "activity_name": "clanguml::t20012::tmain()", + "participant_id": "893699278278125827", + "participant_name": "clanguml::t20012::tmain()" + }, + "name": "operator()()", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 72 + }, + "to": { + "activity_id": "601151241333493101", + "activity_name": "clanguml::t20012::tmain()##(lambda ../../tests/t20012/t20012.cc:66:20)::operator()()", + "participant_id": "871571755123349249", + "participant_name": "clanguml::t20012::tmain()##(lambda ../../tests/t20012/t20012.cc:66:20)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "601151241333493101", + "activity_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:66:20)::operator()()", + "participant_id": "871571755123349249", + "participant_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:66:20)" + }, + "name": "a()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 67 + }, + "to": { + "activity_id": "1871432932744498976", + "activity_name": "clanguml::t20012::A::a()", + "participant_id": "1798184226128732119", + "participant_name": "clanguml::t20012::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1871432932744498976", + "activity_name": "clanguml::t20012::A::a()", + "participant_id": "1798184226128732119", + "participant_name": "clanguml::t20012::A" + }, + "name": "aa()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 10 + }, + "to": { + "activity_id": "1100933039353876539", + "activity_name": "clanguml::t20012::A::aa()", + "participant_id": "1798184226128732119", + "participant_name": "clanguml::t20012::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1100933039353876539", + "activity_name": "clanguml::t20012::A::aa()", + "participant_id": "1798184226128732119", + "participant_name": "clanguml::t20012::A" + }, + "name": "aaa()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 12 + }, + "to": { + "activity_id": "941636185823691898", + "activity_name": "clanguml::t20012::A::aaa()", + "participant_id": "1798184226128732119", + "participant_name": "clanguml::t20012::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "601151241333493101", + "activity_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:66:20)::operator()()", + "participant_id": "871571755123349249", + "participant_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:66:20)" + }, + "name": "b()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 68 + }, + "to": { + "activity_id": "2142697410385270633", + "activity_name": "clanguml::t20012::B::b()", + "participant_id": "1893469899260202653", + "participant_name": "clanguml::t20012::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2142697410385270633", + "activity_name": "clanguml::t20012::B::b()", + "participant_id": "1893469899260202653", + "participant_name": "clanguml::t20012::B" + }, + "name": "bb()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 18 + }, + "to": { + "activity_id": "973718340784931313", + "activity_name": "clanguml::t20012::B::bb()", + "participant_id": "1893469899260202653", + "participant_name": "clanguml::t20012::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "973718340784931313", + "activity_name": "clanguml::t20012::B::bb()", + "participant_id": "1893469899260202653", + "participant_name": "clanguml::t20012::B" + }, + "name": "bbb()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 20 + }, + "to": { + "activity_id": "195788529004378403", + "activity_name": "clanguml::t20012::B::bbb()", + "participant_id": "1893469899260202653", + "participant_name": "clanguml::t20012::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "893699278278125827", + "activity_name": "clanguml::t20012::tmain()", + "participant_id": "893699278278125827", + "participant_name": "clanguml::t20012::tmain()" + }, + "name": "operator()()", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 83 + }, + "to": { + "activity_id": "435249756897748529", + "activity_name": "clanguml::t20012::tmain()##(lambda ../../tests/t20012/t20012.cc:79:20)::operator()()", + "participant_id": "516948909715002916", + "participant_name": "clanguml::t20012::tmain()##(lambda ../../tests/t20012/t20012.cc:79:20)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "435249756897748529", + "activity_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:79:20)::operator()()", + "participant_id": "516948909715002916", + "participant_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:79:20)" + }, + "name": "c()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 80 + }, + "to": { + "activity_id": "675369415318225607", + "activity_name": "clanguml::t20012::C::c()", + "participant_id": "2071958121786360262", + "participant_name": "clanguml::t20012::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "675369415318225607", + "activity_name": "clanguml::t20012::C::c()", + "participant_id": "2071958121786360262", + "participant_name": "clanguml::t20012::C" + }, + "name": "cc()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 28 + }, + "to": { + "activity_id": "1451821704315336057", + "activity_name": "clanguml::t20012::C::cc()", + "participant_id": "2071958121786360262", + "participant_name": "clanguml::t20012::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1451821704315336057", + "activity_name": "clanguml::t20012::C::cc()", + "participant_id": "2071958121786360262", + "participant_name": "clanguml::t20012::C" + }, + "name": "ccc()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 30 + }, + "to": { + "activity_id": "1956141408799600460", + "activity_name": "clanguml::t20012::C::ccc()", + "participant_id": "2071958121786360262", + "participant_name": "clanguml::t20012::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "435249756897748529", + "activity_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:79:20)::operator()()", + "participant_id": "516948909715002916", + "participant_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:79:20)" + }, + "name": "operator()()", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 81 + }, + "to": { + "activity_id": "601151241333493101", + "activity_name": "clanguml::t20012::tmain()##(lambda ../../tests/t20012/t20012.cc:66:20)::operator()()", + "participant_id": "871571755123349249", + "participant_name": "clanguml::t20012::tmain()##(lambda ../../tests/t20012/t20012.cc:66:20)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "893699278278125827", + "activity_name": "clanguml::t20012::tmain()", + "participant_id": "893699278278125827", + "participant_name": "clanguml::t20012::tmain()" + }, + "name": "r()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 87 + }, + "to": { + "activity_id": "1003931867044486762", + "activity_name": "clanguml::t20012::R::r()", + "participant_id": "1639905845562724067", + "participant_name": "clanguml::t20012::R" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1003931867044486762", + "activity_name": "clanguml::t20012::R::r()", + "participant_id": "1639905845562724067", + "participant_name": "clanguml::t20012::R" + }, + "name": "operator()()", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 53 + }, + "to": { + "activity_id": "31472345599504206", + "activity_name": "clanguml::t20012::tmain()##(lambda ../../tests/t20012/t20012.cc:85:9)::operator()()", + "participant_id": "105322683015690128", + "participant_name": "clanguml::t20012::tmain()##(lambda ../../tests/t20012/t20012.cc:85:9)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "31472345599504206", + "activity_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:85:9)::operator()()", + "participant_id": "105322683015690128", + "participant_name": "clanguml::t20012::tmain()::(lambda ../../tests/t20012/t20012.cc:85:9)" + }, + "name": "c()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 85 + }, + "to": { + "activity_id": "675369415318225607", + "activity_name": "clanguml::t20012::C::c()", + "participant_id": "2071958121786360262", + "participant_name": "clanguml::t20012::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "893699278278125827", + "activity_name": "clanguml::t20012::tmain()", + "participant_id": "893699278278125827", + "participant_name": "clanguml::t20012::tmain()" + }, + "name": "add5(int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20012/t20012.cc", + "line": 93 + }, + "to": { + "activity_id": "1355013132527568474", + "activity_name": "clanguml::t20012::D::add5(int)", + "participant_id": "1627226326147373737", + "participant_name": "clanguml::t20012::D" + }, + "type": "message" + } + ], + "start_from": { + "id": 893699278278125827, + "location": "clanguml::t20012::tmain()" + } + } + ], + "using_namespace": "clanguml::t20012" +} +``` diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index 33bc84c6..cbd04446 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,122 +43,122 @@ - - + + tmain() - + tmain() - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:66:20) - + tmain()::(lambda ../../tests/t20012/t20012.cc:66:20) - - + + A - + A - - + + B - + B - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:79:20) - + tmain()::(lambda ../../tests/t20012/t20012.cc:79:20) - - + + C - + C - - + + R<R::(lambda ../../tests/t20012/t20012.cc:85:9)> - + R<R::(lambda ../../tests/t20012/t20012.cc:85:9)> - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:85:9) - + tmain()::(lambda ../../tests/t20012/t20012.cc:85:9) - - + + D - + D - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -167,67 +167,67 @@ - + operator()() - + c() - + cc() - + ccc() - + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -238,29 +238,29 @@ - + r() - + operator()() - + c() - + cc() - + @@ -269,7 +269,7 @@ - + add5(int) diff --git a/docs/test_cases/t20013.md b/docs/test_cases/t20013.md index 3b282d26..51ae1bd0 100644 --- a/docs/test_cases/t20013.md +++ b/docs/test_cases/t20013.md @@ -49,3 +49,182 @@ void tmain(int argc, char **argv) ``` ## Generated UML diagrams ![t20013_sequence](./t20013_sequence.svg "Function and method arguments in sequence diagrams test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20013_sequence", + "participants": [ + { + "id": "1249768632077843821", + "name": "clanguml::t20013::tmain(int,char **)", + "source_location": { + "file": "../../tests/t20013/t20013.cc", + "line": 18 + }, + "type": "function" + }, + { + "id": "1106407610612951303", + "name": "clanguml::t20013::B", + "source_location": { + "file": "../../tests/t20013/t20013.cc", + "line": 10 + }, + "type": "class" + }, + { + "id": "976623130699225079", + "name": "clanguml::t20013::A", + "source_location": { + "file": "../../tests/t20013/t20013.cc", + "line": 4 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1249768632077843821", + "activity_name": "clanguml::t20013::tmain(int,char **)", + "participant_id": "1249768632077843821", + "participant_name": "clanguml::t20013::tmain(int,char **)" + }, + "name": "b(int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20013/t20013.cc", + "line": 22 + }, + "to": { + "activity_id": "2144804108273682993", + "activity_name": "clanguml::t20013::B::b(int)", + "participant_id": "1106407610612951303", + "participant_name": "clanguml::t20013::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2144804108273682993", + "activity_name": "clanguml::t20013::B::b(int)", + "participant_id": "1106407610612951303", + "participant_name": "clanguml::t20013::B" + }, + "name": "a1(int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20013/t20013.cc", + "line": 11 + }, + "to": { + "activity_id": "1034027282942033004", + "activity_name": "clanguml::t20013::A::a1(int)", + "participant_id": "976623130699225079", + "participant_name": "clanguml::t20013::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1249768632077843821", + "activity_name": "clanguml::t20013::tmain(int,char **)", + "participant_id": "1249768632077843821", + "participant_name": "clanguml::t20013::tmain(int,char **)" + }, + "name": "b(double)", + "return_type": "double", + "scope": "normal", + "source_location": { + "file": "../../tests/t20013/t20013.cc", + "line": 23 + }, + "to": { + "activity_id": "640747884486165287", + "activity_name": "clanguml::t20013::B::b(double)", + "participant_id": "1106407610612951303", + "participant_name": "clanguml::t20013::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "640747884486165287", + "activity_name": "clanguml::t20013::B::b(double)", + "participant_id": "1106407610612951303", + "participant_name": "clanguml::t20013::B" + }, + "name": "a2(double)", + "return_type": "double", + "scope": "normal", + "source_location": { + "file": "../../tests/t20013/t20013.cc", + "line": 12 + }, + "to": { + "activity_id": "394053399890813915", + "activity_name": "clanguml::t20013::A::a2(double)", + "participant_id": "976623130699225079", + "participant_name": "clanguml::t20013::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1249768632077843821", + "activity_name": "clanguml::t20013::tmain(int,char **)", + "participant_id": "1249768632077843821", + "participant_name": "clanguml::t20013::tmain(int,char **)" + }, + "name": "b(const char *)", + "return_type": "const char *", + "scope": "normal", + "source_location": { + "file": "../../tests/t20013/t20013.cc", + "line": 24 + }, + "to": { + "activity_id": "1066935874364409142", + "activity_name": "clanguml::t20013::B::b(const char *)", + "participant_id": "1106407610612951303", + "participant_name": "clanguml::t20013::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1066935874364409142", + "activity_name": "clanguml::t20013::B::b(const char *)", + "participant_id": "1106407610612951303", + "participant_name": "clanguml::t20013::B" + }, + "name": "a3(const char *)", + "return_type": "const char *", + "scope": "normal", + "source_location": { + "file": "../../tests/t20013/t20013.cc", + "line": 13 + }, + "to": { + "activity_id": "1841239321495867611", + "activity_name": "clanguml::t20013::A::a3(const char *)", + "participant_id": "976623130699225079", + "participant_name": "clanguml::t20013::A" + }, + "type": "message" + } + ], + "start_from": { + "id": 1249768632077843821, + "location": "clanguml::t20013::tmain(int,char **)" + } + } + ], + "using_namespace": "clanguml::t20013" +} +``` diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index 7fb367d9..3dcc79a9 100644 --- a/docs/test_cases/t20013_sequence.svg +++ b/docs/test_cases/t20013_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -58,12 +58,12 @@ - + b(double) - + a2(double) @@ -72,12 +72,12 @@ - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20014.md b/docs/test_cases/t20014.md index 8b66928c..68de8c88 100644 --- a/docs/test_cases/t20014.md +++ b/docs/test_cases/t20014.md @@ -84,3 +84,191 @@ namespace t20014 { ``` ## Generated UML diagrams ![t20014_sequence](./t20014_sequence.svg "Multiple translation units sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20014_sequence", + "participants": [ + { + "id": "512436830818921250", + "name": "clanguml::t20014::tmain()", + "source_location": { + "file": "../../tests/t20014/t20014.cc", + "line": 10 + }, + "type": "function" + }, + { + "id": "1537634076295867978", + "name": "clanguml::t20014::B", + "source_location": { + "file": "../../tests/t20014/include/t20014_b.h", + "line": 8 + }, + "type": "class" + }, + { + "id": "1504706415756333840", + "name": "clanguml::t20014::A", + "source_location": { + "file": "../../tests/t20014/include/t20014_a.h", + "line": 6 + }, + "type": "class" + }, + { + "id": "500712304857049435", + "name": "clanguml::t20014::C", + "source_location": { + "file": "../../tests/t20014/include/t20014_c.h", + "line": 6 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "512436830818921250", + "activity_name": "clanguml::t20014::tmain()", + "participant_id": "512436830818921250", + "participant_name": "clanguml::t20014::tmain()" + }, + "name": "b1(int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20014/t20014.cc", + "line": 15 + }, + "to": { + "activity_id": "1251633571711578431", + "activity_name": "clanguml::t20014::B::b1(int,int)", + "participant_id": "1537634076295867978", + "participant_name": "clanguml::t20014::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1251633571711578431", + "activity_name": "clanguml::t20014::B::b1(int,int)", + "participant_id": "1537634076295867978", + "participant_name": "clanguml::t20014::B" + }, + "name": "a1(int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20014/t20014_b.cc", + "line": 5 + }, + "to": { + "activity_id": "1753682948110709616", + "activity_name": "clanguml::t20014::A::a1(int,int)", + "participant_id": "1504706415756333840", + "participant_name": "clanguml::t20014::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "512436830818921250", + "activity_name": "clanguml::t20014::tmain()", + "participant_id": "512436830818921250", + "participant_name": "clanguml::t20014::tmain()" + }, + "name": "b2(int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20014/t20014.cc", + "line": 16 + }, + "to": { + "activity_id": "767830966714379991", + "activity_name": "clanguml::t20014::B::b2(int,int)", + "participant_id": "1537634076295867978", + "participant_name": "clanguml::t20014::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "767830966714379991", + "activity_name": "clanguml::t20014::B::b2(int,int)", + "participant_id": "1537634076295867978", + "participant_name": "clanguml::t20014::B" + }, + "name": "a2(int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20014/t20014_b.cc", + "line": 7 + }, + "to": { + "activity_id": "1943487088673912694", + "activity_name": "clanguml::t20014::A::a2(int,int)", + "participant_id": "1504706415756333840", + "participant_name": "clanguml::t20014::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "512436830818921250", + "activity_name": "clanguml::t20014::tmain()", + "participant_id": "512436830818921250", + "participant_name": "clanguml::t20014::tmain()" + }, + "name": "c1(int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20014/t20014.cc", + "line": 18 + }, + "to": { + "activity_id": "407559038402563981", + "activity_name": "clanguml::t20014::C::c1(int,int)", + "participant_id": "500712304857049435", + "participant_name": "clanguml::t20014::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "407559038402563981", + "activity_name": "clanguml::t20014::C::c1(int,int)", + "participant_id": "500712304857049435", + "participant_name": "clanguml::t20014::C" + }, + "name": "b1(int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20014/include/t20014_c.h", + "line": 7 + }, + "to": { + "activity_id": "1251633571711578431", + "activity_name": "clanguml::t20014::B::b1(int,int)", + "participant_id": "1537634076295867978", + "participant_name": "clanguml::t20014::B" + }, + "type": "message" + } + ], + "start_from": { + "id": 512436830818921250, + "location": "clanguml::t20014::tmain()" + } + } + ], + "using_namespace": "clanguml::t20014" +} +``` diff --git a/docs/test_cases/t20014_sequence.svg b/docs/test_cases/t20014_sequence.svg index 40796222..34639fa5 100644 --- a/docs/test_cases/t20014_sequence.svg +++ b/docs/test_cases/t20014_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - - - - - - - + + + + + + + + - - + + tmain() - + tmain() - - + + B - + B - - + + A - + A - - + + C<B,int> - + C<B,int> - - - - - - - - - + + + + + + + + + b1(int,int) - + a1(int,int) @@ -67,12 +67,12 @@ - + b2(int,int) - + a2(int,int) @@ -81,17 +81,17 @@ - + c1(int,int) - + b1(int,int) - + a1(int,int) diff --git a/docs/test_cases/t20015.md b/docs/test_cases/t20015.md index b8f6ebaa..9174ca02 100644 --- a/docs/test_cases/t20015.md +++ b/docs/test_cases/t20015.md @@ -65,3 +65,63 @@ void tmain() ``` ## Generated UML diagrams ![t20015_sequence](./t20015_sequence.svg "Class exclusion by namespace in sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20015_sequence", + "participants": [ + { + "id": "1011496551872082945", + "name": "clanguml::t20015::tmain()", + "source_location": { + "file": "../../tests/t20015/t20015.cc", + "line": 31 + }, + "type": "function" + }, + { + "id": "1302656676783358645", + "name": "clanguml::t20015::B", + "source_location": { + "file": "../../tests/t20015/t20015.cc", + "line": 21 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1011496551872082945", + "activity_name": "clanguml::t20015::tmain()", + "participant_id": "1011496551872082945", + "participant_name": "clanguml::t20015::tmain()" + }, + "name": "setup_a(std::shared_ptr &)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20015/t20015.cc", + "line": 37 + }, + "to": { + "activity_id": "431575772398797060", + "activity_name": "clanguml::t20015::B::setup_a(std::shared_ptr &)", + "participant_id": "1302656676783358645", + "participant_name": "clanguml::t20015::B" + }, + "type": "message" + } + ], + "start_from": { + "id": 1011496551872082945, + "location": "clanguml::t20015::tmain()" + } + } + ], + "using_namespace": "clanguml::t20015" +} +``` diff --git a/docs/test_cases/t20015_sequence.svg b/docs/test_cases/t20015_sequence.svg index e77a03e3..49953ceb 100644 --- a/docs/test_cases/t20015_sequence.svg +++ b/docs/test_cases/t20015_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + B - + B - - - + + + setup_a(std::shared_ptr<detail::A> &) diff --git a/docs/test_cases/t20016.md b/docs/test_cases/t20016.md index a9dcb528..8358bfc2 100644 --- a/docs/test_cases/t20016.md +++ b/docs/test_cases/t20016.md @@ -47,3 +47,138 @@ void tmain() ``` ## Generated UML diagrams ![t20016_sequence](./t20016_sequence.svg "Template method specialization sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20016_sequence", + "participants": [ + { + "id": "1912662358651926712", + "name": "clanguml::t20016::tmain()", + "source_location": { + "file": "../../tests/t20016/t20016.cc", + "line": 16 + }, + "type": "function" + }, + { + "id": "1688340912643326666", + "name": "clanguml::t20016::B", + "source_location": { + "file": "../../tests/t20016/t20016.cc", + "line": 8 + }, + "type": "class" + }, + { + "id": "1351242594275053195", + "name": "clanguml::t20016::A", + "source_location": { + "file": "../../tests/t20016/t20016.cc", + "line": 3 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1912662358651926712", + "activity_name": "clanguml::t20016::tmain()", + "participant_id": "1912662358651926712", + "participant_name": "clanguml::t20016::tmain()" + }, + "name": "b1(long)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20016/t20016.cc", + "line": 20 + }, + "to": { + "activity_id": "2064264710178722261", + "activity_name": "clanguml::t20016::B::b1(long)", + "participant_id": "1688340912643326666", + "participant_name": "clanguml::t20016::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2064264710178722261", + "activity_name": "clanguml::t20016::B::b1(long)", + "participant_id": "1688340912643326666", + "participant_name": "clanguml::t20016::B" + }, + "name": "a1(int)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20016/t20016.cc", + "line": 9 + }, + "to": { + "activity_id": "1198371121423942542", + "activity_name": "clanguml::t20016::A::a1(int)", + "participant_id": "1351242594275053195", + "participant_name": "clanguml::t20016::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1912662358651926712", + "activity_name": "clanguml::t20016::tmain()", + "participant_id": "1912662358651926712", + "participant_name": "clanguml::t20016::tmain()" + }, + "name": "b2(long)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20016/t20016.cc", + "line": 22 + }, + "to": { + "activity_id": "203381140188081853", + "activity_name": "clanguml::t20016::B::b2(long)", + "participant_id": "1688340912643326666", + "participant_name": "clanguml::t20016::B" + }, + "type": "message" + }, + { + "from": { + "activity_id": "203381140188081853", + "activity_name": "clanguml::t20016::B::b2(long)", + "participant_id": "1688340912643326666", + "participant_name": "clanguml::t20016::B" + }, + "name": "a2(const long &)", + "return_type": "long", + "scope": "normal", + "source_location": { + "file": "../../tests/t20016/t20016.cc", + "line": 11 + }, + "to": { + "activity_id": "1208784669530380166", + "activity_name": "clanguml::t20016::A::a2(const long &)", + "participant_id": "1351242594275053195", + "participant_name": "clanguml::t20016::A" + }, + "type": "message" + } + ], + "start_from": { + "id": 1912662358651926712, + "location": "clanguml::t20016::tmain()" + } + } + ], + "using_namespace": "clanguml::t20016" +} +``` diff --git a/docs/test_cases/t20016_sequence.svg b/docs/test_cases/t20016_sequence.svg index a75b3c5a..10e2b0f1 100644 --- a/docs/test_cases/t20016_sequence.svg +++ b/docs/test_cases/t20016_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + B<long> - + B<long> - - + + A - + A - - - - - - + + + + + + b1(long) - + a1(int) - + b2(long) - + a2(const long &) diff --git a/docs/test_cases/t20017.md b/docs/test_cases/t20017.md index a023c4ea..45faa15e 100644 --- a/docs/test_cases/t20017.md +++ b/docs/test_cases/t20017.md @@ -44,3 +44,160 @@ int tmain() { return b2(a1(a2(a3(1, 2), b1(3, 4)), 5), 6); } ``` ## Generated UML diagrams ![t20017_sequence](./t20017_sequence.svg "Test case for combine_free_functions_into_file_participants option") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20017_sequence", + "participants": [ + { + "id": "294332401323799021", + "name": "t20017.cc", + "source_location": { + "file": "t20017.cc", + "line": 6 + }, + "type": "function" + }, + { + "id": "1591222867263639510", + "name": "include/t20017_a.h", + "source_location": { + "file": "include/t20017_a.h", + "line": 7 + }, + "type": "function" + }, + { + "id": "1113611539183189365", + "name": "include/t20017_b.h", + "source_location": { + "file": "include/t20017_b.h", + "line": 5 + }, + "type": "function" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1484746432546296115", + "activity_name": "clanguml::t20017::tmain()", + "participant_id": "294332401323799021", + "participant_name": "t20017.cc" + }, + "name": "a3(int,int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "t20017.cc", + "line": 6 + }, + "to": { + "activity_id": "1681392050252260928", + "activity_name": "clanguml::t20017::a3(int,int)", + "participant_id": "1591222867263639510", + "participant_name": "include/t20017_a.h" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1484746432546296115", + "activity_name": "clanguml::t20017::tmain()", + "participant_id": "294332401323799021", + "participant_name": "t20017.cc" + }, + "name": "b1(int,int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "t20017.cc", + "line": 6 + }, + "to": { + "activity_id": "1714277838806105702", + "activity_name": "clanguml::t20017::b1(int,int)", + "participant_id": "1113611539183189365", + "participant_name": "include/t20017_b.h" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1484746432546296115", + "activity_name": "clanguml::t20017::tmain()", + "participant_id": "294332401323799021", + "participant_name": "t20017.cc" + }, + "name": "a2(int,int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "t20017.cc", + "line": 6 + }, + "to": { + "activity_id": "291553542743365259", + "activity_name": "clanguml::t20017::a2(int,int)", + "participant_id": "1591222867263639510", + "participant_name": "include/t20017_a.h" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1484746432546296115", + "activity_name": "clanguml::t20017::tmain()", + "participant_id": "294332401323799021", + "participant_name": "t20017.cc" + }, + "name": "a1(int,int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "t20017.cc", + "line": 6 + }, + "to": { + "activity_id": "113759676939330212", + "activity_name": "clanguml::t20017::a1(int,int)", + "participant_id": "1591222867263639510", + "participant_name": "include/t20017_a.h" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1484746432546296115", + "activity_name": "clanguml::t20017::tmain()", + "participant_id": "294332401323799021", + "participant_name": "t20017.cc" + }, + "name": "b2(int,int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "t20017.cc", + "line": 6 + }, + "to": { + "activity_id": "775081116464505528", + "activity_name": "clanguml::t20017::b2(int,int)", + "participant_id": "1113611539183189365", + "participant_name": "include/t20017_b.h" + }, + "type": "message" + } + ], + "start_from": { + "id": 1484746432546296115, + "location": "clanguml::t20017::tmain()" + } + } + ], + "using_namespace": "clanguml::t20017" +} +``` diff --git a/docs/test_cases/t20017_sequence.svg b/docs/test_cases/t20017_sequence.svg index 86e801c7..8f319b13 100644 --- a/docs/test_cases/t20017_sequence.svg +++ b/docs/test_cases/t20017_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,65 +9,65 @@ - - - - - - + + + + + + - + t20017.cc - + t20017.cc - + include/t20017_a.h - + include/t20017_a.h - + include/t20017_b.h - + include/t20017_b.h - - - - - - + + + + + + tmain() - + a3(int,int) - + b1(int,int) - + a2(int,int) - + a1(int,int) - + b2<int>(int,int) diff --git a/docs/test_cases/t20018.md b/docs/test_cases/t20018.md index 4caa67e9..24d01a05 100644 --- a/docs/test_cases/t20018.md +++ b/docs/test_cases/t20018.md @@ -49,3 +49,249 @@ void tmain() { Answer>::print(); } ``` ## Generated UML diagrams ![t20018_sequence](./t20018_sequence.svg "Recursive template sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20018_sequence", + "participants": [ + { + "id": "227581758025403815", + "name": "clanguml::t20018::tmain()", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 25 + }, + "type": "function" + }, + { + "id": "1163521725351533502", + "name": "clanguml::t20018::Answer,120>", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 21 + }, + "type": "class" + }, + { + "id": "1482779373563849921", + "name": "clanguml::t20018::Factorial<5>", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "52416404065514823", + "name": "clanguml::t20018::Factorial<4>", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "1658728078296100018", + "name": "clanguml::t20018::Factorial<3>", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "969903469166760124", + "name": "clanguml::t20018::Factorial<2>", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "2032621198190600516", + "name": "clanguml::t20018::Factorial<1>", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "1581865799666386458", + "name": "clanguml::t20018::Factorial<0>", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 12 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "227581758025403815", + "activity_name": "clanguml::t20018::tmain()", + "participant_id": "227581758025403815", + "participant_name": "clanguml::t20018::tmain()" + }, + "name": "print()", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 25 + }, + "to": { + "activity_id": "1185770766239304952", + "activity_name": "clanguml::t20018::Answer,120>::print()", + "participant_id": "1163521725351533502", + "participant_name": "clanguml::t20018::Answer,120>" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1185770766239304952", + "activity_name": "clanguml::t20018::Answer,120>::print()", + "participant_id": "1163521725351533502", + "participant_name": "clanguml::t20018::Answer,120>" + }, + "name": "print(int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 22 + }, + "to": { + "activity_id": "833100888453299461", + "activity_name": "clanguml::t20018::Factorial<5>::print(int)", + "participant_id": "1482779373563849921", + "participant_name": "clanguml::t20018::Factorial<5>" + }, + "type": "message" + }, + { + "from": { + "activity_id": "833100888453299461", + "activity_name": "clanguml::t20018::Factorial<5>::print(int)", + "participant_id": "1482779373563849921", + "participant_name": "clanguml::t20018::Factorial<5>" + }, + "name": "print(int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 9 + }, + "to": { + "activity_id": "1782586643813991247", + "activity_name": "clanguml::t20018::Factorial<4>::print(int)", + "participant_id": "52416404065514823", + "participant_name": "clanguml::t20018::Factorial<4>" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1782586643813991247", + "activity_name": "clanguml::t20018::Factorial<4>::print(int)", + "participant_id": "52416404065514823", + "participant_name": "clanguml::t20018::Factorial<4>" + }, + "name": "print(int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 9 + }, + "to": { + "activity_id": "1238078028595736678", + "activity_name": "clanguml::t20018::Factorial<3>::print(int)", + "participant_id": "1658728078296100018", + "participant_name": "clanguml::t20018::Factorial<3>" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1238078028595736678", + "activity_name": "clanguml::t20018::Factorial<3>::print(int)", + "participant_id": "1658728078296100018", + "participant_name": "clanguml::t20018::Factorial<3>" + }, + "name": "print(int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 9 + }, + "to": { + "activity_id": "2163270950475476780", + "activity_name": "clanguml::t20018::Factorial<2>::print(int)", + "participant_id": "969903469166760124", + "participant_name": "clanguml::t20018::Factorial<2>" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2163270950475476780", + "activity_name": "clanguml::t20018::Factorial<2>::print(int)", + "participant_id": "969903469166760124", + "participant_name": "clanguml::t20018::Factorial<2>" + }, + "name": "print(int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 9 + }, + "to": { + "activity_id": "501166016325937670", + "activity_name": "clanguml::t20018::Factorial<1>::print(int)", + "participant_id": "2032621198190600516", + "participant_name": "clanguml::t20018::Factorial<1>" + }, + "type": "message" + }, + { + "from": { + "activity_id": "501166016325937670", + "activity_name": "clanguml::t20018::Factorial<1>::print(int)", + "participant_id": "2032621198190600516", + "participant_name": "clanguml::t20018::Factorial<1>" + }, + "name": "print(int)", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20018/t20018.cc", + "line": 9 + }, + "to": { + "activity_id": "577232827352391544", + "activity_name": "clanguml::t20018::Factorial<0>::print(int)", + "participant_id": "1581865799666386458", + "participant_name": "clanguml::t20018::Factorial<0>" + }, + "type": "message" + } + ], + "start_from": { + "id": 227581758025403815, + "location": "clanguml::t20018::tmain()" + } + } + ], + "using_namespace": "clanguml::t20018" +} +``` diff --git a/docs/test_cases/t20018_sequence.svg b/docs/test_cases/t20018_sequence.svg index dcec0e02..e4035be0 100644 --- a/docs/test_cases/t20018_sequence.svg +++ b/docs/test_cases/t20018_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + @@ -25,93 +25,93 @@ - - + + tmain() - + tmain() - - + + Answer<Factorial<5>,120> - + Answer<Factorial<5>,120> - - + + Factorial<5> - + Factorial<5> - - + + Factorial<4> - + Factorial<4> - - + + Factorial<3> - + Factorial<3> - - + + Factorial<2> - + Factorial<2> - - + + Factorial<1> - + Factorial<1> - - + + Factorial<0> - + Factorial<0> - - - - - - - - - + + + + + + + + + print() - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) diff --git a/docs/test_cases/t20019.md b/docs/test_cases/t20019.md index 8188a2b0..3702f494 100644 --- a/docs/test_cases/t20019.md +++ b/docs/test_cases/t20019.md @@ -56,3 +56,200 @@ void tmain() ``` ## Generated UML diagrams ![t20019_sequence](./t20019_sequence.svg "Curiously Recurring Template Pattern sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20019_sequence", + "participants": [ + { + "id": "375304196268652861", + "name": "clanguml::t20019::tmain()", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 20 + }, + "type": "function" + }, + { + "id": "381327373934972004", + "name": "clanguml::t20019::Base", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 8 + }, + "type": "class" + }, + { + "id": "1282259011856139592", + "name": "clanguml::t20019::D1", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 12 + }, + "type": "class" + }, + { + "id": "1659477498076328530", + "name": "clanguml::t20019::Base", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 8 + }, + "type": "class" + }, + { + "id": "1307471723138212117", + "name": "clanguml::t20019::D2", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 16 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "375304196268652861", + "activity_name": "clanguml::t20019::tmain()", + "participant_id": "375304196268652861", + "participant_name": "clanguml::t20019::tmain()" + }, + "name": "name()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 23 + }, + "to": { + "activity_id": "1038853547136467401", + "activity_name": "clanguml::t20019::Base::name()", + "participant_id": "381327373934972004", + "participant_name": "clanguml::t20019::Base" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1038853547136467401", + "activity_name": "clanguml::t20019::Base::name()", + "participant_id": "381327373934972004", + "participant_name": "clanguml::t20019::Base" + }, + "name": "impl()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 9 + }, + "to": { + "activity_id": "603969604599968603", + "activity_name": "clanguml::t20019::D1::impl()", + "participant_id": "1282259011856139592", + "participant_name": "clanguml::t20019::D1" + }, + "type": "message" + }, + { + "from": { + "activity_id": "375304196268652861", + "activity_name": "clanguml::t20019::tmain()", + "participant_id": "375304196268652861", + "participant_name": "clanguml::t20019::tmain()" + }, + "name": "name()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 25 + }, + "to": { + "activity_id": "1918672956676175365", + "activity_name": "clanguml::t20019::Base::name()", + "participant_id": "1659477498076328530", + "participant_name": "clanguml::t20019::Base" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1918672956676175365", + "activity_name": "clanguml::t20019::Base::name()", + "participant_id": "1659477498076328530", + "participant_name": "clanguml::t20019::Base" + }, + "name": "impl()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 9 + }, + "to": { + "activity_id": "861400435979772695", + "activity_name": "clanguml::t20019::D2::impl()", + "participant_id": "1307471723138212117", + "participant_name": "clanguml::t20019::D2" + }, + "type": "message" + }, + { + "from": { + "activity_id": "375304196268652861", + "activity_name": "clanguml::t20019::tmain()", + "participant_id": "375304196268652861", + "participant_name": "clanguml::t20019::tmain()" + }, + "name": "name()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 28 + }, + "to": { + "activity_id": "1038853547136467401", + "activity_name": "clanguml::t20019::Base::name()", + "participant_id": "381327373934972004", + "participant_name": "clanguml::t20019::Base" + }, + "type": "message" + }, + { + "from": { + "activity_id": "375304196268652861", + "activity_name": "clanguml::t20019::tmain()", + "participant_id": "375304196268652861", + "participant_name": "clanguml::t20019::tmain()" + }, + "name": "name()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20019/t20019.cc", + "line": 30 + }, + "to": { + "activity_id": "1918672956676175365", + "activity_name": "clanguml::t20019::Base::name()", + "participant_id": "1659477498076328530", + "participant_name": "clanguml::t20019::Base" + }, + "type": "message" + } + ], + "start_from": { + "id": 375304196268652861, + "location": "clanguml::t20019::tmain()" + } + } + ], + "using_namespace": "clanguml::t20019" +} +``` diff --git a/docs/test_cases/t20019_sequence.svg b/docs/test_cases/t20019_sequence.svg index 34c8e115..c11b1680 100644 --- a/docs/test_cases/t20019_sequence.svg +++ b/docs/test_cases/t20019_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + Base<D1> - + Base<D1> - - + + D1 - + D1 - - + + Base<D2> - + Base<D2> - - + + D2 - + D2 - - - - - - - - - - + + + + + + + + + + name() - + impl() - + name() - + impl() - + name() - + impl() - + name() - + impl() diff --git a/docs/test_cases/t20020.md b/docs/test_cases/t20020.md index 0e8eed4c..a22d1d0a 100644 --- a/docs/test_cases/t20020.md +++ b/docs/test_cases/t20020.md @@ -108,3 +108,402 @@ int tmain() ``` ## Generated UML diagrams ![t20020_sequence](./t20020_sequence.svg "If statement sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20020_sequence", + "participants": [ + { + "id": "432124388562400664", + "name": "clanguml::t20020::tmain()", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 39 + }, + "type": "function" + }, + { + "id": "208941846648931609", + "name": "clanguml::t20020::A", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 6 + }, + "type": "class" + }, + { + "id": "1562462306909405383", + "name": "clanguml::t20020::C", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 20 + }, + "type": "class" + }, + { + "id": "1342563483612170412", + "name": "clanguml::t20020::B", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 13 + }, + "type": "class" + }, + { + "id": "1605914310746811866", + "name": "clanguml::t20020::D", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 34 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "activity_id": "432124388562400664", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "a1()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 49 + }, + "to": { + "activity_id": "43928675765534701", + "activity_name": "clanguml::t20020::A::a1()", + "participant_id": "208941846648931609", + "participant_name": "clanguml::t20020::A" + }, + "type": "message" + } + ], + "type": "consequent" + }, + { + "messages": [ + { + "activity_id": "432124388562400664", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "a2()", + "return_type": "int", + "scope": "condition", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 52 + }, + "to": { + "activity_id": "1289745252290688140", + "activity_name": "clanguml::t20020::A::a2()", + "participant_id": "208941846648931609", + "participant_name": "clanguml::t20020::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "c3(int)", + "return_type": "int", + "scope": "condition", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 52 + }, + "to": { + "activity_id": "1303438784842196201", + "activity_name": "clanguml::t20020::C::c3(int)", + "participant_id": "1562462306909405383", + "participant_name": "clanguml::t20020::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "b1()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 53 + }, + "to": { + "activity_id": "542196582335607343", + "activity_name": "clanguml::t20020::B::b1()", + "participant_id": "1342563483612170412", + "participant_name": "clanguml::t20020::B" + }, + "type": "message" + } + ], + "type": "consequent" + }, + { + "messages": [ + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "a3()", + "return_type": "int", + "scope": "condition", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 54 + }, + "to": { + "activity_id": "1983660679554669898", + "activity_name": "clanguml::t20020::A::a3()", + "participant_id": "208941846648931609", + "participant_name": "clanguml::t20020::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "b2()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 55 + }, + "to": { + "activity_id": "505760236964179187", + "activity_name": "clanguml::t20020::B::b2()", + "participant_id": "1342563483612170412", + "participant_name": "clanguml::t20020::B" + }, + "type": "message" + } + ], + "type": "alternative" + } + ], + "name": "if", + "type": "alt" + }, + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "a4()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 60 + }, + "to": { + "activity_id": "20573198999978866", + "activity_name": "clanguml::t20020::A::a4()", + "participant_id": "208941846648931609", + "participant_name": "clanguml::t20020::A" + }, + "type": "message" + } + ], + "type": "alternative" + } + ], + "name": "if", + "type": "alt" + }, + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "log()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 63 + }, + "to": { + "activity_id": "1436250788704205026", + "activity_name": "clanguml::t20020::B::log()", + "participant_id": "1342563483612170412", + "participant_name": "clanguml::t20020::B" + }, + "type": "message" + }, + { + "activity_id": "432124388562400664", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "c1()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 66 + }, + "to": { + "activity_id": "1962953889020699702", + "activity_name": "clanguml::t20020::C::c1()", + "participant_id": "1562462306909405383", + "participant_name": "clanguml::t20020::C" + }, + "type": "message" + }, + { + "activity_id": "1962953889020699702", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "1962953889020699702", + "activity_name": "clanguml::t20020::C::c1()", + "participant_id": "1562462306909405383", + "participant_name": "clanguml::t20020::C" + }, + "name": "c2()", + "return_type": "_Bool", + "scope": "condition", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 25 + }, + "to": { + "activity_id": "1224151733617799047", + "activity_name": "clanguml::t20020::C::c2()", + "participant_id": "1562462306909405383", + "participant_name": "clanguml::t20020::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1962953889020699702", + "activity_name": "clanguml::t20020::C::c1()", + "participant_id": "1562462306909405383", + "participant_name": "clanguml::t20020::C" + }, + "name": "log()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 26 + }, + "to": { + "activity_id": "1108114094862697094", + "activity_name": "clanguml::t20020::C::log()", + "participant_id": "1562462306909405383", + "participant_name": "clanguml::t20020::C" + }, + "type": "message" + } + ], + "type": "consequent" + } + ], + "name": "if", + "type": "alt" + } + ], + "type": "consequent" + } + ], + "name": "if", + "type": "alt" + }, + { + "activity_id": "432124388562400664", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "432124388562400664", + "activity_name": "clanguml::t20020::tmain()", + "participant_id": "432124388562400664", + "participant_name": "clanguml::t20020::tmain()" + }, + "name": "d1(int,int)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20020/t20020.cc", + "line": 69 + }, + "to": { + "activity_id": "1780002010052842766", + "activity_name": "clanguml::t20020::D::d1(int,int)", + "participant_id": "1605914310746811866", + "participant_name": "clanguml::t20020::D" + }, + "type": "message" + } + ], + "type": "consequent" + } + ], + "name": "if", + "type": "alt" + } + ], + "start_from": { + "id": 432124388562400664, + "location": "clanguml::t20020::tmain()" + } + } + ], + "using_namespace": "clanguml::t20020" +} +``` diff --git a/docs/test_cases/t20020_sequence.svg b/docs/test_cases/t20020_sequence.svg index 0d520991..589448fb 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,78 +9,78 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + C - + C - - + + B - + B - - + + D<int> - + D<int> - - - - - - - - - - - - - + + + + + + + + + + + + + alt - + a1() @@ -91,7 +91,7 @@ alt - + [ @@ -100,7 +100,7 @@ - + [ @@ -109,7 +109,7 @@ - + b1() @@ -117,7 +117,7 @@ - + [ @@ -126,21 +126,21 @@ - + b2() - + a4() - + log() @@ -148,7 +148,7 @@ alt - + c1() @@ -156,7 +156,7 @@ alt - + @@ -169,7 +169,7 @@ - + @@ -179,7 +179,7 @@ alt - + d1(int,int) diff --git a/docs/test_cases/t20021.md b/docs/test_cases/t20021.md index a1080295..5fcf502e 100644 --- a/docs/test_cases/t20021.md +++ b/docs/test_cases/t20021.md @@ -79,3 +79,336 @@ int tmain() ``` ## Generated UML diagrams ![t20021_sequence](./t20021_sequence.svg "Loop statements sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20021_sequence", + "participants": [ + { + "id": "1682631020380557915", + "name": "clanguml::t20021::tmain()", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 30 + }, + "type": "function" + }, + { + "id": "451128000259357438", + "name": "clanguml::t20021::C", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 18 + }, + "type": "class" + }, + { + "id": "1280483607329510730", + "name": "clanguml::t20021::A", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 5 + }, + "type": "class" + }, + { + "id": "1849696080443395393", + "name": "clanguml::t20021::B", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 11 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "activity_id": "1682631020380557915", + "messages": [ + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "c4()", + "return_type": "int", + "scope": "condition", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 37 + }, + "to": { + "activity_id": "124927877622321176", + "activity_name": "clanguml::t20021::C::c4()", + "participant_id": "451128000259357438", + "participant_name": "clanguml::t20021::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "124927877622321176", + "activity_name": "clanguml::t20021::C::c4()", + "participant_id": "451128000259357438", + "participant_name": "clanguml::t20021::C" + }, + "name": "c5()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 22 + }, + "to": { + "activity_id": "1325720714179808628", + "activity_name": "clanguml::t20021::C::c5()", + "participant_id": "451128000259357438", + "participant_name": "clanguml::t20021::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "a3()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 38 + }, + "to": { + "activity_id": "1867955233624891190", + "activity_name": "clanguml::t20021::A::a3()", + "participant_id": "1280483607329510730", + "participant_name": "clanguml::t20021::A" + }, + "type": "message" + }, + { + "activity_id": "1682631020380557915", + "messages": [ + { + "activity_id": "1682631020380557915", + "messages": [ + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "a2()", + "return_type": "int", + "scope": "condition", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 40 + }, + "to": { + "activity_id": "1139294797758415018", + "activity_name": "clanguml::t20021::A::a2()", + "participant_id": "1280483607329510730", + "participant_name": "clanguml::t20021::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "c1()", + "return_type": "int", + "scope": "condition", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 40 + }, + "to": { + "activity_id": "2143764740072323303", + "activity_name": "clanguml::t20021::C::c1()", + "participant_id": "451128000259357438", + "participant_name": "clanguml::t20021::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "c2()", + "return_type": "int", + "scope": "condition", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 40 + }, + "to": { + "activity_id": "1707693479408501017", + "activity_name": "clanguml::t20021::C::c2()", + "participant_id": "451128000259357438", + "participant_name": "clanguml::t20021::C" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "a1()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 41 + }, + "to": { + "activity_id": "1659488549696810992", + "activity_name": "clanguml::t20021::A::a1()", + "participant_id": "1280483607329510730", + "participant_name": "clanguml::t20021::A" + }, + "type": "message" + } + ], + "name": "for", + "type": "loop" + }, + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "c3()", + "return_type": "int", + "scope": "condition", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 42 + }, + "to": { + "activity_id": "1302892753246800390", + "activity_name": "clanguml::t20021::C::c3()", + "participant_id": "451128000259357438", + "participant_name": "clanguml::t20021::C" + }, + "type": "message" + } + ], + "name": "do", + "type": "loop" + } + ], + "name": "while", + "type": "loop" + }, + { + "activity_id": "1682631020380557915", + "messages": [ + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "b2()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 47 + }, + "to": { + "activity_id": "1387752719733375782", + "activity_name": "clanguml::t20021::B::b2()", + "participant_id": "1849696080443395393", + "participant_name": "clanguml::t20021::B" + }, + "type": "message" + } + ], + "name": "for", + "type": "loop" + }, + { + "activity_id": "1682631020380557915", + "messages": [ + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "contents()", + "return_type": "std::vector &", + "scope": "condition", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 50 + }, + "to": { + "activity_id": "814405216385697964", + "activity_name": "clanguml::t20021::C::contents()", + "participant_id": "451128000259357438", + "participant_name": "clanguml::t20021::C" + }, + "type": "message" + } + ], + "name": "for", + "type": "loop" + }, + { + "from": { + "activity_id": "1682631020380557915", + "activity_name": "clanguml::t20021::tmain()", + "participant_id": "1682631020380557915", + "participant_name": "clanguml::t20021::tmain()" + }, + "name": "b2()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20021/t20021.cc", + "line": 54 + }, + "to": { + "activity_id": "1387752719733375782", + "activity_name": "clanguml::t20021::B::b2()", + "participant_id": "1849696080443395393", + "participant_name": "clanguml::t20021::B" + }, + "type": "message" + } + ], + "start_from": { + "id": 1682631020380557915, + "location": "clanguml::t20021::tmain()" + } + } + ], + "using_namespace": "clanguml::t20021" +} +``` diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index a26edf43..24e6a231 100644 --- a/docs/test_cases/t20021_sequence.svg +++ b/docs/test_cases/t20021_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + C - + C - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + loop - + [ c4() ] - + @@ -89,7 +89,7 @@ - + a3() @@ -102,7 +102,7 @@ loop - + [ @@ -111,7 +111,7 @@ - + [ @@ -120,7 +120,7 @@ - + [ @@ -129,14 +129,14 @@ - + a1() - + [ @@ -148,7 +148,7 @@ loop - + b2() @@ -158,7 +158,7 @@ loop - + [ @@ -167,7 +167,7 @@ - + b2() diff --git a/docs/test_cases/t20022.md b/docs/test_cases/t20022.md index 526f2c12..e9e6cc89 100644 --- a/docs/test_cases/t20022.md +++ b/docs/test_cases/t20022.md @@ -59,3 +59,94 @@ int tmain() ``` ## Generated UML diagrams ![t20022_sequence](./t20022_sequence.svg "Forward class declaration sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20022_sequence", + "participants": [ + { + "id": "1374011101998494743", + "name": "clanguml::t20022::tmain()", + "source_location": { + "file": "../../tests/t20022/t20022.cc", + "line": 28 + }, + "type": "function" + }, + { + "id": "1535467498096081224", + "name": "clanguml::t20022::A", + "source_location": { + "file": "../../tests/t20022/t20022.cc", + "line": 7 + }, + "type": "class" + }, + { + "id": "1316821731069034940", + "name": "clanguml::t20022::B", + "source_location": { + "file": "../../tests/t20022/t20022.cc", + "line": 16 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1374011101998494743", + "activity_name": "clanguml::t20022::tmain()", + "participant_id": "1374011101998494743", + "participant_name": "clanguml::t20022::tmain()" + }, + "name": "a()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20022/t20022.cc", + "line": 32 + }, + "to": { + "activity_id": "1158824701633811441", + "activity_name": "clanguml::t20022::A::a()", + "participant_id": "1535467498096081224", + "participant_name": "clanguml::t20022::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1158824701633811441", + "activity_name": "clanguml::t20022::A::a()", + "participant_id": "1535467498096081224", + "participant_name": "clanguml::t20022::A" + }, + "name": "b()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20022/t20022.cc", + "line": 26 + }, + "to": { + "activity_id": "2114222968575993291", + "activity_name": "clanguml::t20022::B::b()", + "participant_id": "1316821731069034940", + "participant_name": "clanguml::t20022::B" + }, + "type": "message" + } + ], + "start_from": { + "id": 1374011101998494743, + "location": "clanguml::t20022::tmain()" + } + } + ], + "using_namespace": "clanguml::t20022" +} +``` diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index 65d0dfe3..aa3eb6e5 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - + + + + a() - + b() diff --git a/docs/test_cases/t20023.md b/docs/test_cases/t20023.md index e88c8048..4eeb48e2 100644 --- a/docs/test_cases/t20023.md +++ b/docs/test_cases/t20023.md @@ -62,3 +62,178 @@ int tmain() ``` ## Generated UML diagrams ![t20023_sequence](./t20023_sequence.svg "Try/catch statement sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20023_sequence", + "participants": [ + { + "id": "761552264135157511", + "name": "clanguml::t20023::tmain()", + "source_location": { + "file": "../../tests/t20023/t20023.cc", + "line": 29 + }, + "type": "function" + }, + { + "id": "750638294800359616", + "name": "clanguml::t20023::A", + "source_location": { + "file": "../../tests/t20023/t20023.cc", + "line": 6 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "761552264135157511", + "activity_name": "clanguml::t20023::tmain()", + "participant_id": "761552264135157511", + "participant_name": "clanguml::t20023::tmain()" + }, + "name": "a()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20023/t20023.cc", + "line": 35 + }, + "to": { + "activity_id": "530651320277188697", + "activity_name": "clanguml::t20023::A::a()", + "participant_id": "750638294800359616", + "participant_name": "clanguml::t20023::A" + }, + "type": "message" + }, + { + "activity_id": "530651320277188697", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "530651320277188697", + "activity_name": "clanguml::t20023::A::a()", + "participant_id": "750638294800359616", + "participant_name": "clanguml::t20023::A" + }, + "name": "a1()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20023/t20023.cc", + "line": 15 + }, + "to": { + "activity_id": "94135113932519208", + "activity_name": "clanguml::t20023::A::a1()", + "participant_id": "750638294800359616", + "participant_name": "clanguml::t20023::A" + }, + "type": "message" + } + ], + "type": "main" + }, + { + "messages": [ + { + "from": { + "activity_id": "530651320277188697", + "activity_name": "clanguml::t20023::A::a()", + "participant_id": "750638294800359616", + "participant_name": "clanguml::t20023::A" + }, + "name": "a2()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20023/t20023.cc", + "line": 18 + }, + "to": { + "activity_id": "2060438178899014465", + "activity_name": "clanguml::t20023::A::a2()", + "participant_id": "750638294800359616", + "participant_name": "clanguml::t20023::A" + }, + "type": "message" + } + ], + "type": "catch" + }, + { + "messages": [ + { + "from": { + "activity_id": "530651320277188697", + "activity_name": "clanguml::t20023::A::a()", + "participant_id": "750638294800359616", + "participant_name": "clanguml::t20023::A" + }, + "name": "a3()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20023/t20023.cc", + "line": 21 + }, + "to": { + "activity_id": "1776927259621603017", + "activity_name": "clanguml::t20023::A::a3()", + "participant_id": "750638294800359616", + "participant_name": "clanguml::t20023::A" + }, + "type": "message" + } + ], + "type": "catch" + }, + { + "messages": [ + { + "from": { + "activity_id": "530651320277188697", + "activity_name": "clanguml::t20023::A::a()", + "participant_id": "750638294800359616", + "participant_name": "clanguml::t20023::A" + }, + "name": "a4()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20023/t20023.cc", + "line": 24 + }, + "to": { + "activity_id": "1082587698374248813", + "activity_name": "clanguml::t20023::A::a4()", + "participant_id": "750638294800359616", + "participant_name": "clanguml::t20023::A" + }, + "type": "message" + } + ], + "type": "catch" + } + ], + "name": "try", + "type": "break" + } + ], + "start_from": { + "id": 761552264135157511, + "location": "clanguml::t20023::tmain()" + } + } + ], + "using_namespace": "clanguml::t20023" +} +``` diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg index 5f7368e5..49ff7c9b 100644 --- a/docs/test_cases/t20023_sequence.svg +++ b/docs/test_cases/t20023_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,37 +9,37 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - + + + + + + + a() @@ -47,7 +47,7 @@ try - + @@ -60,7 +60,7 @@ [std::runtime_error &] - + @@ -73,7 +73,7 @@ [std::logic_error &] - + @@ -86,7 +86,7 @@ [...] - + diff --git a/docs/test_cases/t20024.md b/docs/test_cases/t20024.md index 5e439a97..60ff1377 100644 --- a/docs/test_cases/t20024.md +++ b/docs/test_cases/t20024.md @@ -87,3 +87,332 @@ int tmain() ``` ## Generated UML diagrams ![t20024_sequence](./t20024_sequence.svg "Switch statement sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20024_sequence", + "participants": [ + { + "id": "1919714441225983014", + "name": "clanguml::t20024::tmain()", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 53 + }, + "type": "function" + }, + { + "id": "40786919835708828", + "name": "clanguml::t20024::A", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 8 + }, + "type": "class" + }, + { + "id": "933287014626440872", + "name": "clanguml::t20024::B", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 29 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1919714441225983014", + "activity_name": "clanguml::t20024::tmain()", + "participant_id": "1919714441225983014", + "participant_name": "clanguml::t20024::tmain()" + }, + "name": "select(enum_a)", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 58 + }, + "to": { + "activity_id": "1200587047701031901", + "activity_name": "clanguml::t20024::A::select(enum_a)", + "participant_id": "40786919835708828", + "participant_name": "clanguml::t20024::A" + }, + "type": "message" + }, + { + "activity_id": "1200587047701031901", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "1200587047701031901", + "activity_name": "clanguml::t20024::A::select(enum_a)", + "participant_id": "40786919835708828", + "participant_name": "clanguml::t20024::A" + }, + "name": "a0()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 13 + }, + "to": { + "activity_id": "1859614580641799156", + "activity_name": "clanguml::t20024::A::a0()", + "participant_id": "40786919835708828", + "participant_name": "clanguml::t20024::A" + }, + "type": "message" + } + ], + "name": "zero", + "type": "case" + }, + { + "messages": [ + { + "from": { + "activity_id": "1200587047701031901", + "activity_name": "clanguml::t20024::A::select(enum_a)", + "participant_id": "40786919835708828", + "participant_name": "clanguml::t20024::A" + }, + "name": "a1()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 15 + }, + "to": { + "activity_id": "501598940454911460", + "activity_name": "clanguml::t20024::A::a1()", + "participant_id": "40786919835708828", + "participant_name": "clanguml::t20024::A" + }, + "type": "message" + } + ], + "name": "one", + "type": "case" + }, + { + "messages": [ + { + "from": { + "activity_id": "1200587047701031901", + "activity_name": "clanguml::t20024::A::select(enum_a)", + "participant_id": "40786919835708828", + "participant_name": "clanguml::t20024::A" + }, + "name": "a2()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 17 + }, + "to": { + "activity_id": "1698866541173753340", + "activity_name": "clanguml::t20024::A::a2()", + "participant_id": "40786919835708828", + "participant_name": "clanguml::t20024::A" + }, + "type": "message" + } + ], + "name": "two", + "type": "case" + }, + { + "messages": [ + { + "from": { + "activity_id": "1200587047701031901", + "activity_name": "clanguml::t20024::A::select(enum_a)", + "participant_id": "40786919835708828", + "participant_name": "clanguml::t20024::A" + }, + "name": "a3()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 19 + }, + "to": { + "activity_id": "490376438551958259", + "activity_name": "clanguml::t20024::A::a3()", + "participant_id": "40786919835708828", + "participant_name": "clanguml::t20024::A" + }, + "type": "message" + } + ], + "name": "default", + "type": "case" + } + ], + "name": "switch", + "type": "alt" + }, + { + "from": { + "activity_id": "1919714441225983014", + "activity_name": "clanguml::t20024::tmain()", + "participant_id": "1919714441225983014", + "participant_name": "clanguml::t20024::tmain()" + }, + "name": "select(colors)", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 60 + }, + "to": { + "activity_id": "286108218156977422", + "activity_name": "clanguml::t20024::B::select(colors)", + "participant_id": "933287014626440872", + "participant_name": "clanguml::t20024::B" + }, + "type": "message" + }, + { + "activity_id": "286108218156977422", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "286108218156977422", + "activity_name": "clanguml::t20024::B::select(colors)", + "participant_id": "933287014626440872", + "participant_name": "clanguml::t20024::B" + }, + "name": "red()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 34 + }, + "to": { + "activity_id": "112014563206084467", + "activity_name": "clanguml::t20024::B::red()", + "participant_id": "933287014626440872", + "participant_name": "clanguml::t20024::B" + }, + "type": "message" + } + ], + "name": "enum colors::red", + "type": "case" + }, + { + "messages": [ + { + "from": { + "activity_id": "286108218156977422", + "activity_name": "clanguml::t20024::B::select(colors)", + "participant_id": "933287014626440872", + "participant_name": "clanguml::t20024::B" + }, + "name": "orange()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 37 + }, + "to": { + "activity_id": "2222823236498505185", + "activity_name": "clanguml::t20024::B::orange()", + "participant_id": "933287014626440872", + "participant_name": "clanguml::t20024::B" + }, + "type": "message" + } + ], + "name": "enum colors::orange", + "type": "case" + }, + { + "messages": [ + { + "from": { + "activity_id": "286108218156977422", + "activity_name": "clanguml::t20024::B::select(colors)", + "participant_id": "933287014626440872", + "participant_name": "clanguml::t20024::B" + }, + "name": "green()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 40 + }, + "to": { + "activity_id": "519021723720658376", + "activity_name": "clanguml::t20024::B::green()", + "participant_id": "933287014626440872", + "participant_name": "clanguml::t20024::B" + }, + "type": "message" + } + ], + "name": "enum colors::green", + "type": "case" + }, + { + "messages": [ + { + "from": { + "activity_id": "286108218156977422", + "activity_name": "clanguml::t20024::B::select(colors)", + "participant_id": "933287014626440872", + "participant_name": "clanguml::t20024::B" + }, + "name": "grey()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20024/t20024.cc", + "line": 43 + }, + "to": { + "activity_id": "1813557671878544737", + "activity_name": "clanguml::t20024::B::grey()", + "participant_id": "933287014626440872", + "participant_name": "clanguml::t20024::B" + }, + "type": "message" + } + ], + "name": "default", + "type": "case" + } + ], + "name": "switch", + "type": "alt" + } + ], + "start_from": { + "id": 1919714441225983014, + "location": "clanguml::t20024::tmain()" + } + } + ], + "using_namespace": "clanguml::t20024" +} +``` diff --git a/docs/test_cases/t20024_sequence.svg b/docs/test_cases/t20024_sequence.svg index 3cd09910..6b131bba 100644 --- a/docs/test_cases/t20024_sequence.svg +++ b/docs/test_cases/t20024_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -33,36 +33,36 @@ - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + select(enum_a) @@ -72,7 +72,7 @@ switch [zero] - + @@ -85,7 +85,7 @@ [one] - + @@ -98,7 +98,7 @@ [two] - + @@ -111,7 +111,7 @@ [default] - + @@ -124,7 +124,7 @@ - + select(colors) @@ -134,7 +134,7 @@ switch [enum colors::red] - + @@ -143,7 +143,7 @@ [enum colors::orange] - + @@ -152,7 +152,7 @@ [enum colors::green] - + @@ -161,7 +161,7 @@ [default] - + diff --git a/docs/test_cases/t20025.md b/docs/test_cases/t20025.md index f5e9601a..a72f0615 100644 --- a/docs/test_cases/t20025.md +++ b/docs/test_cases/t20025.md @@ -67,3 +67,116 @@ int tmain() ``` ## Generated UML diagrams ![t20025_sequence](./t20025_sequence.svg "Skip decorator sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20025_sequence", + "participants": [ + { + "id": "1268545806896171690", + "name": "clanguml::t20025::tmain()", + "source_location": { + "file": "../../tests/t20025/t20025.cc", + "line": 30 + }, + "type": "function" + }, + { + "id": "2144852170258286289", + "name": "clanguml::t20025::A", + "source_location": { + "file": "../../tests/t20025/t20025.cc", + "line": 14 + }, + "type": "class" + }, + { + "id": "228843323046630374", + "name": "clanguml::t20025::add(int,int)", + "source_location": { + "file": "../../tests/t20025/t20025.cc", + "line": 4 + }, + "type": "function" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1268545806896171690", + "activity_name": "clanguml::t20025::tmain()", + "participant_id": "1268545806896171690", + "participant_name": "clanguml::t20025::tmain()" + }, + "name": "a()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20025/t20025.cc", + "line": 36 + }, + "to": { + "activity_id": "1119830104994271584", + "activity_name": "clanguml::t20025::A::a()", + "participant_id": "2144852170258286289", + "participant_name": "clanguml::t20025::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1119830104994271584", + "activity_name": "clanguml::t20025::A::a()", + "participant_id": "2144852170258286289", + "participant_name": "clanguml::t20025::A" + }, + "name": "a2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20025/t20025.cc", + "line": 19 + }, + "to": { + "activity_id": "2059622670024664066", + "activity_name": "clanguml::t20025::A::a2()", + "participant_id": "2144852170258286289", + "participant_name": "clanguml::t20025::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1268545806896171690", + "activity_name": "clanguml::t20025::tmain()", + "participant_id": "1268545806896171690", + "participant_name": "clanguml::t20025::tmain()" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20025/t20025.cc", + "line": 38 + }, + "to": { + "activity_id": "228843323046630374", + "activity_name": "clanguml::t20025::add(int,int)", + "participant_id": "228843323046630374", + "participant_name": "clanguml::t20025::add(int,int)" + }, + "type": "message" + } + ], + "start_from": { + "id": 1268545806896171690, + "location": "clanguml::t20025::tmain()" + } + } + ], + "using_namespace": "clanguml::t20025" +} +``` diff --git a/docs/test_cases/t20025_sequence.svg b/docs/test_cases/t20025_sequence.svg index 0d6e5f21..cf298ae3 100644 --- a/docs/test_cases/t20025_sequence.svg +++ b/docs/test_cases/t20025_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,41 +9,41 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + add(int,int) - + add(int,int) - - - - - + + + + + a() - + @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t20026.md b/docs/test_cases/t20026.md index 6bba6e41..0c037d13 100644 --- a/docs/test_cases/t20026.md +++ b/docs/test_cases/t20026.md @@ -47,3 +47,63 @@ int tmain() ``` ## Generated UML diagrams ![t20026_sequence](./t20026_sequence.svg "Virtual method call sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20026_sequence", + "participants": [ + { + "id": "2268697350307997040", + "name": "clanguml::t20026::tmain()", + "source_location": { + "file": "../../tests/t20026/t20026.cc", + "line": 16 + }, + "type": "function" + }, + { + "id": "1962121823853291899", + "name": "clanguml::t20026::A", + "source_location": { + "file": "../../tests/t20026/t20026.cc", + "line": 4 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "2268697350307997040", + "activity_name": "clanguml::t20026::tmain()", + "participant_id": "2268697350307997040", + "participant_name": "clanguml::t20026::tmain()" + }, + "name": "a()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20026/t20026.cc", + "line": 20 + }, + "to": { + "activity_id": "600590770418147864", + "activity_name": "clanguml::t20026::A::a()", + "participant_id": "1962121823853291899", + "participant_name": "clanguml::t20026::A" + }, + "type": "message" + } + ], + "start_from": { + "id": 2268697350307997040, + "location": "clanguml::t20026::tmain()" + } + } + ], + "using_namespace": "clanguml::t20026" +} +``` diff --git a/docs/test_cases/t20026_sequence.svg b/docs/test_cases/t20026_sequence.svg index d8b230d7..e5081fbe 100644 --- a/docs/test_cases/t20026_sequence.svg +++ b/docs/test_cases/t20026_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20027.md b/docs/test_cases/t20027.md index d1adac47..345a1ad5 100644 --- a/docs/test_cases/t20027.md +++ b/docs/test_cases/t20027.md @@ -46,3 +46,63 @@ void tmain() ``` ## Generated UML diagrams ![t20027_sequence](./t20027_sequence.svg "Filter call expressions based on access test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20027_sequence", + "participants": [ + { + "id": "1581009482994430286", + "name": "clanguml::t20027::tmain()", + "source_location": { + "file": "../../tests/t20027/t20027.cc", + "line": 15 + }, + "type": "function" + }, + { + "id": "583525629936262089", + "name": "clanguml::t20027::A", + "source_location": { + "file": "../../tests/t20027/t20027.cc", + "line": 4 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "1581009482994430286", + "activity_name": "clanguml::t20027::tmain()", + "participant_id": "1581009482994430286", + "participant_name": "clanguml::t20027::tmain()" + }, + "name": "a()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20027/t20027.cc", + "line": 19 + }, + "to": { + "activity_id": "910514967786202717", + "activity_name": "clanguml::t20027::A::a()", + "participant_id": "583525629936262089", + "participant_name": "clanguml::t20027::A" + }, + "type": "message" + } + ], + "start_from": { + "id": 1581009482994430286, + "location": "clanguml::t20027::tmain()" + } + } + ], + "using_namespace": "clanguml::t20027" +} +``` diff --git a/docs/test_cases/t20027_sequence.svg b/docs/test_cases/t20027_sequence.svg index 06d3dc7e..f2a3cc34 100644 --- a/docs/test_cases/t20027_sequence.svg +++ b/docs/test_cases/t20027_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20028.md b/docs/test_cases/t20028.md index b603b9fb..a02f5ae9 100644 --- a/docs/test_cases/t20028.md +++ b/docs/test_cases/t20028.md @@ -56,3 +56,146 @@ int tmain() ``` ## Generated UML diagrams ![t20028_sequence](./t20028_sequence.svg "Conditional (ternary) '?:' operator test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20028_sequence", + "participants": [ + { + "id": "1347206662193933194", + "name": "clanguml::t20028::tmain()", + "source_location": { + "file": "../../tests/t20028/t20028.cc", + "line": 17 + }, + "type": "function" + }, + { + "id": "2073479923903128898", + "name": "clanguml::t20028::A", + "source_location": { + "file": "../../tests/t20028/t20028.cc", + "line": 4 + }, + "type": "class" + } + ], + "sequences": [ + { + "messages": [ + { + "activity_id": "1347206662193933194", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "1347206662193933194", + "activity_name": "clanguml::t20028::tmain()", + "participant_id": "1347206662193933194", + "participant_name": "clanguml::t20028::tmain()" + }, + "name": "a()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20028/t20028.cc", + "line": 26 + }, + "to": { + "activity_id": "666210834901940781", + "activity_name": "clanguml::t20028::A::a()", + "participant_id": "2073479923903128898", + "participant_name": "clanguml::t20028::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1347206662193933194", + "activity_name": "clanguml::t20028::tmain()", + "participant_id": "1347206662193933194", + "participant_name": "clanguml::t20028::tmain()" + }, + "name": "b()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20028/t20028.cc", + "line": 26 + }, + "to": { + "activity_id": "793793464184037795", + "activity_name": "clanguml::t20028::A::b()", + "participant_id": "2073479923903128898", + "participant_name": "clanguml::t20028::A" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1347206662193933194", + "activity_name": "clanguml::t20028::tmain()", + "participant_id": "1347206662193933194", + "participant_name": "clanguml::t20028::tmain()" + }, + "name": "c()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20028/t20028.cc", + "line": 26 + }, + "to": { + "activity_id": "1582152567698110078", + "activity_name": "clanguml::t20028::A::c()", + "participant_id": "2073479923903128898", + "participant_name": "clanguml::t20028::A" + }, + "type": "message" + } + ], + "type": "consequent" + }, + { + "messages": [ + { + "from": { + "activity_id": "1347206662193933194", + "activity_name": "clanguml::t20028::tmain()", + "participant_id": "1347206662193933194", + "participant_name": "clanguml::t20028::tmain()" + }, + "name": "d()", + "return_type": "int", + "scope": "normal", + "source_location": { + "file": "../../tests/t20028/t20028.cc", + "line": 26 + }, + "to": { + "activity_id": "1178268687951492696", + "activity_name": "clanguml::t20028::A::d()", + "participant_id": "2073479923903128898", + "participant_name": "clanguml::t20028::A" + }, + "type": "message" + } + ], + "type": "alternative" + } + ], + "name": "conditional", + "type": "alt" + } + ], + "start_from": { + "id": 1347206662193933194, + "location": "clanguml::t20028::tmain()" + } + } + ], + "using_namespace": "clanguml::t20028" +} +``` diff --git a/docs/test_cases/t20028_sequence.svg b/docs/test_cases/t20028_sequence.svg index d5d0402d..d3f4e627 100644 --- a/docs/test_cases/t20028_sequence.svg +++ b/docs/test_cases/t20028_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,50 +9,50 @@ - - - - - - + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - + + + + + alt - + a() - + b() - + c() @@ -60,7 +60,7 @@ - + d() diff --git a/docs/test_cases/t20029.md b/docs/test_cases/t20029.md index 352f9f77..5dc92331 100644 --- a/docs/test_cases/t20029.md +++ b/docs/test_cases/t20029.md @@ -100,3 +100,238 @@ int tmain() ``` ## Generated UML diagrams ![t20029_sequence](./t20029_sequence.svg "Combined feature sequence diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "sequence", + "name": "t20029_sequence", + "participants": [ + { + "id": "2091374738808319642", + "name": "clanguml::t20029::tmain()", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 55 + }, + "type": "function" + }, + { + "id": "1673261195873192383", + "name": "clanguml::t20029::Encoder>", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 11 + }, + "type": "class" + }, + { + "id": "658058855590948094", + "name": "clanguml::t20029::Retrier", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 22 + }, + "type": "class" + }, + { + "id": "1896406205097618937", + "name": "clanguml::t20029::ConnectionPool", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 39 + }, + "type": "class" + }, + { + "id": "1362646431260879440", + "name": "clanguml::t20029::encode_b64(std::string &&)", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 9 + }, + "type": "function" + } + ], + "sequences": [ + { + "messages": [ + { + "from": { + "activity_id": "2091374738808319642", + "activity_name": "clanguml::t20029::tmain()", + "participant_id": "2091374738808319642", + "participant_name": "clanguml::t20029::tmain()" + }, + "name": "connect()", + "return_type": "void", + "scope": "normal", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 59 + }, + "to": { + "activity_id": "940428568182104530", + "activity_name": "clanguml::t20029::ConnectionPool::connect()", + "participant_id": "1896406205097618937", + "participant_name": "clanguml::t20029::ConnectionPool" + }, + "type": "message" + }, + { + "activity_id": "2091374738808319642", + "messages": [ + { + "activity_id": "2091374738808319642", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "2091374738808319642", + "activity_name": "clanguml::t20029::tmain()", + "participant_id": "2091374738808319642", + "participant_name": "clanguml::t20029::tmain()" + }, + "name": "send(std::string &&)", + "return_type": "_Bool", + "scope": "condition", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 62 + }, + "to": { + "activity_id": "2026763864005979273", + "activity_name": "clanguml::t20029::Encoder>::send(std::string &&)", + "participant_id": "1673261195873192383", + "participant_name": "clanguml::t20029::Encoder>" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2026763864005979273", + "activity_name": "clanguml::t20029::Encoder>::send(std::string &&)", + "participant_id": "1673261195873192383", + "participant_name": "clanguml::t20029::Encoder>" + }, + "name": "encode(std::string &&)", + "return_type": "std::string", + "scope": "normal", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 15 + }, + "to": { + "activity_id": "1468258269466480773", + "activity_name": "clanguml::t20029::Encoder>::encode(std::string &&)", + "participant_id": "1673261195873192383", + "participant_name": "clanguml::t20029::Encoder>" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1468258269466480773", + "activity_name": "clanguml::t20029::Encoder>::encode(std::string &&)", + "participant_id": "1673261195873192383", + "participant_name": "clanguml::t20029::Encoder>" + }, + "name": "", + "return_type": "", + "scope": "normal", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 19 + }, + "to": { + "activity_id": "1362646431260879440", + "activity_name": "clanguml::t20029::encode_b64(std::string &&)", + "participant_id": "1362646431260879440", + "participant_name": "clanguml::t20029::encode_b64(std::string &&)" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2026763864005979273", + "activity_name": "clanguml::t20029::Encoder>::send(std::string &&)", + "participant_id": "1673261195873192383", + "participant_name": "clanguml::t20029::Encoder>" + }, + "name": "send(std::string &&)", + "return_type": "_Bool", + "scope": "normal", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 15 + }, + "to": { + "activity_id": "30515971485361302", + "activity_name": "clanguml::t20029::Retrier::send(std::string &&)", + "participant_id": "658058855590948094", + "participant_name": "clanguml::t20029::Retrier" + }, + "type": "message" + }, + { + "activity_id": "30515971485361302", + "messages": [ + { + "activity_id": "30515971485361302", + "branches": [ + { + "messages": [ + { + "from": { + "activity_id": "30515971485361302", + "activity_name": "clanguml::t20029::Retrier::send(std::string &&)", + "participant_id": "658058855590948094", + "participant_name": "clanguml::t20029::Retrier" + }, + "name": "send(const std::string &)", + "return_type": "_Bool", + "scope": "condition", + "source_location": { + "file": "../../tests/t20029/t20029.cc", + "line": 31 + }, + "to": { + "activity_id": "972625940114169157", + "activity_name": "clanguml::t20029::ConnectionPool::send(const std::string &)", + "participant_id": "1896406205097618937", + "participant_name": "clanguml::t20029::ConnectionPool" + }, + "type": "message" + } + ], + "type": "consequent" + } + ], + "name": "if", + "type": "alt" + } + ], + "name": "while", + "type": "loop" + } + ], + "type": "consequent" + } + ], + "name": "if", + "type": "alt" + } + ], + "name": "for", + "type": "loop" + } + ], + "start_from": { + "id": 2091374738808319642, + "location": "clanguml::t20029::tmain()" + } + } + ], + "using_namespace": "clanguml::t20029" +} +``` diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg index 3cb2fc4a..428f0973 100644 --- a/docs/test_cases/t20029_sequence.svg +++ b/docs/test_cases/t20029_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,60 +9,60 @@ - - - - - - - - - - - + + + + + + + + + + + - - + + tmain() - + tmain() - - + + Encoder<Retrier<ConnectionPool>> - + Encoder<Retrier<ConnectionPool>> - - + + Retrier<ConnectionPool> - + Retrier<ConnectionPool> - - + + ConnectionPool - + ConnectionPool - - + + encode_b64(std::string &&) - + encode_b64(std::string &&) - - - - - - - - + + + + + + + + connect() @@ -73,21 +73,21 @@ alt - + [ send(std::string &&) ] - + encode(std::string &&) - + @@ -97,7 +97,7 @@ - + send(std::string &&) @@ -108,7 +108,7 @@ alt - + [ diff --git a/docs/test_cases/t30001.md b/docs/test_cases/t30001.md index a81a983f..dc4f0dbe 100644 --- a/docs/test_cases/t30001.md +++ b/docs/test_cases/t30001.md @@ -58,3 +58,140 @@ namespace BB { ``` ## Generated UML diagrams ![t30001_package](./t30001_package.svg "Basic package diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "package", + "elements": [ + { + "display_name": "clanguml::t30001::A", + "elements": [ + { + "comment": { + "formatted": "This is namespace AA in namespace A", + "raw": "/// This is namespace AA in namespace A" + }, + "display_name": "clanguml::t30001::A::AA", + "elements": [ + { + "display_name": "clanguml::t30001::A::AA::AAA", + "id": "274638237740249424", + "is_deprecated": false, + "name": "AAA", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 6 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30001::A::AA::BBB", + "id": "2129154382024012563", + "is_deprecated": false, + "name": "BBB", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 8 + }, + "type": "namespace" + } + ], + "id": "1528517990989164155", + "is_deprecated": false, + "name": "AA", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 5 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30001::A::BB", + "id": "983199564524723281", + "is_deprecated": false, + "name": "BB", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 11 + }, + "type": "namespace" + } + ], + "id": "1184614645531659789", + "is_deprecated": false, + "name": "A", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 3 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30001::B", + "elements": [ + { + "comment": { + "formatted": "This is namespace AA in namespace B", + "raw": "/// This is namespace AA in namespace B" + }, + "display_name": "clanguml::t30001::B::AA", + "elements": [ + { + "display_name": "clanguml::t30001::B::AA::AAA", + "id": "262162485307734028", + "is_deprecated": false, + "name": "AAA", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 17 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30001::B::AA::BBB", + "id": "18542334992237803", + "is_deprecated": false, + "name": "BBB", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 19 + }, + "type": "namespace" + } + ], + "id": "895913707182089871", + "is_deprecated": false, + "name": "AA", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 16 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30001::B::BB", + "id": "2230464321696304488", + "is_deprecated": false, + "name": "BB", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 22 + }, + "type": "namespace" + } + ], + "id": "1931735210112054430", + "is_deprecated": false, + "name": "B", + "source_location": { + "file": "../../tests/t30001/t30001.cc", + "line": 14 + }, + "type": "namespace" + } + ], + "name": "t30001_package", + "relationships": [], + "using_namespace": "clanguml::t30001" +} +``` diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 021a78a6..9ae8b415 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,63 +9,63 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B diff --git a/docs/test_cases/t30002.md b/docs/test_cases/t30002.md index 27475505..357e11f0 100644 --- a/docs/test_cases/t30002.md +++ b/docs/test_cases/t30002.md @@ -138,3 +138,367 @@ template std::map> cm() ``` ## Generated UML diagrams ![t30002_package](./t30002_package.svg "Package dependency test case") +## Generated JSON models +```json +{ + "diagram_type": "package", + "elements": [ + { + "display_name": "clanguml::t30002::A", + "elements": [ + { + "display_name": "clanguml::t30002::A::AA", + "elements": [ + { + "display_name": "clanguml::t30002::A::AA::A1", + "id": "1164966689017271053", + "is_deprecated": false, + "name": "A1", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 10 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A2", + "id": "695366113361481509", + "is_deprecated": false, + "name": "A2", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 13 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A3", + "id": "1267709074800873528", + "is_deprecated": false, + "name": "A3", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 16 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A4", + "id": "299262817531370604", + "is_deprecated": false, + "name": "A4", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 19 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A5", + "id": "1207764290216680521", + "is_deprecated": false, + "name": "A5", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 22 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A6", + "id": "899091126727901939", + "is_deprecated": false, + "name": "A6", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 25 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A7", + "id": "563861734550555261", + "is_deprecated": false, + "name": "A7", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 28 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A8", + "id": "839146342143718390", + "is_deprecated": false, + "name": "A8", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 31 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A9", + "id": "1650835159458422245", + "is_deprecated": false, + "name": "A9", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 34 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A10", + "id": "1453242941322376182", + "is_deprecated": false, + "name": "A10", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 37 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A11", + "id": "384833776371876986", + "is_deprecated": false, + "name": "A11", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 40 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A12", + "id": "1199527037490355138", + "is_deprecated": false, + "name": "A12", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 43 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A13", + "id": "620689743711615190", + "is_deprecated": false, + "name": "A13", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 46 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A14", + "id": "301858476377711436", + "is_deprecated": false, + "name": "A14", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 49 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A15", + "id": "561239706327729436", + "is_deprecated": false, + "name": "A15", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 52 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A16", + "id": "1415398383158410524", + "is_deprecated": false, + "name": "A16", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 55 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::A::AA::A17", + "id": "532437874530119999", + "is_deprecated": false, + "name": "A17", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 58 + }, + "type": "namespace" + } + ], + "id": "1669745471968085401", + "is_deprecated": false, + "name": "AA", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 9 + }, + "type": "namespace" + } + ], + "id": "1543480715632256641", + "is_deprecated": false, + "name": "A", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 9 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30002::B", + "elements": [ + { + "display_name": "clanguml::t30002::B::BB", + "elements": [ + { + "display_name": "clanguml::t30002::B::BB::BBB", + "id": "2255521339657425355", + "is_deprecated": false, + "name": "BBB", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 62 + }, + "type": "namespace" + } + ], + "id": "1938861639623819235", + "is_deprecated": false, + "name": "BB", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 62 + }, + "type": "namespace" + } + ], + "id": "145302773464360955", + "is_deprecated": false, + "name": "B", + "source_location": { + "file": "../../tests/t30002/t30002.cc", + "line": 62 + }, + "type": "namespace" + } + ], + "name": "t30002_package", + "relationships": [ + { + "access": "public", + "destination": "301858476377711436", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "1207764290216680521", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "563861734550555261", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "839146342143718390", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "1650835159458422245", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "1164966689017271053", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "695366113361481509", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "1267709074800873528", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "299262817531370604", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "561239706327729436", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "1415398383158410524", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "532437874530119999", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "899091126727901939", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "1453242941322376182", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "384833776371876986", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "1199527037490355138", + "source": "2255521339657425355", + "type": "dependency" + }, + { + "access": "public", + "destination": "620689743711615190", + "source": "2255521339657425355", + "type": "dependency" + } + ], + "using_namespace": "clanguml::t30002" +} +``` diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index 48d097b8..aa760946 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,113 +9,113 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + BBB diff --git a/docs/test_cases/t30003.md b/docs/test_cases/t30003.md index f8407a0c..1b926eea 100644 --- a/docs/test_cases/t30003.md +++ b/docs/test_cases/t30003.md @@ -26,27 +26,123 @@ namespace t30003 { namespace ns1 { namespace ns2_v1_0_0 { class A { }; -} +} // namespace ns2_v1_0_0 namespace [[deprecated]] ns2_v0_9_0 { class A { }; -} +} // namespace ns2_v0_9_0 namespace { class Anon final { }; -} -} +} // namespace +} // namespace ns1 namespace [[deprecated]] ns3 { namespace ns1::ns2 { class Anon : public t30003::ns1::ns2_v1_0_0::A { }; -} +} // namespace ns1::ns2 class B : public ns1::ns2::Anon { }; -} -} -} +} // namespace ns3 +} // namespace t30003 +} // namespace clanguml ``` ## Generated UML diagrams ![t30003_package](./t30003_package.svg "Package deprecated attribute test case") +## Generated JSON models +```json +{ + "diagram_type": "package", + "elements": [ + { + "display_name": "clanguml::t30003::ns1", + "elements": [ + { + "display_name": "clanguml::t30003::ns1::ns2_v1_0_0", + "id": "647755950450743637", + "is_deprecated": false, + "name": "ns2_v1_0_0", + "source_location": { + "file": "../../tests/t30003/t30003.cc", + "line": 5 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30003::ns1::ns2_v0_9_0", + "id": "1013406647495422406", + "is_deprecated": true, + "name": "ns2_v0_9_0", + "source_location": { + "file": "../../tests/t30003/t30003.cc", + "line": 9 + }, + "type": "namespace" + } + ], + "id": "600452871069546589", + "is_deprecated": false, + "name": "ns1", + "source_location": { + "file": "../../tests/t30003/t30003.cc", + "line": 4 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30003::ns3", + "elements": [ + { + "display_name": "clanguml::t30003::ns3::ns1", + "elements": [ + { + "display_name": "clanguml::t30003::ns3::ns1::ns2", + "id": "820462660523726751", + "is_deprecated": false, + "name": "ns2", + "source_location": { + "file": "../../tests/t30003/t30003.cc", + "line": 20 + }, + "type": "namespace" + } + ], + "id": "1209144861141334061", + "is_deprecated": false, + "name": "ns1", + "source_location": { + "file": "../../tests/t30003/t30003.cc", + "line": 20 + }, + "type": "namespace" + } + ], + "id": "427104404739526818", + "is_deprecated": true, + "name": "ns3", + "source_location": { + "file": "../../tests/t30003/t30003.cc", + "line": 18 + }, + "type": "namespace" + } + ], + "name": "t30003_package", + "relationships": [ + { + "access": "public", + "destination": "820462660523726751", + "source": "427104404739526818", + "type": "dependency" + }, + { + "access": "public", + "destination": "647755950450743637", + "source": "820462660523726751", + "type": "dependency" + } + ], + "using_namespace": "clanguml::t30003" +} +``` diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index a216c1b2..8405efa9 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,35 +9,35 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 diff --git a/docs/test_cases/t30004.md b/docs/test_cases/t30004.md index df36dab7..48da7baa 100644 --- a/docs/test_cases/t30004.md +++ b/docs/test_cases/t30004.md @@ -58,3 +58,91 @@ namespace CCC { ``` ## Generated UML diagrams ![t30004_package](./t30004_package.svg "PlantUML package decorators test case") +## Generated JSON models +```json +{ + "diagram_type": "package", + "elements": [ + { + "comment": { + "formatted": "@uml{style[#green]}", + "raw": "/// @uml{style[#green]}" + }, + "display_name": "clanguml::t30004::A", + "elements": [ + { + "comment": { + "formatted": "@uml{note[ bottom ] Package AAA.}", + "raw": "/// @uml{note[ bottom ] Package AAA.}" + }, + "display_name": "clanguml::t30004::A::AAA", + "id": "1517185300862579159", + "is_deprecated": false, + "name": "AAA", + "source_location": { + "file": "../../tests/t30004/t30004.cc", + "line": 8 + }, + "type": "namespace" + }, + { + "comment": { + "formatted": "\\uml{note[right] Package BBB.}", + "raw": "/// \\uml{note[right] Package BBB.}" + }, + "display_name": "clanguml::t30004::A::BBB", + "id": "1982379087062354928", + "is_deprecated": false, + "name": "BBB", + "source_location": { + "file": "../../tests/t30004/t30004.cc", + "line": 12 + }, + "type": "namespace" + }, + { + "comment": { + "formatted": "\n @uml{note:t30004_package[bottom] CCCC package note.}\n This is package CCC.", + "raw": "///\n/// @uml{note:t30004_package[bottom] CCCC package note.}\n/// This is package CCC." + }, + "display_name": "clanguml::t30004::A::CCC", + "id": "2304726195556701567", + "is_deprecated": false, + "name": "CCC", + "source_location": { + "file": "../../tests/t30004/t30004.cc", + "line": 18 + }, + "type": "namespace" + }, + { + "comment": { + "formatted": "@uml{style[#pink;line:red;line.bold;text:red]}\n\\uml{note[top] We skipped DDD.}", + "raw": "/// @uml{style[#pink;line:red;line.bold;text:red]}\n/// \\uml{note[top] We skipped DDD.}" + }, + "display_name": "clanguml::t30004::A::EEE", + "id": "1084924732216290779", + "is_deprecated": false, + "name": "EEE", + "source_location": { + "file": "../../tests/t30004/t30004.cc", + "line": 27 + }, + "type": "namespace" + } + ], + "id": "33410665874039845", + "is_deprecated": false, + "name": "A", + "source_location": { + "file": "../../tests/t30004/t30004.cc", + "line": 5 + }, + "type": "namespace" + } + ], + "name": "t30004_package", + "relationships": [], + "using_namespace": "clanguml::t30004" +} +``` diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index 7c0f42ba..ac0952e0 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE diff --git a/docs/test_cases/t30005.md b/docs/test_cases/t30005.md index 273f2b41..fbbe02ef 100644 --- a/docs/test_cases/t30005.md +++ b/docs/test_cases/t30005.md @@ -50,3 +50,138 @@ struct C2 { ``` ## Generated UML diagrams ![t30005_package](./t30005_package.svg "Package namespace alias test case") +## Generated JSON models +```json +{ + "diagram_type": "package", + "elements": [ + { + "display_name": "clanguml::t30005::A", + "elements": [ + { + "display_name": "clanguml::t30005::A::AA", + "elements": [ + { + "display_name": "clanguml::t30005::A::AA::AAA", + "id": "914090901927655181", + "is_deprecated": false, + "name": "AAA", + "source_location": { + "file": "../../tests/t30005/t30005.cc", + "line": 4 + }, + "type": "namespace" + } + ], + "id": "1777547159021391040", + "is_deprecated": false, + "name": "AA", + "source_location": { + "file": "../../tests/t30005/t30005.cc", + "line": 4 + }, + "type": "namespace" + } + ], + "id": "1768303675686131578", + "is_deprecated": false, + "name": "A", + "source_location": { + "file": "../../tests/t30005/t30005.cc", + "line": 4 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30005::B", + "elements": [ + { + "display_name": "clanguml::t30005::B::BB", + "elements": [ + { + "display_name": "clanguml::t30005::B::BB::BBB", + "id": "1871026935460001668", + "is_deprecated": false, + "name": "BBB", + "source_location": { + "file": "../../tests/t30005/t30005.cc", + "line": 8 + }, + "type": "namespace" + } + ], + "id": "1696631362104244809", + "is_deprecated": false, + "name": "BB", + "source_location": { + "file": "../../tests/t30005/t30005.cc", + "line": 8 + }, + "type": "namespace" + } + ], + "id": "378529216628023051", + "is_deprecated": false, + "name": "B", + "source_location": { + "file": "../../tests/t30005/t30005.cc", + "line": 8 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30005::C", + "elements": [ + { + "display_name": "clanguml::t30005::C::CC", + "elements": [ + { + "display_name": "clanguml::t30005::C::CC::CCC", + "id": "1763279540133487999", + "is_deprecated": false, + "name": "CCC", + "source_location": { + "file": "../../tests/t30005/t30005.cc", + "line": 16 + }, + "type": "namespace" + } + ], + "id": "2134234141727442046", + "is_deprecated": false, + "name": "CC", + "source_location": { + "file": "../../tests/t30005/t30005.cc", + "line": 16 + }, + "type": "namespace" + } + ], + "id": "1041076320925403190", + "is_deprecated": false, + "name": "C", + "source_location": { + "file": "../../tests/t30005/t30005.cc", + "line": 16 + }, + "type": "namespace" + } + ], + "name": "t30005_package", + "relationships": [ + { + "access": "public", + "destination": "914090901927655181", + "source": "1871026935460001668", + "type": "dependency" + }, + { + "access": "public", + "destination": "914090901927655181", + "source": "1763279540133487999", + "type": "dependency" + } + ], + "using_namespace": "clanguml::t30005" +} +``` diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index a4e5785d..667219f3 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,48 +9,48 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC diff --git a/docs/test_cases/t30006.md b/docs/test_cases/t30006.md index 859cc273..2c783572 100644 --- a/docs/test_cases/t30006.md +++ b/docs/test_cases/t30006.md @@ -50,3 +50,64 @@ struct A2 { ``` ## Generated UML diagrams ![t30006_package](./t30006_package.svg "Package split namespace test case") +## Generated JSON models +```json +{ + "diagram_type": "package", + "elements": [ + { + "display_name": "clanguml::t30006::B", + "id": "1659090172211944144", + "is_deprecated": false, + "name": "B", + "source_location": { + "file": "../../tests/t30006/t30006.cc", + "line": 4 + }, + "type": "namespace" + }, + { + "comment": { + "formatted": "\\uml{note[top] Top A note.}", + "raw": "/// \\uml{note[top] Top A note.}" + }, + "display_name": "clanguml::t30006::A", + "id": "1499919423527579699", + "is_deprecated": false, + "name": "A", + "source_location": { + "file": "../../tests/t30006/t30006.cc", + "line": 9 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30006::C", + "id": "1380567463986115369", + "is_deprecated": false, + "name": "C", + "source_location": { + "file": "../../tests/t30006/t30006.cc", + "line": 15 + }, + "type": "namespace" + } + ], + "name": "t30006_package", + "relationships": [ + { + "access": "public", + "destination": "1659090172211944144", + "source": "1499919423527579699", + "type": "dependency" + }, + { + "access": "public", + "destination": "1380567463986115369", + "source": "1499919423527579699", + "type": "dependency" + } + ], + "using_namespace": "clanguml::t30006" +} +``` diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index 8e55e359..b593cdbe 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - + + B - - + + A - - + + C - + Top A note. diff --git a/docs/test_cases/t30007.md b/docs/test_cases/t30007.md index 40e86e09..a0c5c263 100644 --- a/docs/test_cases/t30007.md +++ b/docs/test_cases/t30007.md @@ -58,3 +58,77 @@ struct A2 { ``` ## Generated UML diagrams ![t30007_package](./t30007_package.svg "Package diagram layout hints test case") +## Generated JSON models +```json +{ + "diagram_type": "package", + "elements": [ + { + "display_name": "clanguml::t30007::B", + "id": "1852704221005355550", + "is_deprecated": false, + "name": "B", + "source_location": { + "file": "../../tests/t30007/t30007.cc", + "line": 4 + }, + "type": "namespace" + }, + { + "comment": { + "formatted": "\\uml{note[top] Compare layout with t30006.}", + "raw": "/// \\uml{note[top] Compare layout with t30006.}" + }, + "display_name": "clanguml::t30007::A", + "elements": [ + { + "display_name": "clanguml::t30007::A::AA", + "id": "357722505818238170", + "is_deprecated": false, + "name": "AA", + "source_location": { + "file": "../../tests/t30007/t30007.cc", + "line": 10 + }, + "type": "namespace" + } + ], + "id": "870874615388866345", + "is_deprecated": false, + "name": "A", + "source_location": { + "file": "../../tests/t30007/t30007.cc", + "line": 9 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30007::C", + "id": "937791537887318363", + "is_deprecated": false, + "name": "C", + "source_location": { + "file": "../../tests/t30007/t30007.cc", + "line": 17 + }, + "type": "namespace" + } + ], + "name": "t30007_package", + "relationships": [ + { + "access": "public", + "destination": "1852704221005355550", + "source": "357722505818238170", + "type": "dependency" + }, + { + "access": "public", + "destination": "937791537887318363", + "source": "357722505818238170", + "type": "dependency" + } + ], + "using_namespace": "clanguml::t30007" +} +``` diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index 96a79144..d5477fa6 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,27 +9,27 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. diff --git a/docs/test_cases/t30008.md b/docs/test_cases/t30008.md index 2b61f3b7..54a32b17 100644 --- a/docs/test_cases/t30008.md +++ b/docs/test_cases/t30008.md @@ -68,3 +68,155 @@ struct FF { ``` ## Generated UML diagrams ![t30008_package](./t30008_package.svg "Dependants and dependencies package diagram filter test") +## Generated JSON models +```json +{ + "diagram_type": "package", + "elements": [ + { + "display_name": "clanguml", + "elements": [ + { + "display_name": "clanguml::t30008", + "id": "588296309731944574", + "is_deprecated": false, + "name": "t30008", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 2 + }, + "type": "namespace" + } + ], + "id": "2174271399507040339", + "is_deprecated": false, + "name": "clanguml", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 1 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30008::dependants", + "elements": [ + { + "display_name": "clanguml::t30008::dependants::A", + "id": "2096441629244782012", + "is_deprecated": false, + "name": "A", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 7 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30008::dependants::B", + "id": "500208250168931957", + "is_deprecated": false, + "name": "B", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 10 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30008::dependants::C", + "id": "1095841247154575825", + "is_deprecated": false, + "name": "C", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 15 + }, + "type": "namespace" + } + ], + "id": "1601960042765615222", + "is_deprecated": false, + "name": "dependants", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 4 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30008::dependencies", + "elements": [ + { + "display_name": "clanguml::t30008::dependencies::D", + "id": "912387297717034254", + "is_deprecated": false, + "name": "D", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 27 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30008::dependencies::E", + "id": "1114997990364518938", + "is_deprecated": false, + "name": "E", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 30 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30008::dependencies::F", + "id": "1062827161678172094", + "is_deprecated": false, + "name": "F", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 35 + }, + "type": "namespace" + } + ], + "id": "2103969167872217960", + "is_deprecated": false, + "name": "dependencies", + "source_location": { + "file": "../../tests/t30008/t30008.cc", + "line": 23 + }, + "type": "namespace" + } + ], + "name": "t30008_package", + "relationships": [ + { + "access": "public", + "destination": "2096441629244782012", + "source": "500208250168931957", + "type": "dependency" + }, + { + "access": "public", + "destination": "500208250168931957", + "source": "1095841247154575825", + "type": "dependency" + }, + { + "access": "public", + "destination": "912387297717034254", + "source": "1114997990364518938", + "type": "dependency" + }, + { + "access": "public", + "destination": "1114997990364518938", + "source": "1062827161678172094", + "type": "dependency" + } + ], + "using_namespace": "clanguml::t30008" +} +``` diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index fca2649e..e17827b0 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F diff --git a/docs/test_cases/t30009.md b/docs/test_cases/t30009.md index 3dd65cb1..47469e8a 100644 --- a/docs/test_cases/t30009.md +++ b/docs/test_cases/t30009.md @@ -48,3 +48,128 @@ namespace D { ``` ## Generated UML diagrams ![t30009_package](./t30009_package.svg "Together layout hint test") +## Generated JSON models +```json +{ + "diagram_type": "package", + "elements": [ + { + "display_name": "clanguml::t30009::One", + "elements": [ + { + "display_name": "clanguml::t30009::One::A", + "id": "1189741240939898414", + "is_deprecated": false, + "name": "A", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 3 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30009::One::B", + "id": "209763670816643341", + "is_deprecated": false, + "name": "B", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 5 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30009::One::C", + "id": "946522260503371974", + "is_deprecated": false, + "name": "C", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 7 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30009::One::D", + "id": "1181245940399690936", + "is_deprecated": false, + "name": "D", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 9 + }, + "type": "namespace" + } + ], + "id": "1187941209208108244", + "is_deprecated": false, + "name": "One", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 2 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30009::Two", + "elements": [ + { + "display_name": "clanguml::t30009::Two::A", + "id": "986505573514384282", + "is_deprecated": false, + "name": "A", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 13 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30009::Two::B", + "id": "2156827588463114203", + "is_deprecated": false, + "name": "B", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 15 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30009::Two::C", + "id": "1653274432960093632", + "is_deprecated": false, + "name": "C", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 17 + }, + "type": "namespace" + }, + { + "display_name": "clanguml::t30009::Two::D", + "id": "263095551354153183", + "is_deprecated": false, + "name": "D", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 19 + }, + "type": "namespace" + } + ], + "id": "1940839474792549233", + "is_deprecated": false, + "name": "Two", + "source_location": { + "file": "../../tests/t30009/t30009.cc", + "line": 12 + }, + "type": "namespace" + } + ], + "name": "t30009_package", + "relationships": [], + "using_namespace": "clanguml::t30009" +} +``` diff --git a/docs/test_cases/t30009_package.svg b/docs/test_cases/t30009_package.svg index 6ea3a7db..08b5acab 100644 --- a/docs/test_cases/t30009_package.svg +++ b/docs/test_cases/t30009_package.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + One - - + + Two - - + + B - - + + D - - + + A - - + + C - - + + A - - + + B - - + + C - - + + D diff --git a/docs/test_cases/t40001.md b/docs/test_cases/t40001.md index d4663270..ef8bd71f 100644 --- a/docs/test_cases/t40001.md +++ b/docs/test_cases/t40001.md @@ -28,3 +28,116 @@ diagrams: ## Source code ## Generated UML diagrams ![t40001_include](./t40001_include.svg "Basic include graph diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "include", + "elements": [ + { + "display_name": "src", + "elements": [ + { + "display_name": "src/t40001.cc", + "file_kind": "implementation", + "id": "1755015016680017839", + "name": "t40001.cc", + "type": "file" + } + ], + "id": "1387619747296316447", + "name": "src", + "type": "folder" + }, + { + "display_name": "string", + "file_kind": "header", + "id": "1687197357150905926", + "name": "string", + "type": "file" + }, + { + "display_name": "vector", + "file_kind": "header", + "id": "405203884025072971", + "name": "vector", + "type": "file" + }, + { + "display_name": "include", + "elements": [ + { + "display_name": "include/t40001_include1.h", + "file_kind": "header", + "id": "1926692816440595520", + "name": "t40001_include1.h", + "type": "file" + }, + { + "display_name": "include/lib1", + "elements": [ + { + "display_name": "include/lib1/lib1.h", + "file_kind": "header", + "id": "2193549214042244690", + "name": "lib1.h", + "type": "file" + } + ], + "id": "1687675335949018432", + "name": "lib1", + "type": "folder" + } + ], + "id": "989412417490706876", + "name": "include", + "type": "folder" + }, + { + "display_name": "yaml-cpp/yaml.h", + "file_kind": "header", + "id": "1659736894483045485", + "name": "yaml-cpp/yaml.h", + "type": "file" + } + ], + "name": "t40001_include", + "relationships": [ + { + "access": "public", + "destination": "1687197357150905926", + "source": "1755015016680017839", + "type": "dependency" + }, + { + "access": "public", + "destination": "405203884025072971", + "source": "1755015016680017839", + "type": "dependency" + }, + { + "access": "public", + "destination": "1926692816440595520", + "source": "1755015016680017839", + "type": "association" + }, + { + "access": "public", + "destination": "2193549214042244690", + "source": "1926692816440595520", + "type": "association" + }, + { + "access": "public", + "destination": "1659736894483045485", + "source": "1926692816440595520", + "type": "dependency" + }, + { + "access": "public", + "destination": "1687197357150905926", + "source": "1926692816440595520", + "type": "dependency" + } + ] +} +``` diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index 4d50cc51..14caaed2 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + yaml-cpp/yaml.h - + This is a lib1 include dir - + This is a t40001_include1.h include file diff --git a/docs/test_cases/t40002.md b/docs/test_cases/t40002.md index e51460be..7f2da126 100644 --- a/docs/test_cases/t40002.md +++ b/docs/test_cases/t40002.md @@ -29,3 +29,127 @@ diagrams: ## Source code ## Generated UML diagrams ![t40002_include](./t40002_include.svg "Cyclic include graph diagram test case") +## Generated JSON models +```json +{ + "diagram_type": "include", + "elements": [ + { + "display_name": "src", + "elements": [ + { + "display_name": "src/t40002.cc", + "file_kind": "implementation", + "id": "1489450289909741706", + "name": "t40002.cc", + "type": "file" + }, + { + "display_name": "src/lib1", + "elements": [ + { + "display_name": "src/lib1/lib1.cc", + "file_kind": "implementation", + "id": "1493913207373215402", + "name": "lib1.cc", + "type": "file" + } + ], + "id": "1284742705549910910", + "name": "lib1", + "type": "folder" + }, + { + "display_name": "src/lib2", + "elements": [ + { + "display_name": "src/lib2/lib2.cc", + "file_kind": "implementation", + "id": "1761875020766116446", + "name": "lib2.cc", + "type": "file" + } + ], + "id": "1397224709580110803", + "name": "lib2", + "type": "folder" + } + ], + "id": "1387619747296316447", + "name": "src", + "type": "folder" + }, + { + "display_name": "include", + "elements": [ + { + "display_name": "include/lib1", + "elements": [ + { + "display_name": "include/lib1/lib1.h", + "file_kind": "header", + "id": "2193549214042244690", + "name": "lib1.h", + "type": "file" + } + ], + "id": "1687675335949018432", + "name": "lib1", + "type": "folder" + }, + { + "display_name": "include/lib2", + "elements": [ + { + "display_name": "include/lib2/lib2.h", + "file_kind": "header", + "id": "1969674835696841438", + "name": "lib2.h", + "type": "file" + } + ], + "id": "1248530620501446930", + "name": "lib2", + "type": "folder" + } + ], + "id": "989412417490706876", + "name": "include", + "type": "folder" + } + ], + "name": "t40002_include", + "relationships": [ + { + "access": "public", + "destination": "2193549214042244690", + "source": "1489450289909741706", + "type": "association" + }, + { + "access": "public", + "destination": "1969674835696841438", + "source": "1489450289909741706", + "type": "association" + }, + { + "access": "public", + "destination": "2193549214042244690", + "source": "1493913207373215402", + "type": "association" + }, + { + "access": "public", + "destination": "1969674835696841438", + "source": "1761875020766116446", + "type": "association" + }, + { + "access": "public", + "destination": "1969674835696841438", + "source": "2193549214042244690", + "type": "association" + } + ] +} +``` diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index ab86090c..e184123c 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h diff --git a/docs/test_cases/t40003.md b/docs/test_cases/t40003.md index d5fc9c01..a9c088ef 100644 --- a/docs/test_cases/t40003.md +++ b/docs/test_cases/t40003.md @@ -27,3 +27,179 @@ diagrams: ## Source code ## Generated UML diagrams ![t40003_include](./t40003_include.svg "Dependants and dependencies include diagram filter test") +## Generated JSON models +```json +{ + "diagram_type": "include", + "elements": [ + { + "display_name": "src", + "elements": [ + { + "display_name": "src/dependants", + "elements": [ + { + "display_name": "src/dependants/t1.cc", + "file_kind": "implementation", + "id": "1215324434184692437", + "name": "t1.cc", + "type": "file" + } + ], + "id": "1128556599972003761", + "name": "dependants", + "type": "folder" + }, + { + "display_name": "src/dependencies", + "elements": [ + { + "display_name": "src/dependencies/t2.cc", + "file_kind": "implementation", + "id": "2215849176605856058", + "name": "t2.cc", + "type": "file" + } + ], + "id": "2015386828772336316", + "name": "dependencies", + "type": "folder" + } + ], + "id": "1387619747296316447", + "name": "src", + "type": "folder" + }, + { + "display_name": "include", + "elements": [ + { + "display_name": "include/dependants", + "elements": [ + { + "display_name": "include/dependants/t3.h", + "file_kind": "header", + "id": "60001020671836182", + "name": "t3.h", + "type": "file" + }, + { + "display_name": "include/dependants/t2.h", + "file_kind": "header", + "id": "1921842892192045013", + "name": "t2.h", + "type": "file" + }, + { + "display_name": "include/dependants/t1.h", + "file_kind": "header", + "id": "2295271780650013565", + "name": "t1.h", + "type": "file" + } + ], + "id": "1763526330848915994", + "name": "dependants", + "type": "folder" + }, + { + "display_name": "include/dependencies", + "elements": [ + { + "display_name": "include/dependencies/t3.h", + "file_kind": "header", + "id": "1226843223635488673", + "name": "t3.h", + "type": "file" + }, + { + "display_name": "include/dependencies/t2.h", + "file_kind": "header", + "id": "1849348825646635129", + "name": "t2.h", + "type": "file" + }, + { + "display_name": "include/dependencies/t1.h", + "file_kind": "header", + "id": "1120257488305564427", + "name": "t1.h", + "type": "file" + }, + { + "display_name": "include/dependencies/t5.h", + "file_kind": "header", + "id": "2106129159239499468", + "name": "t5.h", + "type": "file" + } + ], + "id": "1833478793852674517", + "name": "dependencies", + "type": "folder" + } + ], + "id": "989412417490706876", + "name": "include", + "type": "folder" + } + ], + "name": "t40003_include", + "relationships": [ + { + "access": "public", + "destination": "60001020671836182", + "source": "1215324434184692437", + "type": "association" + }, + { + "access": "public", + "destination": "1882940911178525353", + "source": "1215324434184692437", + "type": "association" + }, + { + "access": "public", + "destination": "1226843223635488673", + "source": "2215849176605856058", + "type": "association" + }, + { + "access": "public", + "destination": "2106129159239499468", + "source": "2215849176605856058", + "type": "association" + }, + { + "access": "public", + "destination": "1921842892192045013", + "source": "60001020671836182", + "type": "association" + }, + { + "access": "public", + "destination": "2295271780650013565", + "source": "1921842892192045013", + "type": "association" + }, + { + "access": "public", + "destination": "1849348825646635129", + "source": "1226843223635488673", + "type": "association" + }, + { + "access": "public", + "destination": "1120257488305564427", + "source": "1849348825646635129", + "type": "association" + }, + { + "access": "public", + "destination": "1120257488305564427", + "source": "2106129159239499468", + "type": "association" + } + ] +} +``` diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index 6719d62d..cb1d7c74 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - + src - + dependants - + dependencies - + include - + dependants - + dependencies - - + + t1.cc - - + + t2.cc - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h diff --git a/docs/test_cases/t90000.md b/docs/test_cases/t90000.md index 47496b72..95ffd5ff 100644 --- a/docs/test_cases/t90000.md +++ b/docs/test_cases/t90000.md @@ -30,3 +30,4 @@ File t90000.cc ``` ## Generated UML diagrams ![t90000_class](./t90000_class.svg "Basic config test") +## Generated JSON models