# t00022 - Template method pattern
## Config
```yaml
compilation_database_dir: ..
output_directory: puml
diagrams:
  t00022_class:
    type: class
    glob:
      - ../../tests/t00022/t00022.cc
    using_namespace:
      - clanguml::t00022
    include:
      namespaces:
        - clanguml::t00022

```
## Source code
File t00022.cc
```cpp
#include <memory>

namespace clanguml {
namespace t00022 {

class A {
public:
    void template_method()
    {
        method1();
        method2();
    }

protected:
    virtual void method1() = 0;
    virtual void method2() = 0;
};

class A1 : public A {
protected:
    void method1() override { }
    void method2() override { }
};

class A2 : public A {
protected:
    void method1() override { }
    void method2() override { }
};
} // namespace t00022
} // namespace clanguml

```
## Generated UML diagrams
![t00022_class](./t00022_class.svg "Template method pattern")
## Generated JSON models
```json
{
  "diagram_type": "class",
  "elements": [
    {
      "bases": [],
      "display_name": "clanguml::t00022::A",
      "id": "2012435893382068755",
      "is_abstract": true,
      "is_nested": false,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "template_method",
          "parameters": [],
          "type": "void"
        },
        {
          "access": "protected",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": true,
          "is_static": false,
          "is_virtual": true,
          "name": "method1",
          "parameters": [],
          "type": "void"
        },
        {
          "access": "protected",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": true,
          "is_static": false,
          "is_virtual": true,
          "name": "method2",
          "parameters": [],
          "type": "void"
        }
      ],
      "name": "A",
      "namespace": "clanguml::t00022",
      "source_location": {
        "file": "../../tests/t00022/t00022.cc",
        "line": 6
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [
        {
          "access": "public",
          "id": "2012435893382068755",
          "is_virtual": false,
          "name": "clanguml::t00022::A"
        }
      ],
      "display_name": "clanguml::t00022::A1",
      "id": "2282061426381077447",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [
        {
          "access": "protected",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": true,
          "name": "method1",
          "parameters": [],
          "type": "void"
        },
        {
          "access": "protected",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": true,
          "name": "method2",
          "parameters": [],
          "type": "void"
        }
      ],
      "name": "A1",
      "namespace": "clanguml::t00022",
      "source_location": {
        "file": "../../tests/t00022/t00022.cc",
        "line": 19
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [
        {
          "access": "public",
          "id": "2012435893382068755",
          "is_virtual": false,
          "name": "clanguml::t00022::A"
        }
      ],
      "display_name": "clanguml::t00022::A2",
      "id": "158819862916671538",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [
        {
          "access": "protected",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": true,
          "name": "method1",
          "parameters": [],
          "type": "void"
        },
        {
          "access": "protected",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": true,
          "name": "method2",
          "parameters": [],
          "type": "void"
        }
      ],
      "name": "A2",
      "namespace": "clanguml::t00022",
      "source_location": {
        "file": "../../tests/t00022/t00022.cc",
        "line": 25
      },
      "template_parameters": [],
      "type": "class"
    }
  ],
  "metadata": {
    "clang_uml_version": "0.3.5-27-g81c7ce7",
    "llvm_version": "Ubuntu clang version 15.0.6",
    "schema_version": 1
  },
  "name": "t00022_class",
  "relationships": [
    {
      "access": "public",
      "destination": "2012435893382068755",
      "source": "2282061426381077447",
      "type": "extension"
    },
    {
      "access": "public",
      "destination": "2012435893382068755",
      "source": "158819862916671538",
      "type": "extension"
    }
  ],
  "using_namespace": "clanguml::t00022"
}
```
