summaryrefslogtreecommitdiff
path: root/ddl/out/cpp/LambdaCube.TypeInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ddl/out/cpp/LambdaCube.TypeInfo.cpp')
-rw-r--r--ddl/out/cpp/LambdaCube.TypeInfo.cpp188
1 files changed, 188 insertions, 0 deletions
diff --git a/ddl/out/cpp/LambdaCube.TypeInfo.cpp b/ddl/out/cpp/LambdaCube.TypeInfo.cpp
new file mode 100644
index 0000000..23bdb5b
--- /dev/null
+++ b/ddl/out/cpp/LambdaCube.TypeInfo.cpp
@@ -0,0 +1,188 @@
1// generated file, do not modify!
2// 2016-11-11T11:17:03.605012000000Z
3
4#include "LambdaCube.TypeInfo.hpp"
5template<> json toJSON<std::shared_ptr<Range>>(std::shared_ptr<Range> &v) {
6 json obj({});
7 switch (v->tag) {
8 case ::Range::tag::Range:
9 obj["tag"] = "Range";
10 {
11 std::shared_ptr<data::Range> tv = std::static_pointer_cast<data::Range>(v);
12 obj["startLine"] = toJSON(tv->startLine);
13 obj["startColumn"] = toJSON(tv->startColumn);
14 obj["endLine"] = toJSON(tv->endLine);
15 obj["endColumn"] = toJSON(tv->endColumn);
16 }
17 break;
18 }
19 return obj;
20}
21
22template<> std::shared_ptr<Range> fromJSON<std::shared_ptr<Range>>(W<std::shared_ptr<Range>> v, json &obj) {
23 enum ::Range::tag tagType;
24 std::string tag = obj["tag"];
25 if (tag == "Range") {
26 tagType = ::Range::tag::Range;
27 std::shared_ptr<data::Range> tv(new data::Range());
28 tv->startLine = fromJSON(W<Int>(), obj["startLine"]);
29 tv->startColumn = fromJSON(W<Int>(), obj["startColumn"]);
30 tv->endLine = fromJSON(W<Int>(), obj["endLine"]);
31 tv->endColumn = fromJSON(W<Int>(), obj["endColumn"]);
32 return tv;
33 }
34 else throw "unknown constructor: " + tag;
35 std::shared_ptr<::Range> o(new ::Range());
36 o->tag = tagType;
37 return o;
38}
39
40template<> json toJSON<std::shared_ptr<TypeInfo>>(std::shared_ptr<TypeInfo> &v) {
41 json obj({});
42 switch (v->tag) {
43 case ::TypeInfo::tag::TypeInfo:
44 obj["tag"] = "TypeInfo";
45 {
46 std::shared_ptr<data::TypeInfo> tv = std::static_pointer_cast<data::TypeInfo>(v);
47 obj["range"] = toJSON(tv->range);
48 obj["text"] = toJSON(tv->text);
49 }
50 break;
51 }
52 return obj;
53}
54
55template<> std::shared_ptr<TypeInfo> fromJSON<std::shared_ptr<TypeInfo>>(W<std::shared_ptr<TypeInfo>> v, json &obj) {
56 enum ::TypeInfo::tag tagType;
57 std::string tag = obj["tag"];
58 if (tag == "TypeInfo") {
59 tagType = ::TypeInfo::tag::TypeInfo;
60 std::shared_ptr<data::TypeInfo> tv(new data::TypeInfo());
61 tv->range = fromJSON(W<std::shared_ptr<::Range>>(), obj["range"]);
62 tv->text = fromJSON(W<String>(), obj["text"]);
63 return tv;
64 }
65 else throw "unknown constructor: " + tag;
66 std::shared_ptr<::TypeInfo> o(new ::TypeInfo());
67 o->tag = tagType;
68 return o;
69}
70
71template<> json toJSON<std::shared_ptr<WarningInfo>>(std::shared_ptr<WarningInfo> &v) {
72 json obj({});
73 switch (v->tag) {
74 case ::WarningInfo::tag::WarningInfo:
75 obj["tag"] = "WarningInfo";
76 {
77 std::shared_ptr<data::WarningInfo> tv = std::static_pointer_cast<data::WarningInfo>(v);
78 obj["wRange"] = toJSON(tv->wRange);
79 obj["wText"] = toJSON(tv->wText);
80 }
81 break;
82 }
83 return obj;
84}
85
86template<> std::shared_ptr<WarningInfo> fromJSON<std::shared_ptr<WarningInfo>>(W<std::shared_ptr<WarningInfo>> v, json &obj) {
87 enum ::WarningInfo::tag tagType;
88 std::string tag = obj["tag"];
89 if (tag == "WarningInfo") {
90 tagType = ::WarningInfo::tag::WarningInfo;
91 std::shared_ptr<data::WarningInfo> tv(new data::WarningInfo());
92 tv->wRange = fromJSON(W<std::shared_ptr<::Range>>(), obj["wRange"]);
93 tv->wText = fromJSON(W<String>(), obj["wText"]);
94 return tv;
95 }
96 else throw "unknown constructor: " + tag;
97 std::shared_ptr<::WarningInfo> o(new ::WarningInfo());
98 o->tag = tagType;
99 return o;
100}
101
102template<> json toJSON<std::shared_ptr<ErrorInfo>>(std::shared_ptr<ErrorInfo> &v) {
103 json obj({});
104 switch (v->tag) {
105 case ::ErrorInfo::tag::ErrorInfo:
106 obj["tag"] = "ErrorInfo";
107 {
108 std::shared_ptr<data::ErrorInfo> tv = std::static_pointer_cast<data::ErrorInfo>(v);
109 obj["eRange"] = toJSON(tv->eRange);
110 obj["eText"] = toJSON(tv->eText);
111 }
112 break;
113 }
114 return obj;
115}
116
117template<> std::shared_ptr<ErrorInfo> fromJSON<std::shared_ptr<ErrorInfo>>(W<std::shared_ptr<ErrorInfo>> v, json &obj) {
118 enum ::ErrorInfo::tag tagType;
119 std::string tag = obj["tag"];
120 if (tag == "ErrorInfo") {
121 tagType = ::ErrorInfo::tag::ErrorInfo;
122 std::shared_ptr<data::ErrorInfo> tv(new data::ErrorInfo());
123 tv->eRange = fromJSON(W<std::shared_ptr<::Range>>(), obj["eRange"]);
124 tv->eText = fromJSON(W<String>(), obj["eText"]);
125 return tv;
126 }
127 else throw "unknown constructor: " + tag;
128 std::shared_ptr<::ErrorInfo> o(new ::ErrorInfo());
129 o->tag = tagType;
130 return o;
131}
132
133template<> json toJSON<std::shared_ptr<CompileResult>>(std::shared_ptr<CompileResult> &v) {
134 json obj({});
135 switch (v->tag) {
136 case ::CompileResult::tag::CompileError:
137 obj["tag"] = "CompileError";
138 {
139 std::shared_ptr<data::CompileError> tv = std::static_pointer_cast<data::CompileError>(v);
140 obj["arg0"] = toJSON(tv->_0);
141 obj["arg1"] = toJSON(tv->_1);
142 obj["arg2"] = toJSON(tv->_2);
143 obj["arg3"] = toJSON(tv->_3);
144 }
145 break;
146 case ::CompileResult::tag::Compiled:
147 obj["tag"] = "Compiled";
148 {
149 std::shared_ptr<data::Compiled> tv = std::static_pointer_cast<data::Compiled>(v);
150 obj["arg0"] = toJSON(tv->_0);
151 obj["arg1"] = toJSON(tv->_1);
152 obj["arg2"] = toJSON(tv->_2);
153 obj["arg3"] = toJSON(tv->_3);
154 obj["arg4"] = toJSON(tv->_4);
155 }
156 break;
157 }
158 return obj;
159}
160
161template<> std::shared_ptr<CompileResult> fromJSON<std::shared_ptr<CompileResult>>(W<std::shared_ptr<CompileResult>> v, json &obj) {
162 enum ::CompileResult::tag tagType;
163 std::string tag = obj["tag"];
164 if (tag == "CompileError") {
165 tagType = ::CompileResult::tag::CompileError;
166 std::shared_ptr<data::CompileError> tv(new data::CompileError());
167 tv->_0 = fromJSON(W<String>(), obj["arg0"]);
168 tv->_1 = fromJSON(W<std::vector<std::shared_ptr<::TypeInfo>>>(), obj["arg1"]);
169 tv->_2 = fromJSON(W<std::vector<std::shared_ptr<::WarningInfo>>>(), obj["arg2"]);
170 tv->_3 = fromJSON(W<std::vector<std::shared_ptr<::ErrorInfo>>>(), obj["arg3"]);
171 return tv;
172 }
173 else if (tag == "Compiled") {
174 tagType = ::CompileResult::tag::Compiled;
175 std::shared_ptr<data::Compiled> tv(new data::Compiled());
176 tv->_0 = fromJSON(W<String>(), obj["arg0"]);
177 tv->_1 = fromJSON(W<String>(), obj["arg1"]);
178 tv->_2 = fromJSON(W<std::shared_ptr<::Pipeline>>(), obj["arg2"]);
179 tv->_3 = fromJSON(W<std::vector<std::shared_ptr<::TypeInfo>>>(), obj["arg3"]);
180 tv->_4 = fromJSON(W<std::vector<std::shared_ptr<::WarningInfo>>>(), obj["arg4"]);
181 return tv;
182 }
183 else throw "unknown constructor: " + tag;
184 std::shared_ptr<::CompileResult> o(new ::CompileResult());
185 o->tag = tagType;
186 return o;
187}
188