diff options
Diffstat (limited to 'ddl/templates/data.hpp2.ede')
-rw-r--r-- | ddl/templates/data.hpp2.ede | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ddl/templates/data.hpp2.ede b/ddl/templates/data.hpp2.ede new file mode 100644 index 0000000..b28562d --- /dev/null +++ b/ddl/templates/data.hpp2.ede | |||
@@ -0,0 +1,44 @@ | |||
1 | // generated file, do not modify! | ||
2 | // {{ dateTime }} | ||
3 | |||
4 | #ifndef HEADER_{{ moduleName }}_H | ||
5 | #define HEADER_{{ moduleName }}_H | ||
6 | |||
7 | #include "RT.hpp" | ||
8 | |||
9 | {% for m in imports %} | ||
10 | #include "{{ m.value }}.hpp" | ||
11 | {% endfor %} | ||
12 | |||
13 | {% for t in dataAndType %} | ||
14 | {% case t.value | constType %} | ||
15 | {% when "DataDef" %} | ||
16 | namespace data { {% for c in t.value.constructors %}{% if !(c.value.fields | empty) %} | ||
17 | class {{ c.value.name }} { | ||
18 | public: {% for f in c.value.fields %}{% if c.value.fields | hasFieldNames %} | ||
19 | {{ f.value.fieldType | cppType }} {{ f.value.fieldName }};{% else %} | ||
20 | {{ f.value.fieldType | cppType | parens }} _{{ f.index0 }};{% endif %}{% endfor %} | ||
21 | };{% endif %}{% endfor %} | ||
22 | } | ||
23 | class {{ t.value.dataName }} { | ||
24 | public: | ||
25 | enum class tag { {% for c in t.value.constructors %} | ||
26 | {{ c.value.name }}{% if !c.last %},{% endif %}{% endfor %} | ||
27 | } tag; | ||
28 | {% for c in t.value.constructors %} | ||
29 | {% if !(c.value.fields | empty) %} | ||
30 | std::shared_ptr<data::{{ c.value.name }}> {{ c.value.name }}; | ||
31 | {% endif %} | ||
32 | {% endfor %} | ||
33 | }; | ||
34 | {% when "TypeAlias" %} | ||
35 | {% case t.value.aliasType.tag %} | ||
36 | {% when "Data" %} | ||
37 | typedef {{ t.value.aliasType.contents }} {{ t.value.aliasName }}; | ||
38 | {% else %} | ||
39 | typedef {{ t.value.aliasType | cppType }} {{ t.value.aliasName }}; | ||
40 | {% endcase %} | ||
41 | |||
42 | {% endcase %} | ||
43 | {% endfor %} | ||
44 | #endif | ||