9#define __NARG__(...) __NARG_I_(__VA_ARGS__, __RSEQ_N())
10#define __NARG_I_(...) __ARG_N(__VA_ARGS__)
11#define __ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, \
12 _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, \
13 _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, \
14 _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, \
15 _59, _60, _61, _62, _63, N, ...) \
18 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, \
19 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, \
20 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
23#define _VFUNC_(name, n) name##n
24#define _VFUNC(name, n) _VFUNC_(name, n)
25#define VFUNC(func, ...) _VFUNC(func, __NARG__(__VA_ARGS__))(__VA_ARGS__)
27#define MECACELL_STR_FIRST(k, v) #k
28#define MECACELL_FIRST(k, v) k
29#define MECACELL_SECOND(k, v) v
32#define MECACELL_K(...) MECACELL_FIRST __VA_ARGS__
33#define MECACELL_SK(...) MECACELL_STR_FIRST __VA_ARGS__
34#define MECACELL_V(...) MECACELL_SECOND __VA_ARGS__
36#define EXPORTABLE_INHERIT(...) VFUNC(EXPORTABLE_INHERIT, __VA_ARGS__)
37#define EXPORTABLE(...) VFUNC(EXPORTABLE, __VA_ARGS__)
39#define EXPORTABLE_INHERIT3(S, Base, p0) \
40 struct Exportable : ExportableType<Base>::type { \
41 using BType = ExportableType<Base>::type; \
42 using json = nlohmann::json; \
43 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
45 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
46 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
47 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
49 void from_json(const json& o) { \
50 if (o.count(MECACELL_SK(p0))) \
51 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
53 json to_json() const { \
54 auto b = BType::to_json(); \
55 auto r = to_jsonL(*this); \
56 if (!b.empty()) r.update(b); \
59 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
60 return s.saveJ(MECACELL_SK(p0), s.MECACELL_K(p0)); \
62 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
64 Exportable getExport() const { return Exportable(*this); }
66#define EXPORTABLE2(S, v0) EXPORTABLE_INHERIT3(S, BaseExportable, v0)
68#define EXPORTABLE_INHERIT4(S, Base, p0, p1) \
69 struct Exportable : ExportableType<Base>::type { \
70 using BType = ExportableType<Base>::type; \
71 using json = nlohmann::json; \
72 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
73 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
75 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
76 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
77 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
78 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
80 void from_json(const json& o) { \
81 if (o.count(MECACELL_SK(p0))) \
82 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
83 if (o.count(MECACELL_SK(p1))) \
84 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
86 json to_json() const { \
87 auto b = BType::to_json(); \
88 auto r = to_jsonL(*this); \
89 if (!b.empty()) r.update(b); \
92 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
93 return s.saveJ(MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), \
96 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
98 Exportable getExport() const { return Exportable(*this); }
100#define EXPORTABLE3(S, v0, v1) EXPORTABLE_INHERIT4(S, BaseExportable, v0, v1)
102#define EXPORTABLE_INHERIT5(S, Base, p0, p1, p2) \
103 struct Exportable : ExportableType<Base>::type { \
104 using BType = ExportableType<Base>::type; \
105 using json = nlohmann::json; \
106 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
107 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
108 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
110 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
111 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
112 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
113 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
114 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
116 void from_json(const json& o) { \
117 if (o.count(MECACELL_SK(p0))) \
118 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
119 if (o.count(MECACELL_SK(p1))) \
120 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
121 if (o.count(MECACELL_SK(p2))) \
122 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
124 json to_json() const { \
125 auto b = BType::to_json(); \
126 auto r = to_jsonL(*this); \
127 if (!b.empty()) r.update(b); \
130 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
131 return s.saveJ(MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), \
132 s.MECACELL_K(p1), MECACELL_SK(p2), s.MECACELL_K(p2)); \
134 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
136 Exportable getExport() const { return Exportable(*this); }
138#define EXPORTABLE4(S, v0, v1, v2) EXPORTABLE_INHERIT5(S, BaseExportable, v0, v1, v2)
140#define EXPORTABLE_INHERIT6(S, Base, p0, p1, p2, p3) \
141 struct Exportable : ExportableType<Base>::type { \
142 using BType = ExportableType<Base>::type; \
143 using json = nlohmann::json; \
144 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
145 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
146 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
147 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
149 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
150 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
151 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
152 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
153 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
154 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
156 void from_json(const json& o) { \
157 if (o.count(MECACELL_SK(p0))) \
158 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
159 if (o.count(MECACELL_SK(p1))) \
160 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
161 if (o.count(MECACELL_SK(p2))) \
162 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
163 if (o.count(MECACELL_SK(p3))) \
164 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
166 json to_json() const { \
167 auto b = BType::to_json(); \
168 auto r = to_jsonL(*this); \
169 if (!b.empty()) r.update(b); \
172 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
173 return s.saveJ(MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), \
174 s.MECACELL_K(p1), MECACELL_SK(p2), s.MECACELL_K(p2), \
175 MECACELL_SK(p3), s.MECACELL_K(p3)); \
177 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
179 Exportable getExport() const { return Exportable(*this); }
181#define EXPORTABLE5(S, v0, v1, v2, v3) \
182 EXPORTABLE_INHERIT6(S, BaseExportable, v0, v1, v2, v3)
184#define EXPORTABLE_INHERIT7(S, Base, p0, p1, p2, p3, p4) \
185 struct Exportable : ExportableType<Base>::type { \
186 using BType = ExportableType<Base>::type; \
187 using json = nlohmann::json; \
188 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
189 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
190 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
191 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
192 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
194 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
195 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
196 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
197 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
198 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
199 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
200 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
202 void from_json(const json& o) { \
203 if (o.count(MECACELL_SK(p0))) \
204 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
205 if (o.count(MECACELL_SK(p1))) \
206 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
207 if (o.count(MECACELL_SK(p2))) \
208 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
209 if (o.count(MECACELL_SK(p3))) \
210 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
211 if (o.count(MECACELL_SK(p4))) \
212 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
214 json to_json() const { \
215 auto b = BType::to_json(); \
216 auto r = to_jsonL(*this); \
217 if (!b.empty()) r.update(b); \
220 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
221 return s.saveJ(MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), \
222 s.MECACELL_K(p1), MECACELL_SK(p2), s.MECACELL_K(p2), \
223 MECACELL_SK(p3), s.MECACELL_K(p3), MECACELL_SK(p4), \
226 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
228 Exportable getExport() const { return Exportable(*this); }
230#define EXPORTABLE6(S, v0, v1, v2, v3, v4) \
231 EXPORTABLE_INHERIT7(S, BaseExportable, v0, v1, v2, v3, v4)
233#define EXPORTABLE_INHERIT8(S, Base, p0, p1, p2, p3, p4, p5) \
234 struct Exportable : ExportableType<Base>::type { \
235 using BType = ExportableType<Base>::type; \
236 using json = nlohmann::json; \
237 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
238 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
239 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
240 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
241 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
242 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
244 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
245 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
246 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
247 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
248 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
249 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
250 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
251 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
253 void from_json(const json& o) { \
254 if (o.count(MECACELL_SK(p0))) \
255 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
256 if (o.count(MECACELL_SK(p1))) \
257 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
258 if (o.count(MECACELL_SK(p2))) \
259 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
260 if (o.count(MECACELL_SK(p3))) \
261 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
262 if (o.count(MECACELL_SK(p4))) \
263 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
264 if (o.count(MECACELL_SK(p5))) \
265 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
267 json to_json() const { \
268 auto b = BType::to_json(); \
269 auto r = to_jsonL(*this); \
270 if (!b.empty()) r.update(b); \
273 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
274 return s.saveJ(MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), \
275 s.MECACELL_K(p1), MECACELL_SK(p2), s.MECACELL_K(p2), \
276 MECACELL_SK(p3), s.MECACELL_K(p3), MECACELL_SK(p4), \
277 s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5)); \
279 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
281 Exportable getExport() const { return Exportable(*this); }
283#define EXPORTABLE7(S, v0, v1, v2, v3, v4, v5) \
284 EXPORTABLE_INHERIT8(S, BaseExportable, v0, v1, v2, v3, v4, v5)
286#define EXPORTABLE_INHERIT9(S, Base, p0, p1, p2, p3, p4, p5, p6) \
287 struct Exportable : ExportableType<Base>::type { \
288 using BType = ExportableType<Base>::type; \
289 using json = nlohmann::json; \
290 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
291 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
292 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
293 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
294 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
295 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
296 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
298 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
299 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
300 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
301 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
302 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
303 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
304 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
305 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
306 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
308 void from_json(const json& o) { \
309 if (o.count(MECACELL_SK(p0))) \
310 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
311 if (o.count(MECACELL_SK(p1))) \
312 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
313 if (o.count(MECACELL_SK(p2))) \
314 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
315 if (o.count(MECACELL_SK(p3))) \
316 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
317 if (o.count(MECACELL_SK(p4))) \
318 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
319 if (o.count(MECACELL_SK(p5))) \
320 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
321 if (o.count(MECACELL_SK(p6))) \
322 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
324 json to_json() const { \
325 auto b = BType::to_json(); \
326 auto r = to_jsonL(*this); \
327 if (!b.empty()) r.update(b); \
330 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
331 return s.saveJ(MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), \
332 s.MECACELL_K(p1), MECACELL_SK(p2), s.MECACELL_K(p2), \
333 MECACELL_SK(p3), s.MECACELL_K(p3), MECACELL_SK(p4), \
334 s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
335 MECACELL_SK(p6), s.MECACELL_K(p6)); \
337 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
339 Exportable getExport() const { return Exportable(*this); }
341#define EXPORTABLE8(S, v0, v1, v2, v3, v4, v5, v6) \
342 EXPORTABLE_INHERIT9(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6)
344#define EXPORTABLE_INHERIT10(S, Base, p0, p1, p2, p3, p4, p5, p6, p7) \
345 struct Exportable : ExportableType<Base>::type { \
346 using BType = ExportableType<Base>::type; \
347 using json = nlohmann::json; \
348 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
349 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
350 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
351 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
352 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
353 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
354 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
355 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
357 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
358 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
359 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
360 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
361 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
362 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
363 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
364 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
365 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
366 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
368 void from_json(const json& o) { \
369 if (o.count(MECACELL_SK(p0))) \
370 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
371 if (o.count(MECACELL_SK(p1))) \
372 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
373 if (o.count(MECACELL_SK(p2))) \
374 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
375 if (o.count(MECACELL_SK(p3))) \
376 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
377 if (o.count(MECACELL_SK(p4))) \
378 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
379 if (o.count(MECACELL_SK(p5))) \
380 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
381 if (o.count(MECACELL_SK(p6))) \
382 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
383 if (o.count(MECACELL_SK(p7))) \
384 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
386 json to_json() const { \
387 auto b = BType::to_json(); \
388 auto r = to_jsonL(*this); \
389 if (!b.empty()) r.update(b); \
392 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
394 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
395 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
396 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
397 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7)); \
399 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
401 Exportable getExport() const { return Exportable(*this); }
403#define EXPORTABLE9(S, v0, v1, v2, v3, v4, v5, v6, v7) \
404 EXPORTABLE_INHERIT10(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7)
406#define EXPORTABLE_INHERIT11(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8) \
407 struct Exportable : ExportableType<Base>::type { \
408 using BType = ExportableType<Base>::type; \
409 using json = nlohmann::json; \
410 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
411 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
412 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
413 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
414 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
415 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
416 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
417 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
418 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
420 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
421 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
422 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
423 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
424 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
425 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
426 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
427 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
428 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
429 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
430 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
432 void from_json(const json& o) { \
433 if (o.count(MECACELL_SK(p0))) \
434 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
435 if (o.count(MECACELL_SK(p1))) \
436 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
437 if (o.count(MECACELL_SK(p2))) \
438 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
439 if (o.count(MECACELL_SK(p3))) \
440 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
441 if (o.count(MECACELL_SK(p4))) \
442 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
443 if (o.count(MECACELL_SK(p5))) \
444 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
445 if (o.count(MECACELL_SK(p6))) \
446 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
447 if (o.count(MECACELL_SK(p7))) \
448 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
449 if (o.count(MECACELL_SK(p8))) \
450 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
452 json to_json() const { \
453 auto b = BType::to_json(); \
454 auto r = to_jsonL(*this); \
455 if (!b.empty()) r.update(b); \
458 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
459 return s.saveJ(MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), \
460 s.MECACELL_K(p1), MECACELL_SK(p2), s.MECACELL_K(p2), \
461 MECACELL_SK(p3), s.MECACELL_K(p3), MECACELL_SK(p4), \
462 s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
463 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), \
464 s.MECACELL_K(p7), MECACELL_SK(p8), s.MECACELL_K(p8)); \
466 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
468 Exportable getExport() const { return Exportable(*this); }
470#define EXPORTABLE10(S, v0, v1, v2, v3, v4, v5, v6, v7, v8) \
471 EXPORTABLE_INHERIT11(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8)
473#define EXPORTABLE_INHERIT12(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9) \
474 struct Exportable : ExportableType<Base>::type { \
475 using BType = ExportableType<Base>::type; \
476 using json = nlohmann::json; \
477 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
478 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
479 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
480 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
481 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
482 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
483 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
484 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
485 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
486 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
488 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
489 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
490 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
491 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
492 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
493 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
494 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
495 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
496 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
497 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
498 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
499 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
501 void from_json(const json& o) { \
502 if (o.count(MECACELL_SK(p0))) \
503 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
504 if (o.count(MECACELL_SK(p1))) \
505 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
506 if (o.count(MECACELL_SK(p2))) \
507 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
508 if (o.count(MECACELL_SK(p3))) \
509 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
510 if (o.count(MECACELL_SK(p4))) \
511 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
512 if (o.count(MECACELL_SK(p5))) \
513 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
514 if (o.count(MECACELL_SK(p6))) \
515 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
516 if (o.count(MECACELL_SK(p7))) \
517 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
518 if (o.count(MECACELL_SK(p8))) \
519 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
520 if (o.count(MECACELL_SK(p9))) \
521 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
523 json to_json() const { \
524 auto b = BType::to_json(); \
525 auto r = to_jsonL(*this); \
526 if (!b.empty()) r.update(b); \
529 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
531 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
532 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
533 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
534 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
535 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9)); \
537 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
539 Exportable getExport() const { return Exportable(*this); }
541#define EXPORTABLE11(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
542 EXPORTABLE_INHERIT12(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9)
544#define EXPORTABLE_INHERIT13(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) \
545 struct Exportable : ExportableType<Base>::type { \
546 using BType = ExportableType<Base>::type; \
547 using json = nlohmann::json; \
548 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
549 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
550 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
551 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
552 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
553 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
554 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
555 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
556 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
557 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
558 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
560 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
561 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
562 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
563 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
564 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
565 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
566 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
567 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
568 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
569 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
570 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
571 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
572 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
574 void from_json(const json& o) { \
575 if (o.count(MECACELL_SK(p0))) \
576 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
577 if (o.count(MECACELL_SK(p1))) \
578 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
579 if (o.count(MECACELL_SK(p2))) \
580 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
581 if (o.count(MECACELL_SK(p3))) \
582 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
583 if (o.count(MECACELL_SK(p4))) \
584 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
585 if (o.count(MECACELL_SK(p5))) \
586 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
587 if (o.count(MECACELL_SK(p6))) \
588 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
589 if (o.count(MECACELL_SK(p7))) \
590 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
591 if (o.count(MECACELL_SK(p8))) \
592 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
593 if (o.count(MECACELL_SK(p9))) \
594 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
595 if (o.count(MECACELL_SK(p10))) \
596 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
598 json to_json() const { \
599 auto b = BType::to_json(); \
600 auto r = to_jsonL(*this); \
601 if (!b.empty()) r.update(b); \
604 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
606 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
607 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
608 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
609 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
610 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
611 MECACELL_SK(p10), s.MECACELL_K(p10)); \
613 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
615 Exportable getExport() const { return Exportable(*this); }
617#define EXPORTABLE12(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) \
618 EXPORTABLE_INHERIT13(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10)
620#define EXPORTABLE_INHERIT14(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) \
621 struct Exportable : ExportableType<Base>::type { \
622 using BType = ExportableType<Base>::type; \
623 using json = nlohmann::json; \
624 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
625 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
626 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
627 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
628 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
629 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
630 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
631 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
632 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
633 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
634 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
635 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
637 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
638 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
639 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
640 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
641 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
642 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
643 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
644 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
645 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
646 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
647 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
648 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
649 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
650 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
652 void from_json(const json& o) { \
653 if (o.count(MECACELL_SK(p0))) \
654 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
655 if (o.count(MECACELL_SK(p1))) \
656 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
657 if (o.count(MECACELL_SK(p2))) \
658 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
659 if (o.count(MECACELL_SK(p3))) \
660 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
661 if (o.count(MECACELL_SK(p4))) \
662 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
663 if (o.count(MECACELL_SK(p5))) \
664 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
665 if (o.count(MECACELL_SK(p6))) \
666 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
667 if (o.count(MECACELL_SK(p7))) \
668 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
669 if (o.count(MECACELL_SK(p8))) \
670 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
671 if (o.count(MECACELL_SK(p9))) \
672 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
673 if (o.count(MECACELL_SK(p10))) \
674 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
675 if (o.count(MECACELL_SK(p11))) \
676 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
678 json to_json() const { \
679 auto b = BType::to_json(); \
680 auto r = to_jsonL(*this); \
681 if (!b.empty()) r.update(b); \
684 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
686 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
687 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
688 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
689 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
690 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
691 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11)); \
693 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
695 Exportable getExport() const { return Exportable(*this); }
697#define EXPORTABLE13(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) \
698 EXPORTABLE_INHERIT14(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
701#define EXPORTABLE_INHERIT15(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
703 struct Exportable : ExportableType<Base>::type { \
704 using BType = ExportableType<Base>::type; \
705 using json = nlohmann::json; \
706 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
707 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
708 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
709 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
710 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
711 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
712 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
713 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
714 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
715 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
716 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
717 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
718 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
720 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
721 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
722 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
723 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
724 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
725 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
726 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
727 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
728 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
729 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
730 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
731 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
732 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
733 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
734 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
736 void from_json(const json& o) { \
737 if (o.count(MECACELL_SK(p0))) \
738 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
739 if (o.count(MECACELL_SK(p1))) \
740 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
741 if (o.count(MECACELL_SK(p2))) \
742 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
743 if (o.count(MECACELL_SK(p3))) \
744 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
745 if (o.count(MECACELL_SK(p4))) \
746 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
747 if (o.count(MECACELL_SK(p5))) \
748 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
749 if (o.count(MECACELL_SK(p6))) \
750 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
751 if (o.count(MECACELL_SK(p7))) \
752 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
753 if (o.count(MECACELL_SK(p8))) \
754 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
755 if (o.count(MECACELL_SK(p9))) \
756 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
757 if (o.count(MECACELL_SK(p10))) \
758 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
759 if (o.count(MECACELL_SK(p11))) \
760 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
761 if (o.count(MECACELL_SK(p12))) \
762 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
764 json to_json() const { \
765 auto b = BType::to_json(); \
766 auto r = to_jsonL(*this); \
767 if (!b.empty()) r.update(b); \
770 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
772 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
773 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
774 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
775 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
776 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
777 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
778 MECACELL_SK(p12), s.MECACELL_K(p12)); \
780 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
782 Exportable getExport() const { return Exportable(*this); }
784#define EXPORTABLE14(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) \
785 EXPORTABLE_INHERIT15(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
788#define EXPORTABLE_INHERIT16(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
790 struct Exportable : ExportableType<Base>::type { \
791 using BType = ExportableType<Base>::type; \
792 using json = nlohmann::json; \
793 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
794 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
795 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
796 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
797 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
798 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
799 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
800 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
801 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
802 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
803 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
804 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
805 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
806 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
808 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
809 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
810 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
811 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
812 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
813 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
814 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
815 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
816 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
817 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
818 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
819 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
820 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
821 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
822 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
823 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
825 void from_json(const json& o) { \
826 if (o.count(MECACELL_SK(p0))) \
827 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
828 if (o.count(MECACELL_SK(p1))) \
829 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
830 if (o.count(MECACELL_SK(p2))) \
831 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
832 if (o.count(MECACELL_SK(p3))) \
833 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
834 if (o.count(MECACELL_SK(p4))) \
835 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
836 if (o.count(MECACELL_SK(p5))) \
837 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
838 if (o.count(MECACELL_SK(p6))) \
839 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
840 if (o.count(MECACELL_SK(p7))) \
841 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
842 if (o.count(MECACELL_SK(p8))) \
843 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
844 if (o.count(MECACELL_SK(p9))) \
845 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
846 if (o.count(MECACELL_SK(p10))) \
847 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
848 if (o.count(MECACELL_SK(p11))) \
849 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
850 if (o.count(MECACELL_SK(p12))) \
851 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
852 if (o.count(MECACELL_SK(p13))) \
853 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
855 json to_json() const { \
856 auto b = BType::to_json(); \
857 auto r = to_jsonL(*this); \
858 if (!b.empty()) r.update(b); \
861 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
863 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
864 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
865 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
866 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
867 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
868 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
869 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13)); \
871 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
873 Exportable getExport() const { return Exportable(*this); }
875#define EXPORTABLE15(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) \
876 EXPORTABLE_INHERIT16(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
879#define EXPORTABLE_INHERIT17(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
881 struct Exportable : ExportableType<Base>::type { \
882 using BType = ExportableType<Base>::type; \
883 using json = nlohmann::json; \
884 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
885 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
886 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
887 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
888 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
889 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
890 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
891 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
892 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
893 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
894 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
895 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
896 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
897 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
898 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
900 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
901 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
902 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
903 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
904 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
905 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
906 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
907 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
908 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
909 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
910 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
911 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
912 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
913 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
914 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
915 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
916 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
918 void from_json(const json& o) { \
919 if (o.count(MECACELL_SK(p0))) \
920 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
921 if (o.count(MECACELL_SK(p1))) \
922 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
923 if (o.count(MECACELL_SK(p2))) \
924 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
925 if (o.count(MECACELL_SK(p3))) \
926 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
927 if (o.count(MECACELL_SK(p4))) \
928 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
929 if (o.count(MECACELL_SK(p5))) \
930 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
931 if (o.count(MECACELL_SK(p6))) \
932 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
933 if (o.count(MECACELL_SK(p7))) \
934 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
935 if (o.count(MECACELL_SK(p8))) \
936 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
937 if (o.count(MECACELL_SK(p9))) \
938 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
939 if (o.count(MECACELL_SK(p10))) \
940 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
941 if (o.count(MECACELL_SK(p11))) \
942 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
943 if (o.count(MECACELL_SK(p12))) \
944 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
945 if (o.count(MECACELL_SK(p13))) \
946 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
947 if (o.count(MECACELL_SK(p14))) \
948 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
950 json to_json() const { \
951 auto b = BType::to_json(); \
952 auto r = to_jsonL(*this); \
953 if (!b.empty()) r.update(b); \
956 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
958 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
959 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
960 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
961 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
962 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
963 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
964 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
965 MECACELL_SK(p14), s.MECACELL_K(p14)); \
967 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
969 Exportable getExport() const { return Exportable(*this); }
971#define EXPORTABLE16(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) \
972 EXPORTABLE_INHERIT17(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
975#define EXPORTABLE_INHERIT18(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
976 p12, p13, p14, p15) \
977 struct Exportable : ExportableType<Base>::type { \
978 using BType = ExportableType<Base>::type; \
979 using json = nlohmann::json; \
980 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
981 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
982 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
983 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
984 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
985 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
986 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
987 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
988 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
989 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
990 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
991 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
992 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
993 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
994 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
995 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
997 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
998 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
999 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
1000 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
1001 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
1002 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
1003 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
1004 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
1005 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
1006 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
1007 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
1008 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
1009 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
1010 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
1011 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
1012 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
1013 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
1014 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
1016 void from_json(const json& o) { \
1017 if (o.count(MECACELL_SK(p0))) \
1018 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
1019 if (o.count(MECACELL_SK(p1))) \
1020 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
1021 if (o.count(MECACELL_SK(p2))) \
1022 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
1023 if (o.count(MECACELL_SK(p3))) \
1024 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
1025 if (o.count(MECACELL_SK(p4))) \
1026 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
1027 if (o.count(MECACELL_SK(p5))) \
1028 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
1029 if (o.count(MECACELL_SK(p6))) \
1030 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
1031 if (o.count(MECACELL_SK(p7))) \
1032 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
1033 if (o.count(MECACELL_SK(p8))) \
1034 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
1035 if (o.count(MECACELL_SK(p9))) \
1036 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
1037 if (o.count(MECACELL_SK(p10))) \
1038 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
1039 if (o.count(MECACELL_SK(p11))) \
1040 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
1041 if (o.count(MECACELL_SK(p12))) \
1042 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
1043 if (o.count(MECACELL_SK(p13))) \
1044 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
1045 if (o.count(MECACELL_SK(p14))) \
1046 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
1047 if (o.count(MECACELL_SK(p15))) \
1048 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
1050 json to_json() const { \
1051 auto b = BType::to_json(); \
1052 auto r = to_jsonL(*this); \
1053 if (!b.empty()) r.update(b); \
1056 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
1058 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
1059 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
1060 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
1061 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
1062 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
1063 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
1064 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
1065 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15)); \
1067 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
1069 Exportable getExport() const { return Exportable(*this); }
1071#define EXPORTABLE17(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
1073 EXPORTABLE_INHERIT18(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
1074 v11, v12, v13, v14, v15)
1076#define EXPORTABLE_INHERIT19(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
1077 p12, p13, p14, p15, p16) \
1078 struct Exportable : ExportableType<Base>::type { \
1079 using BType = ExportableType<Base>::type; \
1080 using json = nlohmann::json; \
1081 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
1082 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
1083 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
1084 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
1085 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
1086 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
1087 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
1088 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
1089 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
1090 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
1091 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
1092 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
1093 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
1094 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
1095 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
1096 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
1097 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
1099 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
1100 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
1101 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
1102 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
1103 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
1104 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
1105 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
1106 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
1107 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
1108 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
1109 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
1110 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
1111 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
1112 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
1113 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
1114 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
1115 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
1116 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
1117 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
1119 void from_json(const json& o) { \
1120 if (o.count(MECACELL_SK(p0))) \
1121 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
1122 if (o.count(MECACELL_SK(p1))) \
1123 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
1124 if (o.count(MECACELL_SK(p2))) \
1125 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
1126 if (o.count(MECACELL_SK(p3))) \
1127 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
1128 if (o.count(MECACELL_SK(p4))) \
1129 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
1130 if (o.count(MECACELL_SK(p5))) \
1131 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
1132 if (o.count(MECACELL_SK(p6))) \
1133 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
1134 if (o.count(MECACELL_SK(p7))) \
1135 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
1136 if (o.count(MECACELL_SK(p8))) \
1137 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
1138 if (o.count(MECACELL_SK(p9))) \
1139 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
1140 if (o.count(MECACELL_SK(p10))) \
1141 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
1142 if (o.count(MECACELL_SK(p11))) \
1143 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
1144 if (o.count(MECACELL_SK(p12))) \
1145 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
1146 if (o.count(MECACELL_SK(p13))) \
1147 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
1148 if (o.count(MECACELL_SK(p14))) \
1149 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
1150 if (o.count(MECACELL_SK(p15))) \
1151 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
1152 if (o.count(MECACELL_SK(p16))) \
1153 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
1155 json to_json() const { \
1156 auto b = BType::to_json(); \
1157 auto r = to_jsonL(*this); \
1158 if (!b.empty()) r.update(b); \
1161 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
1163 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
1164 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
1165 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
1166 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
1167 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
1168 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
1169 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
1170 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
1171 MECACELL_SK(p16), s.MECACELL_K(p16)); \
1173 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
1175 Exportable getExport() const { return Exportable(*this); }
1177#define EXPORTABLE18(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
1179 EXPORTABLE_INHERIT19(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
1180 v11, v12, v13, v14, v15, v16)
1182#define EXPORTABLE_INHERIT20(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
1183 p12, p13, p14, p15, p16, p17) \
1184 struct Exportable : ExportableType<Base>::type { \
1185 using BType = ExportableType<Base>::type; \
1186 using json = nlohmann::json; \
1187 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
1188 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
1189 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
1190 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
1191 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
1192 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
1193 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
1194 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
1195 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
1196 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
1197 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
1198 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
1199 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
1200 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
1201 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
1202 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
1203 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
1204 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
1206 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
1207 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
1208 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
1209 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
1210 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
1211 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
1212 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
1213 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
1214 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
1215 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
1216 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
1217 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
1218 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
1219 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
1220 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
1221 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
1222 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
1223 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
1224 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
1225 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
1227 void from_json(const json& o) { \
1228 if (o.count(MECACELL_SK(p0))) \
1229 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
1230 if (o.count(MECACELL_SK(p1))) \
1231 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
1232 if (o.count(MECACELL_SK(p2))) \
1233 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
1234 if (o.count(MECACELL_SK(p3))) \
1235 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
1236 if (o.count(MECACELL_SK(p4))) \
1237 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
1238 if (o.count(MECACELL_SK(p5))) \
1239 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
1240 if (o.count(MECACELL_SK(p6))) \
1241 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
1242 if (o.count(MECACELL_SK(p7))) \
1243 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
1244 if (o.count(MECACELL_SK(p8))) \
1245 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
1246 if (o.count(MECACELL_SK(p9))) \
1247 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
1248 if (o.count(MECACELL_SK(p10))) \
1249 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
1250 if (o.count(MECACELL_SK(p11))) \
1251 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
1252 if (o.count(MECACELL_SK(p12))) \
1253 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
1254 if (o.count(MECACELL_SK(p13))) \
1255 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
1256 if (o.count(MECACELL_SK(p14))) \
1257 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
1258 if (o.count(MECACELL_SK(p15))) \
1259 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
1260 if (o.count(MECACELL_SK(p16))) \
1261 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
1262 if (o.count(MECACELL_SK(p17))) \
1263 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
1265 json to_json() const { \
1266 auto b = BType::to_json(); \
1267 auto r = to_jsonL(*this); \
1268 if (!b.empty()) r.update(b); \
1271 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
1273 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
1274 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
1275 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
1276 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
1277 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
1278 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
1279 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
1280 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
1281 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17)); \
1283 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
1285 Exportable getExport() const { return Exportable(*this); }
1287#define EXPORTABLE19(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
1289 EXPORTABLE_INHERIT20(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
1290 v11, v12, v13, v14, v15, v16, v17)
1292#define EXPORTABLE_INHERIT21(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
1293 p12, p13, p14, p15, p16, p17, p18) \
1294 struct Exportable : ExportableType<Base>::type { \
1295 using BType = ExportableType<Base>::type; \
1296 using json = nlohmann::json; \
1297 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
1298 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
1299 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
1300 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
1301 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
1302 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
1303 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
1304 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
1305 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
1306 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
1307 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
1308 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
1309 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
1310 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
1311 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
1312 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
1313 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
1314 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
1315 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
1317 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
1318 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
1319 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
1320 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
1321 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
1322 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
1323 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
1324 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
1325 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
1326 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
1327 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
1328 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
1329 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
1330 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
1331 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
1332 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
1333 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
1334 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
1335 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
1336 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
1337 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
1339 void from_json(const json& o) { \
1340 if (o.count(MECACELL_SK(p0))) \
1341 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
1342 if (o.count(MECACELL_SK(p1))) \
1343 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
1344 if (o.count(MECACELL_SK(p2))) \
1345 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
1346 if (o.count(MECACELL_SK(p3))) \
1347 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
1348 if (o.count(MECACELL_SK(p4))) \
1349 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
1350 if (o.count(MECACELL_SK(p5))) \
1351 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
1352 if (o.count(MECACELL_SK(p6))) \
1353 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
1354 if (o.count(MECACELL_SK(p7))) \
1355 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
1356 if (o.count(MECACELL_SK(p8))) \
1357 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
1358 if (o.count(MECACELL_SK(p9))) \
1359 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
1360 if (o.count(MECACELL_SK(p10))) \
1361 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
1362 if (o.count(MECACELL_SK(p11))) \
1363 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
1364 if (o.count(MECACELL_SK(p12))) \
1365 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
1366 if (o.count(MECACELL_SK(p13))) \
1367 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
1368 if (o.count(MECACELL_SK(p14))) \
1369 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
1370 if (o.count(MECACELL_SK(p15))) \
1371 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
1372 if (o.count(MECACELL_SK(p16))) \
1373 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
1374 if (o.count(MECACELL_SK(p17))) \
1375 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
1376 if (o.count(MECACELL_SK(p18))) \
1377 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
1379 json to_json() const { \
1380 auto b = BType::to_json(); \
1381 auto r = to_jsonL(*this); \
1382 if (!b.empty()) r.update(b); \
1385 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
1387 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
1388 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
1389 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
1390 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
1391 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
1392 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
1393 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
1394 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
1395 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
1396 MECACELL_SK(p18), s.MECACELL_K(p18)); \
1398 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
1400 Exportable getExport() const { return Exportable(*this); }
1402#define EXPORTABLE20(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
1403 v15, v16, v17, v18) \
1404 EXPORTABLE_INHERIT21(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
1405 v11, v12, v13, v14, v15, v16, v17, v18)
1407#define EXPORTABLE_INHERIT22(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
1408 p12, p13, p14, p15, p16, p17, p18, p19) \
1409 struct Exportable : ExportableType<Base>::type { \
1410 using BType = ExportableType<Base>::type; \
1411 using json = nlohmann::json; \
1412 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
1413 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
1414 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
1415 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
1416 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
1417 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
1418 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
1419 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
1420 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
1421 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
1422 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
1423 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
1424 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
1425 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
1426 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
1427 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
1428 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
1429 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
1430 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
1431 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
1433 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
1434 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
1435 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
1436 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
1437 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
1438 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
1439 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
1440 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
1441 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
1442 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
1443 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
1444 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
1445 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
1446 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
1447 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
1448 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
1449 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
1450 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
1451 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
1452 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
1453 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
1454 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
1456 void from_json(const json& o) { \
1457 if (o.count(MECACELL_SK(p0))) \
1458 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
1459 if (o.count(MECACELL_SK(p1))) \
1460 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
1461 if (o.count(MECACELL_SK(p2))) \
1462 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
1463 if (o.count(MECACELL_SK(p3))) \
1464 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
1465 if (o.count(MECACELL_SK(p4))) \
1466 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
1467 if (o.count(MECACELL_SK(p5))) \
1468 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
1469 if (o.count(MECACELL_SK(p6))) \
1470 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
1471 if (o.count(MECACELL_SK(p7))) \
1472 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
1473 if (o.count(MECACELL_SK(p8))) \
1474 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
1475 if (o.count(MECACELL_SK(p9))) \
1476 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
1477 if (o.count(MECACELL_SK(p10))) \
1478 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
1479 if (o.count(MECACELL_SK(p11))) \
1480 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
1481 if (o.count(MECACELL_SK(p12))) \
1482 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
1483 if (o.count(MECACELL_SK(p13))) \
1484 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
1485 if (o.count(MECACELL_SK(p14))) \
1486 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
1487 if (o.count(MECACELL_SK(p15))) \
1488 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
1489 if (o.count(MECACELL_SK(p16))) \
1490 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
1491 if (o.count(MECACELL_SK(p17))) \
1492 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
1493 if (o.count(MECACELL_SK(p18))) \
1494 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
1495 if (o.count(MECACELL_SK(p19))) \
1496 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
1498 json to_json() const { \
1499 auto b = BType::to_json(); \
1500 auto r = to_jsonL(*this); \
1501 if (!b.empty()) r.update(b); \
1504 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
1506 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
1507 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
1508 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
1509 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
1510 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
1511 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
1512 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
1513 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
1514 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
1515 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19)); \
1517 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
1519 Exportable getExport() const { return Exportable(*this); }
1521#define EXPORTABLE21(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
1522 v15, v16, v17, v18, v19) \
1523 EXPORTABLE_INHERIT22(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
1524 v11, v12, v13, v14, v15, v16, v17, v18, v19)
1526#define EXPORTABLE_INHERIT23(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
1527 p12, p13, p14, p15, p16, p17, p18, p19, p20) \
1528 struct Exportable : ExportableType<Base>::type { \
1529 using BType = ExportableType<Base>::type; \
1530 using json = nlohmann::json; \
1531 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
1532 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
1533 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
1534 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
1535 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
1536 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
1537 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
1538 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
1539 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
1540 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
1541 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
1542 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
1543 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
1544 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
1545 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
1546 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
1547 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
1548 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
1549 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
1550 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
1551 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
1553 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
1554 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
1555 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
1556 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
1557 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
1558 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
1559 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
1560 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
1561 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
1562 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
1563 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
1564 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
1565 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
1566 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
1567 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
1568 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
1569 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
1570 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
1571 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
1572 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
1573 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
1574 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
1575 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
1577 void from_json(const json& o) { \
1578 if (o.count(MECACELL_SK(p0))) \
1579 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
1580 if (o.count(MECACELL_SK(p1))) \
1581 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
1582 if (o.count(MECACELL_SK(p2))) \
1583 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
1584 if (o.count(MECACELL_SK(p3))) \
1585 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
1586 if (o.count(MECACELL_SK(p4))) \
1587 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
1588 if (o.count(MECACELL_SK(p5))) \
1589 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
1590 if (o.count(MECACELL_SK(p6))) \
1591 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
1592 if (o.count(MECACELL_SK(p7))) \
1593 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
1594 if (o.count(MECACELL_SK(p8))) \
1595 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
1596 if (o.count(MECACELL_SK(p9))) \
1597 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
1598 if (o.count(MECACELL_SK(p10))) \
1599 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
1600 if (o.count(MECACELL_SK(p11))) \
1601 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
1602 if (o.count(MECACELL_SK(p12))) \
1603 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
1604 if (o.count(MECACELL_SK(p13))) \
1605 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
1606 if (o.count(MECACELL_SK(p14))) \
1607 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
1608 if (o.count(MECACELL_SK(p15))) \
1609 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
1610 if (o.count(MECACELL_SK(p16))) \
1611 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
1612 if (o.count(MECACELL_SK(p17))) \
1613 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
1614 if (o.count(MECACELL_SK(p18))) \
1615 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
1616 if (o.count(MECACELL_SK(p19))) \
1617 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
1618 if (o.count(MECACELL_SK(p20))) \
1619 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
1621 json to_json() const { \
1622 auto b = BType::to_json(); \
1623 auto r = to_jsonL(*this); \
1624 if (!b.empty()) r.update(b); \
1627 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
1629 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
1630 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
1631 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
1632 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
1633 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
1634 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
1635 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
1636 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
1637 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
1638 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
1639 MECACELL_SK(p20), s.MECACELL_K(p20)); \
1641 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
1643 Exportable getExport() const { return Exportable(*this); }
1645#define EXPORTABLE22(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
1646 v15, v16, v17, v18, v19, v20) \
1647 EXPORTABLE_INHERIT23(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
1648 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20)
1650#define EXPORTABLE_INHERIT24(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
1651 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21) \
1652 struct Exportable : ExportableType<Base>::type { \
1653 using BType = ExportableType<Base>::type; \
1654 using json = nlohmann::json; \
1655 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
1656 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
1657 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
1658 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
1659 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
1660 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
1661 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
1662 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
1663 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
1664 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
1665 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
1666 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
1667 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
1668 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
1669 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
1670 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
1671 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
1672 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
1673 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
1674 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
1675 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
1676 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
1678 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
1679 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
1680 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
1681 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
1682 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
1683 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
1684 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
1685 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
1686 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
1687 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
1688 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
1689 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
1690 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
1691 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
1692 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
1693 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
1694 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
1695 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
1696 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
1697 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
1698 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
1699 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
1700 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
1701 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
1703 void from_json(const json& o) { \
1704 if (o.count(MECACELL_SK(p0))) \
1705 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
1706 if (o.count(MECACELL_SK(p1))) \
1707 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
1708 if (o.count(MECACELL_SK(p2))) \
1709 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
1710 if (o.count(MECACELL_SK(p3))) \
1711 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
1712 if (o.count(MECACELL_SK(p4))) \
1713 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
1714 if (o.count(MECACELL_SK(p5))) \
1715 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
1716 if (o.count(MECACELL_SK(p6))) \
1717 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
1718 if (o.count(MECACELL_SK(p7))) \
1719 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
1720 if (o.count(MECACELL_SK(p8))) \
1721 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
1722 if (o.count(MECACELL_SK(p9))) \
1723 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
1724 if (o.count(MECACELL_SK(p10))) \
1725 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
1726 if (o.count(MECACELL_SK(p11))) \
1727 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
1728 if (o.count(MECACELL_SK(p12))) \
1729 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
1730 if (o.count(MECACELL_SK(p13))) \
1731 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
1732 if (o.count(MECACELL_SK(p14))) \
1733 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
1734 if (o.count(MECACELL_SK(p15))) \
1735 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
1736 if (o.count(MECACELL_SK(p16))) \
1737 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
1738 if (o.count(MECACELL_SK(p17))) \
1739 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
1740 if (o.count(MECACELL_SK(p18))) \
1741 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
1742 if (o.count(MECACELL_SK(p19))) \
1743 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
1744 if (o.count(MECACELL_SK(p20))) \
1745 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
1746 if (o.count(MECACELL_SK(p21))) \
1747 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
1749 json to_json() const { \
1750 auto b = BType::to_json(); \
1751 auto r = to_jsonL(*this); \
1752 if (!b.empty()) r.update(b); \
1755 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
1757 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
1758 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
1759 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
1760 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
1761 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
1762 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
1763 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
1764 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
1765 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
1766 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
1767 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21)); \
1769 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
1771 Exportable getExport() const { return Exportable(*this); }
1773#define EXPORTABLE23(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
1774 v15, v16, v17, v18, v19, v20, v21) \
1775 EXPORTABLE_INHERIT24(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
1776 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21)
1778#define EXPORTABLE_INHERIT25(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
1779 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22) \
1780 struct Exportable : ExportableType<Base>::type { \
1781 using BType = ExportableType<Base>::type; \
1782 using json = nlohmann::json; \
1783 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
1784 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
1785 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
1786 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
1787 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
1788 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
1789 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
1790 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
1791 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
1792 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
1793 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
1794 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
1795 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
1796 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
1797 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
1798 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
1799 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
1800 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
1801 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
1802 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
1803 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
1804 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
1805 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
1807 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
1808 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
1809 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
1810 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
1811 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
1812 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
1813 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
1814 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
1815 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
1816 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
1817 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
1818 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
1819 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
1820 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
1821 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
1822 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
1823 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
1824 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
1825 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
1826 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
1827 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
1828 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
1829 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
1830 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
1831 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
1833 void from_json(const json& o) { \
1834 if (o.count(MECACELL_SK(p0))) \
1835 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
1836 if (o.count(MECACELL_SK(p1))) \
1837 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
1838 if (o.count(MECACELL_SK(p2))) \
1839 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
1840 if (o.count(MECACELL_SK(p3))) \
1841 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
1842 if (o.count(MECACELL_SK(p4))) \
1843 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
1844 if (o.count(MECACELL_SK(p5))) \
1845 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
1846 if (o.count(MECACELL_SK(p6))) \
1847 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
1848 if (o.count(MECACELL_SK(p7))) \
1849 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
1850 if (o.count(MECACELL_SK(p8))) \
1851 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
1852 if (o.count(MECACELL_SK(p9))) \
1853 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
1854 if (o.count(MECACELL_SK(p10))) \
1855 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
1856 if (o.count(MECACELL_SK(p11))) \
1857 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
1858 if (o.count(MECACELL_SK(p12))) \
1859 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
1860 if (o.count(MECACELL_SK(p13))) \
1861 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
1862 if (o.count(MECACELL_SK(p14))) \
1863 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
1864 if (o.count(MECACELL_SK(p15))) \
1865 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
1866 if (o.count(MECACELL_SK(p16))) \
1867 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
1868 if (o.count(MECACELL_SK(p17))) \
1869 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
1870 if (o.count(MECACELL_SK(p18))) \
1871 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
1872 if (o.count(MECACELL_SK(p19))) \
1873 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
1874 if (o.count(MECACELL_SK(p20))) \
1875 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
1876 if (o.count(MECACELL_SK(p21))) \
1877 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
1878 if (o.count(MECACELL_SK(p22))) \
1879 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
1881 json to_json() const { \
1882 auto b = BType::to_json(); \
1883 auto r = to_jsonL(*this); \
1884 if (!b.empty()) r.update(b); \
1887 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
1889 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
1890 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
1891 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
1892 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
1893 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
1894 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
1895 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
1896 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
1897 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
1898 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
1899 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
1900 MECACELL_SK(p22), s.MECACELL_K(p22)); \
1902 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
1904 Exportable getExport() const { return Exportable(*this); }
1906#define EXPORTABLE24(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
1907 v15, v16, v17, v18, v19, v20, v21, v22) \
1908 EXPORTABLE_INHERIT25(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
1909 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22)
1911#define EXPORTABLE_INHERIT26(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
1912 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23) \
1913 struct Exportable : ExportableType<Base>::type { \
1914 using BType = ExportableType<Base>::type; \
1915 using json = nlohmann::json; \
1916 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
1917 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
1918 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
1919 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
1920 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
1921 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
1922 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
1923 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
1924 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
1925 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
1926 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
1927 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
1928 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
1929 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
1930 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
1931 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
1932 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
1933 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
1934 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
1935 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
1936 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
1937 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
1938 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
1939 typename ExportableType<decltype(S::MECACELL_V(p23))>::type MECACELL_K(p23); \
1941 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
1942 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
1943 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
1944 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
1945 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
1946 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
1947 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
1948 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
1949 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
1950 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
1951 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
1952 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
1953 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
1954 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
1955 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
1956 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
1957 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
1958 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
1959 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
1960 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
1961 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
1962 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
1963 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
1964 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
1965 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
1966 ExportableConstruct(MECACELL_K(p23), s.MECACELL_V(p23), s); \
1968 void from_json(const json& o) { \
1969 if (o.count(MECACELL_SK(p0))) \
1970 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
1971 if (o.count(MECACELL_SK(p1))) \
1972 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
1973 if (o.count(MECACELL_SK(p2))) \
1974 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
1975 if (o.count(MECACELL_SK(p3))) \
1976 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
1977 if (o.count(MECACELL_SK(p4))) \
1978 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
1979 if (o.count(MECACELL_SK(p5))) \
1980 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
1981 if (o.count(MECACELL_SK(p6))) \
1982 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
1983 if (o.count(MECACELL_SK(p7))) \
1984 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
1985 if (o.count(MECACELL_SK(p8))) \
1986 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
1987 if (o.count(MECACELL_SK(p9))) \
1988 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
1989 if (o.count(MECACELL_SK(p10))) \
1990 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
1991 if (o.count(MECACELL_SK(p11))) \
1992 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
1993 if (o.count(MECACELL_SK(p12))) \
1994 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
1995 if (o.count(MECACELL_SK(p13))) \
1996 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
1997 if (o.count(MECACELL_SK(p14))) \
1998 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
1999 if (o.count(MECACELL_SK(p15))) \
2000 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
2001 if (o.count(MECACELL_SK(p16))) \
2002 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
2003 if (o.count(MECACELL_SK(p17))) \
2004 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
2005 if (o.count(MECACELL_SK(p18))) \
2006 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
2007 if (o.count(MECACELL_SK(p19))) \
2008 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
2009 if (o.count(MECACELL_SK(p20))) \
2010 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
2011 if (o.count(MECACELL_SK(p21))) \
2012 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
2013 if (o.count(MECACELL_SK(p22))) \
2014 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
2015 if (o.count(MECACELL_SK(p23))) \
2016 MECACELL_K(p23) = o[MECACELL_SK(p23)].get<decltype(MECACELL_K(p23))>(); \
2018 json to_json() const { \
2019 auto b = BType::to_json(); \
2020 auto r = to_jsonL(*this); \
2021 if (!b.empty()) r.update(b); \
2024 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
2026 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
2027 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
2028 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
2029 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
2030 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
2031 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
2032 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
2033 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
2034 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
2035 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
2036 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
2037 MECACELL_SK(p22), s.MECACELL_K(p22), MECACELL_SK(p23), s.MECACELL_K(p23)); \
2039 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
2041 Exportable getExport() const { return Exportable(*this); }
2043#define EXPORTABLE25(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
2044 v15, v16, v17, v18, v19, v20, v21, v22, v23) \
2045 EXPORTABLE_INHERIT26(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
2046 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23)
2048#define EXPORTABLE_INHERIT27(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
2049 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, \
2051 struct Exportable : ExportableType<Base>::type { \
2052 using BType = ExportableType<Base>::type; \
2053 using json = nlohmann::json; \
2054 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
2055 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
2056 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
2057 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
2058 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
2059 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
2060 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
2061 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
2062 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
2063 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
2064 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
2065 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
2066 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
2067 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
2068 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
2069 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
2070 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
2071 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
2072 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
2073 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
2074 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
2075 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
2076 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
2077 typename ExportableType<decltype(S::MECACELL_V(p23))>::type MECACELL_K(p23); \
2078 typename ExportableType<decltype(S::MECACELL_V(p24))>::type MECACELL_K(p24); \
2080 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
2081 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
2082 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
2083 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
2084 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
2085 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
2086 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
2087 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
2088 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
2089 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
2090 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
2091 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
2092 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
2093 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
2094 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
2095 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
2096 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
2097 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
2098 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
2099 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
2100 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
2101 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
2102 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
2103 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
2104 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
2105 ExportableConstruct(MECACELL_K(p23), s.MECACELL_V(p23), s); \
2106 ExportableConstruct(MECACELL_K(p24), s.MECACELL_V(p24), s); \
2108 void from_json(const json& o) { \
2109 if (o.count(MECACELL_SK(p0))) \
2110 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
2111 if (o.count(MECACELL_SK(p1))) \
2112 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
2113 if (o.count(MECACELL_SK(p2))) \
2114 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
2115 if (o.count(MECACELL_SK(p3))) \
2116 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
2117 if (o.count(MECACELL_SK(p4))) \
2118 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
2119 if (o.count(MECACELL_SK(p5))) \
2120 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
2121 if (o.count(MECACELL_SK(p6))) \
2122 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
2123 if (o.count(MECACELL_SK(p7))) \
2124 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
2125 if (o.count(MECACELL_SK(p8))) \
2126 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
2127 if (o.count(MECACELL_SK(p9))) \
2128 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
2129 if (o.count(MECACELL_SK(p10))) \
2130 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
2131 if (o.count(MECACELL_SK(p11))) \
2132 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
2133 if (o.count(MECACELL_SK(p12))) \
2134 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
2135 if (o.count(MECACELL_SK(p13))) \
2136 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
2137 if (o.count(MECACELL_SK(p14))) \
2138 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
2139 if (o.count(MECACELL_SK(p15))) \
2140 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
2141 if (o.count(MECACELL_SK(p16))) \
2142 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
2143 if (o.count(MECACELL_SK(p17))) \
2144 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
2145 if (o.count(MECACELL_SK(p18))) \
2146 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
2147 if (o.count(MECACELL_SK(p19))) \
2148 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
2149 if (o.count(MECACELL_SK(p20))) \
2150 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
2151 if (o.count(MECACELL_SK(p21))) \
2152 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
2153 if (o.count(MECACELL_SK(p22))) \
2154 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
2155 if (o.count(MECACELL_SK(p23))) \
2156 MECACELL_K(p23) = o[MECACELL_SK(p23)].get<decltype(MECACELL_K(p23))>(); \
2157 if (o.count(MECACELL_SK(p24))) \
2158 MECACELL_K(p24) = o[MECACELL_SK(p24)].get<decltype(MECACELL_K(p24))>(); \
2160 json to_json() const { \
2161 auto b = BType::to_json(); \
2162 auto r = to_jsonL(*this); \
2163 if (!b.empty()) r.update(b); \
2166 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
2168 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
2169 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
2170 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
2171 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
2172 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
2173 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
2174 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
2175 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
2176 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
2177 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
2178 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
2179 MECACELL_SK(p22), s.MECACELL_K(p22), MECACELL_SK(p23), s.MECACELL_K(p23), \
2180 MECACELL_SK(p24), s.MECACELL_K(p24)); \
2182 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
2184 Exportable getExport() const { return Exportable(*this); }
2186#define EXPORTABLE26(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
2187 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) \
2188 EXPORTABLE_INHERIT27(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
2189 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, \
2192#define EXPORTABLE_INHERIT28(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
2193 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, \
2195 struct Exportable : ExportableType<Base>::type { \
2196 using BType = ExportableType<Base>::type; \
2197 using json = nlohmann::json; \
2198 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
2199 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
2200 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
2201 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
2202 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
2203 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
2204 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
2205 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
2206 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
2207 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
2208 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
2209 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
2210 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
2211 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
2212 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
2213 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
2214 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
2215 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
2216 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
2217 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
2218 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
2219 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
2220 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
2221 typename ExportableType<decltype(S::MECACELL_V(p23))>::type MECACELL_K(p23); \
2222 typename ExportableType<decltype(S::MECACELL_V(p24))>::type MECACELL_K(p24); \
2223 typename ExportableType<decltype(S::MECACELL_V(p25))>::type MECACELL_K(p25); \
2225 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
2226 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
2227 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
2228 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
2229 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
2230 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
2231 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
2232 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
2233 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
2234 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
2235 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
2236 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
2237 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
2238 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
2239 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
2240 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
2241 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
2242 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
2243 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
2244 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
2245 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
2246 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
2247 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
2248 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
2249 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
2250 ExportableConstruct(MECACELL_K(p23), s.MECACELL_V(p23), s); \
2251 ExportableConstruct(MECACELL_K(p24), s.MECACELL_V(p24), s); \
2252 ExportableConstruct(MECACELL_K(p25), s.MECACELL_V(p25), s); \
2254 void from_json(const json& o) { \
2255 if (o.count(MECACELL_SK(p0))) \
2256 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
2257 if (o.count(MECACELL_SK(p1))) \
2258 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
2259 if (o.count(MECACELL_SK(p2))) \
2260 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
2261 if (o.count(MECACELL_SK(p3))) \
2262 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
2263 if (o.count(MECACELL_SK(p4))) \
2264 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
2265 if (o.count(MECACELL_SK(p5))) \
2266 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
2267 if (o.count(MECACELL_SK(p6))) \
2268 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
2269 if (o.count(MECACELL_SK(p7))) \
2270 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
2271 if (o.count(MECACELL_SK(p8))) \
2272 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
2273 if (o.count(MECACELL_SK(p9))) \
2274 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
2275 if (o.count(MECACELL_SK(p10))) \
2276 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
2277 if (o.count(MECACELL_SK(p11))) \
2278 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
2279 if (o.count(MECACELL_SK(p12))) \
2280 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
2281 if (o.count(MECACELL_SK(p13))) \
2282 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
2283 if (o.count(MECACELL_SK(p14))) \
2284 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
2285 if (o.count(MECACELL_SK(p15))) \
2286 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
2287 if (o.count(MECACELL_SK(p16))) \
2288 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
2289 if (o.count(MECACELL_SK(p17))) \
2290 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
2291 if (o.count(MECACELL_SK(p18))) \
2292 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
2293 if (o.count(MECACELL_SK(p19))) \
2294 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
2295 if (o.count(MECACELL_SK(p20))) \
2296 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
2297 if (o.count(MECACELL_SK(p21))) \
2298 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
2299 if (o.count(MECACELL_SK(p22))) \
2300 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
2301 if (o.count(MECACELL_SK(p23))) \
2302 MECACELL_K(p23) = o[MECACELL_SK(p23)].get<decltype(MECACELL_K(p23))>(); \
2303 if (o.count(MECACELL_SK(p24))) \
2304 MECACELL_K(p24) = o[MECACELL_SK(p24)].get<decltype(MECACELL_K(p24))>(); \
2305 if (o.count(MECACELL_SK(p25))) \
2306 MECACELL_K(p25) = o[MECACELL_SK(p25)].get<decltype(MECACELL_K(p25))>(); \
2308 json to_json() const { \
2309 auto b = BType::to_json(); \
2310 auto r = to_jsonL(*this); \
2311 if (!b.empty()) r.update(b); \
2314 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
2316 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
2317 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
2318 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
2319 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
2320 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
2321 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
2322 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
2323 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
2324 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
2325 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
2326 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
2327 MECACELL_SK(p22), s.MECACELL_K(p22), MECACELL_SK(p23), s.MECACELL_K(p23), \
2328 MECACELL_SK(p24), s.MECACELL_K(p24), MECACELL_SK(p25), s.MECACELL_K(p25)); \
2330 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
2332 Exportable getExport() const { return Exportable(*this); }
2334#define EXPORTABLE27(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
2335 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) \
2336 EXPORTABLE_INHERIT28(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
2337 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, \
2340#define EXPORTABLE_INHERIT29(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
2341 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, \
2343 struct Exportable : ExportableType<Base>::type { \
2344 using BType = ExportableType<Base>::type; \
2345 using json = nlohmann::json; \
2346 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
2347 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
2348 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
2349 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
2350 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
2351 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
2352 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
2353 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
2354 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
2355 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
2356 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
2357 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
2358 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
2359 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
2360 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
2361 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
2362 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
2363 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
2364 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
2365 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
2366 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
2367 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
2368 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
2369 typename ExportableType<decltype(S::MECACELL_V(p23))>::type MECACELL_K(p23); \
2370 typename ExportableType<decltype(S::MECACELL_V(p24))>::type MECACELL_K(p24); \
2371 typename ExportableType<decltype(S::MECACELL_V(p25))>::type MECACELL_K(p25); \
2372 typename ExportableType<decltype(S::MECACELL_V(p26))>::type MECACELL_K(p26); \
2374 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
2375 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
2376 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
2377 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
2378 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
2379 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
2380 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
2381 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
2382 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
2383 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
2384 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
2385 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
2386 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
2387 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
2388 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
2389 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
2390 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
2391 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
2392 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
2393 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
2394 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
2395 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
2396 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
2397 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
2398 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
2399 ExportableConstruct(MECACELL_K(p23), s.MECACELL_V(p23), s); \
2400 ExportableConstruct(MECACELL_K(p24), s.MECACELL_V(p24), s); \
2401 ExportableConstruct(MECACELL_K(p25), s.MECACELL_V(p25), s); \
2402 ExportableConstruct(MECACELL_K(p26), s.MECACELL_V(p26), s); \
2404 void from_json(const json& o) { \
2405 if (o.count(MECACELL_SK(p0))) \
2406 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
2407 if (o.count(MECACELL_SK(p1))) \
2408 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
2409 if (o.count(MECACELL_SK(p2))) \
2410 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
2411 if (o.count(MECACELL_SK(p3))) \
2412 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
2413 if (o.count(MECACELL_SK(p4))) \
2414 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
2415 if (o.count(MECACELL_SK(p5))) \
2416 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
2417 if (o.count(MECACELL_SK(p6))) \
2418 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
2419 if (o.count(MECACELL_SK(p7))) \
2420 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
2421 if (o.count(MECACELL_SK(p8))) \
2422 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
2423 if (o.count(MECACELL_SK(p9))) \
2424 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
2425 if (o.count(MECACELL_SK(p10))) \
2426 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
2427 if (o.count(MECACELL_SK(p11))) \
2428 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
2429 if (o.count(MECACELL_SK(p12))) \
2430 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
2431 if (o.count(MECACELL_SK(p13))) \
2432 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
2433 if (o.count(MECACELL_SK(p14))) \
2434 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
2435 if (o.count(MECACELL_SK(p15))) \
2436 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
2437 if (o.count(MECACELL_SK(p16))) \
2438 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
2439 if (o.count(MECACELL_SK(p17))) \
2440 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
2441 if (o.count(MECACELL_SK(p18))) \
2442 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
2443 if (o.count(MECACELL_SK(p19))) \
2444 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
2445 if (o.count(MECACELL_SK(p20))) \
2446 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
2447 if (o.count(MECACELL_SK(p21))) \
2448 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
2449 if (o.count(MECACELL_SK(p22))) \
2450 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
2451 if (o.count(MECACELL_SK(p23))) \
2452 MECACELL_K(p23) = o[MECACELL_SK(p23)].get<decltype(MECACELL_K(p23))>(); \
2453 if (o.count(MECACELL_SK(p24))) \
2454 MECACELL_K(p24) = o[MECACELL_SK(p24)].get<decltype(MECACELL_K(p24))>(); \
2455 if (o.count(MECACELL_SK(p25))) \
2456 MECACELL_K(p25) = o[MECACELL_SK(p25)].get<decltype(MECACELL_K(p25))>(); \
2457 if (o.count(MECACELL_SK(p26))) \
2458 MECACELL_K(p26) = o[MECACELL_SK(p26)].get<decltype(MECACELL_K(p26))>(); \
2460 json to_json() const { \
2461 auto b = BType::to_json(); \
2462 auto r = to_jsonL(*this); \
2463 if (!b.empty()) r.update(b); \
2466 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
2468 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
2469 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
2470 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
2471 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
2472 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
2473 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
2474 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
2475 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
2476 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
2477 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
2478 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
2479 MECACELL_SK(p22), s.MECACELL_K(p22), MECACELL_SK(p23), s.MECACELL_K(p23), \
2480 MECACELL_SK(p24), s.MECACELL_K(p24), MECACELL_SK(p25), s.MECACELL_K(p25), \
2481 MECACELL_SK(p26), s.MECACELL_K(p26)); \
2483 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
2485 Exportable getExport() const { return Exportable(*this); }
2487#define EXPORTABLE28(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
2488 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) \
2489 EXPORTABLE_INHERIT29(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
2490 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, \
2493#define EXPORTABLE_INHERIT30(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
2494 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, \
2495 p24, p25, p26, p27) \
2496 struct Exportable : ExportableType<Base>::type { \
2497 using BType = ExportableType<Base>::type; \
2498 using json = nlohmann::json; \
2499 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
2500 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
2501 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
2502 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
2503 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
2504 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
2505 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
2506 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
2507 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
2508 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
2509 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
2510 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
2511 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
2512 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
2513 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
2514 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
2515 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
2516 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
2517 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
2518 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
2519 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
2520 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
2521 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
2522 typename ExportableType<decltype(S::MECACELL_V(p23))>::type MECACELL_K(p23); \
2523 typename ExportableType<decltype(S::MECACELL_V(p24))>::type MECACELL_K(p24); \
2524 typename ExportableType<decltype(S::MECACELL_V(p25))>::type MECACELL_K(p25); \
2525 typename ExportableType<decltype(S::MECACELL_V(p26))>::type MECACELL_K(p26); \
2526 typename ExportableType<decltype(S::MECACELL_V(p27))>::type MECACELL_K(p27); \
2528 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
2529 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
2530 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
2531 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
2532 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
2533 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
2534 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
2535 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
2536 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
2537 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
2538 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
2539 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
2540 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
2541 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
2542 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
2543 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
2544 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
2545 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
2546 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
2547 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
2548 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
2549 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
2550 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
2551 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
2552 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
2553 ExportableConstruct(MECACELL_K(p23), s.MECACELL_V(p23), s); \
2554 ExportableConstruct(MECACELL_K(p24), s.MECACELL_V(p24), s); \
2555 ExportableConstruct(MECACELL_K(p25), s.MECACELL_V(p25), s); \
2556 ExportableConstruct(MECACELL_K(p26), s.MECACELL_V(p26), s); \
2557 ExportableConstruct(MECACELL_K(p27), s.MECACELL_V(p27), s); \
2559 void from_json(const json& o) { \
2560 if (o.count(MECACELL_SK(p0))) \
2561 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
2562 if (o.count(MECACELL_SK(p1))) \
2563 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
2564 if (o.count(MECACELL_SK(p2))) \
2565 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
2566 if (o.count(MECACELL_SK(p3))) \
2567 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
2568 if (o.count(MECACELL_SK(p4))) \
2569 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
2570 if (o.count(MECACELL_SK(p5))) \
2571 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
2572 if (o.count(MECACELL_SK(p6))) \
2573 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
2574 if (o.count(MECACELL_SK(p7))) \
2575 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
2576 if (o.count(MECACELL_SK(p8))) \
2577 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
2578 if (o.count(MECACELL_SK(p9))) \
2579 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
2580 if (o.count(MECACELL_SK(p10))) \
2581 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
2582 if (o.count(MECACELL_SK(p11))) \
2583 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
2584 if (o.count(MECACELL_SK(p12))) \
2585 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
2586 if (o.count(MECACELL_SK(p13))) \
2587 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
2588 if (o.count(MECACELL_SK(p14))) \
2589 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
2590 if (o.count(MECACELL_SK(p15))) \
2591 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
2592 if (o.count(MECACELL_SK(p16))) \
2593 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
2594 if (o.count(MECACELL_SK(p17))) \
2595 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
2596 if (o.count(MECACELL_SK(p18))) \
2597 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
2598 if (o.count(MECACELL_SK(p19))) \
2599 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
2600 if (o.count(MECACELL_SK(p20))) \
2601 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
2602 if (o.count(MECACELL_SK(p21))) \
2603 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
2604 if (o.count(MECACELL_SK(p22))) \
2605 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
2606 if (o.count(MECACELL_SK(p23))) \
2607 MECACELL_K(p23) = o[MECACELL_SK(p23)].get<decltype(MECACELL_K(p23))>(); \
2608 if (o.count(MECACELL_SK(p24))) \
2609 MECACELL_K(p24) = o[MECACELL_SK(p24)].get<decltype(MECACELL_K(p24))>(); \
2610 if (o.count(MECACELL_SK(p25))) \
2611 MECACELL_K(p25) = o[MECACELL_SK(p25)].get<decltype(MECACELL_K(p25))>(); \
2612 if (o.count(MECACELL_SK(p26))) \
2613 MECACELL_K(p26) = o[MECACELL_SK(p26)].get<decltype(MECACELL_K(p26))>(); \
2614 if (o.count(MECACELL_SK(p27))) \
2615 MECACELL_K(p27) = o[MECACELL_SK(p27)].get<decltype(MECACELL_K(p27))>(); \
2617 json to_json() const { \
2618 auto b = BType::to_json(); \
2619 auto r = to_jsonL(*this); \
2620 if (!b.empty()) r.update(b); \
2623 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
2625 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
2626 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
2627 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
2628 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
2629 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
2630 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
2631 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
2632 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
2633 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
2634 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
2635 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
2636 MECACELL_SK(p22), s.MECACELL_K(p22), MECACELL_SK(p23), s.MECACELL_K(p23), \
2637 MECACELL_SK(p24), s.MECACELL_K(p24), MECACELL_SK(p25), s.MECACELL_K(p25), \
2638 MECACELL_SK(p26), s.MECACELL_K(p26), MECACELL_SK(p27), s.MECACELL_K(p27)); \
2640 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
2642 Exportable getExport() const { return Exportable(*this); }
2644#define EXPORTABLE29(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
2645 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) \
2646 EXPORTABLE_INHERIT30(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
2647 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, \
2650#define EXPORTABLE_INHERIT31(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
2651 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, \
2652 p24, p25, p26, p27, p28) \
2653 struct Exportable : ExportableType<Base>::type { \
2654 using BType = ExportableType<Base>::type; \
2655 using json = nlohmann::json; \
2656 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
2657 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
2658 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
2659 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
2660 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
2661 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
2662 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
2663 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
2664 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
2665 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
2666 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
2667 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
2668 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
2669 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
2670 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
2671 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
2672 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
2673 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
2674 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
2675 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
2676 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
2677 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
2678 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
2679 typename ExportableType<decltype(S::MECACELL_V(p23))>::type MECACELL_K(p23); \
2680 typename ExportableType<decltype(S::MECACELL_V(p24))>::type MECACELL_K(p24); \
2681 typename ExportableType<decltype(S::MECACELL_V(p25))>::type MECACELL_K(p25); \
2682 typename ExportableType<decltype(S::MECACELL_V(p26))>::type MECACELL_K(p26); \
2683 typename ExportableType<decltype(S::MECACELL_V(p27))>::type MECACELL_K(p27); \
2684 typename ExportableType<decltype(S::MECACELL_V(p28))>::type MECACELL_K(p28); \
2686 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
2687 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
2688 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
2689 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
2690 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
2691 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
2692 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
2693 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
2694 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
2695 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
2696 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
2697 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
2698 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
2699 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
2700 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
2701 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
2702 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
2703 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
2704 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
2705 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
2706 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
2707 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
2708 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
2709 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
2710 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
2711 ExportableConstruct(MECACELL_K(p23), s.MECACELL_V(p23), s); \
2712 ExportableConstruct(MECACELL_K(p24), s.MECACELL_V(p24), s); \
2713 ExportableConstruct(MECACELL_K(p25), s.MECACELL_V(p25), s); \
2714 ExportableConstruct(MECACELL_K(p26), s.MECACELL_V(p26), s); \
2715 ExportableConstruct(MECACELL_K(p27), s.MECACELL_V(p27), s); \
2716 ExportableConstruct(MECACELL_K(p28), s.MECACELL_V(p28), s); \
2718 void from_json(const json& o) { \
2719 if (o.count(MECACELL_SK(p0))) \
2720 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
2721 if (o.count(MECACELL_SK(p1))) \
2722 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
2723 if (o.count(MECACELL_SK(p2))) \
2724 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
2725 if (o.count(MECACELL_SK(p3))) \
2726 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
2727 if (o.count(MECACELL_SK(p4))) \
2728 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
2729 if (o.count(MECACELL_SK(p5))) \
2730 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
2731 if (o.count(MECACELL_SK(p6))) \
2732 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
2733 if (o.count(MECACELL_SK(p7))) \
2734 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
2735 if (o.count(MECACELL_SK(p8))) \
2736 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
2737 if (o.count(MECACELL_SK(p9))) \
2738 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
2739 if (o.count(MECACELL_SK(p10))) \
2740 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
2741 if (o.count(MECACELL_SK(p11))) \
2742 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
2743 if (o.count(MECACELL_SK(p12))) \
2744 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
2745 if (o.count(MECACELL_SK(p13))) \
2746 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
2747 if (o.count(MECACELL_SK(p14))) \
2748 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
2749 if (o.count(MECACELL_SK(p15))) \
2750 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
2751 if (o.count(MECACELL_SK(p16))) \
2752 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
2753 if (o.count(MECACELL_SK(p17))) \
2754 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
2755 if (o.count(MECACELL_SK(p18))) \
2756 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
2757 if (o.count(MECACELL_SK(p19))) \
2758 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
2759 if (o.count(MECACELL_SK(p20))) \
2760 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
2761 if (o.count(MECACELL_SK(p21))) \
2762 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
2763 if (o.count(MECACELL_SK(p22))) \
2764 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
2765 if (o.count(MECACELL_SK(p23))) \
2766 MECACELL_K(p23) = o[MECACELL_SK(p23)].get<decltype(MECACELL_K(p23))>(); \
2767 if (o.count(MECACELL_SK(p24))) \
2768 MECACELL_K(p24) = o[MECACELL_SK(p24)].get<decltype(MECACELL_K(p24))>(); \
2769 if (o.count(MECACELL_SK(p25))) \
2770 MECACELL_K(p25) = o[MECACELL_SK(p25)].get<decltype(MECACELL_K(p25))>(); \
2771 if (o.count(MECACELL_SK(p26))) \
2772 MECACELL_K(p26) = o[MECACELL_SK(p26)].get<decltype(MECACELL_K(p26))>(); \
2773 if (o.count(MECACELL_SK(p27))) \
2774 MECACELL_K(p27) = o[MECACELL_SK(p27)].get<decltype(MECACELL_K(p27))>(); \
2775 if (o.count(MECACELL_SK(p28))) \
2776 MECACELL_K(p28) = o[MECACELL_SK(p28)].get<decltype(MECACELL_K(p28))>(); \
2778 json to_json() const { \
2779 auto b = BType::to_json(); \
2780 auto r = to_jsonL(*this); \
2781 if (!b.empty()) r.update(b); \
2784 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
2786 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
2787 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
2788 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
2789 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
2790 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
2791 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
2792 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
2793 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
2794 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
2795 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
2796 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
2797 MECACELL_SK(p22), s.MECACELL_K(p22), MECACELL_SK(p23), s.MECACELL_K(p23), \
2798 MECACELL_SK(p24), s.MECACELL_K(p24), MECACELL_SK(p25), s.MECACELL_K(p25), \
2799 MECACELL_SK(p26), s.MECACELL_K(p26), MECACELL_SK(p27), s.MECACELL_K(p27), \
2800 MECACELL_SK(p28), s.MECACELL_K(p28)); \
2802 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
2804 Exportable getExport() const { return Exportable(*this); }
2806#define EXPORTABLE30(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
2807 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, \
2809 EXPORTABLE_INHERIT31(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
2810 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, \
2811 v24, v25, v26, v27, v28)
2813#define EXPORTABLE_INHERIT32(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
2814 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, \
2815 p24, p25, p26, p27, p28, p29) \
2816 struct Exportable : ExportableType<Base>::type { \
2817 using BType = ExportableType<Base>::type; \
2818 using json = nlohmann::json; \
2819 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
2820 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
2821 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
2822 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
2823 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
2824 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
2825 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
2826 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
2827 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
2828 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
2829 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
2830 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
2831 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
2832 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
2833 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
2834 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
2835 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
2836 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
2837 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
2838 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
2839 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
2840 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
2841 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
2842 typename ExportableType<decltype(S::MECACELL_V(p23))>::type MECACELL_K(p23); \
2843 typename ExportableType<decltype(S::MECACELL_V(p24))>::type MECACELL_K(p24); \
2844 typename ExportableType<decltype(S::MECACELL_V(p25))>::type MECACELL_K(p25); \
2845 typename ExportableType<decltype(S::MECACELL_V(p26))>::type MECACELL_K(p26); \
2846 typename ExportableType<decltype(S::MECACELL_V(p27))>::type MECACELL_K(p27); \
2847 typename ExportableType<decltype(S::MECACELL_V(p28))>::type MECACELL_K(p28); \
2848 typename ExportableType<decltype(S::MECACELL_V(p29))>::type MECACELL_K(p29); \
2850 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
2851 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
2852 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
2853 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
2854 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
2855 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
2856 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
2857 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
2858 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
2859 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
2860 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
2861 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
2862 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
2863 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
2864 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
2865 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
2866 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
2867 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
2868 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
2869 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
2870 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
2871 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
2872 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
2873 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
2874 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
2875 ExportableConstruct(MECACELL_K(p23), s.MECACELL_V(p23), s); \
2876 ExportableConstruct(MECACELL_K(p24), s.MECACELL_V(p24), s); \
2877 ExportableConstruct(MECACELL_K(p25), s.MECACELL_V(p25), s); \
2878 ExportableConstruct(MECACELL_K(p26), s.MECACELL_V(p26), s); \
2879 ExportableConstruct(MECACELL_K(p27), s.MECACELL_V(p27), s); \
2880 ExportableConstruct(MECACELL_K(p28), s.MECACELL_V(p28), s); \
2881 ExportableConstruct(MECACELL_K(p29), s.MECACELL_V(p29), s); \
2883 void from_json(const json& o) { \
2884 if (o.count(MECACELL_SK(p0))) \
2885 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
2886 if (o.count(MECACELL_SK(p1))) \
2887 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
2888 if (o.count(MECACELL_SK(p2))) \
2889 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
2890 if (o.count(MECACELL_SK(p3))) \
2891 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
2892 if (o.count(MECACELL_SK(p4))) \
2893 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
2894 if (o.count(MECACELL_SK(p5))) \
2895 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
2896 if (o.count(MECACELL_SK(p6))) \
2897 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
2898 if (o.count(MECACELL_SK(p7))) \
2899 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
2900 if (o.count(MECACELL_SK(p8))) \
2901 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
2902 if (o.count(MECACELL_SK(p9))) \
2903 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
2904 if (o.count(MECACELL_SK(p10))) \
2905 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
2906 if (o.count(MECACELL_SK(p11))) \
2907 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
2908 if (o.count(MECACELL_SK(p12))) \
2909 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
2910 if (o.count(MECACELL_SK(p13))) \
2911 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
2912 if (o.count(MECACELL_SK(p14))) \
2913 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
2914 if (o.count(MECACELL_SK(p15))) \
2915 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
2916 if (o.count(MECACELL_SK(p16))) \
2917 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
2918 if (o.count(MECACELL_SK(p17))) \
2919 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
2920 if (o.count(MECACELL_SK(p18))) \
2921 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
2922 if (o.count(MECACELL_SK(p19))) \
2923 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
2924 if (o.count(MECACELL_SK(p20))) \
2925 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
2926 if (o.count(MECACELL_SK(p21))) \
2927 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
2928 if (o.count(MECACELL_SK(p22))) \
2929 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
2930 if (o.count(MECACELL_SK(p23))) \
2931 MECACELL_K(p23) = o[MECACELL_SK(p23)].get<decltype(MECACELL_K(p23))>(); \
2932 if (o.count(MECACELL_SK(p24))) \
2933 MECACELL_K(p24) = o[MECACELL_SK(p24)].get<decltype(MECACELL_K(p24))>(); \
2934 if (o.count(MECACELL_SK(p25))) \
2935 MECACELL_K(p25) = o[MECACELL_SK(p25)].get<decltype(MECACELL_K(p25))>(); \
2936 if (o.count(MECACELL_SK(p26))) \
2937 MECACELL_K(p26) = o[MECACELL_SK(p26)].get<decltype(MECACELL_K(p26))>(); \
2938 if (o.count(MECACELL_SK(p27))) \
2939 MECACELL_K(p27) = o[MECACELL_SK(p27)].get<decltype(MECACELL_K(p27))>(); \
2940 if (o.count(MECACELL_SK(p28))) \
2941 MECACELL_K(p28) = o[MECACELL_SK(p28)].get<decltype(MECACELL_K(p28))>(); \
2942 if (o.count(MECACELL_SK(p29))) \
2943 MECACELL_K(p29) = o[MECACELL_SK(p29)].get<decltype(MECACELL_K(p29))>(); \
2945 json to_json() const { \
2946 auto b = BType::to_json(); \
2947 auto r = to_jsonL(*this); \
2948 if (!b.empty()) r.update(b); \
2951 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
2953 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
2954 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
2955 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
2956 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
2957 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
2958 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
2959 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
2960 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
2961 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
2962 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
2963 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
2964 MECACELL_SK(p22), s.MECACELL_K(p22), MECACELL_SK(p23), s.MECACELL_K(p23), \
2965 MECACELL_SK(p24), s.MECACELL_K(p24), MECACELL_SK(p25), s.MECACELL_K(p25), \
2966 MECACELL_SK(p26), s.MECACELL_K(p26), MECACELL_SK(p27), s.MECACELL_K(p27), \
2967 MECACELL_SK(p28), s.MECACELL_K(p28), MECACELL_SK(p29), s.MECACELL_K(p29)); \
2969 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
2971 Exportable getExport() const { return Exportable(*this); }
2973#define EXPORTABLE31(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
2974 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, \
2976 EXPORTABLE_INHERIT32(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
2977 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, \
2978 v24, v25, v26, v27, v28, v29)
2980#define EXPORTABLE_INHERIT33(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
2981 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, \
2982 p24, p25, p26, p27, p28, p29, p30) \
2983 struct Exportable : ExportableType<Base>::type { \
2984 using BType = ExportableType<Base>::type; \
2985 using json = nlohmann::json; \
2986 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
2987 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
2988 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
2989 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
2990 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
2991 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
2992 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
2993 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
2994 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
2995 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
2996 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
2997 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
2998 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
2999 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
3000 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
3001 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
3002 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
3003 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
3004 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
3005 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
3006 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
3007 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
3008 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
3009 typename ExportableType<decltype(S::MECACELL_V(p23))>::type MECACELL_K(p23); \
3010 typename ExportableType<decltype(S::MECACELL_V(p24))>::type MECACELL_K(p24); \
3011 typename ExportableType<decltype(S::MECACELL_V(p25))>::type MECACELL_K(p25); \
3012 typename ExportableType<decltype(S::MECACELL_V(p26))>::type MECACELL_K(p26); \
3013 typename ExportableType<decltype(S::MECACELL_V(p27))>::type MECACELL_K(p27); \
3014 typename ExportableType<decltype(S::MECACELL_V(p28))>::type MECACELL_K(p28); \
3015 typename ExportableType<decltype(S::MECACELL_V(p29))>::type MECACELL_K(p29); \
3016 typename ExportableType<decltype(S::MECACELL_V(p30))>::type MECACELL_K(p30); \
3018 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
3019 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
3020 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
3021 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
3022 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
3023 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
3024 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
3025 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
3026 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
3027 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
3028 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
3029 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
3030 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
3031 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
3032 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
3033 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
3034 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
3035 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
3036 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
3037 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
3038 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
3039 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
3040 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
3041 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
3042 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
3043 ExportableConstruct(MECACELL_K(p23), s.MECACELL_V(p23), s); \
3044 ExportableConstruct(MECACELL_K(p24), s.MECACELL_V(p24), s); \
3045 ExportableConstruct(MECACELL_K(p25), s.MECACELL_V(p25), s); \
3046 ExportableConstruct(MECACELL_K(p26), s.MECACELL_V(p26), s); \
3047 ExportableConstruct(MECACELL_K(p27), s.MECACELL_V(p27), s); \
3048 ExportableConstruct(MECACELL_K(p28), s.MECACELL_V(p28), s); \
3049 ExportableConstruct(MECACELL_K(p29), s.MECACELL_V(p29), s); \
3050 ExportableConstruct(MECACELL_K(p30), s.MECACELL_V(p30), s); \
3052 void from_json(const json& o) { \
3053 if (o.count(MECACELL_SK(p0))) \
3054 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
3055 if (o.count(MECACELL_SK(p1))) \
3056 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
3057 if (o.count(MECACELL_SK(p2))) \
3058 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
3059 if (o.count(MECACELL_SK(p3))) \
3060 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
3061 if (o.count(MECACELL_SK(p4))) \
3062 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
3063 if (o.count(MECACELL_SK(p5))) \
3064 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
3065 if (o.count(MECACELL_SK(p6))) \
3066 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
3067 if (o.count(MECACELL_SK(p7))) \
3068 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
3069 if (o.count(MECACELL_SK(p8))) \
3070 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
3071 if (o.count(MECACELL_SK(p9))) \
3072 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
3073 if (o.count(MECACELL_SK(p10))) \
3074 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
3075 if (o.count(MECACELL_SK(p11))) \
3076 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
3077 if (o.count(MECACELL_SK(p12))) \
3078 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
3079 if (o.count(MECACELL_SK(p13))) \
3080 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
3081 if (o.count(MECACELL_SK(p14))) \
3082 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
3083 if (o.count(MECACELL_SK(p15))) \
3084 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
3085 if (o.count(MECACELL_SK(p16))) \
3086 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
3087 if (o.count(MECACELL_SK(p17))) \
3088 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
3089 if (o.count(MECACELL_SK(p18))) \
3090 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
3091 if (o.count(MECACELL_SK(p19))) \
3092 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
3093 if (o.count(MECACELL_SK(p20))) \
3094 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
3095 if (o.count(MECACELL_SK(p21))) \
3096 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
3097 if (o.count(MECACELL_SK(p22))) \
3098 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
3099 if (o.count(MECACELL_SK(p23))) \
3100 MECACELL_K(p23) = o[MECACELL_SK(p23)].get<decltype(MECACELL_K(p23))>(); \
3101 if (o.count(MECACELL_SK(p24))) \
3102 MECACELL_K(p24) = o[MECACELL_SK(p24)].get<decltype(MECACELL_K(p24))>(); \
3103 if (o.count(MECACELL_SK(p25))) \
3104 MECACELL_K(p25) = o[MECACELL_SK(p25)].get<decltype(MECACELL_K(p25))>(); \
3105 if (o.count(MECACELL_SK(p26))) \
3106 MECACELL_K(p26) = o[MECACELL_SK(p26)].get<decltype(MECACELL_K(p26))>(); \
3107 if (o.count(MECACELL_SK(p27))) \
3108 MECACELL_K(p27) = o[MECACELL_SK(p27)].get<decltype(MECACELL_K(p27))>(); \
3109 if (o.count(MECACELL_SK(p28))) \
3110 MECACELL_K(p28) = o[MECACELL_SK(p28)].get<decltype(MECACELL_K(p28))>(); \
3111 if (o.count(MECACELL_SK(p29))) \
3112 MECACELL_K(p29) = o[MECACELL_SK(p29)].get<decltype(MECACELL_K(p29))>(); \
3113 if (o.count(MECACELL_SK(p30))) \
3114 MECACELL_K(p30) = o[MECACELL_SK(p30)].get<decltype(MECACELL_K(p30))>(); \
3116 json to_json() const { \
3117 auto b = BType::to_json(); \
3118 auto r = to_jsonL(*this); \
3119 if (!b.empty()) r.update(b); \
3122 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
3124 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
3125 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
3126 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
3127 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
3128 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
3129 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
3130 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
3131 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
3132 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
3133 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
3134 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
3135 MECACELL_SK(p22), s.MECACELL_K(p22), MECACELL_SK(p23), s.MECACELL_K(p23), \
3136 MECACELL_SK(p24), s.MECACELL_K(p24), MECACELL_SK(p25), s.MECACELL_K(p25), \
3137 MECACELL_SK(p26), s.MECACELL_K(p26), MECACELL_SK(p27), s.MECACELL_K(p27), \
3138 MECACELL_SK(p28), s.MECACELL_K(p28), MECACELL_SK(p29), s.MECACELL_K(p29), \
3139 MECACELL_SK(p30), s.MECACELL_K(p30)); \
3141 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
3143 Exportable getExport() const { return Exportable(*this); }
3145#define EXPORTABLE32(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
3146 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, \
3148 EXPORTABLE_INHERIT33(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
3149 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, \
3150 v24, v25, v26, v27, v28, v29, v30)
3152#define EXPORTABLE_INHERIT34(S, Base, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, \
3153 p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, \
3154 p24, p25, p26, p27, p28, p29, p30, p31) \
3155 struct Exportable : ExportableType<Base>::type { \
3156 using BType = ExportableType<Base>::type; \
3157 using json = nlohmann::json; \
3158 typename ExportableType<decltype(S::MECACELL_V(p0))>::type MECACELL_K(p0); \
3159 typename ExportableType<decltype(S::MECACELL_V(p1))>::type MECACELL_K(p1); \
3160 typename ExportableType<decltype(S::MECACELL_V(p2))>::type MECACELL_K(p2); \
3161 typename ExportableType<decltype(S::MECACELL_V(p3))>::type MECACELL_K(p3); \
3162 typename ExportableType<decltype(S::MECACELL_V(p4))>::type MECACELL_K(p4); \
3163 typename ExportableType<decltype(S::MECACELL_V(p5))>::type MECACELL_K(p5); \
3164 typename ExportableType<decltype(S::MECACELL_V(p6))>::type MECACELL_K(p6); \
3165 typename ExportableType<decltype(S::MECACELL_V(p7))>::type MECACELL_K(p7); \
3166 typename ExportableType<decltype(S::MECACELL_V(p8))>::type MECACELL_K(p8); \
3167 typename ExportableType<decltype(S::MECACELL_V(p9))>::type MECACELL_K(p9); \
3168 typename ExportableType<decltype(S::MECACELL_V(p10))>::type MECACELL_K(p10); \
3169 typename ExportableType<decltype(S::MECACELL_V(p11))>::type MECACELL_K(p11); \
3170 typename ExportableType<decltype(S::MECACELL_V(p12))>::type MECACELL_K(p12); \
3171 typename ExportableType<decltype(S::MECACELL_V(p13))>::type MECACELL_K(p13); \
3172 typename ExportableType<decltype(S::MECACELL_V(p14))>::type MECACELL_K(p14); \
3173 typename ExportableType<decltype(S::MECACELL_V(p15))>::type MECACELL_K(p15); \
3174 typename ExportableType<decltype(S::MECACELL_V(p16))>::type MECACELL_K(p16); \
3175 typename ExportableType<decltype(S::MECACELL_V(p17))>::type MECACELL_K(p17); \
3176 typename ExportableType<decltype(S::MECACELL_V(p18))>::type MECACELL_K(p18); \
3177 typename ExportableType<decltype(S::MECACELL_V(p19))>::type MECACELL_K(p19); \
3178 typename ExportableType<decltype(S::MECACELL_V(p20))>::type MECACELL_K(p20); \
3179 typename ExportableType<decltype(S::MECACELL_V(p21))>::type MECACELL_K(p21); \
3180 typename ExportableType<decltype(S::MECACELL_V(p22))>::type MECACELL_K(p22); \
3181 typename ExportableType<decltype(S::MECACELL_V(p23))>::type MECACELL_K(p23); \
3182 typename ExportableType<decltype(S::MECACELL_V(p24))>::type MECACELL_K(p24); \
3183 typename ExportableType<decltype(S::MECACELL_V(p25))>::type MECACELL_K(p25); \
3184 typename ExportableType<decltype(S::MECACELL_V(p26))>::type MECACELL_K(p26); \
3185 typename ExportableType<decltype(S::MECACELL_V(p27))>::type MECACELL_K(p27); \
3186 typename ExportableType<decltype(S::MECACELL_V(p28))>::type MECACELL_K(p28); \
3187 typename ExportableType<decltype(S::MECACELL_V(p29))>::type MECACELL_K(p29); \
3188 typename ExportableType<decltype(S::MECACELL_V(p30))>::type MECACELL_K(p30); \
3189 typename ExportableType<decltype(S::MECACELL_V(p31))>::type MECACELL_K(p31); \
3191 Exportable(const std::string& dump) { from_json(json::parse(dump)); } \
3192 Exportable(const S& s) : BType(static_cast<const BType&>(s)) { \
3193 ExportableConstruct(MECACELL_K(p0), s.MECACELL_V(p0), s); \
3194 ExportableConstruct(MECACELL_K(p1), s.MECACELL_V(p1), s); \
3195 ExportableConstruct(MECACELL_K(p2), s.MECACELL_V(p2), s); \
3196 ExportableConstruct(MECACELL_K(p3), s.MECACELL_V(p3), s); \
3197 ExportableConstruct(MECACELL_K(p4), s.MECACELL_V(p4), s); \
3198 ExportableConstruct(MECACELL_K(p5), s.MECACELL_V(p5), s); \
3199 ExportableConstruct(MECACELL_K(p6), s.MECACELL_V(p6), s); \
3200 ExportableConstruct(MECACELL_K(p7), s.MECACELL_V(p7), s); \
3201 ExportableConstruct(MECACELL_K(p8), s.MECACELL_V(p8), s); \
3202 ExportableConstruct(MECACELL_K(p9), s.MECACELL_V(p9), s); \
3203 ExportableConstruct(MECACELL_K(p10), s.MECACELL_V(p10), s); \
3204 ExportableConstruct(MECACELL_K(p11), s.MECACELL_V(p11), s); \
3205 ExportableConstruct(MECACELL_K(p12), s.MECACELL_V(p12), s); \
3206 ExportableConstruct(MECACELL_K(p13), s.MECACELL_V(p13), s); \
3207 ExportableConstruct(MECACELL_K(p14), s.MECACELL_V(p14), s); \
3208 ExportableConstruct(MECACELL_K(p15), s.MECACELL_V(p15), s); \
3209 ExportableConstruct(MECACELL_K(p16), s.MECACELL_V(p16), s); \
3210 ExportableConstruct(MECACELL_K(p17), s.MECACELL_V(p17), s); \
3211 ExportableConstruct(MECACELL_K(p18), s.MECACELL_V(p18), s); \
3212 ExportableConstruct(MECACELL_K(p19), s.MECACELL_V(p19), s); \
3213 ExportableConstruct(MECACELL_K(p20), s.MECACELL_V(p20), s); \
3214 ExportableConstruct(MECACELL_K(p21), s.MECACELL_V(p21), s); \
3215 ExportableConstruct(MECACELL_K(p22), s.MECACELL_V(p22), s); \
3216 ExportableConstruct(MECACELL_K(p23), s.MECACELL_V(p23), s); \
3217 ExportableConstruct(MECACELL_K(p24), s.MECACELL_V(p24), s); \
3218 ExportableConstruct(MECACELL_K(p25), s.MECACELL_V(p25), s); \
3219 ExportableConstruct(MECACELL_K(p26), s.MECACELL_V(p26), s); \
3220 ExportableConstruct(MECACELL_K(p27), s.MECACELL_V(p27), s); \
3221 ExportableConstruct(MECACELL_K(p28), s.MECACELL_V(p28), s); \
3222 ExportableConstruct(MECACELL_K(p29), s.MECACELL_V(p29), s); \
3223 ExportableConstruct(MECACELL_K(p30), s.MECACELL_V(p30), s); \
3224 ExportableConstruct(MECACELL_K(p31), s.MECACELL_V(p31), s); \
3226 void from_json(const json& o) { \
3227 if (o.count(MECACELL_SK(p0))) \
3228 MECACELL_K(p0) = o[MECACELL_SK(p0)].get<decltype(MECACELL_K(p0))>(); \
3229 if (o.count(MECACELL_SK(p1))) \
3230 MECACELL_K(p1) = o[MECACELL_SK(p1)].get<decltype(MECACELL_K(p1))>(); \
3231 if (o.count(MECACELL_SK(p2))) \
3232 MECACELL_K(p2) = o[MECACELL_SK(p2)].get<decltype(MECACELL_K(p2))>(); \
3233 if (o.count(MECACELL_SK(p3))) \
3234 MECACELL_K(p3) = o[MECACELL_SK(p3)].get<decltype(MECACELL_K(p3))>(); \
3235 if (o.count(MECACELL_SK(p4))) \
3236 MECACELL_K(p4) = o[MECACELL_SK(p4)].get<decltype(MECACELL_K(p4))>(); \
3237 if (o.count(MECACELL_SK(p5))) \
3238 MECACELL_K(p5) = o[MECACELL_SK(p5)].get<decltype(MECACELL_K(p5))>(); \
3239 if (o.count(MECACELL_SK(p6))) \
3240 MECACELL_K(p6) = o[MECACELL_SK(p6)].get<decltype(MECACELL_K(p6))>(); \
3241 if (o.count(MECACELL_SK(p7))) \
3242 MECACELL_K(p7) = o[MECACELL_SK(p7)].get<decltype(MECACELL_K(p7))>(); \
3243 if (o.count(MECACELL_SK(p8))) \
3244 MECACELL_K(p8) = o[MECACELL_SK(p8)].get<decltype(MECACELL_K(p8))>(); \
3245 if (o.count(MECACELL_SK(p9))) \
3246 MECACELL_K(p9) = o[MECACELL_SK(p9)].get<decltype(MECACELL_K(p9))>(); \
3247 if (o.count(MECACELL_SK(p10))) \
3248 MECACELL_K(p10) = o[MECACELL_SK(p10)].get<decltype(MECACELL_K(p10))>(); \
3249 if (o.count(MECACELL_SK(p11))) \
3250 MECACELL_K(p11) = o[MECACELL_SK(p11)].get<decltype(MECACELL_K(p11))>(); \
3251 if (o.count(MECACELL_SK(p12))) \
3252 MECACELL_K(p12) = o[MECACELL_SK(p12)].get<decltype(MECACELL_K(p12))>(); \
3253 if (o.count(MECACELL_SK(p13))) \
3254 MECACELL_K(p13) = o[MECACELL_SK(p13)].get<decltype(MECACELL_K(p13))>(); \
3255 if (o.count(MECACELL_SK(p14))) \
3256 MECACELL_K(p14) = o[MECACELL_SK(p14)].get<decltype(MECACELL_K(p14))>(); \
3257 if (o.count(MECACELL_SK(p15))) \
3258 MECACELL_K(p15) = o[MECACELL_SK(p15)].get<decltype(MECACELL_K(p15))>(); \
3259 if (o.count(MECACELL_SK(p16))) \
3260 MECACELL_K(p16) = o[MECACELL_SK(p16)].get<decltype(MECACELL_K(p16))>(); \
3261 if (o.count(MECACELL_SK(p17))) \
3262 MECACELL_K(p17) = o[MECACELL_SK(p17)].get<decltype(MECACELL_K(p17))>(); \
3263 if (o.count(MECACELL_SK(p18))) \
3264 MECACELL_K(p18) = o[MECACELL_SK(p18)].get<decltype(MECACELL_K(p18))>(); \
3265 if (o.count(MECACELL_SK(p19))) \
3266 MECACELL_K(p19) = o[MECACELL_SK(p19)].get<decltype(MECACELL_K(p19))>(); \
3267 if (o.count(MECACELL_SK(p20))) \
3268 MECACELL_K(p20) = o[MECACELL_SK(p20)].get<decltype(MECACELL_K(p20))>(); \
3269 if (o.count(MECACELL_SK(p21))) \
3270 MECACELL_K(p21) = o[MECACELL_SK(p21)].get<decltype(MECACELL_K(p21))>(); \
3271 if (o.count(MECACELL_SK(p22))) \
3272 MECACELL_K(p22) = o[MECACELL_SK(p22)].get<decltype(MECACELL_K(p22))>(); \
3273 if (o.count(MECACELL_SK(p23))) \
3274 MECACELL_K(p23) = o[MECACELL_SK(p23)].get<decltype(MECACELL_K(p23))>(); \
3275 if (o.count(MECACELL_SK(p24))) \
3276 MECACELL_K(p24) = o[MECACELL_SK(p24)].get<decltype(MECACELL_K(p24))>(); \
3277 if (o.count(MECACELL_SK(p25))) \
3278 MECACELL_K(p25) = o[MECACELL_SK(p25)].get<decltype(MECACELL_K(p25))>(); \
3279 if (o.count(MECACELL_SK(p26))) \
3280 MECACELL_K(p26) = o[MECACELL_SK(p26)].get<decltype(MECACELL_K(p26))>(); \
3281 if (o.count(MECACELL_SK(p27))) \
3282 MECACELL_K(p27) = o[MECACELL_SK(p27)].get<decltype(MECACELL_K(p27))>(); \
3283 if (o.count(MECACELL_SK(p28))) \
3284 MECACELL_K(p28) = o[MECACELL_SK(p28)].get<decltype(MECACELL_K(p28))>(); \
3285 if (o.count(MECACELL_SK(p29))) \
3286 MECACELL_K(p29) = o[MECACELL_SK(p29)].get<decltype(MECACELL_K(p29))>(); \
3287 if (o.count(MECACELL_SK(p30))) \
3288 MECACELL_K(p30) = o[MECACELL_SK(p30)].get<decltype(MECACELL_K(p30))>(); \
3289 if (o.count(MECACELL_SK(p31))) \
3290 MECACELL_K(p31) = o[MECACELL_SK(p31)].get<decltype(MECACELL_K(p31))>(); \
3292 json to_json() const { \
3293 auto b = BType::to_json(); \
3294 auto r = to_jsonL(*this); \
3295 if (!b.empty()) r.update(b); \
3298 std::function<json(const Exportable&)> to_jsonL = [](const Exportable& s) { \
3300 MECACELL_SK(p0), s.MECACELL_K(p0), MECACELL_SK(p1), s.MECACELL_K(p1), \
3301 MECACELL_SK(p2), s.MECACELL_K(p2), MECACELL_SK(p3), s.MECACELL_K(p3), \
3302 MECACELL_SK(p4), s.MECACELL_K(p4), MECACELL_SK(p5), s.MECACELL_K(p5), \
3303 MECACELL_SK(p6), s.MECACELL_K(p6), MECACELL_SK(p7), s.MECACELL_K(p7), \
3304 MECACELL_SK(p8), s.MECACELL_K(p8), MECACELL_SK(p9), s.MECACELL_K(p9), \
3305 MECACELL_SK(p10), s.MECACELL_K(p10), MECACELL_SK(p11), s.MECACELL_K(p11), \
3306 MECACELL_SK(p12), s.MECACELL_K(p12), MECACELL_SK(p13), s.MECACELL_K(p13), \
3307 MECACELL_SK(p14), s.MECACELL_K(p14), MECACELL_SK(p15), s.MECACELL_K(p15), \
3308 MECACELL_SK(p16), s.MECACELL_K(p16), MECACELL_SK(p17), s.MECACELL_K(p17), \
3309 MECACELL_SK(p18), s.MECACELL_K(p18), MECACELL_SK(p19), s.MECACELL_K(p19), \
3310 MECACELL_SK(p20), s.MECACELL_K(p20), MECACELL_SK(p21), s.MECACELL_K(p21), \
3311 MECACELL_SK(p22), s.MECACELL_K(p22), MECACELL_SK(p23), s.MECACELL_K(p23), \
3312 MECACELL_SK(p24), s.MECACELL_K(p24), MECACELL_SK(p25), s.MECACELL_K(p25), \
3313 MECACELL_SK(p26), s.MECACELL_K(p26), MECACELL_SK(p27), s.MECACELL_K(p27), \
3314 MECACELL_SK(p28), s.MECACELL_K(p28), MECACELL_SK(p29), s.MECACELL_K(p29), \
3315 MECACELL_SK(p30), s.MECACELL_K(p30), MECACELL_SK(p31), s.MECACELL_K(p31)); \
3317 std::function<std::string(void)> save = [this]() { return to_json().dump(2); }; \
3319 Exportable getExport() const { return Exportable(*this); }
3321#define EXPORTABLE33(S, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, \
3322 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, \
3323 v28, v29, v30, v31) \
3324 EXPORTABLE_INHERIT34(S, BaseExportable, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, \
3325 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, \
3326 v24, v25, v26, v27, v28, v29, v30, v31)
3332template <
typename T>
inline T*
asPtr(T& obj) {
return &obj; }
3333template <
typename T>
inline T*
asPtr(T* obj) {
return obj; }
3336 using type = std::remove_cv_t<std::remove_pointer_t<std::remove_reference_t<T>>>;
3339template <
typename A,
typename B,
typename S>
3344template <
typename A,
typename S,
typename T>
3349template <
typename NonEx,
typename Ex,
typename S>
3353 for (
const auto& i : b) {
3354 if (
asPtr(i) !=
nullptr) a.emplace_back(Ex(*
asPtr(i)));
3359 template <
typename T>
static constexpr T
getType(...) {
3363 template <
typename T>
static constexpr typename T::Exportable
getType(
void*) {
3367 template <
class U,
typename S,
typename T>
3372 template <
class U,
template <
class,
class>
class Cont,
class T,
3373 template <
class>
class Alloc>
3374 static constexpr Cont<typename BareType<T>::type::Exportable,
3375 Alloc<typename BareType<T>::type::Exportable>>
3381 getType<typename BareType<C>::type>(std::declval<typename BareType<C>::type*>()));
3384 getType<typename BareType<C>::type>(
3392 template <
typename T>
using KV = std::pair<std::string, T>;
3396 template <
typename T,
typename... Args>
3397 json saveJ(
const std::string& name,
const T& var, Args&&... args)
const {
3404 template <
typename T>
json saveJ(
const std::string& name,
const T& var)
const {
3420 for (
const auto& i : j) {
3429 for (
const auto& i : e) {
a class to store JSON values
void update(const_reference j)
updates a JSON object from another object, overwriting existing keys
static JSON_NODISCARD basic_json array(initializer_list_t init={})
explicitly create an array from an initializer list
void push_back(basic_json &&val)
add an object to an array
A simple vector class template.
void reserve(size_t newCapacity)
Reserves storage for the specified number of elements.
void push_back(const T &value)
Adds an element to the end of the vector.
size_t size() const
Returns the number of elements in the vector.
void from_json(const nlohmann::json &j, T &e)
void ExportableConstruct(A &a, const B &b, const S &)
void to_json(nlohmann::json &j, const T &e)
basic_json<> json
default JSON class
iostream cerr
Standard error stream.
iostream endl
End-of-line manipulator.
std::remove_cv_t< std::remove_pointer_t< std::remove_reference_t< T > > > type
json saveJ(const std::string &name, const T &var) const
json saveJ(const std::string &name, const T &var, Args &&... args) const
std::pair< std::string, T > KV
std::function< T(const S &)> getValue
decltype(getType< typename BareType< C >::type >(std::declval< typename BareType< C >::type * >())) type
static constexpr T getType(ExportableAlias< S, T > *)
static constexpr T getType(...)
static constexpr Cont< typename BareType< T >::type::Exportable, Alloc< typename BareType< T >::type::Exportable > > getType(Cont< T, Alloc< T > > *)
static constexpr T::Exportable getType(void *)