diff options
Diffstat (limited to 'ddl')
31 files changed, 179 insertions, 37 deletions
diff --git a/ddl/Definitions.hs b/ddl/Definitions.hs index 89c4af3..6fd6afd 100644 --- a/ddl/Definitions.hs +++ b/ddl/Definitions.hs | |||
@@ -532,13 +532,19 @@ testData = do | |||
532 | , "frames" #:: Array "Frame" | 532 | , "frames" #:: Array "Frame" |
533 | ] | 533 | ] |
534 | 534 | ||
535 | data_ "PipelineInfo" $ do | ||
536 | constR_ "PipelineInfo" | ||
537 | [ "pipelineName" #:: String | ||
538 | , "pipeline" #:: "Pipeline" | ||
539 | ] | ||
540 | |||
535 | data_ "RenderJob" $ do | 541 | data_ "RenderJob" $ do |
536 | constR_ "RenderJob" | 542 | constR_ "RenderJob" |
537 | [ "meshes" #:: Array "Mesh" | 543 | [ "meshes" #:: Array "Mesh" |
538 | , "textures" #:: Array String -- png texture | 544 | , "textures" #:: Array String -- png texture |
539 | , "schema" #:: "PipelineSchema" | 545 | , "schema" #:: "PipelineSchema" |
540 | , "scenes" #:: Array "Scene" | 546 | , "scenes" #:: Array "Scene" |
541 | , "pipelines" #:: Array "Pipeline" | 547 | , "pipelines" #:: Array "PipelineInfo" |
542 | ] | 548 | ] |
543 | 549 | ||
544 | -- test result | 550 | -- test result |
diff --git a/ddl/out/LambdaCube.IR.cpp b/ddl/out/LambdaCube.IR.cpp index 66ca8b3..335a512 100644 --- a/ddl/out/LambdaCube.IR.cpp +++ b/ddl/out/LambdaCube.IR.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:23.674070000000Z | 2 | // 2016-02-12T16:05:12.941660000000Z |
3 | 3 | ||
4 | #include "LambdaCube.IR.hpp" | 4 | #include "LambdaCube.IR.hpp" |
5 | template<> json toJSON<std::shared_ptr<ArrayValue>>(std::shared_ptr<ArrayValue> &v) { | 5 | template<> json toJSON<std::shared_ptr<ArrayValue>>(std::shared_ptr<ArrayValue> &v) { |
diff --git a/ddl/out/LambdaCube.IR.hpp b/ddl/out/LambdaCube.IR.hpp index bba849e..06e5835 100644 --- a/ddl/out/LambdaCube.IR.hpp +++ b/ddl/out/LambdaCube.IR.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:23.674070000000Z | 2 | // 2016-02-12T16:05:12.941660000000Z |
3 | 3 | ||
4 | #ifndef HEADER_LambdaCube.IR_H | 4 | #ifndef HEADER_LambdaCube.IR_H |
5 | #define HEADER_LambdaCube.IR_H | 5 | #define HEADER_LambdaCube.IR_H |
diff --git a/ddl/out/LambdaCube.IR.hs b/ddl/out/LambdaCube.IR.hs index b81163f..fdf8116 100644 --- a/ddl/out/LambdaCube.IR.hs +++ b/ddl/out/LambdaCube.IR.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:23.674070000000Z | 2 | -- 2016-02-12T16:05:12.941660000000Z |
3 | 3 | ||
4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} | 4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} |
5 | module LambdaCube.IR where | 5 | module LambdaCube.IR where |
diff --git a/ddl/out/LambdaCube.IR.purs b/ddl/out/LambdaCube.IR.purs index 3e88ad7..f62464e 100644 --- a/ddl/out/LambdaCube.IR.purs +++ b/ddl/out/LambdaCube.IR.purs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:23.674070000000Z | 2 | -- 2016-02-12T16:05:12.941660000000Z |
3 | 3 | ||
4 | module LambdaCube.IR where | 4 | module LambdaCube.IR where |
5 | import Prelude | 5 | import Prelude |
diff --git a/ddl/out/LambdaCube.IR.swift b/ddl/out/LambdaCube.IR.swift index cfc61da..2dd9300 100644 --- a/ddl/out/LambdaCube.IR.swift +++ b/ddl/out/LambdaCube.IR.swift | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:23.674070000000Z | 2 | // 2016-02-12T16:05:12.941660000000Z |
3 | 3 | ||
4 | typealias StreamName = Int | 4 | typealias StreamName = Int |
5 | 5 | ||
diff --git a/ddl/out/LambdaCube.IR2.hpp b/ddl/out/LambdaCube.IR2.hpp index d3c1eee..d353460 100644 --- a/ddl/out/LambdaCube.IR2.hpp +++ b/ddl/out/LambdaCube.IR2.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:23.674070000000Z | 2 | // 2016-02-12T16:05:12.941660000000Z |
3 | 3 | ||
4 | #ifndef HEADER_LambdaCube.IR_H | 4 | #ifndef HEADER_LambdaCube.IR_H |
5 | #define HEADER_LambdaCube.IR_H | 5 | #define HEADER_LambdaCube.IR_H |
diff --git a/ddl/out/LambdaCube.Mesh.cpp b/ddl/out/LambdaCube.Mesh.cpp index 4179c3d..9e704e1 100644 --- a/ddl/out/LambdaCube.Mesh.cpp +++ b/ddl/out/LambdaCube.Mesh.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.058473000000Z | 2 | // 2016-02-12T16:05:13.332951000000Z |
3 | 3 | ||
4 | #include "LambdaCube.Mesh.hpp" | 4 | #include "LambdaCube.Mesh.hpp" |
5 | template<> json toJSON<std::shared_ptr<MeshAttribute>>(std::shared_ptr<MeshAttribute> &v) { | 5 | template<> json toJSON<std::shared_ptr<MeshAttribute>>(std::shared_ptr<MeshAttribute> &v) { |
diff --git a/ddl/out/LambdaCube.Mesh.hpp b/ddl/out/LambdaCube.Mesh.hpp index 730e04e..b93ec58 100644 --- a/ddl/out/LambdaCube.Mesh.hpp +++ b/ddl/out/LambdaCube.Mesh.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.058473000000Z | 2 | // 2016-02-12T16:05:13.332951000000Z |
3 | 3 | ||
4 | #ifndef HEADER_LambdaCube.Mesh_H | 4 | #ifndef HEADER_LambdaCube.Mesh_H |
5 | #define HEADER_LambdaCube.Mesh_H | 5 | #define HEADER_LambdaCube.Mesh_H |
diff --git a/ddl/out/LambdaCube.Mesh.hs b/ddl/out/LambdaCube.Mesh.hs index 47b7da6..da937f3 100644 --- a/ddl/out/LambdaCube.Mesh.hs +++ b/ddl/out/LambdaCube.Mesh.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:24.058473000000Z | 2 | -- 2016-02-12T16:05:13.332951000000Z |
3 | 3 | ||
4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} | 4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} |
5 | module LambdaCube.Mesh where | 5 | module LambdaCube.Mesh where |
diff --git a/ddl/out/LambdaCube.Mesh.purs b/ddl/out/LambdaCube.Mesh.purs index 829bf91..d418ac2 100644 --- a/ddl/out/LambdaCube.Mesh.purs +++ b/ddl/out/LambdaCube.Mesh.purs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:24.058473000000Z | 2 | -- 2016-02-12T16:05:13.332951000000Z |
3 | 3 | ||
4 | module LambdaCube.Mesh where | 4 | module LambdaCube.Mesh where |
5 | import Prelude | 5 | import Prelude |
diff --git a/ddl/out/LambdaCube.Mesh.swift b/ddl/out/LambdaCube.Mesh.swift index 7380a34..82c8ba5 100644 --- a/ddl/out/LambdaCube.Mesh.swift +++ b/ddl/out/LambdaCube.Mesh.swift | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.058473000000Z | 2 | // 2016-02-12T16:05:13.332951000000Z |
3 | 3 | ||
4 | enum MeshAttribute { | 4 | enum MeshAttribute { |
5 | case A_Float(Array<Float>) | 5 | case A_Float(Array<Float>) |
diff --git a/ddl/out/LambdaCube.Mesh2.hpp b/ddl/out/LambdaCube.Mesh2.hpp index 5c81c54..a6a7cfe 100644 --- a/ddl/out/LambdaCube.Mesh2.hpp +++ b/ddl/out/LambdaCube.Mesh2.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.058473000000Z | 2 | // 2016-02-12T16:05:13.332951000000Z |
3 | 3 | ||
4 | #ifndef HEADER_LambdaCube.Mesh_H | 4 | #ifndef HEADER_LambdaCube.Mesh_H |
5 | #define HEADER_LambdaCube.Mesh_H | 5 | #define HEADER_LambdaCube.Mesh_H |
diff --git a/ddl/out/LambdaCube.PipelineSchema.cpp b/ddl/out/LambdaCube.PipelineSchema.cpp index 7dced29..283aa31 100644 --- a/ddl/out/LambdaCube.PipelineSchema.cpp +++ b/ddl/out/LambdaCube.PipelineSchema.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.035933000000Z | 2 | // 2016-02-12T16:05:13.310528000000Z |
3 | 3 | ||
4 | #include "LambdaCube.PipelineSchema.hpp" | 4 | #include "LambdaCube.PipelineSchema.hpp" |
5 | template<> json toJSON<std::shared_ptr<StreamType>>(std::shared_ptr<StreamType> &v) { | 5 | template<> json toJSON<std::shared_ptr<StreamType>>(std::shared_ptr<StreamType> &v) { |
diff --git a/ddl/out/LambdaCube.PipelineSchema.hpp b/ddl/out/LambdaCube.PipelineSchema.hpp index d0ad084..68b309f 100644 --- a/ddl/out/LambdaCube.PipelineSchema.hpp +++ b/ddl/out/LambdaCube.PipelineSchema.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.035933000000Z | 2 | // 2016-02-12T16:05:13.310528000000Z |
3 | 3 | ||
4 | #ifndef HEADER_LambdaCube.PipelineSchema_H | 4 | #ifndef HEADER_LambdaCube.PipelineSchema_H |
5 | #define HEADER_LambdaCube.PipelineSchema_H | 5 | #define HEADER_LambdaCube.PipelineSchema_H |
diff --git a/ddl/out/LambdaCube.PipelineSchema.hs b/ddl/out/LambdaCube.PipelineSchema.hs index 69998de..a573d27 100644 --- a/ddl/out/LambdaCube.PipelineSchema.hs +++ b/ddl/out/LambdaCube.PipelineSchema.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:24.035933000000Z | 2 | -- 2016-02-12T16:05:13.310528000000Z |
3 | 3 | ||
4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} | 4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} |
5 | module LambdaCube.PipelineSchema where | 5 | module LambdaCube.PipelineSchema where |
diff --git a/ddl/out/LambdaCube.PipelineSchema.purs b/ddl/out/LambdaCube.PipelineSchema.purs index 059008b..b31416b 100644 --- a/ddl/out/LambdaCube.PipelineSchema.purs +++ b/ddl/out/LambdaCube.PipelineSchema.purs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:24.035933000000Z | 2 | -- 2016-02-12T16:05:13.310528000000Z |
3 | 3 | ||
4 | module LambdaCube.PipelineSchema where | 4 | module LambdaCube.PipelineSchema where |
5 | import Prelude | 5 | import Prelude |
diff --git a/ddl/out/LambdaCube.PipelineSchema.swift b/ddl/out/LambdaCube.PipelineSchema.swift index 3d90f40..542e8e2 100644 --- a/ddl/out/LambdaCube.PipelineSchema.swift +++ b/ddl/out/LambdaCube.PipelineSchema.swift | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.035933000000Z | 2 | // 2016-02-12T16:05:13.310528000000Z |
3 | 3 | ||
4 | enum StreamType { | 4 | enum StreamType { |
5 | case Attribute_Word | 5 | case Attribute_Word |
diff --git a/ddl/out/LambdaCube.PipelineSchema2.hpp b/ddl/out/LambdaCube.PipelineSchema2.hpp index e4ec5e3..153a9f6 100644 --- a/ddl/out/LambdaCube.PipelineSchema2.hpp +++ b/ddl/out/LambdaCube.PipelineSchema2.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.035933000000Z | 2 | // 2016-02-12T16:05:13.310528000000Z |
3 | 3 | ||
4 | #ifndef HEADER_LambdaCube.PipelineSchema_H | 4 | #ifndef HEADER_LambdaCube.PipelineSchema_H |
5 | #define HEADER_LambdaCube.PipelineSchema_H | 5 | #define HEADER_LambdaCube.PipelineSchema_H |
diff --git a/ddl/out/LambdaCube.TypeInfo.cpp b/ddl/out/LambdaCube.TypeInfo.cpp index f79e093..ce2dcff 100644 --- a/ddl/out/LambdaCube.TypeInfo.cpp +++ b/ddl/out/LambdaCube.TypeInfo.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.089367000000Z | 2 | // 2016-02-12T16:05:13.364534000000Z |
3 | 3 | ||
4 | #include "LambdaCube.TypeInfo.hpp" | 4 | #include "LambdaCube.TypeInfo.hpp" |
5 | template<> json toJSON<std::shared_ptr<TypeInfo>>(std::shared_ptr<TypeInfo> &v) { | 5 | template<> json toJSON<std::shared_ptr<TypeInfo>>(std::shared_ptr<TypeInfo> &v) { |
diff --git a/ddl/out/LambdaCube.TypeInfo.hpp b/ddl/out/LambdaCube.TypeInfo.hpp index 3a6e2bb..6e302f3 100644 --- a/ddl/out/LambdaCube.TypeInfo.hpp +++ b/ddl/out/LambdaCube.TypeInfo.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.089367000000Z | 2 | // 2016-02-12T16:05:13.364534000000Z |
3 | 3 | ||
4 | #ifndef HEADER_LambdaCube.TypeInfo_H | 4 | #ifndef HEADER_LambdaCube.TypeInfo_H |
5 | #define HEADER_LambdaCube.TypeInfo_H | 5 | #define HEADER_LambdaCube.TypeInfo_H |
diff --git a/ddl/out/LambdaCube.TypeInfo.hs b/ddl/out/LambdaCube.TypeInfo.hs index 9405419..a2df59c 100644 --- a/ddl/out/LambdaCube.TypeInfo.hs +++ b/ddl/out/LambdaCube.TypeInfo.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:24.089367000000Z | 2 | -- 2016-02-12T16:05:13.364534000000Z |
3 | 3 | ||
4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} | 4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} |
5 | module LambdaCube.TypeInfo where | 5 | module LambdaCube.TypeInfo where |
diff --git a/ddl/out/LambdaCube.TypeInfo.purs b/ddl/out/LambdaCube.TypeInfo.purs index cf00b8e..afd8a86 100644 --- a/ddl/out/LambdaCube.TypeInfo.purs +++ b/ddl/out/LambdaCube.TypeInfo.purs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:24.089367000000Z | 2 | -- 2016-02-12T16:05:13.364534000000Z |
3 | 3 | ||
4 | module LambdaCube.TypeInfo where | 4 | module LambdaCube.TypeInfo where |
5 | import Prelude | 5 | import Prelude |
diff --git a/ddl/out/LambdaCube.TypeInfo.swift b/ddl/out/LambdaCube.TypeInfo.swift index 8322914..d3b03d1 100644 --- a/ddl/out/LambdaCube.TypeInfo.swift +++ b/ddl/out/LambdaCube.TypeInfo.swift | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.089367000000Z | 2 | // 2016-02-12T16:05:13.364534000000Z |
3 | 3 | ||
4 | enum TypeInfo { | 4 | enum TypeInfo { |
5 | case TypeInfo(TypeInfo_Data) | 5 | case TypeInfo(TypeInfo_Data) |
diff --git a/ddl/out/LambdaCube.TypeInfo2.hpp b/ddl/out/LambdaCube.TypeInfo2.hpp index ae6412b..c6d5f4b 100644 --- a/ddl/out/LambdaCube.TypeInfo2.hpp +++ b/ddl/out/LambdaCube.TypeInfo2.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.089367000000Z | 2 | // 2016-02-12T16:05:13.364534000000Z |
3 | 3 | ||
4 | #ifndef HEADER_LambdaCube.TypeInfo_H | 4 | #ifndef HEADER_LambdaCube.TypeInfo_H |
5 | #define HEADER_LambdaCube.TypeInfo_H | 5 | #define HEADER_LambdaCube.TypeInfo_H |
diff --git a/ddl/out/TestData.cpp b/ddl/out/TestData.cpp index bbb2251..558a45b 100644 --- a/ddl/out/TestData.cpp +++ b/ddl/out/TestData.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.109009000000Z | 2 | // 2016-02-12T16:05:13.383716000000Z |
3 | 3 | ||
4 | #include "TestData.hpp" | 4 | #include "TestData.hpp" |
5 | template<> json toJSON<std::shared_ptr<ClientInfo>>(std::shared_ptr<ClientInfo> &v) { | 5 | template<> json toJSON<std::shared_ptr<ClientInfo>>(std::shared_ptr<ClientInfo> &v) { |
@@ -101,6 +101,37 @@ template<> std::shared_ptr<Scene> fromJSON<std::shared_ptr<Scene>>(W<std::shared | |||
101 | return o; | 101 | return o; |
102 | } | 102 | } |
103 | 103 | ||
104 | template<> json toJSON<std::shared_ptr<PipelineInfo>>(std::shared_ptr<PipelineInfo> &v) { | ||
105 | json obj({}); | ||
106 | switch (v->tag) { | ||
107 | case ::PipelineInfo::tag::PipelineInfo: | ||
108 | obj["tag"] = "PipelineInfo"; | ||
109 | { | ||
110 | std::shared_ptr<data::PipelineInfo> tv = std::static_pointer_cast<data::PipelineInfo>(v); | ||
111 | obj["pipelineName"] = toJSON(tv->pipelineName); | ||
112 | obj["pipeline"] = toJSON(tv->pipeline); | ||
113 | } | ||
114 | break; | ||
115 | } | ||
116 | return obj; | ||
117 | } | ||
118 | |||
119 | template<> std::shared_ptr<PipelineInfo> fromJSON<std::shared_ptr<PipelineInfo>>(W<std::shared_ptr<PipelineInfo>> v, json &obj) { | ||
120 | enum ::PipelineInfo::tag tagType; | ||
121 | std::string tag = obj["tag"]; | ||
122 | if (tag == "PipelineInfo") { | ||
123 | tagType = ::PipelineInfo::tag::PipelineInfo; | ||
124 | std::shared_ptr<data::PipelineInfo> tv(new data::PipelineInfo()); | ||
125 | tv->pipelineName = fromJSON(W<String>(), obj["pipelineName"]); | ||
126 | tv->pipeline = fromJSON(W<std::shared_ptr<::Pipeline>>(), obj["pipeline"]); | ||
127 | return tv; | ||
128 | } | ||
129 | else throw "unknown constructor: " + tag; | ||
130 | std::shared_ptr<::PipelineInfo> o(new ::PipelineInfo()); | ||
131 | o->tag = tagType; | ||
132 | return o; | ||
133 | } | ||
134 | |||
104 | template<> json toJSON<std::shared_ptr<RenderJob>>(std::shared_ptr<RenderJob> &v) { | 135 | template<> json toJSON<std::shared_ptr<RenderJob>>(std::shared_ptr<RenderJob> &v) { |
105 | json obj({}); | 136 | json obj({}); |
106 | switch (v->tag) { | 137 | switch (v->tag) { |
@@ -129,7 +160,7 @@ template<> std::shared_ptr<RenderJob> fromJSON<std::shared_ptr<RenderJob>>(W<std | |||
129 | tv->textures = fromJSON(W<std::vector<String>>(), obj["textures"]); | 160 | tv->textures = fromJSON(W<std::vector<String>>(), obj["textures"]); |
130 | tv->schema = fromJSON(W<std::shared_ptr<::PipelineSchema>>(), obj["schema"]); | 161 | tv->schema = fromJSON(W<std::shared_ptr<::PipelineSchema>>(), obj["schema"]); |
131 | tv->scenes = fromJSON(W<std::vector<std::shared_ptr<::Scene>>>(), obj["scenes"]); | 162 | tv->scenes = fromJSON(W<std::vector<std::shared_ptr<::Scene>>>(), obj["scenes"]); |
132 | tv->pipelines = fromJSON(W<std::vector<std::shared_ptr<::Pipeline>>>(), obj["pipelines"]); | 163 | tv->pipelines = fromJSON(W<std::vector<std::shared_ptr<::PipelineInfo>>>(), obj["pipelines"]); |
133 | return tv; | 164 | return tv; |
134 | } | 165 | } |
135 | else throw "unknown constructor: " + tag; | 166 | else throw "unknown constructor: " + tag; |
diff --git a/ddl/out/TestData.hpp b/ddl/out/TestData.hpp index 08b6020..39aa824 100644 --- a/ddl/out/TestData.hpp +++ b/ddl/out/TestData.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.109009000000Z | 2 | // 2016-02-12T16:05:13.383716000000Z |
3 | 3 | ||
4 | #ifndef HEADER_TestData_H | 4 | #ifndef HEADER_TestData_H |
5 | #define HEADER_TestData_H | 5 | #define HEADER_TestData_H |
@@ -55,6 +55,20 @@ namespace data { | |||
55 | Scene() { tag = tag::Scene; } | 55 | Scene() { tag = tag::Scene; } |
56 | }; | 56 | }; |
57 | } | 57 | } |
58 | class PipelineInfo { | ||
59 | public: | ||
60 | enum class tag { | ||
61 | PipelineInfo | ||
62 | } tag; | ||
63 | }; | ||
64 | namespace data { | ||
65 | class PipelineInfo : public ::PipelineInfo { | ||
66 | public: | ||
67 | String pipelineName; | ||
68 | std::shared_ptr<::Pipeline> pipeline; | ||
69 | PipelineInfo() { tag = tag::PipelineInfo; } | ||
70 | }; | ||
71 | } | ||
58 | class RenderJob { | 72 | class RenderJob { |
59 | public: | 73 | public: |
60 | enum class tag { | 74 | enum class tag { |
@@ -68,7 +82,7 @@ namespace data { | |||
68 | std::vector<String> textures; | 82 | std::vector<String> textures; |
69 | std::shared_ptr<::PipelineSchema> schema; | 83 | std::shared_ptr<::PipelineSchema> schema; |
70 | std::vector<std::shared_ptr<::Scene>> scenes; | 84 | std::vector<std::shared_ptr<::Scene>> scenes; |
71 | std::vector<std::shared_ptr<::Pipeline>> pipelines; | 85 | std::vector<std::shared_ptr<::PipelineInfo>> pipelines; |
72 | RenderJob() { tag = tag::RenderJob; } | 86 | RenderJob() { tag = tag::RenderJob; } |
73 | }; | 87 | }; |
74 | } | 88 | } |
diff --git a/ddl/out/TestData.hs b/ddl/out/TestData.hs index a81134f..d6d8e38 100644 --- a/ddl/out/TestData.hs +++ b/ddl/out/TestData.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:24.109009000000Z | 2 | -- 2016-02-12T16:05:13.383716000000Z |
3 | 3 | ||
4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} | 4 | {-# LANGUAGE OverloadedStrings, RecordWildCards #-} |
5 | module TestData where | 5 | module TestData where |
@@ -46,13 +46,21 @@ data Scene | |||
46 | 46 | ||
47 | deriving (Show, Eq, Ord) | 47 | deriving (Show, Eq, Ord) |
48 | 48 | ||
49 | data PipelineInfo | ||
50 | = PipelineInfo | ||
51 | { pipelineName :: String | ||
52 | , pipeline :: Pipeline | ||
53 | } | ||
54 | |||
55 | deriving (Show, Eq, Ord) | ||
56 | |||
49 | data RenderJob | 57 | data RenderJob |
50 | = RenderJob | 58 | = RenderJob |
51 | { meshes :: Vector Mesh | 59 | { meshes :: Vector Mesh |
52 | , textures :: Vector String | 60 | , textures :: Vector String |
53 | , schema :: PipelineSchema | 61 | , schema :: PipelineSchema |
54 | , scenes :: Vector Scene | 62 | , scenes :: Vector Scene |
55 | , pipelines :: Vector Pipeline | 63 | , pipelines :: Vector PipelineInfo |
56 | } | 64 | } |
57 | 65 | ||
58 | deriving (Show, Eq, Ord) | 66 | deriving (Show, Eq, Ord) |
@@ -144,6 +152,27 @@ instance FromJSON Scene where | |||
144 | } | 152 | } |
145 | parseJSON _ = mzero | 153 | parseJSON _ = mzero |
146 | 154 | ||
155 | instance ToJSON PipelineInfo where | ||
156 | toJSON v = case v of | ||
157 | PipelineInfo{..} -> object | ||
158 | [ "tag" .= ("PipelineInfo" :: Text) | ||
159 | , "pipelineName" .= pipelineName | ||
160 | , "pipeline" .= pipeline | ||
161 | ] | ||
162 | |||
163 | instance FromJSON PipelineInfo where | ||
164 | parseJSON (Object obj) = do | ||
165 | tag <- obj .: "tag" | ||
166 | case tag :: Text of | ||
167 | "PipelineInfo" -> do | ||
168 | pipelineName <- obj .: "pipelineName" | ||
169 | pipeline <- obj .: "pipeline" | ||
170 | pure $ PipelineInfo | ||
171 | { pipelineName = pipelineName | ||
172 | , pipeline = pipeline | ||
173 | } | ||
174 | parseJSON _ = mzero | ||
175 | |||
147 | instance ToJSON RenderJob where | 176 | instance ToJSON RenderJob where |
148 | toJSON v = case v of | 177 | toJSON v = case v of |
149 | RenderJob{..} -> object | 178 | RenderJob{..} -> object |
diff --git a/ddl/out/TestData.purs b/ddl/out/TestData.purs index 891704d..426da42 100644 --- a/ddl/out/TestData.purs +++ b/ddl/out/TestData.purs | |||
@@ -1,5 +1,5 @@ | |||
1 | -- generated file, do not modify! | 1 | -- generated file, do not modify! |
2 | -- 2016-02-08T13:33:24.109009000000Z | 2 | -- 2016-02-12T16:05:13.383716000000Z |
3 | 3 | ||
4 | module TestData where | 4 | module TestData where |
5 | import Prelude | 5 | import Prelude |
@@ -44,13 +44,20 @@ data Scene | |||
44 | } | 44 | } |
45 | 45 | ||
46 | 46 | ||
47 | data PipelineInfo | ||
48 | = PipelineInfo | ||
49 | { pipelineName :: String | ||
50 | , pipeline :: Pipeline | ||
51 | } | ||
52 | |||
53 | |||
47 | data RenderJob | 54 | data RenderJob |
48 | = RenderJob | 55 | = RenderJob |
49 | { meshes :: Array Mesh | 56 | { meshes :: Array Mesh |
50 | , textures :: Array String | 57 | , textures :: Array String |
51 | , schema :: PipelineSchema | 58 | , schema :: PipelineSchema |
52 | , scenes :: Array Scene | 59 | , scenes :: Array Scene |
53 | , pipelines :: Array Pipeline | 60 | , pipelines :: Array PipelineInfo |
54 | } | 61 | } |
55 | 62 | ||
56 | 63 | ||
@@ -140,6 +147,27 @@ instance decodeJsonScene :: DecodeJson Scene where | |||
140 | , frames:frames | 147 | , frames:frames |
141 | } | 148 | } |
142 | 149 | ||
150 | instance encodeJsonPipelineInfo :: EncodeJson PipelineInfo where | ||
151 | encodeJson v = case v of | ||
152 | PipelineInfo r -> | ||
153 | "tag" := "PipelineInfo" ~> | ||
154 | "pipelineName" := r.pipelineName ~> | ||
155 | "pipeline" := r.pipeline ~> | ||
156 | jsonEmptyObject | ||
157 | |||
158 | instance decodeJsonPipelineInfo :: DecodeJson PipelineInfo where | ||
159 | decodeJson json = do | ||
160 | obj <- decodeJson json | ||
161 | tag <- obj .? "tag" | ||
162 | case tag of | ||
163 | "PipelineInfo" -> do | ||
164 | pipelineName <- obj .? "pipelineName" | ||
165 | pipeline <- obj .? "pipeline" | ||
166 | pure $ PipelineInfo | ||
167 | { pipelineName:pipelineName | ||
168 | , pipeline:pipeline | ||
169 | } | ||
170 | |||
143 | instance encodeJsonRenderJob :: EncodeJson RenderJob where | 171 | instance encodeJsonRenderJob :: EncodeJson RenderJob where |
144 | encodeJson v = case v of | 172 | encodeJson v = case v of |
145 | RenderJob r -> | 173 | RenderJob r -> |
diff --git a/ddl/out/TestData.swift b/ddl/out/TestData.swift index 398ce23..671c6bf 100644 --- a/ddl/out/TestData.swift +++ b/ddl/out/TestData.swift | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.109009000000Z | 2 | // 2016-02-12T16:05:13.383716000000Z |
3 | 3 | ||
4 | enum ClientInfo { | 4 | enum ClientInfo { |
5 | case ClientInfo(ClientInfo_Data) | 5 | case ClientInfo(ClientInfo_Data) |
@@ -28,6 +28,14 @@ enum Scene { | |||
28 | } | 28 | } |
29 | } | 29 | } |
30 | 30 | ||
31 | enum PipelineInfo { | ||
32 | case PipelineInfo(PipelineInfo_Data) | ||
33 | struct PipelineInfo_Data { | ||
34 | var pipelineName : String | ||
35 | var pipeline : Pipeline | ||
36 | } | ||
37 | } | ||
38 | |||
31 | enum RenderJob { | 39 | enum RenderJob { |
32 | case RenderJob(RenderJob_Data) | 40 | case RenderJob(RenderJob_Data) |
33 | struct RenderJob_Data { | 41 | struct RenderJob_Data { |
@@ -35,7 +43,7 @@ enum RenderJob { | |||
35 | var textures : Array<String> | 43 | var textures : Array<String> |
36 | var schema : PipelineSchema | 44 | var schema : PipelineSchema |
37 | var scenes : Array<Scene> | 45 | var scenes : Array<Scene> |
38 | var pipelines : Array<Pipeline> | 46 | var pipelines : Array<PipelineInfo> |
39 | } | 47 | } |
40 | } | 48 | } |
41 | 49 | ||
@@ -143,6 +151,17 @@ extension Scene { | |||
143 | } | 151 | } |
144 | } | 152 | } |
145 | } | 153 | } |
154 | extension PipelineInfo { | ||
155 | var toJSON : [String: AnyObject] { | ||
156 | switch self { | ||
157 | case .PipelineInfo(let v): | ||
158 | return [ "tag" : "PipelineInfo" | ||
159 | , "pipelineName" : v.pipelineName.toJSON | ||
160 | , "pipeline" : v.pipeline.toJSON | ||
161 | ] | ||
162 | } | ||
163 | } | ||
164 | } | ||
146 | extension RenderJob { | 165 | extension RenderJob { |
147 | var toJSON : [String: AnyObject] { | 166 | var toJSON : [String: AnyObject] { |
148 | switch self { | 167 | switch self { |
@@ -200,6 +219,7 @@ enum Type { | |||
200 | case ClientInfo | 219 | case ClientInfo |
201 | case Frame | 220 | case Frame |
202 | case Scene | 221 | case Scene |
222 | case PipelineInfo | ||
203 | case RenderJob | 223 | case RenderJob |
204 | case FrameResult | 224 | case FrameResult |
205 | case RenderJobResult | 225 | case RenderJobResult |
diff --git a/ddl/out/TestData2.hpp b/ddl/out/TestData2.hpp index 07ef071..e876551 100644 --- a/ddl/out/TestData2.hpp +++ b/ddl/out/TestData2.hpp | |||
@@ -1,5 +1,5 @@ | |||
1 | // generated file, do not modify! | 1 | // generated file, do not modify! |
2 | // 2016-02-08T13:33:24.109009000000Z | 2 | // 2016-02-12T16:05:13.383716000000Z |
3 | 3 | ||
4 | #ifndef HEADER_TestData_H | 4 | #ifndef HEADER_TestData_H |
5 | #define HEADER_TestData_H | 5 | #define HEADER_TestData_H |
@@ -56,13 +56,27 @@ public: | |||
56 | std::shared_ptr<data::Scene> Scene; | 56 | std::shared_ptr<data::Scene> Scene; |
57 | }; | 57 | }; |
58 | namespace data { | 58 | namespace data { |
59 | class PipelineInfo { | ||
60 | public: | ||
61 | String pipelineName; | ||
62 | std::shared_ptr<::Pipeline> pipeline; | ||
63 | }; | ||
64 | } | ||
65 | class PipelineInfo { | ||
66 | public: | ||
67 | enum class tag { | ||
68 | PipelineInfo | ||
69 | } tag; | ||
70 | std::shared_ptr<data::PipelineInfo> PipelineInfo; | ||
71 | }; | ||
72 | namespace data { | ||
59 | class RenderJob { | 73 | class RenderJob { |
60 | public: | 74 | public: |
61 | std::vector<std::shared_ptr<::Mesh>> meshes; | 75 | std::vector<std::shared_ptr<::Mesh>> meshes; |
62 | std::vector<String> textures; | 76 | std::vector<String> textures; |
63 | std::shared_ptr<::PipelineSchema> schema; | 77 | std::shared_ptr<::PipelineSchema> schema; |
64 | std::vector<std::shared_ptr<::Scene>> scenes; | 78 | std::vector<std::shared_ptr<::Scene>> scenes; |
65 | std::vector<std::shared_ptr<::Pipeline>> pipelines; | 79 | std::vector<std::shared_ptr<::PipelineInfo>> pipelines; |
66 | }; | 80 | }; |
67 | } | 81 | } |
68 | class RenderJob { | 82 | class RenderJob { |