# t00048 - Test case for unique entity id with multiple translation units
## Config
```yaml
compilation_database_dir: ..
output_directory: puml
diagrams:
  t00048_class:
    type: class
    glob:
      - ../../tests/t00048/b_t00048.cc
      - ../../tests/t00048/a_t00048.cc
      - ../../tests/t00048/t00048.cc
    using_namespace: clanguml::t00048
    parse_includes: true
    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 <typename T> struct BTemplate : public BaseTemplate<T> {
    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 <typename T> struct ATemplate : public BaseTemplate<T> {
    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 <typename T> struct BaseTemplate {
    T base;

    virtual void foo() = 0;
};

}
}
```
## 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<T>",
      "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<T>"
        }
      ],
      "display_name": "clanguml::t00048::BTemplate<T>",
      "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<T>"
        }
      ],
      "display_name": "clanguml::t00048::ATemplate<T>",
      "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"
    }
  ],
  "metadata": {
    "clang_uml_version": "0.3.5-27-g81c7ce7",
    "llvm_version": "Ubuntu clang version 15.0.6",
    "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"
}
```
