# t00048 - Test case for unique entity id with multiple translation units ## Config ```yaml compilation_database_dir: .. output_directory: diagrams diagrams: t00048_class: type: class glob: - ../../tests/t00048/b_t00048.cc - ../../tests/t00048/a_t00048.cc - ../../tests/t00048/t00048.cc using_namespace: clanguml::t00048 include: namespaces: - clanguml::t00048 ``` ## Source code File b_t00048.h ```cpp #include "t00048.h" #pragma once namespace clanguml { namespace t00048 { struct B : public Base { int b; void foo() override; }; template struct BTemplate : public BaseTemplate { T b; void foo() override { } }; } } ``` File b_t00048.cc ```cpp #include "b_t00048.h" namespace clanguml { namespace t00048 { void B::foo() { } } } ``` File t00048.cc ```cpp #include "t00048.h" namespace clanguml { namespace t00048 { } } ``` File a_t00048.h ```cpp #include "t00048.h" #pragma once namespace clanguml { namespace t00048 { struct A : public Base { int a; void foo() override; }; template struct ATemplate : public BaseTemplate { T a; void foo() override { } }; } } ``` File a_t00048.cc ```cpp #include "a_t00048.h" namespace clanguml { namespace t00048 { void A::foo() { } } } ``` File t00048.h ```cpp #pragma once namespace clanguml { namespace t00048 { struct Base { int base; virtual void foo() = 0; }; template struct BaseTemplate { T base; virtual void foo() = 0; }; } } ``` ## Generated PlantUML diagrams ![t00048_class](./t00048_class.svg "Test case for unique entity id with multiple translation units") ## Generated Mermaid diagrams ![t00048_class](./t00048_class_mermaid.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": { "column": 9, "file": "../../tests/t00048/t00048.h", "line": 7, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "type": "int" } ], "methods": [ { "access": "public", "is_const": false, "is_consteval": false, "is_constexpr": false, "is_constructor": false, "is_copy_assignment": false, "is_defaulted": false, "is_deleted": false, "is_move_assignment": false, "is_noexcept": false, "is_operator": false, "is_pure_virtual": true, "is_static": false, "is_virtual": true, "name": "foo", "parameters": [], "source_location": { "column": 18, "file": "../../tests/t00048/t00048.h", "line": 9, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "type": "void" } ], "name": "Base", "namespace": "clanguml::t00048", "source_location": { "column": 8, "file": "../../tests/t00048/t00048.h", "line": 6, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "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": { "column": 7, "file": "../../tests/t00048/t00048.h", "line": 13, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "type": "T" } ], "methods": [ { "access": "public", "is_const": false, "is_consteval": false, "is_constexpr": false, "is_constructor": false, "is_copy_assignment": false, "is_defaulted": false, "is_deleted": false, "is_move_assignment": false, "is_noexcept": false, "is_operator": false, "is_pure_virtual": true, "is_static": false, "is_virtual": true, "name": "foo", "parameters": [], "source_location": { "column": 18, "file": "../../tests/t00048/t00048.h", "line": 15, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "type": "void" } ], "name": "BaseTemplate", "namespace": "clanguml::t00048", "source_location": { "column": 30, "file": "../../tests/t00048/t00048.h", "line": 12, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "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": { "column": 9, "file": "../../tests/t00048/b_t00048.h", "line": 9, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "type": "int" } ], "methods": [ { "access": "public", "is_const": false, "is_consteval": false, "is_constexpr": false, "is_constructor": false, "is_copy_assignment": false, "is_defaulted": false, "is_deleted": false, "is_move_assignment": false, "is_noexcept": false, "is_operator": false, "is_pure_virtual": false, "is_static": false, "is_virtual": true, "name": "foo", "parameters": [], "source_location": { "column": 10, "file": "../../tests/t00048/b_t00048.h", "line": 11, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "type": "void" } ], "name": "B", "namespace": "clanguml::t00048", "source_location": { "column": 8, "file": "../../tests/t00048/b_t00048.h", "line": 8, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "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": { "column": 7, "file": "../../tests/t00048/b_t00048.h", "line": 15, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "type": "T" } ], "methods": [ { "access": "public", "is_const": false, "is_consteval": false, "is_constexpr": false, "is_constructor": false, "is_copy_assignment": false, "is_defaulted": false, "is_deleted": false, "is_move_assignment": false, "is_noexcept": false, "is_operator": false, "is_pure_virtual": false, "is_static": false, "is_virtual": false, "name": "foo", "parameters": [], "source_location": { "column": 10, "file": "../../tests/t00048/b_t00048.h", "line": 17, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "type": "void" } ], "name": "BTemplate", "namespace": "clanguml::t00048", "source_location": { "column": 30, "file": "../../tests/t00048/b_t00048.h", "line": 14, "translation_unit": "../../tests/t00048/b_t00048.cc" }, "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": { "column": 9, "file": "../../tests/t00048/a_t00048.h", "line": 9, "translation_unit": "../../tests/t00048/a_t00048.cc" }, "type": "int" } ], "methods": [ { "access": "public", "is_const": false, "is_consteval": false, "is_constexpr": false, "is_constructor": false, "is_copy_assignment": false, "is_defaulted": false, "is_deleted": false, "is_move_assignment": false, "is_noexcept": false, "is_operator": false, "is_pure_virtual": false, "is_static": false, "is_virtual": true, "name": "foo", "parameters": [], "source_location": { "column": 10, "file": "../../tests/t00048/a_t00048.h", "line": 11, "translation_unit": "../../tests/t00048/a_t00048.cc" }, "type": "void" } ], "name": "A", "namespace": "clanguml::t00048", "source_location": { "column": 8, "file": "../../tests/t00048/a_t00048.h", "line": 8, "translation_unit": "../../tests/t00048/a_t00048.cc" }, "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": { "column": 7, "file": "../../tests/t00048/a_t00048.h", "line": 15, "translation_unit": "../../tests/t00048/a_t00048.cc" }, "type": "T" } ], "methods": [ { "access": "public", "is_const": false, "is_consteval": false, "is_constexpr": false, "is_constructor": false, "is_copy_assignment": false, "is_defaulted": false, "is_deleted": false, "is_move_assignment": false, "is_noexcept": false, "is_operator": false, "is_pure_virtual": false, "is_static": false, "is_virtual": false, "name": "foo", "parameters": [], "source_location": { "column": 10, "file": "../../tests/t00048/a_t00048.h", "line": 17, "translation_unit": "../../tests/t00048/a_t00048.cc" }, "type": "void" } ], "name": "ATemplate", "namespace": "clanguml::t00048", "source_location": { "column": 30, "file": "../../tests/t00048/a_t00048.h", "line": 14, "translation_unit": "../../tests/t00048/a_t00048.cc" }, "template_parameters": [ { "is_variadic": false, "kind": "template_type", "name": "T", "template_parameters": [] } ], "type": "class" } ], "metadata": { "clang_uml_version": "0.4.0-28-g03ac212", "llvm_version": "Ubuntu clang version 16.0.6 (++20230710042027+7cbf1a259152-1~exp1~20230710162048.105)", "schema_version": 1 }, "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" } ```