From 8dad985328e2183b224300aa992951131956fdb3 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 23 Jan 2024 13:12:11 +0100 Subject: core,codec-json,codec-minecraft,codec-netcdf,codec,io-tls,io,io_codec,window,window-opengl: Renamed file endings and changed includes --- modules/codec/c++/schema.h | 172 --------------------------------------------- 1 file changed, 172 deletions(-) delete mode 100644 modules/codec/c++/schema.h (limited to 'modules/codec/c++/schema.h') diff --git a/modules/codec/c++/schema.h b/modules/codec/c++/schema.h deleted file mode 100644 index 4549916..0000000 --- a/modules/codec/c++/schema.h +++ /dev/null @@ -1,172 +0,0 @@ -#pragma once - -#include -#include - -namespace saw { -namespace schema { -// NOLINTBEGIN -template struct Member { - static constexpr string_literal name = "Member"; -}; - -template struct Struct { - static_assert( - always_false, - "This schema template doesn't support this type of template argument"); -}; - -template -struct Struct...> { - static constexpr string_literal name = "Struct"; -}; - -template struct Union { - static_assert( - always_false, - "This schema template doesn't support this type of template argument"); -}; - -template -struct Union...> { - static constexpr string_literal name = "Union"; -}; - -template struct Array { - static constexpr string_literal name = "Array"; -}; - -template struct FixedArray { - static constexpr string_literal name = "FixedArray"; -}; - -template struct Tuple { - static constexpr string_literal name = "Tuple"; -}; - -/** - * This acts as a separator of different encodings being mashed together - * For example we can transport any base64 encodings in JSON - * - * using WrappedExample = schema::Tuple< - * schema::Wrapper - * >; - * - * data ex_data; - */ -template -class Wrapper { - static constexpr string_literal name = "Wrapper"; -}; - -struct String { - static constexpr string_literal name = "String"; -}; - - -struct SignedInteger { - static constexpr string_literal name = "SignedInteger"; -}; -struct UnsignedInteger { - static constexpr string_literal name = "UnsignedInteger"; -}; -struct FloatingPoint { - static constexpr string_literal name = "FloatingPoint"; -}; - -template struct Primitive { - static_assert(((std::is_same_v || - std::is_same_v)&&(N == 1 || N == 2 || - N == 4 || N == 8)) || - (std::is_same_v && (N == 4 || N == 8)), - "Primitive Type is not supported"); - static constexpr string_literal name = "Primitive"; -}; - -using Int8 = Primitive; -using Int16 = Primitive; -using Int32 = Primitive; -using Int64 = Primitive; - -using UInt8 = Primitive; -using UInt16 = Primitive; -using UInt32 = Primitive; -using UInt64 = Primitive; - -using Float32 = Primitive; -using Float64 = Primitive; - -/** - * Classes allowing to distinguish Ints from VarInts - */ -template -struct VariableLengthPrimitive { - static constexpr string_literal name = "VariableLengthPrimitive"; -}; - -using VarInt = VariableLengthPrimitive; -using VarLong = VariableLengthPrimitive; - -/** - * Classes enabling Rpc calls - */ -template -struct Function { - static constexpr string_literal name = "Function"; -}; - -template struct Interface { - static_assert( - always_false, - "This schema template doesn't support this type of template argument"); - - static constexpr string_literal name = "Interface"; -}; - -template -struct Interface,Names>...> { - static constexpr string_literal name = "Interface"; -}; - -// NOLINTEND -} // namespace schema -template struct is_struct { - constexpr static bool value = false; -}; - -template struct is_struct...>> { - constexpr static bool value = true; -}; - -template struct is_string { - constexpr static bool value = false; -}; - -template <> struct is_string { - constexpr static bool value = true; -}; - -template struct is_tuple { - constexpr static bool value = false; -}; - -template struct is_tuple> { - constexpr static bool value = true; -}; - -template struct is_array { - constexpr static bool value = false; -}; - -template struct is_array> { - constexpr static bool value = true; -}; - -template struct is_primitive { - constexpr static bool value = false; -}; - -template struct is_primitive> { - constexpr static bool value = true; -}; -} // namespace saw -- cgit v1.2.3