Files
clang-uml/docs/test_cases/t00049.md
2022-12-26 21:58:34 +01:00

1.1 KiB

t00049 - Test case configurable type aliases

Config

compilation_database_dir: ..
output_directory: puml
diagrams:
  t00049_class:
    type: class
    using_namespace: clanguml::t00049
    type_aliases:
      "std::basic_string<char>": thestring
      "std::string": thestring
      "std::vector<std::string>": string_vector
      "std::vector<thestring>": string_vector
      "std::map<int,int>": intmap
    glob:
      - ../../tests/t00049/t00049.cc
    include:
      namespaces:
        - clanguml::t00049

Source code

File t00049.cc

#include <map>
#include <string>
#include <vector>

namespace clanguml {
namespace t00049 {
template <typename T> struct A {
    T a;

    T &get_a() { return a; }
};

struct R {
    A<std::basic_string<char>> a_string;
    A<std::vector<std::string>> a_vector_string;
    A<std::map<int, int>> a_int_map;

    A<std::map<int, int>> get_int_map() { return a_int_map; }

    void set_int_map(A<std::map<int, int>> &&int_map) { a_int_map = int_map; }
};
} // namespace t00049
} // namespace clanguml

Generated UML diagrams

t00049_class