Files
clang-uml/docs/test_cases/t00048.md
2023-01-18 21:38:37 +01:00

125 lines
1.7 KiB
Markdown

# 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")