# t00004 - Nested classes and enums
## Config
```yaml
diagrams:
  t00004_class:
    type: class
    glob:
      - t00004.cc
    using_namespace: clanguml::t00004
    include:
      namespaces:
        - clanguml::t00004

```
## Source code
File `tests/t00004/t00004.cc`
```cpp
namespace clanguml {
namespace t00004 {

enum Color { Red, Green, Blue };

class B {
public:
    enum AA { AA_1, AA_2, AA_3 };

    AA aa;
    Color *color;
};

class A {
public:
    void foo() const { }

    class AA {
    public:
        enum class Lights { Green, Yellow, Red };

        class AAA {
            Lights lights;
        };
    };

    void foo2() const { }
};

template <typename T> class C {
public:
    T t;

    class AA {
        class AAA { };

        enum class CCC { CCC_1, CCC_2 };
    };

    template <typename V> class B {
        V b;
    };

    B<int> b_int;

    enum class CC { CC_1, CC_2 };
};

namespace detail {
class D {
public:
    enum class AA { AA_1, AA_2, AA_3 };

    class DD { };
};
}

} // namespace t00004
} // namespace clanguml

```
## Generated PlantUML diagrams
![t00004_class](./t00004_class.svg "Nested classes and enums")
## Generated Mermaid diagrams
![t00004_class](./t00004_class_mermaid.svg "Nested classes and enums")
## Generated JSON models
```json
{
  "diagram_type": "class",
  "elements": [
    {
      "constants": [
        "Red",
        "Green",
        "Blue"
      ],
      "display_name": "Color",
      "id": "8844195389762820798",
      "is_nested": false,
      "name": "Color",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 6,
        "file": "t00004.cc",
        "line": 4,
        "translation_unit": "t00004.cc"
      },
      "type": "enum"
    },
    {
      "bases": [],
      "display_name": "B",
      "id": "9860995429872413691",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "aa",
          "source_location": {
            "column": 8,
            "file": "t00004.cc",
            "line": 10,
            "translation_unit": "t00004.cc"
          },
          "type": "AA"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "color",
          "source_location": {
            "column": 12,
            "file": "t00004.cc",
            "line": 11,
            "translation_unit": "t00004.cc"
          },
          "type": "Color *"
        }
      ],
      "methods": [],
      "name": "B",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 7,
        "file": "t00004.cc",
        "line": 6,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "constants": [
        "AA_1",
        "AA_2",
        "AA_3"
      ],
      "display_name": "B::AA",
      "id": "13041644057721012989",
      "is_nested": true,
      "name": "B::AA",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 10,
        "file": "t00004.cc",
        "line": 8,
        "translation_unit": "t00004.cc"
      },
      "type": "enum"
    },
    {
      "bases": [],
      "display_name": "A",
      "id": "12418199527012894198",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [
        {
          "access": "public",
          "display_name": "foo",
          "is_const": true,
          "is_consteval": false,
          "is_constexpr": false,
          "is_constructor": false,
          "is_copy_assignment": false,
          "is_coroutine": false,
          "is_defaulted": false,
          "is_deleted": false,
          "is_move_assignment": false,
          "is_noexcept": false,
          "is_operator": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "foo",
          "parameters": [],
          "source_location": {
            "column": 10,
            "file": "t00004.cc",
            "line": 16,
            "translation_unit": "t00004.cc"
          },
          "template_parameters": [],
          "type": "void"
        },
        {
          "access": "public",
          "display_name": "foo2",
          "is_const": true,
          "is_consteval": false,
          "is_constexpr": false,
          "is_constructor": false,
          "is_copy_assignment": false,
          "is_coroutine": false,
          "is_defaulted": false,
          "is_deleted": false,
          "is_move_assignment": false,
          "is_noexcept": false,
          "is_operator": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "foo2",
          "parameters": [],
          "source_location": {
            "column": 10,
            "file": "t00004.cc",
            "line": 27,
            "translation_unit": "t00004.cc"
          },
          "template_parameters": [],
          "type": "void"
        }
      ],
      "name": "A",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 7,
        "file": "t00004.cc",
        "line": 14,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "A::AA",
      "id": "13939998749822876416",
      "is_abstract": false,
      "is_nested": true,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "A::AA",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 11,
        "file": "t00004.cc",
        "line": 18,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "constants": [
        "Green",
        "Yellow",
        "Red"
      ],
      "display_name": "A::AA::Lights",
      "id": "4727494996070729955",
      "is_nested": true,
      "name": "A::AA::Lights",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 20,
        "file": "t00004.cc",
        "line": 20,
        "translation_unit": "t00004.cc"
      },
      "type": "enum"
    },
    {
      "bases": [],
      "display_name": "A::AA::AAA",
      "id": "11441493064034257052",
      "is_abstract": false,
      "is_nested": true,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [
        {
          "access": "private",
          "is_static": false,
          "name": "lights",
          "source_location": {
            "column": 20,
            "file": "t00004.cc",
            "line": 23,
            "translation_unit": "t00004.cc"
          },
          "type": "Lights"
        }
      ],
      "methods": [],
      "name": "A::AA::AAA",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 15,
        "file": "t00004.cc",
        "line": 22,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "C::B<int>",
      "id": "2302554954640607720",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": true,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "C::B",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 33,
        "file": "t00004.cc",
        "line": 40,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "argument",
          "template_parameters": [],
          "type": "int"
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "C<T>",
      "id": "18226625421819521092",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": true,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "t",
          "source_location": {
            "column": 7,
            "file": "t00004.cc",
            "line": 32,
            "translation_unit": "t00004.cc"
          },
          "type": "T"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "b_int",
          "source_location": {
            "column": 12,
            "file": "t00004.cc",
            "line": 44,
            "translation_unit": "t00004.cc"
          },
          "type": "B<int>"
        }
      ],
      "methods": [],
      "name": "C",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 29,
        "file": "t00004.cc",
        "line": 30,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "template_type",
          "name": "T",
          "template_parameters": []
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "C::AA",
      "id": "4991521063183421232",
      "is_abstract": false,
      "is_nested": true,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "C::AA",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 11,
        "file": "t00004.cc",
        "line": 34,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "C::AA::AAA",
      "id": "12782408698292006929",
      "is_abstract": false,
      "is_nested": true,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "C::AA::AAA",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 15,
        "file": "t00004.cc",
        "line": 35,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "constants": [
        "CCC_1",
        "CCC_2"
      ],
      "display_name": "C::AA::CCC",
      "id": "654553621116797875",
      "is_nested": true,
      "name": "C::AA::CCC",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 20,
        "file": "t00004.cc",
        "line": 37,
        "translation_unit": "t00004.cc"
      },
      "type": "enum"
    },
    {
      "bases": [],
      "display_name": "C::B<V>",
      "id": "11050386686796671606",
      "is_abstract": false,
      "is_nested": true,
      "is_struct": false,
      "is_template": true,
      "is_union": false,
      "members": [
        {
          "access": "private",
          "is_static": false,
          "name": "b",
          "source_location": {
            "column": 11,
            "file": "t00004.cc",
            "line": 41,
            "translation_unit": "t00004.cc"
          },
          "type": "V"
        }
      ],
      "methods": [],
      "name": "C::B",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 33,
        "file": "t00004.cc",
        "line": 40,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "template_type",
          "name": "V",
          "template_parameters": []
        }
      ],
      "type": "class"
    },
    {
      "constants": [
        "CC_1",
        "CC_2"
      ],
      "display_name": "C::CC",
      "id": "16299031488803029599",
      "is_nested": true,
      "name": "C::CC",
      "namespace": "clanguml::t00004",
      "source_location": {
        "column": 16,
        "file": "t00004.cc",
        "line": 46,
        "translation_unit": "t00004.cc"
      },
      "type": "enum"
    },
    {
      "bases": [],
      "display_name": "detail::D",
      "id": "4897065367017086369",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "D",
      "namespace": "clanguml::t00004::detail",
      "source_location": {
        "column": 7,
        "file": "t00004.cc",
        "line": 50,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "constants": [
        "AA_1",
        "AA_2",
        "AA_3"
      ],
      "display_name": "detail::D::AA",
      "id": "12576640463341047379",
      "is_nested": true,
      "name": "D::AA",
      "namespace": "clanguml::t00004::detail",
      "source_location": {
        "column": 16,
        "file": "t00004.cc",
        "line": 52,
        "translation_unit": "t00004.cc"
      },
      "type": "enum"
    },
    {
      "bases": [],
      "display_name": "detail::D::DD",
      "id": "4807329861420443943",
      "is_abstract": false,
      "is_nested": true,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "D::DD",
      "namespace": "clanguml::t00004::detail",
      "source_location": {
        "column": 11,
        "file": "t00004.cc",
        "line": 54,
        "translation_unit": "t00004.cc"
      },
      "template_parameters": [],
      "type": "class"
    }
  ],
  "name": "t00004_class",
  "package_type": "namespace",
  "relationships": [
    {
      "access": "public",
      "destination": "13041644057721012989",
      "label": "aa",
      "source": "9860995429872413691",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "8844195389762820798",
      "label": "color",
      "source": "9860995429872413691",
      "type": "association"
    },
    {
      "access": "public",
      "destination": "9860995429872413691",
      "source": "13041644057721012989",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "12418199527012894198",
      "source": "13939998749822876416",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "13939998749822876416",
      "source": "4727494996070729955",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "13939998749822876416",
      "source": "11441493064034257052",
      "type": "containment"
    },
    {
      "access": "private",
      "destination": "4727494996070729955",
      "label": "lights",
      "source": "11441493064034257052",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "11050386686796671606",
      "source": "2302554954640607720",
      "type": "instantiation"
    },
    {
      "access": "public",
      "destination": "2302554954640607720",
      "label": "b_int",
      "source": "18226625421819521092",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "18226625421819521092",
      "source": "4991521063183421232",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "4991521063183421232",
      "source": "12782408698292006929",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "4991521063183421232",
      "source": "654553621116797875",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "18226625421819521092",
      "source": "11050386686796671606",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "18226625421819521092",
      "source": "16299031488803029599",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "4897065367017086369",
      "source": "12576640463341047379",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "4897065367017086369",
      "source": "4807329861420443943",
      "type": "containment"
    }
  ],
  "using_namespace": "clanguml::t00004"
}
```
