summaryrefslogtreecommitdiff
path: root/templates/data.hpp.ede
blob: 0dcb02cd130d619c05dcf57f8b8fab044831bb98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// generated file, do not modify!
// {{ dateTime }}

#ifndef HEADER_{{ moduleName }}_H
#define HEADER_{{ moduleName }}_H

#include "RT.hpp"

{% for m in imports %}
#include "{{ m.value }}.hpp"
{% endfor %}

{% for t in dataAndType %}
{% case t.value | constType %}
{% when "DataDef" %}
class {{ t.value.dataName }} {
  public:
    enum class tag { {% for c in t.value.constructors %}
      {{ c.value.name }}{% if !c.last %},{% endif %}{% endfor %}
    } tag;
};
namespace data { {% for c in t.value.constructors %}{% if !(c.value.fields | empty) %}
  class {{ c.value.name }} : public ::{{ t.value.dataName }} {
    public:{% for f in c.value.fields %}{% if c.value.fields | hasFieldNames %}
      {{ f.value.fieldType | cppType }} {{ f.value.fieldName }};{% else %}
      {{ f.value.fieldType | cppType | parens }} _{{ f.index0 }};{% endif %}{% endfor %}
  };{% endif %}{% endfor %}
}
{% when "TypeAlias" %}
typedef {{ t.value.aliasType | cppType }} {{ t.value.aliasName }};

{% endcase %}
{% endfor %}
#endif