From f2c255560d4ac83bdcb87c2d1a75a95ec540508c Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sun, 10 Mar 2024 19:27:46 +0100 Subject: codec,tools: Fixed Header generation --- modules/codec/c++/schema.hpp | 3 +++ modules/codec/c++/schema_hash.hpp | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'modules/codec') diff --git a/modules/codec/c++/schema.hpp b/modules/codec/c++/schema.hpp index 5348cfe..82fc0a5 100644 --- a/modules/codec/c++/schema.hpp +++ b/modules/codec/c++/schema.hpp @@ -116,6 +116,9 @@ using VarLong = VariableLengthPrimitive; template struct Function { static constexpr string_literal name = "Function"; + + using RequestT = Request; + using ResponseT = Response; }; template struct Interface { diff --git a/modules/codec/c++/schema_hash.hpp b/modules/codec/c++/schema_hash.hpp index 90ab208..5e44497 100644 --- a/modules/codec/c++/schema_hash.hpp +++ b/modules/codec/c++/schema_hash.hpp @@ -125,6 +125,18 @@ struct schema_hash_seed> { } }; +template +struct schema_hash_seed> { + using Schema = schema::Member; + + static constexpr uint32_t apply(uint32_t seed){ + seed = hash_literal::apply(seed); + seed = schema_hash_seed::apply(seed); + seed = hash_literal::apply(seed); + return seed; + } +}; + template struct schema_hash_seed...>> { using Schema = schema::Struct...>; @@ -135,9 +147,7 @@ struct schema_hash_seed...>> { constexpr string_literal Lit = parameter_key_pack_type::literal; using MemberT = typename parameter_pack_type...>::type; - seed = hash_literal::apply(seed); - seed = schema_hash_seed::apply(seed); - seed = hash_literal::apply(seed); + seed = schema_hash_seed::apply(seed); if constexpr ( (i+1) < sizeof...(V) ){ return apply_ele(seed); @@ -176,9 +186,7 @@ struct schema_hash_seed...>> { constexpr string_literal Lit = parameter_key_pack_type::literal; using MemberT = schema::Member; - seed = hash_literal::apply(seed); - seed = schema_hash_seed::apply(seed); - seed = hash_literal::apply(seed); + seed = schema_hash_seed::apply(seed); if constexpr ( (i+1) < sizeof...(T) ){ return apply_ele(seed); -- cgit v1.2.3