diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-01-05 05:58:49 +0100 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-01-05 05:58:49 +0100 |
commit | 70a3abcb3aad4c5e74b4b9fa6ac76508ac157f55 (patch) | |
tree | 07f6516c19fd4f5eda0c7a5c8cb440570eafccfb /modules/codec/c++/schema.h | |
parent | 162e5c5da90f4316725086fa6a2ae13b3c22104e (diff) |
codec: Adding a basic csv decoder. Unfinished
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 |