{#-
 # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 # Copyright (C) 2021  UAVCAN Development Team  <uavcan.org>
 # This software is distributed under the terms of the MIT License.
#}
    union // The union is placed first to ensure that the active element address equals the object address.
    {
{%- for field in composite_type.fields -%}
{%- if field is not padding %}
        {{ field.data_type | declaration }} {{ field.name | id }};
{%- endif -%}
{%- endfor %}
    };
private:
    {{ composite_type.tag_field_type | declaration }} tag_;
public:
{%- for field in composite_type.fields -%}
{%- if field is not padding %}
    bool {{ ('is' + field.name.capitalize())  | id }}() const { return (tag_ == {{ loop.index0 }}); }
    void {{ ('select' + field.name.capitalize())  | id }}() { tag_ = {{ loop.index0 }}; }
{%- endif -%}
{%- endfor-%}
