1
+ /**
2
+ * INTERNAL: Do not use.
3
+ * This module defines the IPA layer on top of raw DB entities, and the conversions between the two
4
+ * layers.
5
+ */
6
+
1
7
private import { {import_prefix} }.SynthConstructors
2
8
private import { {import_prefix} }.Raw
3
9
4
10
cached module Synth {
11
+ /**
12
+ * INTERNAL: Do not use.
13
+ * The synthesized type of all elements.
14
+ */
5
15
cached newtype T{{root} } =
6
16
{ {#final_classes} }
7
17
{ {^first} }
8
18
or
9
19
{ {/first} }
20
+ /**
21
+ * INTERNAL: Do not use.
22
+ */
10
23
T{ {name} }({ {#params} }{ {^first} }, { {/first} }{ {type} } { {param} }{ {/params} }){ {#has_params} } { construct{{name} }({ {#params} }{ {^first} }, { {/first} }{ {param} }{ {/params} }) }{ {/has_params} }
11
24
{ {/final_classes} }
12
25
13
26
{ {#non_final_classes} }
14
27
{ {^root} }
28
+ /**
29
+ * INTERNAL: Do not use.
30
+ */
15
31
class T{ {name} } = { {#derived} }{ {^first} } or { {/first} }T{ {name} }{ {/derived} };
16
32
{ {/root} }
17
33
{ {/non_final_classes} }
18
34
19
35
{ {#final_classes} }
36
+ /**
37
+ * INTERNAL: Do not use.
38
+ * Converts a raw element to a synthesized `T{ {name} }`, if possible.
39
+ */
20
40
cached T{ {name} } convert{ {name} }FromRaw(Raw::Element e) {
21
41
{{^is_fresh_ipa} }
22
42
result = T{ {name} }(e)
@@ -28,6 +48,10 @@ cached module Synth {
28
48
{ {/final_classes} }
29
49
30
50
{ {#non_final_classes} }
51
+ /**
52
+ * INTERNAL: Do not use.
53
+ * Converts a raw DB element to a synthesized `T{ {name} }`, if possible.
54
+ */
31
55
cached T{ {name} } convert{ {name} }FromRaw(Raw::Element e) {
32
56
{{#derived} }
33
57
{ {^first} }
@@ -39,6 +63,10 @@ cached module Synth {
39
63
{ {/non_final_classes} }
40
64
41
65
{ {#final_classes} }
66
+ /**
67
+ * INTERNAL: Do not use.
68
+ * Converts a synthesized `T{ {name} }` to a raw DB element, if possible.
69
+ */
42
70
cached Raw::Element convert{ {name} }ToRaw(T{ {name} } e) {
43
71
{{^is_fresh_ipa} }
44
72
e = T{ {name} }(result)
@@ -50,6 +78,10 @@ cached module Synth {
50
78
{ {/final_classes} }
51
79
52
80
{ {#non_final_classes} }
81
+ /**
82
+ * INTERNAL: Do not use.
83
+ * Converts a synthesized `T{ {name} }` to a raw DB element, if possible.
84
+ */
53
85
cached Raw::Element convert{ {name} }ToRaw(T{ {name} } e) {
54
86
{{#derived} }
55
87
{ {^first} }
0 commit comments