diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-04-11 15:29:04 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-04-11 15:29:04 +0200 |
commit | 188692a048b28361f91150b2e93804dfb944bf9c (patch) | |
tree | 83ddf60264bda299d4be075728f8e6213f1404d5 /modules/codec/c++/schema.hpp | |
parent | 5c6ceae33853af5c04adf9d46804e878f58e7893 (diff) |
codec: Added mixed precision schema and implemented their native data
type
Diffstat (limited to 'modules/codec/c++/schema.hpp')
-rw-r--r-- | modules/codec/c++/schema.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/codec/c++/schema.hpp b/modules/codec/c++/schema.hpp index 3c5bce5..3d20c10 100644 --- a/modules/codec/c++/schema.hpp +++ b/modules/codec/c++/schema.hpp @@ -102,7 +102,7 @@ using Float64 = Primitive<FloatingPoint, 8>; /** * Classes allowing to distinguish Ints from VarInts */ -template<typename T, std::size_t MaxLen> +template<typename T, uint64_t MaxLen> struct VariableLengthPrimitive { static constexpr string_literal name = "VariableLengthPrimitive"; }; @@ -110,6 +110,15 @@ struct VariableLengthPrimitive { using VarInt = VariableLengthPrimitive<SignedInteger, 5>; using VarLong = VariableLengthPrimitive<SignedInteger, 10>; +template<typename PrimA, typename PrimB> +struct MixedPrecision { + using InterfaceSchema = PrimA; + using StorageSchema = PrimB; + + static_assert(is_primitive<PrimA>::value, "InterfaceSchema needs to be a Primitive"); + static_assert(is_primitive<PrimB>::value, "StorageSchema needs to be a Primitive"); +}; + /** * Classes enabling Rpc calls */ |