OLD | NEW |
1 {% from "enum_macros.tmpl" import enum_decl -%} | 1 {% from "enum_macros.tmpl" import enum_decl -%} |
| 2 |
| 3 class {{struct.name}}_Reader; |
| 4 |
2 class {{struct.name}} { | 5 class {{struct.name}} { |
3 public: | 6 public: |
4 using Data_ = internal::{{struct.name}}_Data; | 7 using Data_ = internal::{{struct.name}}_Data; |
| 8 using Reader = {{struct.name}}_Reader; |
5 | 9 |
6 {#--- Enums #} | 10 {#--- Enums #} |
7 {%- for enum in struct.enums -%} | 11 {%- for enum in struct.enums -%} |
8 {{enum_decl(enum, is_static=true)|indent(2)}} | 12 {{enum_decl(enum, is_static=true)|indent(2)}} |
9 {%- endfor %} | 13 {%- endfor %} |
10 | 14 |
11 {#--- Constants #} | 15 {#--- Constants #} |
12 {%- for constant in struct.constants %} | 16 {%- for constant in struct.constants %} |
13 {%- if constant.kind|is_integral_kind %} | 17 {%- if constant.kind|is_integral_kind %} |
14 static const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|con
stant_value}}; | 18 static const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|con
stant_value}}; |
(...skipping 22 matching lines...) Expand all Loading... |
37 {%- endif %} | 41 {%- endif %} |
38 bool Equals(const {{struct.name}}& other) const; | 42 bool Equals(const {{struct.name}}& other) const; |
39 | 43 |
40 {#--- Struct members #} | 44 {#--- Struct members #} |
41 {% for field in struct.fields %} | 45 {% for field in struct.fields %} |
42 {%- set type = field.kind|cpp_wrapper_type %} | 46 {%- set type = field.kind|cpp_wrapper_type %} |
43 {%- set name = field.name %} | 47 {%- set name = field.name %} |
44 {{type}} {{name}}; | 48 {{type}} {{name}}; |
45 {%- endfor %} | 49 {%- endfor %} |
46 }; | 50 }; |
OLD | NEW |