diff --git a/README.md b/README.md index 3c85a81b..c2d8ef1a 100644 --- a/README.md +++ b/README.md @@ -146,30 +146,63 @@ and checkout the SVG diagrams in `docs/diagrams` folder. Source code: ```cpp -#include -#include - -namespace clanguml { -namespace t00009 { - -template class A { -public: - T value; +template struct A { + T t; + P p; }; -class B { -public: - A aint; - A *astring; - A> &avector; +struct B { + std::string value; +}; + +template using AString = A; +template using AStringPtr = A>; + +template +using PairPairBA = std::pair>, long>; + +template using VectorPtr = std::unique_ptr>; +template using APtr = std::unique_ptr>; +template using ASharedPtr = std::shared_ptr>; +template +using AAPtr = std::unique_ptr, A>>; + +template using GeneralCallback = std::function; +using VoidCallback = GeneralCallback<>; + +using BVector = std::vector; +using BVector2 = BVector; + +using AIntString = AString; +using AStringString = AString; +using BStringString = AStringString; + +class R { + PairPairBA bapair; + + APtr abool; + AAPtr aboolfloat; + ASharedPtr afloat; + A boolstring; + AStringPtr floatstring; + AIntString intstring; + AStringString stringstring; + BStringString bstringstring; + +protected: + BVector bs; + +public: + BVector2 bs2; + GeneralCallback cb; + VoidCallback vcb; + VectorPtr vps; }; -} -} ``` generates the following diagram (via PlantUML): -![class_diagram_example](docs/test_cases/t00009_class.svg) +![class_diagram_example](docs/test_cases/t00014_class.svg) > Open the raw image [here](https://raw.githubusercontent.com/bkryza/clang-uml/master/docs/test_cases/t00009_class.svg), > and checkout the hover tooltips and hyperlinks to classes and methods. diff --git a/docs/configuration_file.md b/docs/configuration_file.md index 2ce9ee6e..9d216993 100644 --- a/docs/configuration_file.md +++ b/docs/configuration_file.md @@ -101,6 +101,17 @@ diagrams: ClassA: - up: ClassB - left: ClassC + # Specify customized relationship hints for types which are + # arguments in template instantiations + relationship_hints: + # All tuple arguments should be treated as aggregation + std::tuple: aggregation + # All some_template arguments should be treated as associations + # except for arguments with indexes 2 and 10 + ns1::n2::some_template: + default: association + 2: composition + 10: aggregation # Entities from this namespace will be shortened # (can only contain one element at the moment) using_namespace: diff --git a/tests/t00014/t00014.cc b/tests/t00014/t00014.cc index 7978f432..dca89263 100644 --- a/tests/t00014/t00014.cc +++ b/tests/t00014/t00014.cc @@ -1,11 +1,7 @@ -//#include #include -//#include #include #include -//#include #include -//#include #include #include