summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2015-12-21 12:55:17 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2015-12-21 12:55:17 +0100
commitdc8e31235fccbe5ea54d94b0ca69e005ca88c7ea (patch)
tree6bd7205488d5d37439650f6e9b68314a480e2f0f
parentb56039baea14e416384f741551cf0c2938e70b09 (diff)
add alternative c++ template
-rw-r--r--templates/data.hpp2.ede44
1 files changed, 44 insertions, 0 deletions
diff --git a/templates/data.hpp2.ede b/templates/data.hpp2.ede
new file mode 100644
index 0000000..b28562d
--- /dev/null
+++ b/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" %}
16namespace 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}
23class {{ t.value.dataName }} {
24public:
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" %}
37typedef {{ t.value.aliasType.contents }} {{ t.value.aliasName }};
38{% else %}
39typedef {{ t.value.aliasType | cppType }} {{ t.value.aliasName }};
40{% endcase %}
41
42{% endcase %}
43{% endfor %}
44#endif