Files
clang-uml/docs/test_cases/t00048.md
2022-12-06 00:33:08 +01:00

1.7 KiB

t00048 - Test case for unique entity id with multiple translation units

Config

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 t00048.h

#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;
};

}
}

File t00048.cc

#include "t00048.h"

namespace clanguml {
namespace t00048 {
}
}

File a_t00048.h

#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 b_t00048.h

#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 a_t00048.cc

#include "a_t00048.h"

namespace clanguml {
namespace t00048 {

void A::foo() { }

}
}

File b_t00048.cc

#include "b_t00048.h"

namespace clanguml {
namespace t00048 {

void B::foo() { }

}
}

Generated UML diagrams

t00048_class