// generated file, do not modify! <<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9 // 2016-03-01T13:00:40.829757000000Z ======= // 2016-03-20T21:42:13.043021000000Z >>>>>>> working c# backend #include "TestData.hpp" template<> json toJSON>(std::shared_ptr &v) { json obj({}); switch (v->tag) { case ::ClientInfo::tag::ClientInfo: obj["tag"] = "ClientInfo"; { std::shared_ptr tv = std::static_pointer_cast(v); obj["clientName"] = toJSON(tv->clientName); obj["clientBackend"] = toJSON(tv->clientBackend); } break; } return obj; } template<> std::shared_ptr fromJSON>(W> v, json &obj) { enum ::ClientInfo::tag tagType; std::string tag = obj["tag"]; if (tag == "ClientInfo") { tagType = ::ClientInfo::tag::ClientInfo; std::shared_ptr tv(new data::ClientInfo()); tv->clientName = fromJSON(W(), obj["clientName"]); tv->clientBackend = fromJSON(W>(), obj["clientBackend"]); return tv; } else throw "unknown constructor: " + tag; std::shared_ptr<::ClientInfo> o(new ::ClientInfo()); o->tag = tagType; return o; } template<> json toJSON>(std::shared_ptr &v) { json obj({}); switch (v->tag) { case ::Frame::tag::Frame: obj["tag"] = "Frame"; { std::shared_ptr tv = std::static_pointer_cast(v); obj["renderCount"] = toJSON(tv->renderCount); obj["frameUniforms"] = toJSON(tv->frameUniforms); obj["frameTextures"] = toJSON(tv->frameTextures); } break; } return obj; } template<> std::shared_ptr fromJSON>(W> v, json &obj) { enum ::Frame::tag tagType; std::string tag = obj["tag"]; if (tag == "Frame") { tagType = ::Frame::tag::Frame; std::shared_ptr tv(new data::Frame()); tv->renderCount = fromJSON(W(), obj["renderCount"]); tv->frameUniforms = fromJSON(W>>(), obj["frameUniforms"]); tv->frameTextures = fromJSON(W>(), obj["frameTextures"]); return tv; } else throw "unknown constructor: " + tag; std::shared_ptr<::Frame> o(new ::Frame()); o->tag = tagType; return o; } template<> json toJSON>(std::shared_ptr &v) { json obj({}); switch (v->tag) { case ::Scene::tag::Scene: obj["tag"] = "Scene"; { std::shared_ptr tv = std::static_pointer_cast(v); obj["objectArrays"] = toJSON(tv->objectArrays); obj["renderTargetWidth"] = toJSON(tv->renderTargetWidth); obj["renderTargetHeight"] = toJSON(tv->renderTargetHeight); obj["frames"] = toJSON(tv->frames); } break; } return obj; } template<> std::shared_ptr fromJSON>(W> v, json &obj) { enum ::Scene::tag tagType; std::string tag = obj["tag"]; if (tag == "Scene") { tagType = ::Scene::tag::Scene; std::shared_ptr tv(new data::Scene()); tv->objectArrays = fromJSON(W>>(), obj["objectArrays"]); tv->renderTargetWidth = fromJSON(W(), obj["renderTargetWidth"]); tv->renderTargetHeight = fromJSON(W(), obj["renderTargetHeight"]); tv->frames = fromJSON(W>>(), obj["frames"]); return tv; } else throw "unknown constructor: " + tag; std::shared_ptr<::Scene> o(new ::Scene()); o->tag = tagType; return o; } template<> json toJSON>(std::shared_ptr &v) { json obj({}); switch (v->tag) { case ::PipelineInfo::tag::PipelineInfo: obj["tag"] = "PipelineInfo"; { std::shared_ptr tv = std::static_pointer_cast(v); obj["pipelineName"] = toJSON(tv->pipelineName); obj["pipeline"] = toJSON(tv->pipeline); } break; } return obj; } template<> std::shared_ptr fromJSON>(W> v, json &obj) { enum ::PipelineInfo::tag tagType; std::string tag = obj["tag"]; if (tag == "PipelineInfo") { tagType = ::PipelineInfo::tag::PipelineInfo; std::shared_ptr tv(new data::PipelineInfo()); tv->pipelineName = fromJSON(W(), obj["pipelineName"]); tv->pipeline = fromJSON(W>(), obj["pipeline"]); return tv; } else throw "unknown constructor: " + tag; std::shared_ptr<::PipelineInfo> o(new ::PipelineInfo()); o->tag = tagType; return o; } template<> json toJSON>(std::shared_ptr &v) { json obj({}); switch (v->tag) { case ::RenderJob::tag::RenderJob: obj["tag"] = "RenderJob"; { std::shared_ptr tv = std::static_pointer_cast(v); obj["meshes"] = toJSON(tv->meshes); obj["textures"] = toJSON(tv->textures); obj["schema"] = toJSON(tv->schema); obj["scenes"] = toJSON(tv->scenes); obj["pipelines"] = toJSON(tv->pipelines); } break; } return obj; } template<> std::shared_ptr fromJSON>(W> v, json &obj) { enum ::RenderJob::tag tagType; std::string tag = obj["tag"]; if (tag == "RenderJob") { tagType = ::RenderJob::tag::RenderJob; std::shared_ptr tv(new data::RenderJob()); tv->meshes = fromJSON(W>>(), obj["meshes"]); tv->textures = fromJSON(W>(), obj["textures"]); tv->schema = fromJSON(W>(), obj["schema"]); tv->scenes = fromJSON(W>>(), obj["scenes"]); tv->pipelines = fromJSON(W>>(), obj["pipelines"]); return tv; } else throw "unknown constructor: " + tag; std::shared_ptr<::RenderJob> o(new ::RenderJob()); o->tag = tagType; return o; } template<> json toJSON>(std::shared_ptr &v) { json obj({}); switch (v->tag) { case ::FrameResult::tag::FrameResult: obj["tag"] = "FrameResult"; { std::shared_ptr tv = std::static_pointer_cast(v); obj["frRenderTimes"] = toJSON(tv->frRenderTimes); obj["frImageWidth"] = toJSON(tv->frImageWidth); obj["frImageHeight"] = toJSON(tv->frImageHeight); } break; } return obj; } template<> std::shared_ptr fromJSON>(W> v, json &obj) { enum ::FrameResult::tag tagType; std::string tag = obj["tag"]; if (tag == "FrameResult") { tagType = ::FrameResult::tag::FrameResult; std::shared_ptr tv(new data::FrameResult()); tv->frRenderTimes = fromJSON(W>(), obj["frRenderTimes"]); tv->frImageWidth = fromJSON(W(), obj["frImageWidth"]); tv->frImageHeight = fromJSON(W(), obj["frImageHeight"]); return tv; } else throw "unknown constructor: " + tag; std::shared_ptr<::FrameResult> o(new ::FrameResult()); o->tag = tagType; return o; } template<> json toJSON>(std::shared_ptr &v) { json obj({}); switch (v->tag) { case ::RenderJobResult::tag::RenderJobResult: obj["tag"] = "RenderJobResult"; { std::shared_ptr tv = std::static_pointer_cast(v); obj["arg0"] = toJSON(tv->_0); } break; case ::RenderJobResult::tag::RenderJobError: obj["tag"] = "RenderJobError"; { std::shared_ptr tv = std::static_pointer_cast(v); obj["arg0"] = toJSON(tv->_0); } break; } return obj; } template<> std::shared_ptr fromJSON>(W> v, json &obj) { enum ::RenderJobResult::tag tagType; std::string tag = obj["tag"]; if (tag == "RenderJobResult") { tagType = ::RenderJobResult::tag::RenderJobResult; std::shared_ptr tv(new data::RenderJobResult()); tv->_0 = fromJSON(W>(), obj["arg0"]); return tv; } else if (tag == "RenderJobError") { tagType = ::RenderJobResult::tag::RenderJobError; std::shared_ptr tv(new data::RenderJobError()); tv->_0 = fromJSON(W(), obj["arg0"]); return tv; } else throw "unknown constructor: " + tag; std::shared_ptr<::RenderJobResult> o(new ::RenderJobResult()); o->tag = tagType; return o; }