class __{{struct_name}}:
{%- filter indent(width=4) %}
{% if struct_fields|length -%}
{{struct_fields-}}
{% endif -%}
{%if sub_structs|length -%}
{{sub_structs-}}
{% endif -%}
{% endfilter -%}
{% if struct_instance|length -%}
{{struct_instance}} = __{{struct_name}}()
{% endif -%}
{% if not struct_instance|length -%}
__map_type = __{{struct_name}}
def add_entry(self, name):
    setattr(self, name, self.__map_type())
def get_entry(self, name):
    return getattr(self, name, self.__map_type())
{% endif -%}
