summaryrefslogtreecommitdiff
path: root/ddl/out/LambdaCube.PipelineSchema.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ddl/out/LambdaCube.PipelineSchema.cs')
-rw-r--r--ddl/out/LambdaCube.PipelineSchema.cs339
1 files changed, 339 insertions, 0 deletions
diff --git a/ddl/out/LambdaCube.PipelineSchema.cs b/ddl/out/LambdaCube.PipelineSchema.cs
new file mode 100644
index 0000000..945ae0c
--- /dev/null
+++ b/ddl/out/LambdaCube.PipelineSchema.cs
@@ -0,0 +1,339 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.343859000000Z
3
4using System;
5using System.Linq;
6using System.Collections.Generic;
7using Newtonsoft.Json.Linq;
8
9using LambdaCube.IR;
10
11namespace LambdaCube.PipelineSchema {
12 class StreamType {
13 public enum Tag {
14 Attribute_Word,
15 Attribute_V2U,
16 Attribute_V3U,
17 Attribute_V4U,
18 Attribute_Int,
19 Attribute_V2I,
20 Attribute_V3I,
21 Attribute_V4I,
22 Attribute_Float,
23 Attribute_V2F,
24 Attribute_V3F,
25 Attribute_V4F,
26 Attribute_M22F,
27 Attribute_M23F,
28 Attribute_M24F,
29 Attribute_M32F,
30 Attribute_M33F,
31 Attribute_M34F,
32 Attribute_M42F,
33 Attribute_M43F,
34 Attribute_M44F
35 };
36 public Tag tag;
37 };
38
39 namespace data {
40 }
41 class ObjectArraySchema {
42 public enum Tag {
43 ObjectArraySchema
44 };
45 public Tag tag;
46 };
47
48 namespace data {
49 class ObjectArraySchema : LambdaCube.PipelineSchema.ObjectArraySchema {
50 public global::LambdaCube.PipelineSchema.FetchPrimitive primitive;
51 public Dictionary<string, global::LambdaCube.PipelineSchema.StreamType> attributes;
52 public ObjectArraySchema() { tag = LambdaCube.PipelineSchema.ObjectArraySchema.Tag.ObjectArraySchema; }
53 };
54 }
55 class PipelineSchema {
56 public enum Tag {
57 PipelineSchema
58 };
59 public Tag tag;
60 };
61
62 namespace data {
63 class PipelineSchema : LambdaCube.PipelineSchema.PipelineSchema {
64 public Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema> objectArrays;
65 public Dictionary<string, global::LambdaCube.PipelineSchema.InputType> uniforms;
66 public PipelineSchema() { tag = LambdaCube.PipelineSchema.PipelineSchema.Tag.PipelineSchema; }
67 };
68 }
69
70 // JSON deserializer
71 enum Type {
72 String,
73 Map_String_InputType,
74 Map_String_ObjectArraySchema,
75 Map_String_StreamType,
76 FetchPrimitive,
77 InputType,
78 ObjectArraySchema,
79 PipelineSchema,
80 StreamType
81 }
82
83 class Loader {
84 public static object fromJSON(Type type, JToken obj) {
85 switch (type) {
86 case Type.String: return (string)obj;
87 case Type.Map_String_InputType: {
88 var map = new Dictionary<string, global::LambdaCube.PipelineSchema.InputType> ();
89 foreach(var i in (JObject)obj) {
90 map.Add( (string)fromJSON(Type.String,i.Key)
91 , (global::LambdaCube.PipelineSchema.InputType)fromJSON(Type.InputType,i.Value));
92 }
93 return map;
94 }
95 case Type.Map_String_ObjectArraySchema: {
96 var map = new Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema> ();
97 foreach(var i in (JObject)obj) {
98 map.Add( (string)fromJSON(Type.String,i.Key)
99 , (global::LambdaCube.PipelineSchema.ObjectArraySchema)fromJSON(Type.ObjectArraySchema,i.Value));
100 }
101 return map;
102 }
103 case Type.Map_String_StreamType: {
104 var map = new Dictionary<string, global::LambdaCube.PipelineSchema.StreamType> ();
105 foreach(var i in (JObject)obj) {
106 map.Add( (string)fromJSON(Type.String,i.Key)
107 , (global::LambdaCube.PipelineSchema.StreamType)fromJSON(Type.StreamType,i.Value));
108 }
109 return map;
110 }
111
112 case Type.StreamType: {
113 string tag = (string)obj["tag"];
114 StreamType.Tag tagType;
115 if (tag == "Attribute_Word") {
116 tagType = StreamType.Tag.Attribute_Word;
117 }
118 else if (tag == "Attribute_V2U") {
119 tagType = StreamType.Tag.Attribute_V2U;
120 }
121 else if (tag == "Attribute_V3U") {
122 tagType = StreamType.Tag.Attribute_V3U;
123 }
124 else if (tag == "Attribute_V4U") {
125 tagType = StreamType.Tag.Attribute_V4U;
126 }
127 else if (tag == "Attribute_Int") {
128 tagType = StreamType.Tag.Attribute_Int;
129 }
130 else if (tag == "Attribute_V2I") {
131 tagType = StreamType.Tag.Attribute_V2I;
132 }
133 else if (tag == "Attribute_V3I") {
134 tagType = StreamType.Tag.Attribute_V3I;
135 }
136 else if (tag == "Attribute_V4I") {
137 tagType = StreamType.Tag.Attribute_V4I;
138 }
139 else if (tag == "Attribute_Float") {
140 tagType = StreamType.Tag.Attribute_Float;
141 }
142 else if (tag == "Attribute_V2F") {
143 tagType = StreamType.Tag.Attribute_V2F;
144 }
145 else if (tag == "Attribute_V3F") {
146 tagType = StreamType.Tag.Attribute_V3F;
147 }
148 else if (tag == "Attribute_V4F") {
149 tagType = StreamType.Tag.Attribute_V4F;
150 }
151 else if (tag == "Attribute_M22F") {
152 tagType = StreamType.Tag.Attribute_M22F;
153 }
154 else if (tag == "Attribute_M23F") {
155 tagType = StreamType.Tag.Attribute_M23F;
156 }
157 else if (tag == "Attribute_M24F") {
158 tagType = StreamType.Tag.Attribute_M24F;
159 }
160 else if (tag == "Attribute_M32F") {
161 tagType = StreamType.Tag.Attribute_M32F;
162 }
163 else if (tag == "Attribute_M33F") {
164 tagType = StreamType.Tag.Attribute_M33F;
165 }
166 else if (tag == "Attribute_M34F") {
167 tagType = StreamType.Tag.Attribute_M34F;
168 }
169 else if (tag == "Attribute_M42F") {
170 tagType = StreamType.Tag.Attribute_M42F;
171 }
172 else if (tag == "Attribute_M43F") {
173 tagType = StreamType.Tag.Attribute_M43F;
174 }
175 else if (tag == "Attribute_M44F") {
176 tagType = StreamType.Tag.Attribute_M44F;
177 }
178 else throw new Exception("unknown constructor: " + tag);
179 StreamType o = new StreamType();
180 o.tag = tagType;
181 return o;
182 }
183 case Type.ObjectArraySchema: {
184 string tag = (string)obj["tag"];
185 ObjectArraySchema.Tag tagType;
186 if (tag == "ObjectArraySchema") {
187 tagType = ObjectArraySchema.Tag.ObjectArraySchema;
188 data.ObjectArraySchema tv = new data.ObjectArraySchema();
189 tv.primitive = (global::LambdaCube.PipelineSchema.FetchPrimitive)fromJSON(Type.FetchPrimitive,obj["primitive"]);
190 tv.attributes = (Dictionary<string, global::LambdaCube.PipelineSchema.StreamType>)fromJSON(Type.Map_String_StreamType,obj["attributes"]);
191 return tv;
192 }
193 else throw new Exception("unknown constructor: " + tag);
194 ObjectArraySchema o = new ObjectArraySchema();
195 o.tag = tagType;
196 return o;
197 }
198 case Type.PipelineSchema: {
199 string tag = (string)obj["tag"];
200 PipelineSchema.Tag tagType;
201 if (tag == "PipelineSchema") {
202 tagType = PipelineSchema.Tag.PipelineSchema;
203 data.PipelineSchema tv = new data.PipelineSchema();
204 tv.objectArrays = (Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema>)fromJSON(Type.Map_String_ObjectArraySchema,obj["objectArrays"]);
205 tv.uniforms = (Dictionary<string, global::LambdaCube.PipelineSchema.InputType>)fromJSON(Type.Map_String_InputType,obj["uniforms"]);
206 return tv;
207 }
208 else throw new Exception("unknown constructor: " + tag);
209 PipelineSchema o = new PipelineSchema();
210 o.tag = tagType;
211 return o;
212 }
213 }
214 throw new Exception("unknown type");
215 return null;
216 }
217
218 JToken toJSON(StreamType v) {
219 var obj = new JObject();
220 switch (v.tag) {
221 case StreamType.Tag.Attribute_Word:
222 obj["tag"] = "Attribute_Word";
223 break;
224 case StreamType.Tag.Attribute_V2U:
225 obj["tag"] = "Attribute_V2U";
226 break;
227 case StreamType.Tag.Attribute_V3U:
228 obj["tag"] = "Attribute_V3U";
229 break;
230 case StreamType.Tag.Attribute_V4U:
231 obj["tag"] = "Attribute_V4U";
232 break;
233 case StreamType.Tag.Attribute_Int:
234 obj["tag"] = "Attribute_Int";
235 break;
236 case StreamType.Tag.Attribute_V2I:
237 obj["tag"] = "Attribute_V2I";
238 break;
239 case StreamType.Tag.Attribute_V3I:
240 obj["tag"] = "Attribute_V3I";
241 break;
242 case StreamType.Tag.Attribute_V4I:
243 obj["tag"] = "Attribute_V4I";
244 break;
245 case StreamType.Tag.Attribute_Float:
246 obj["tag"] = "Attribute_Float";
247 break;
248 case StreamType.Tag.Attribute_V2F:
249 obj["tag"] = "Attribute_V2F";
250 break;
251 case StreamType.Tag.Attribute_V3F:
252 obj["tag"] = "Attribute_V3F";
253 break;
254 case StreamType.Tag.Attribute_V4F:
255 obj["tag"] = "Attribute_V4F";
256 break;
257 case StreamType.Tag.Attribute_M22F:
258 obj["tag"] = "Attribute_M22F";
259 break;
260 case StreamType.Tag.Attribute_M23F:
261 obj["tag"] = "Attribute_M23F";
262 break;
263 case StreamType.Tag.Attribute_M24F:
264 obj["tag"] = "Attribute_M24F";
265 break;
266 case StreamType.Tag.Attribute_M32F:
267 obj["tag"] = "Attribute_M32F";
268 break;
269 case StreamType.Tag.Attribute_M33F:
270 obj["tag"] = "Attribute_M33F";
271 break;
272 case StreamType.Tag.Attribute_M34F:
273 obj["tag"] = "Attribute_M34F";
274 break;
275 case StreamType.Tag.Attribute_M42F:
276 obj["tag"] = "Attribute_M42F";
277 break;
278 case StreamType.Tag.Attribute_M43F:
279 obj["tag"] = "Attribute_M43F";
280 break;
281 case StreamType.Tag.Attribute_M44F:
282 obj["tag"] = "Attribute_M44F";
283 break;
284 }
285 return obj;
286 }
287 JToken toJSON(ObjectArraySchema v) {
288 var obj = new JObject();
289 switch (v.tag) {
290 case ObjectArraySchema.Tag.ObjectArraySchema:
291 obj["tag"] = "ObjectArraySchema";
292 {
293 var tv = (data.ObjectArraySchema)v;
294 obj["primitive"] = toJSON(tv.primitive);
295 obj["attributes"] = toJSON(tv.attributes);
296 }
297 break;
298 }
299 return obj;
300 }
301 JToken toJSON(PipelineSchema v) {
302 var obj = new JObject();
303 switch (v.tag) {
304 case PipelineSchema.Tag.PipelineSchema:
305 obj["tag"] = "PipelineSchema";
306 {
307 var tv = (data.PipelineSchema)v;
308 obj["objectArrays"] = toJSON(tv.objectArrays);
309 obj["uniforms"] = toJSON(tv.uniforms);
310 }
311 break;
312 }
313 return obj;
314 }
315
316 JToken toJSON(string v) { return new JValue(v); }
317 JToken toJSON(Dictionary<string, global::LambdaCube.PipelineSchema.InputType> v) {
318 var obj = new JObject();
319 foreach (var i in v) {
320 obj[i.Key] = toJSON(i.Value);
321 }
322 return obj;
323 }
324 JToken toJSON(Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema> v) {
325 var obj = new JObject();
326 foreach (var i in v) {
327 obj[i.Key] = toJSON(i.Value);
328 }
329 return obj;
330 }
331 JToken toJSON(Dictionary<string, global::LambdaCube.PipelineSchema.StreamType> v) {
332 var obj = new JObject();
333 foreach (var i in v) {
334 obj[i.Key] = toJSON(i.Value);
335 }
336 return obj;
337 }
338 }
339}