diff options
author | Claudius Holeksa <mail@keldu.de> | 2023-05-03 20:34:02 +0200 |
---|---|---|
committer | Claudius Holeksa <mail@keldu.de> | 2023-05-03 20:34:02 +0200 |
commit | 2aa2af0007b7e969845642027c635cd3fd9c8aea (patch) | |
tree | e72a05a3c2bfe58442b160c0c8e98ce1d095f36f /forstio/codec/schema.h | |
parent | 9b81a2585142260f89d47cbe1e592cec9e1f778f (diff) |
Moved dirs and added codec-json dir
Diffstat (limited to 'forstio/codec/schema.h')
-rw-r--r-- | forstio/codec/schema.h | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/forstio/codec/schema.h b/forstio/codec/schema.h deleted file mode 100644 index b23aaa1..0000000 --- a/forstio/codec/schema.h +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once - -#include <forstio/common.h> -#include <forstio/string_literal.h> - -namespace saw { -namespace schema { -// NOLINTBEGIN -template <typename T, string_literal Literal> struct NamedMember {}; - -template <typename... T> struct Struct { - static_assert( - always_false<T...>, - "This schema template doesn't support this type of template argument"); -}; - -template <typename... V, string_literal... K> -struct Struct<NamedMember<V, K>...> {}; - -template <typename... T> struct Union { - static_assert( - always_false<T...>, - "This schema template doesn't support this type of template argument"); -}; - -template <typename... V, string_literal... K> -struct Union<NamedMember<V, K>...> {}; - -template <typename T> struct Array {}; - -template<typename T, size_t S> FixedArray {}; - -template <typename... T> struct Tuple {}; - -struct String {}; - -struct SignedInteger {}; -struct UnsignedInteger {}; -struct FloatingPoint {}; - -template <class T, size_t N> struct Primitive { - static_assert(((std::is_same_v<T, SignedInteger> || - std::is_same_v<T, UnsignedInteger>)&&(N == 1 || N == 2 || - N == 4 || N == 8)) || - (std::is_same_v<T, FloatingPoint> && (N == 4 || N == 8)), - "Primitive Type is not supported"); -}; - -using Int8 = Primitive<SignedInteger, 1>; -using Int16 = Primitive<SignedInteger, 2>; -using Int32 = Primitive<SignedInteger, 4>; -using Int64 = Primitive<SignedInteger, 8>; - -using UInt8 = Primitive<UnsignedInteger, 1>; -using UInt16 = Primitive<UnsignedInteger, 2>; -using UInt32 = Primitive<UnsignedInteger, 4>; -using UInt64 = Primitive<UnsignedInteger, 8>; - -using Float32 = Primitive<FloatingPoint, 4>; -using Float64 = Primitive<FloatingPoint, 8>; - -/** - * Classes enabling Rpc calls - */ -template <class Request, class Response, string_literal Literal> -struct Function {}; - -template <class... T> struct Interface { - static_assert( - always_false<T...>, - "This schema template doesn't support this type of template argument"); -}; - -template <class... Request, class... Response, string_literal... Literal> -struct Interface<Function<Request, Response, Literal>...> {}; - -// NOLINTEND -} // namespace schema -} // namespace saw |