diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-10-17 02:30:52 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-10-17 02:30:52 +0200 |
commit | e933ccb59c7f032d2ffc5c5f7046317a06e85e14 (patch) | |
tree | db0992ce4d337d9a0f3761fd111385a38f71af45 /c++/codec | |
parent | 37a120868976520c54a9df29d246c68c599bf917 (diff) |
codec,codec-minecraft: Adding basic foundations needed for the minecraft
protocol
Diffstat (limited to 'c++/codec')
-rw-r--r-- | c++/codec/schema.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/c++/codec/schema.h b/c++/codec/schema.h index ba6dd4c..a8494fe 100644 --- a/c++/codec/schema.h +++ b/c++/codec/schema.h @@ -81,9 +81,18 @@ using Float32 = Primitive<FloatingPoint, 4>; using Float64 = Primitive<FloatingPoint, 8>; /** + * Classes allowing to distinguish Ints from VarInts + */ +template<typename T, std::size_t MaxLen> +struct VariableLengthPrimitive {}; + +using VarInt = VariableLengthPrimitive<SignedInteger, 5>; +using VarLong = VariableLengthPrimitive<SignedInteger, 10>; + +/** * Classes enabling Rpc calls */ -template <class Request, class Response, string_literal Literal> +template <class Request, class Response> struct Function {}; template <class... T> struct Interface { @@ -92,8 +101,8 @@ template <class... T> struct Interface { "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>...> {}; +template <class... Requests, class... Responses, string_literal... Names> +struct Interface<Member<Function<Requests, Responses>,Names>...> {}; // NOLINTEND } // namespace schema |