diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2016-01-29 15:27:53 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2016-01-29 15:27:53 +0100 |
commit | fe9a7c6d0af59227ff34b098f2a5ba1359790ae8 (patch) | |
tree | 3bb7170620c4b914d8bc39127af1e4fb4627fab3 /ddl/out/LambdaCube.PipelineSchema.cpp | |
parent | 0c885c5c6bfb69c543635fd08d697ce44f24642d (diff) |
add Schema to IR module, also use namespace
Diffstat (limited to 'ddl/out/LambdaCube.PipelineSchema.cpp')
-rw-r--r-- | ddl/out/LambdaCube.PipelineSchema.cpp | 208 |
1 files changed, 208 insertions, 0 deletions
diff --git a/ddl/out/LambdaCube.PipelineSchema.cpp b/ddl/out/LambdaCube.PipelineSchema.cpp new file mode 100644 index 0000000..6337f5b --- /dev/null +++ b/ddl/out/LambdaCube.PipelineSchema.cpp | |||
@@ -0,0 +1,208 @@ | |||
1 | // generated file, do not modify! | ||
2 | // 2016-01-28T13:15:31.196716Z | ||
3 | |||
4 | #include "LambdaCube.PipelineSchema.hpp" | ||
5 | template<> json toJSON<std::shared_ptr<StreamType>>(std::shared_ptr<StreamType> &v) { | ||
6 | json obj({}); | ||
7 | switch (v->tag) { | ||
8 | case ::StreamType::tag::Attribute_Word: | ||
9 | obj["tag"] = "Attribute_Word"; | ||
10 | break; | ||
11 | case ::StreamType::tag::Attribute_V2U: | ||
12 | obj["tag"] = "Attribute_V2U"; | ||
13 | break; | ||
14 | case ::StreamType::tag::Attribute_V3U: | ||
15 | obj["tag"] = "Attribute_V3U"; | ||
16 | break; | ||
17 | case ::StreamType::tag::Attribute_V4U: | ||
18 | obj["tag"] = "Attribute_V4U"; | ||
19 | break; | ||
20 | case ::StreamType::tag::Attribute_Int: | ||
21 | obj["tag"] = "Attribute_Int"; | ||
22 | break; | ||
23 | case ::StreamType::tag::Attribute_V2I: | ||
24 | obj["tag"] = "Attribute_V2I"; | ||
25 | break; | ||
26 | case ::StreamType::tag::Attribute_V3I: | ||
27 | obj["tag"] = "Attribute_V3I"; | ||
28 | break; | ||
29 | case ::StreamType::tag::Attribute_V4I: | ||
30 | obj["tag"] = "Attribute_V4I"; | ||
31 | break; | ||
32 | case ::StreamType::tag::Attribute_Float: | ||
33 | obj["tag"] = "Attribute_Float"; | ||
34 | break; | ||
35 | case ::StreamType::tag::Attribute_V2F: | ||
36 | obj["tag"] = "Attribute_V2F"; | ||
37 | break; | ||
38 | case ::StreamType::tag::Attribute_V3F: | ||
39 | obj["tag"] = "Attribute_V3F"; | ||
40 | break; | ||
41 | case ::StreamType::tag::Attribute_V4F: | ||
42 | obj["tag"] = "Attribute_V4F"; | ||
43 | break; | ||
44 | case ::StreamType::tag::Attribute_M22F: | ||
45 | obj["tag"] = "Attribute_M22F"; | ||
46 | break; | ||
47 | case ::StreamType::tag::Attribute_M23F: | ||
48 | obj["tag"] = "Attribute_M23F"; | ||
49 | break; | ||
50 | case ::StreamType::tag::Attribute_M24F: | ||
51 | obj["tag"] = "Attribute_M24F"; | ||
52 | break; | ||
53 | case ::StreamType::tag::Attribute_M32F: | ||
54 | obj["tag"] = "Attribute_M32F"; | ||
55 | break; | ||
56 | case ::StreamType::tag::Attribute_M33F: | ||
57 | obj["tag"] = "Attribute_M33F"; | ||
58 | break; | ||
59 | case ::StreamType::tag::Attribute_M34F: | ||
60 | obj["tag"] = "Attribute_M34F"; | ||
61 | break; | ||
62 | case ::StreamType::tag::Attribute_M42F: | ||
63 | obj["tag"] = "Attribute_M42F"; | ||
64 | break; | ||
65 | case ::StreamType::tag::Attribute_M43F: | ||
66 | obj["tag"] = "Attribute_M43F"; | ||
67 | break; | ||
68 | case ::StreamType::tag::Attribute_M44F: | ||
69 | obj["tag"] = "Attribute_M44F"; | ||
70 | break; | ||
71 | } | ||
72 | return obj; | ||
73 | } | ||
74 | |||
75 | template<> std::shared_ptr<StreamType> fromJSON<std::shared_ptr<StreamType>>(W<std::shared_ptr<StreamType>> v, json &obj) { | ||
76 | enum ::StreamType::tag tagType; | ||
77 | std::string tag = obj["tag"]; | ||
78 | if (tag == "Attribute_Word") { | ||
79 | tagType = ::StreamType::tag::Attribute_Word; | ||
80 | } | ||
81 | else if (tag == "Attribute_V2U") { | ||
82 | tagType = ::StreamType::tag::Attribute_V2U; | ||
83 | } | ||
84 | else if (tag == "Attribute_V3U") { | ||
85 | tagType = ::StreamType::tag::Attribute_V3U; | ||
86 | } | ||
87 | else if (tag == "Attribute_V4U") { | ||
88 | tagType = ::StreamType::tag::Attribute_V4U; | ||
89 | } | ||
90 | else if (tag == "Attribute_Int") { | ||
91 | tagType = ::StreamType::tag::Attribute_Int; | ||
92 | } | ||
93 | else if (tag == "Attribute_V2I") { | ||
94 | tagType = ::StreamType::tag::Attribute_V2I; | ||
95 | } | ||
96 | else if (tag == "Attribute_V3I") { | ||
97 | tagType = ::StreamType::tag::Attribute_V3I; | ||
98 | } | ||
99 | else if (tag == "Attribute_V4I") { | ||
100 | tagType = ::StreamType::tag::Attribute_V4I; | ||
101 | } | ||
102 | else if (tag == "Attribute_Float") { | ||
103 | tagType = ::StreamType::tag::Attribute_Float; | ||
104 | } | ||
105 | else if (tag == "Attribute_V2F") { | ||
106 | tagType = ::StreamType::tag::Attribute_V2F; | ||
107 | } | ||
108 | else if (tag == "Attribute_V3F") { | ||
109 | tagType = ::StreamType::tag::Attribute_V3F; | ||
110 | } | ||
111 | else if (tag == "Attribute_V4F") { | ||
112 | tagType = ::StreamType::tag::Attribute_V4F; | ||
113 | } | ||
114 | else if (tag == "Attribute_M22F") { | ||
115 | tagType = ::StreamType::tag::Attribute_M22F; | ||
116 | } | ||
117 | else if (tag == "Attribute_M23F") { | ||
118 | tagType = ::StreamType::tag::Attribute_M23F; | ||
119 | } | ||
120 | else if (tag == "Attribute_M24F") { | ||
121 | tagType = ::StreamType::tag::Attribute_M24F; | ||
122 | } | ||
123 | else if (tag == "Attribute_M32F") { | ||
124 | tagType = ::StreamType::tag::Attribute_M32F; | ||
125 | } | ||
126 | else if (tag == "Attribute_M33F") { | ||
127 | tagType = ::StreamType::tag::Attribute_M33F; | ||
128 | } | ||
129 | else if (tag == "Attribute_M34F") { | ||
130 | tagType = ::StreamType::tag::Attribute_M34F; | ||
131 | } | ||
132 | else if (tag == "Attribute_M42F") { | ||
133 | tagType = ::StreamType::tag::Attribute_M42F; | ||
134 | } | ||
135 | else if (tag == "Attribute_M43F") { | ||
136 | tagType = ::StreamType::tag::Attribute_M43F; | ||
137 | } | ||
138 | else if (tag == "Attribute_M44F") { | ||
139 | tagType = ::StreamType::tag::Attribute_M44F; | ||
140 | } | ||
141 | else throw "unknown constructor: " + tag; | ||
142 | std::shared_ptr<::StreamType> o(new ::StreamType()); | ||
143 | o->tag = tagType; | ||
144 | return o; | ||
145 | } | ||
146 | |||
147 | template<> json toJSON<std::shared_ptr<ObjectArraySchema>>(std::shared_ptr<ObjectArraySchema> &v) { | ||
148 | json obj({}); | ||
149 | switch (v->tag) { | ||
150 | case ::ObjectArraySchema::tag::ObjectArraySchema: | ||
151 | obj["tag"] = "ObjectArraySchema"; | ||
152 | { | ||
153 | std::shared_ptr<data::ObjectArraySchema> tv = std::static_pointer_cast<data::ObjectArraySchema>(v); | ||
154 | obj["primitive"] = toJSON(tv->primitive); | ||
155 | obj["attributes"] = toJSON(tv->attributes); | ||
156 | } | ||
157 | break; | ||
158 | } | ||
159 | return obj; | ||
160 | } | ||
161 | |||
162 | template<> std::shared_ptr<ObjectArraySchema> fromJSON<std::shared_ptr<ObjectArraySchema>>(W<std::shared_ptr<ObjectArraySchema>> v, json &obj) { | ||
163 | enum ::ObjectArraySchema::tag tagType; | ||
164 | std::string tag = obj["tag"]; | ||
165 | if (tag == "ObjectArraySchema") { | ||
166 | tagType = ::ObjectArraySchema::tag::ObjectArraySchema; | ||
167 | std::shared_ptr<data::ObjectArraySchema> tv(new data::ObjectArraySchema()); | ||
168 | tv->primitive = fromJSON(W<std::shared_ptr<::FetchPrimitive>>(), obj["primitive"]); | ||
169 | tv->attributes = fromJSON(W<std::map<String, std::shared_ptr<::StreamType>>>(), obj["attributes"]); | ||
170 | return tv; | ||
171 | } | ||
172 | else throw "unknown constructor: " + tag; | ||
173 | std::shared_ptr<::ObjectArraySchema> o(new ::ObjectArraySchema()); | ||
174 | o->tag = tagType; | ||
175 | return o; | ||
176 | } | ||
177 | |||
178 | template<> json toJSON<std::shared_ptr<PipelineSchema>>(std::shared_ptr<PipelineSchema> &v) { | ||
179 | json obj({}); | ||
180 | switch (v->tag) { | ||
181 | case ::PipelineSchema::tag::PipelineSchema: | ||
182 | obj["tag"] = "PipelineSchema"; | ||
183 | { | ||
184 | std::shared_ptr<data::PipelineSchema> tv = std::static_pointer_cast<data::PipelineSchema>(v); | ||
185 | obj["objectArrays"] = toJSON(tv->objectArrays); | ||
186 | obj["uniforms"] = toJSON(tv->uniforms); | ||
187 | } | ||
188 | break; | ||
189 | } | ||
190 | return obj; | ||
191 | } | ||
192 | |||
193 | template<> std::shared_ptr<PipelineSchema> fromJSON<std::shared_ptr<PipelineSchema>>(W<std::shared_ptr<PipelineSchema>> v, json &obj) { | ||
194 | enum ::PipelineSchema::tag tagType; | ||
195 | std::string tag = obj["tag"]; | ||
196 | if (tag == "PipelineSchema") { | ||
197 | tagType = ::PipelineSchema::tag::PipelineSchema; | ||
198 | std::shared_ptr<data::PipelineSchema> tv(new data::PipelineSchema()); | ||
199 | tv->objectArrays = fromJSON(W<std::map<String, std::shared_ptr<::ObjectArraySchema>>>(), obj["objectArrays"]); | ||
200 | tv->uniforms = fromJSON(W<std::map<String, std::shared_ptr<::InputType>>>(), obj["uniforms"]); | ||
201 | return tv; | ||
202 | } | ||
203 | else throw "unknown constructor: " + tag; | ||
204 | std::shared_ptr<::PipelineSchema> o(new ::PipelineSchema()); | ||
205 | o->tag = tagType; | ||
206 | return o; | ||
207 | } | ||
208 | |||