summaryrefslogtreecommitdiff
path: root/ddl/out/csharp/LambdaCube.PipelineSchema.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ddl/out/csharp/LambdaCube.PipelineSchema.cs')
-rw-r--r--ddl/out/csharp/LambdaCube.PipelineSchema.cs293
1 files changed, 293 insertions, 0 deletions
diff --git a/ddl/out/csharp/LambdaCube.PipelineSchema.cs b/ddl/out/csharp/LambdaCube.PipelineSchema.cs
new file mode 100644
index 0000000..c5f6548
--- /dev/null
+++ b/ddl/out/csharp/LambdaCube.PipelineSchema.cs
@@ -0,0 +1,293 @@
1// generated file, do not modify!
2// 2016-11-11T11:17:03.470118000000Z
3
4using System;
5using System.Linq;
6using System.Collections.Generic;
7using Newtonsoft.Json.Linq;
8
9using LambdaCube.IR;
10
11namespace LambdaCube.PipelineSchema {
12 public 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 public class ObjectArraySchema {
42 public enum Tag {
43 ObjectArraySchema
44 };
45 public Tag tag;
46 };
47
48 namespace data {
49 public 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 public class PipelineSchema {
56 public enum Tag {
57 PipelineSchema
58 };
59 public Tag tag;
60 };
61
62 namespace data {
63 public 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 public 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 public 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 switch (tag) {
116 case "Attribute_Word": tagType = StreamType.Tag.Attribute_Word; break;
117 case "Attribute_V2U": tagType = StreamType.Tag.Attribute_V2U; break;
118 case "Attribute_V3U": tagType = StreamType.Tag.Attribute_V3U; break;
119 case "Attribute_V4U": tagType = StreamType.Tag.Attribute_V4U; break;
120 case "Attribute_Int": tagType = StreamType.Tag.Attribute_Int; break;
121 case "Attribute_V2I": tagType = StreamType.Tag.Attribute_V2I; break;
122 case "Attribute_V3I": tagType = StreamType.Tag.Attribute_V3I; break;
123 case "Attribute_V4I": tagType = StreamType.Tag.Attribute_V4I; break;
124 case "Attribute_Float": tagType = StreamType.Tag.Attribute_Float; break;
125 case "Attribute_V2F": tagType = StreamType.Tag.Attribute_V2F; break;
126 case "Attribute_V3F": tagType = StreamType.Tag.Attribute_V3F; break;
127 case "Attribute_V4F": tagType = StreamType.Tag.Attribute_V4F; break;
128 case "Attribute_M22F": tagType = StreamType.Tag.Attribute_M22F; break;
129 case "Attribute_M23F": tagType = StreamType.Tag.Attribute_M23F; break;
130 case "Attribute_M24F": tagType = StreamType.Tag.Attribute_M24F; break;
131 case "Attribute_M32F": tagType = StreamType.Tag.Attribute_M32F; break;
132 case "Attribute_M33F": tagType = StreamType.Tag.Attribute_M33F; break;
133 case "Attribute_M34F": tagType = StreamType.Tag.Attribute_M34F; break;
134 case "Attribute_M42F": tagType = StreamType.Tag.Attribute_M42F; break;
135 case "Attribute_M43F": tagType = StreamType.Tag.Attribute_M43F; break;
136 case "Attribute_M44F": tagType = StreamType.Tag.Attribute_M44F; break;
137 default: throw new Exception("unknown constructor: " + tag);
138 }
139 StreamType o = new StreamType();
140 o.tag = tagType;
141 return o;
142 }
143 case Type.ObjectArraySchema: {
144 string tag = (string)obj["tag"];
145 switch (tag) {
146 case "ObjectArraySchema": {
147 data.ObjectArraySchema tv = new data.ObjectArraySchema();
148 tv.primitive = (global::LambdaCube.PipelineSchema.FetchPrimitive)fromJSON(Type.FetchPrimitive,obj["primitive"]);
149 tv.attributes = (Dictionary<string, global::LambdaCube.PipelineSchema.StreamType>)fromJSON(Type.Map_String_StreamType,obj["attributes"]);
150 return tv;
151 }
152 default: throw new Exception("unknown constructor: " + tag);
153 }
154 }
155 case Type.PipelineSchema: {
156 string tag = (string)obj["tag"];
157 switch (tag) {
158 case "PipelineSchema": {
159 data.PipelineSchema tv = new data.PipelineSchema();
160 tv.objectArrays = (Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema>)fromJSON(Type.Map_String_ObjectArraySchema,obj["objectArrays"]);
161 tv.uniforms = (Dictionary<string, global::LambdaCube.PipelineSchema.InputType>)fromJSON(Type.Map_String_InputType,obj["uniforms"]);
162 return tv;
163 }
164 default: throw new Exception("unknown constructor: " + tag);
165 }
166 }
167 }
168 throw new Exception("unknown type");
169 return null;
170 }
171
172 public static JToken toJSON(StreamType v) {
173 var obj = new JObject();
174 switch (v.tag) {
175 case StreamType.Tag.Attribute_Word:
176 obj["tag"] = "Attribute_Word";
177 break;
178 case StreamType.Tag.Attribute_V2U:
179 obj["tag"] = "Attribute_V2U";
180 break;
181 case StreamType.Tag.Attribute_V3U:
182 obj["tag"] = "Attribute_V3U";
183 break;
184 case StreamType.Tag.Attribute_V4U:
185 obj["tag"] = "Attribute_V4U";
186 break;
187 case StreamType.Tag.Attribute_Int:
188 obj["tag"] = "Attribute_Int";
189 break;
190 case StreamType.Tag.Attribute_V2I:
191 obj["tag"] = "Attribute_V2I";
192 break;
193 case StreamType.Tag.Attribute_V3I:
194 obj["tag"] = "Attribute_V3I";
195 break;
196 case StreamType.Tag.Attribute_V4I:
197 obj["tag"] = "Attribute_V4I";
198 break;
199 case StreamType.Tag.Attribute_Float:
200 obj["tag"] = "Attribute_Float";
201 break;
202 case StreamType.Tag.Attribute_V2F:
203 obj["tag"] = "Attribute_V2F";
204 break;
205 case StreamType.Tag.Attribute_V3F:
206 obj["tag"] = "Attribute_V3F";
207 break;
208 case StreamType.Tag.Attribute_V4F:
209 obj["tag"] = "Attribute_V4F";
210 break;
211 case StreamType.Tag.Attribute_M22F:
212 obj["tag"] = "Attribute_M22F";
213 break;
214 case StreamType.Tag.Attribute_M23F:
215 obj["tag"] = "Attribute_M23F";
216 break;
217 case StreamType.Tag.Attribute_M24F:
218 obj["tag"] = "Attribute_M24F";
219 break;
220 case StreamType.Tag.Attribute_M32F:
221 obj["tag"] = "Attribute_M32F";
222 break;
223 case StreamType.Tag.Attribute_M33F:
224 obj["tag"] = "Attribute_M33F";
225 break;
226 case StreamType.Tag.Attribute_M34F:
227 obj["tag"] = "Attribute_M34F";
228 break;
229 case StreamType.Tag.Attribute_M42F:
230 obj["tag"] = "Attribute_M42F";
231 break;
232 case StreamType.Tag.Attribute_M43F:
233 obj["tag"] = "Attribute_M43F";
234 break;
235 case StreamType.Tag.Attribute_M44F:
236 obj["tag"] = "Attribute_M44F";
237 break;
238 }
239 return obj;
240 }
241 public static JToken toJSON(ObjectArraySchema v) {
242 var obj = new JObject();
243 switch (v.tag) {
244 case ObjectArraySchema.Tag.ObjectArraySchema:
245 obj["tag"] = "ObjectArraySchema";
246 {
247 var tv = (data.ObjectArraySchema)v;
248 obj["primitive"] = toJSON(tv.primitive);
249 obj["attributes"] = toJSON(tv.attributes);
250 }
251 break;
252 }
253 return obj;
254 }
255 public static JToken toJSON(PipelineSchema v) {
256 var obj = new JObject();
257 switch (v.tag) {
258 case PipelineSchema.Tag.PipelineSchema:
259 obj["tag"] = "PipelineSchema";
260 {
261 var tv = (data.PipelineSchema)v;
262 obj["objectArrays"] = toJSON(tv.objectArrays);
263 obj["uniforms"] = toJSON(tv.uniforms);
264 }
265 break;
266 }
267 return obj;
268 }
269
270 public static JToken toJSON(string v) { return new JValue(v); }
271 public static JToken toJSON(Dictionary<string, global::LambdaCube.PipelineSchema.InputType> v) {
272 var obj = new JObject();
273 foreach (var i in v) {
274 obj[i.Key] = toJSON(i.Value);
275 }
276 return obj;
277 }
278 public static JToken toJSON(Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema> v) {
279 var obj = new JObject();
280 foreach (var i in v) {
281 obj[i.Key] = toJSON(i.Value);
282 }
283 return obj;
284 }
285 public static JToken toJSON(Dictionary<string, global::LambdaCube.PipelineSchema.StreamType> v) {
286 var obj = new JObject();
287 foreach (var i in v) {
288 obj[i.Key] = toJSON(i.Value);
289 }
290 return obj;
291 }
292 }
293}