# t00024 - Proxy pattern
## Config
```yaml
compilation_database_dir: ..
output_directory: puml
diagrams:
  t00024_class:
    type: class
    glob:
      - ../../tests/t00024/t00024.cc
    using_namespace:
      - clanguml::t00024
    include:
      namespaces:
        - clanguml::t00024

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

namespace clanguml {
namespace t00024 {

class Target {
public:
    virtual ~Target() = 0;

    virtual void m1() = 0;
    virtual void m2() = 0;
};

class Target1 : public Target {
public:
    void m1() override { }
    void m2() override { }
};

class Target2 : public Target {
public:
    void m1() override { }
    void m2() override { }
};

class Proxy : public Target {
public:
    Proxy(std::shared_ptr<Target> target)
        : m_target{std::move(target)}
    {
    }
    void m1() override { m_target->m1(); }
    void m2() override { m_target->m2(); }

private:
    std::shared_ptr<Target> m_target;
};
} // namespace t00024
} // namespace clanguml

```
## Generated UML diagrams
![t00024_class](./t00024_class.svg "Proxy pattern")
## Generated JSON models
```json
{
  "diagram_type": "class",
  "elements": [
    {
      "bases": [],
      "display_name": "clanguml::t00024::Target",
      "id": "1116408959993110019",
      "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": true,
          "is_static": false,
          "is_virtual": true,
          "name": "~Target",
          "parameters": [],
          "type": "void"
        },
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": true,
          "is_static": false,
          "is_virtual": true,
          "name": "m1",
          "parameters": [],
          "type": "void"
        },
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": true,
          "is_static": false,
          "is_virtual": true,
          "name": "m2",
          "parameters": [],
          "type": "void"
        }
      ],
      "name": "Target",
      "namespace": "clanguml::t00024",
      "source_location": {
        "file": "../../tests/t00024/t00024.cc",
        "line": 6
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [
        {
          "access": "public",
          "id": "1116408959993110019",
          "is_virtual": false,
          "name": "clanguml::t00024::Target"
        }
      ],
      "display_name": "clanguml::t00024::Target1",
      "id": "669517069151826610",
      "is_abstract": false,
      "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": true,
          "name": "m1",
          "parameters": [],
          "type": "void"
        },
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": true,
          "name": "m2",
          "parameters": [],
          "type": "void"
        }
      ],
      "name": "Target1",
      "namespace": "clanguml::t00024",
      "source_location": {
        "file": "../../tests/t00024/t00024.cc",
        "line": 14
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [
        {
          "access": "public",
          "id": "1116408959993110019",
          "is_virtual": false,
          "name": "clanguml::t00024::Target"
        }
      ],
      "display_name": "clanguml::t00024::Target2",
      "id": "1210513233906695933",
      "is_abstract": false,
      "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": true,
          "name": "m1",
          "parameters": [],
          "type": "void"
        },
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": true,
          "name": "m2",
          "parameters": [],
          "type": "void"
        }
      ],
      "name": "Target2",
      "namespace": "clanguml::t00024",
      "source_location": {
        "file": "../../tests/t00024/t00024.cc",
        "line": 20
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [
        {
          "access": "public",
          "id": "1116408959993110019",
          "is_virtual": false,
          "name": "clanguml::t00024::Target"
        }
      ],
      "display_name": "clanguml::t00024::Proxy",
      "id": "594707401639991215",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [
        {
          "access": "private",
          "is_static": false,
          "name": "m_target",
          "source_location": {
            "file": "../../tests/t00024/t00024.cc",
            "line": 36
          },
          "type": "std::shared_ptr<Target>"
        }
      ],
      "methods": [
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "Proxy",
          "parameters": [
            {
              "name": "target",
              "type": "std::shared_ptr<Target>"
            }
          ],
          "type": "void"
        },
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": true,
          "name": "m1",
          "parameters": [],
          "type": "void"
        },
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": true,
          "name": "m2",
          "parameters": [],
          "type": "void"
        }
      ],
      "name": "Proxy",
      "namespace": "clanguml::t00024",
      "source_location": {
        "file": "../../tests/t00024/t00024.cc",
        "line": 26
      },
      "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": "t00024_class",
  "relationships": [
    {
      "access": "public",
      "destination": "1116408959993110019",
      "source": "669517069151826610",
      "type": "extension"
    },
    {
      "access": "public",
      "destination": "1116408959993110019",
      "source": "1210513233906695933",
      "type": "extension"
    },
    {
      "access": "public",
      "destination": "1116408959993110019",
      "source": "594707401639991215",
      "type": "dependency"
    },
    {
      "access": "private",
      "destination": "1116408959993110019",
      "label": "m_target",
      "source": "594707401639991215",
      "type": "association"
    },
    {
      "access": "public",
      "destination": "1116408959993110019",
      "source": "594707401639991215",
      "type": "extension"
    }
  ],
  "using_namespace": "clanguml::t00024"
}
```
