1{%- for pf in struct.packed.packed_fields_in_ordinal_order %} 2{%- set kind = pf.field.kind %} 3{%- set name = pf.field.name %} 4 5{%- if kind|is_union_kind %} 6inline void {{struct.name}}DataView::Get{{name|under_to_camel}}DataView( 7 {{kind|cpp_data_view_type}}* output) { 8{%- if pf.min_version != 0 %} 9 auto pointer = data_->header_.version >= {{pf.min_version}} 10 ? &data_->{{name}} : nullptr; 11{%- else %} 12 auto pointer = &data_->{{name}}; 13{%- endif %} 14 *output = {{kind|cpp_data_view_type}}(pointer, context_); 15} 16 17{%- elif kind|is_object_kind %} 18inline void {{struct.name}}DataView::Get{{name|under_to_camel}}DataView( 19 {{kind|cpp_data_view_type}}* output) { 20{%- if pf.min_version != 0 %} 21 auto pointer = data_->header_.version >= {{pf.min_version}} 22 ? data_->{{name}}.Get() : nullptr; 23{%- else %} 24 auto pointer = data_->{{name}}.Get(); 25{%- endif %} 26 *output = {{kind|cpp_data_view_type}}(pointer, context_); 27} 28{%- endif %} 29{%- endfor %} 30 31