{{ composite_type | definition_begin }}
{
{%- for constant in composite_type.constants %}
    static constexpr {{ constant.data_type | declaration }} {{ constant.name | id }} = {{ constant.value.native_value.numerator }} / {{ constant.value.native_value.denominator }};
{%- endfor -%}
{% for field in composite_type.fields -%}
{%- if field is not padding %}
    {{ field.data_type | declaration }} {{ field.name | id }};
{%- endif -%}
{%- endfor %}
{%- if not nunavut.support.omit %}
    static {{ typename_unsigned_length }} serialize(
        std::vector<{{ typename_byte }}>& inout_byte_buffer,
        {{ typename_unsigned_length }} bit_offset,
        {{ composite_type | declaration }}& t)
    {
        // Not yet implemented.
        const {{ typename_byte_ptr }} bits_in = { reinterpret_cast<{{typename_byte_ptr}}>(&t) };
{%- for field in composite_type.fields %}
{%- if field is VariableLengthArrayType %}
        // var array here
{%- elif field is FixedLengthArrayType %}
        // static array here
{%- else %}
        bit_offset += {{ nunavut.support.namespace | to_namespace_qualifier }}copyBitsAlignedToUnaligned<{{ typename_unsigned_length }}, {{typename_byte}}>( bits_in, inout_byte_buffer, bit_offset, 4 );
{%- endif %}
{%- endfor %}
        return 0;
    }
{%- endif %}
}{{ composite_type | definition_end }}