diff options
Diffstat (limited to 'modules/codec/c++/schema.h')
-rw-r--r-- | modules/codec/c++/schema.h | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/modules/codec/c++/schema.h b/modules/codec/c++/schema.h index 69233fa..576f378 100644 --- a/modules/codec/c++/schema.h +++ b/modules/codec/c++/schema.h @@ -28,14 +28,6 @@ struct Union<Member<V, K>...> {}; template <typename T, size_t Dim = 1> struct Array {}; -template <class T> struct is_array { - constexpr static bool value = false; -}; - -template <class T, size_t Dim> struct is_array<schema::Array<T,Dim>> { - constexpr static bool value = true; -}; - template<typename T, size_t... S> struct FixedArray {}; template <typename... T> struct Tuple {}; @@ -55,6 +47,7 @@ class Wrapper {}; struct String {}; + struct SignedInteger {}; struct UnsignedInteger {}; struct FloatingPoint {}; @@ -106,4 +99,43 @@ struct Interface<Member<Function<Requests, Responses>,Names>...> {}; // NOLINTEND } // namespace schema +template <class T> struct is_struct { + constexpr static bool value = false; +}; + +template <class... V, string_literal... K> struct is_struct<schema::Struct<schema::Member<V,K>...>> { + constexpr static bool value = true; +}; + +template <class T> struct is_string { + constexpr static bool value = false; +}; + +template <> struct is_string<schema::String> { + constexpr static bool value = true; +}; + +template <class T> struct is_tuple { + constexpr static bool value = false; +}; + +template <class... T> struct is_tuple<schema::Tuple<T...>> { + constexpr static bool value = true; +}; + +template <class T> struct is_array { + constexpr static bool value = false; +}; + +template <class T, size_t Dim> struct is_array<schema::Array<T,Dim>> { + constexpr static bool value = true; +}; + +template <class T> struct is_primitive { + constexpr static bool value = false; +}; + +template <typename T, size_t N> struct is_primitive<schema::Primitive<T,N>> { + constexpr static bool value = true; +}; } // namespace saw |