From ee753f559571b2056397a38817135892c7ff57c0 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sun, 25 Jul 2021 22:51:46 +0200 Subject: [PATCH] Added template decorator pattern --- docs/test_cases.md | 1 + docs/test_cases/t00026.md | 1 - docs/test_cases/t00027.md | 79 +++++++++++++++++++++++++++++ docs/test_cases/t00027_class.png | Bin 0 -> 43866 bytes src/puml/class_diagram_generator.h | 3 +- src/uml/class_diagram_visitor.cc | 2 + tests/t00027/.clanguml | 12 +++++ tests/t00027/t00027.cc | 55 ++++++++++++++++++++ tests/t00027/test_case.h | 66 ++++++++++++++++++++++++ tests/test_cases.cc | 1 + tests/test_cases.yaml | 3 ++ 11 files changed, 221 insertions(+), 2 deletions(-) create mode 100644 docs/test_cases/t00027.md create mode 100644 docs/test_cases/t00027_class.png create mode 100644 tests/t00027/.clanguml create mode 100644 tests/t00027/t00027.cc create mode 100644 tests/t00027/test_case.h diff --git a/docs/test_cases.md b/docs/test_cases.md index e4da3ba2..c4a69690 100644 --- a/docs/test_cases.md +++ b/docs/test_cases.md @@ -25,6 +25,7 @@ * [t00024](./test_cases/t00024.md) - Proxy pattern * [t00025](./test_cases/t00025.md) - Template proxy pattern * [t00026](./test_cases/t00026.md) - Template memento pattern + * [t00027](./test_cases/t00027.md) - Template decorator pattern ## Sequence diagrams * [t20001](./test_cases/t20001.md) - Basic sequence diagram ## Configuration diagrams diff --git a/docs/test_cases/t00026.md b/docs/test_cases/t00026.md index fece16cc..f0012b02 100644 --- a/docs/test_cases/t00026.md +++ b/docs/test_cases/t00026.md @@ -74,7 +74,6 @@ struct StringMemento { Caretaker caretaker; Originator originator; }; - } } diff --git a/docs/test_cases/t00027.md b/docs/test_cases/t00027.md new file mode 100644 index 00000000..b794cfe3 --- /dev/null +++ b/docs/test_cases/t00027.md @@ -0,0 +1,79 @@ +# t00027 - Template decorator pattern +## Config +```yaml +compilation_database_dir: .. +output_directory: puml +diagrams: + t00027_class: + type: class + glob: + - ../../tests/t00027/t00027.cc + using_namespace: + - clanguml::t00027 + include: + namespaces: + - clanguml::t00027 + +``` +## Source code +File t00027.cc +```cpp +#include +#include +#include + +namespace clanguml { +namespace t00027 { + +class Shape { +public: + virtual void display() = 0; + virtual ~Shape() = default; +}; + +template