#pragma once #include "schema.hpp" namespace saw { template struct meta_schema { static_assert(always_false, "Not supported Schema."); }; template<> struct meta_schema { using Schema = schema::Void; using MetaSchema = schema::Void; }; template<> struct meta_schema { using Schema = schema::Bool; using MetaSchema = schema::Void; }; template struct meta_schema> { using Schema = schema::Primitive; using MetaSchema = schema::Void; }; template struct meta_schema, schema::Primitive >> { using Schema = schema::MixedPrecision, schema::Primitive>; using MetaSchema = schema::Void; }; template struct meta_schema> { using Schema = schema::Ref; using MetaSchema = schema::Void; }; template struct meta_schema> { using Schema = schema::Map; using MetaSchema = schema::Void; }; template struct meta_schema...>> { using Schema = schema::Struct...>; using MetaSchema = schema::Struct::MetaSchema,Lit>...>; }; template struct meta_schema...>> { using Schema = schema::Union...>; using MetaSchema = schema::Union::MetaSchema,Lit>...>; }; template struct meta_schema> { using Schema = schema::Tuple; using MetaSchema = schema::Tuple::MetaSchema...>; }; template<> struct meta_schema { using Schema = schema::String; using MetaSchema = schema::UInt64; }; /** * Technically we also can distinguish if T is primitive. */ template struct meta_schema> { // TODO Technically this should be a FixedArray of the inner meta schema, except when the inner meta schema is Void using Schema = schema::Array; using MetaSchema = schema::FixedArray; }; template struct meta_schema> { // TODO Technically this should be a FixedArray of the inner meta schema, except when the inner meta schema is Void using Schema = schema::FixedArray; using MetaSchema = schema::Void; }; }