diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 74b14e526..6796f63eb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -56,6 +56,7 @@ RUN apt install -y \ xvfb \ gdb \ protobuf-compiler \ + protobuf-compiler protobuf-compiler-grpc \ bear \ libzmq3-dev \ rr diff --git a/.gitignore b/.gitignore index 8f7d7a5fb..76049fcd6 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ ### R ### .RData .Rhistory +external/R/doc/manual/*.html +external/R/doc/NEWS.pdf ..Rcheck ### C ### diff --git a/.idea/code.iml b/.idea/code.iml deleted file mode 100644 index d6ebd4805..000000000 --- a/.idea/code.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 8b9dc5d07..09665c35f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,6 +4,7 @@ @@ -56,7 +57,7 @@ - + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 23968dc67..000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.jqwik-database b/.jqwik-database deleted file mode 100644 index 711006c3d..000000000 Binary files a/.jqwik-database and /dev/null differ diff --git a/.vscode/settings.json b/.vscode/settings.json index 8f2b7113d..930796ee5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,77 @@ { - "java.compile.nullAnalysis.mode": "disabled" + "java.compile.nullAnalysis.mode": "disabled", + "files.associations": { + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "*.tcc": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "cinttypes": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "compare": "cpp", + "complex": "cpp", + "concepts": "cpp", + "condition_variable": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "list": "cpp", + "map": "cpp", + "set": "cpp", + "string": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "format": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "numbers": "cpp", + "ostream": "cpp", + "semaphore": "cpp", + "shared_mutex": "cpp", + "span": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "stop_token": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "cfenv": "cpp", + "typeinfo": "cpp", + "variant": "cpp", + "text_encoding": "cpp", + "expected": "cpp" + } } \ No newline at end of file diff --git a/README.md b/README.md index 66da8e329..6aaff9067 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ If the dev container is too slow, you can also setup on the host machine. To do - **Solution:** ensure you have a Java 22 JDK installed, then run `JAVA_HOME= mvn …` - e.g. if using IntelliJ on macOS, openJDK 22, set `JAVA_HOME=~/Library/Java/JavaVirtualMachines/openjdk-22/Contents/Home` - In the devcontainer, `JAVA_HOME=/usr/lib/jvm/jdk` +- **Problem:** some R symbols are not visible when JIT-compiling. + - **Solution:** make sure that `external/R` is up-to-date with `git submodule update --init --recursive` and check if it is the right branch, `RSH-4-3-2`. If you have a different issue than the above, [report it on GitHub](https://github.com/PRL-PRG/r-compile-server/issues/new/choose). diff --git a/client/protocol/Makefile b/client/protocol/Makefile deleted file mode 100644 index 9ba7e67dc..000000000 --- a/client/protocol/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -CPP_DEST := ../rsh/src -JAVA_DEST := ../../server/src/main/java - -all: - protoc --cpp_out=$(CPP_DEST) --java_out=$(JAVA_DEST) protocol.proto diff --git a/client/protocol/protocol.proto b/client/protocol/protocol.proto deleted file mode 100644 index 48a03de62..000000000 --- a/client/protocol/protocol.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.prlprg.server.protocol"; - -package rsh.server.protocol; - -message Request { - oneof payload { - HandshakeRequest handshake = 1; - CompileRequest compile = 2; - } -} - -message HandshakeRequest { - string Rsh_version = 1; - string R_version = 2; - string platform = 3; - repeated string packages = 4; -} - -message CompileRequest { - string name = 2; - // the closure to be compiled as CLOSXP - bytes closure = 3; - uint32 bc_optimization = 4; - uint32 cc_optimization = 5; -} - -message CompiledFunction { - string name = 2; - // content of the object file as spilled by the compiler - bytes native_code = 3; - // the constants used by the native code as VECSXP - bytes constants = 4; -} - -message CompileResponse { - oneof data { - string failure = 2; - CompiledFunction result = 3; - } -} diff --git a/client/rsh/Makefile b/client/rsh/Makefile index 0f6ac8196..7b1d039ca 100644 --- a/client/rsh/Makefile +++ b/client/rsh/Makefile @@ -83,3 +83,5 @@ benchmark: fi; \ done +test6: + $(LLVM_R) -f test6.R \ No newline at end of file diff --git a/client/rsh/NAMESPACE b/client/rsh/NAMESPACE index 669b869c5..72b0b703b 100644 --- a/client/rsh/NAMESPACE +++ b/client/rsh/NAMESPACE @@ -1,5 +1,6 @@ export(rsh_cmpfun) export(rsh_compile) +export(init_client) export(rsh_jit_disable) export(rsh_jit_enable) export(is_compiled) diff --git a/client/rsh/R/rsh.R b/client/rsh/R/rsh.R index 41d19a7ff..3aa7f09a2 100644 --- a/client/rsh/R/rsh.R +++ b/client/rsh/R/rsh.R @@ -6,6 +6,7 @@ NULL # save the original compiler::cmpfun .gnur_cmpfun <- compiler::cmpfun + # Because of the ORC JIT we need all the native symbols registered globally # (as RTLD_GLOBAL) so the ORC linker can find them. Unfortunatelly, R does # not provide a way to instruct the namespace loader to load pass the @@ -31,6 +32,19 @@ NULL ) .Call(C_initialize) + + # for the client, so that it is not GC-ed + env[[".rsh_client"]] <- init_client("0.0.0.0", 8980L) +} + +#' Initialize the Rsh client +#' +#' @param address IP address of the server +#' @param port port of the server +#' @export +init_client <- function(address="0.0.0.0", port=8980L) { + .rsh_client <- .Call(C_init_client, address, port, installed.packages()[,1]) + .rsh_client } #' Activate the Rsh JIT @@ -71,6 +85,10 @@ rsh_compile <- function(f, options) { options$inplace <- TRUE } + if(is.null(options$tier)) { + options$tier <- "optimized" + } + invisible(.Call(C_compile, f, options)) } @@ -118,3 +136,11 @@ rsh_override_cmpfun <- function(f) { lockBinding("cmpfun", compiler_ns) } +#' Get the total size of the messages sent +#' and received by the server, in bytes +#' @return integer vector of size 2, the first element is the total size of requests, +#' and the second element is the total size of responses +#' @export +rsh_total_size <- function() { + .Call(C_get_total_size) +} \ No newline at end of file diff --git a/client/rsh/inst/xxhash.hpp b/client/rsh/inst/xxhash.hpp new file mode 100644 index 000000000..886454841 --- /dev/null +++ b/client/rsh/inst/xxhash.hpp @@ -0,0 +1,2226 @@ +#pragma once +#include +#include +#include +#include +#include +#include + +/* +xxHash - Extremely Fast Hash algorithm +Header File +Copyright (C) 2012-2024, Yann Collet. +Copyright (C) 2017-2024, Red Gavin. +All rights reserved. + +BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: +* Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +You can contact the author at : +- xxHash source repository : https://github.com/Cyan4973/xxHash +- xxHash C++ port repository : https://github.com/RedSpah/xxhash_cpp +*/ + +/* Intrinsics +* Sadly has to be included in the global namespace or literally everything breaks +*/ +#if (defined(__ARM_NEON) && defined(__APPLE__)) +#include "sse2neon.h" +#else +#include +#endif + +namespace xxh +{ + /* ************************************* + * Versioning + ***************************************/ + + namespace version + { + constexpr int cpp_version_major = 0; + constexpr int cpp_version_minor = 8; + constexpr int cpp_version_release = 1; + } + + constexpr uint32_t version_number() + { + return version::cpp_version_major * 10000 + version::cpp_version_minor * 100 + version::cpp_version_release; + } + + + /* ************************************* + * Basic Types - Predefining uint128_t for intrin + ***************************************/ + + namespace typedefs + { + struct alignas(16) uint128_t + { + uint64_t low64 = 0; + uint64_t high64 = 0; + + bool operator==(const uint128_t & other) + { + return (low64 == other.low64 && high64 == other.high64); + } + + bool operator>(const uint128_t & other) + { + return (high64 > other.high64 || low64 > other.low64); + } + + bool operator>=(const uint128_t & other) + { + return (*this > other || *this == other); + } + + bool operator<(const uint128_t & other) + { + return !(*this >= other); + } + + bool operator<=(const uint128_t & other) + { + return !(*this > other); + } + + bool operator!=(const uint128_t & other) + { + return !(*this == other); + } + + uint128_t(uint64_t low, uint64_t high) : low64(low), high64(high) {} + + uint128_t() {} + }; + + } + + using uint128_t = typedefs::uint128_t; + + + /* ************************************* + * Compiler / Platform Specific Features + ***************************************/ + + namespace intrin + { + /*!XXH_CPU_LITTLE_ENDIAN : + * This is a CPU endian detection macro, will be + * automatically set to 1 (little endian) if it is left undefined. + * If compiling for a big endian system (why), XXH_CPU_LITTLE_ENDIAN has to be explicitly defined as 0. + */ +#ifndef XXH_CPU_LITTLE_ENDIAN +# define XXH_CPU_LITTLE_ENDIAN 1 +#endif + + + /* Vectorization Detection + * NOTE: XXH_NEON and XXH_VSX aren't supported in this C++ port. + * The primary reason is that I don't have access to an ARM and PowerPC + * machines to test them, and the secondary reason is that I even doubt anyone writing + * code for such machines would bother using a C++ port rather than the original C version. + */ +#ifndef XXH_VECTOR /* can be predefined on command line */ +# if defined(__AVX512F__) +# define XXH_VECTOR 3 /* AVX512 for Skylake and Icelake */ +# elif defined(__AVX2__) +# define XXH_VECTOR 2 /* AVX2 for Haswell and Bulldozer */ +# elif defined(__SSE2__) || defined(_M_AMD64) || defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP == 2)) +# define XXH_VECTOR 1 /* SSE2 for Pentium 4 and all x86_64 */ +# else +# define XXH_VECTOR 0 /* Portable scalar version */ +# endif +#endif + + constexpr int vector_mode = XXH_VECTOR; + +#if XXH_VECTOR == 3 /* AVX512 for Skylake and Icelake */ + constexpr int acc_align = 64; + using avx512_underlying = __m512i; + using avx2_underlying = __m256i; + using sse2_underlying = __m128i; +#elif XXH_VECTOR == 2 /* AVX2 for Haswell and Bulldozer */ + constexpr int acc_align = 32; + using avx512_underlying = void; + using avx2_underlying = __m256i; + using sse2_underlying = __m128i; +#elif XXH_VECTOR == 1 /* SSE2 for Pentium 4 and all x86_64 */ + using avx512_underlying = void; + using avx2_underlying = void; //std::array<__m128i, 2>; + using sse2_underlying = __m128i; + constexpr int acc_align = 16; +#else /* Portable scalar version */ + using avx512_underlying = void; + using avx2_underlying = void; //std::array; + using sse2_underlying = void; //std::array; + constexpr int acc_align = 8; +#endif + + + /* Compiler Specifics + * Defines inline macros and includes specific compiler's instrinsics. + * */ +#ifdef XXH_FORCE_INLINE /* First undefining the symbols in case they're already defined */ +# undef XXH_FORCE_INLINE +#endif +#ifdef XXH_NO_INLINE +# undef XXH_NO_INLINE +#endif + +#ifdef _MSC_VER /* Visual Studio */ +# pragma warning(disable : 4127) +# define XXH_FORCE_INLINE static __forceinline +# define XXH_NO_INLINE static __declspec(noinline) +# include +#elif defined(__GNUC__) /* Clang / GCC */ +# define XXH_FORCE_INLINE static inline __attribute__((always_inline)) +# define XXH_NO_INLINE static __attribute__((noinline)) +#if (defined(__ARM_NEON) && defined(__APPLE__)) +# include "sse2neon.h" +# else +# include +# endif +#else +# define XXH_FORCE_INLINE static inline +# define XXH_NO_INLINE static +#endif + + + /* Prefetch + * Can be disabled by defining XXH_NO_PREFETCH + */ +#if defined(XXH_NO_PREFETCH) + XXH_FORCE_INLINE void prefetch(const void* ptr) {} +#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) + XXH_FORCE_INLINE void prefetch(const void* ptr) { _mm_prefetch((const char*)(ptr), _MM_HINT_T0); } +#elif defined(__GNUC__) + XXH_FORCE_INLINE void prefetch(const void* ptr) { __builtin_prefetch((ptr), 0, 3); } +#else + XXH_FORCE_INLINE void prefetch(const void* ptr) {} +#endif + + + /* Restrict + * Defines macro for restrict, which in C++ is sadly just a compiler extension (for now). + * Can be disabled by defining XXH_NO_RESTRICT + */ +#ifdef XXH_RESTRICT +# undef XXH_RESTRICT +#endif + +#if (defined(__GNUC__) || defined(_MSC_VER)) && defined(__cplusplus) && !defined(XXH_NO_RESTRICT) +# define XXH_RESTRICT __restrict +#else +# define XXH_RESTRICT +#endif + + + /* Likely / Unlikely + * Defines macros for Likely / Unlikely, which are official in C++20, but sadly this library aims the previous standard. + * Not present on MSVC. + * Can be disabled by defining XXH_NO_BRANCH_HINTS + */ +#if ((defined(__GNUC__) && (__GNUC__ >= 3)) || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 800)) || defined(__clang__)) && !defined(XXH_NO_BRANCH_HINTS) +# define XXH_likely(x) __builtin_expect(x, 1) +# define XXH_unlikely(x) __builtin_expect(x, 0) +#else +# define XXH_likely(x) (x) +# define XXH_unlikely(x) (x) +#endif + + + namespace bit_ops + { +#if defined(_MSC_VER) + static inline uint32_t rotl32(uint32_t x, int32_t r) { return _rotl(x, r); } + static inline uint64_t rotl64(uint64_t x, int32_t r) { return _rotl64(x, r); } + static inline uint32_t rotr32(uint32_t x, int32_t r) { return _rotr(x, r); } + static inline uint64_t rotr64(uint64_t x, int32_t r) { return _rotr64(x, r); } +#else + static inline uint32_t rotl32(uint32_t x, int32_t r) { return ((x << r) | (x >> (32 - r))); } + static inline uint64_t rotl64(uint64_t x, int32_t r) { return ((x << r) | (x >> (64 - r))); } + static inline uint32_t rotr32(uint32_t x, int32_t r) { return ((x >> r) | (x << (32 - r))); } + static inline uint64_t rotr64(uint64_t x, int32_t r) { return ((x >> r) | (x << (64 - r))); } +#endif + + +#if defined(_MSC_VER) /* Visual Studio */ + static inline uint32_t swap32(uint32_t x) { return _byteswap_ulong(x); } + static inline uint64_t swap64(uint64_t x) { return _byteswap_uint64(x); } +#elif defined(__GNUC__) + static inline uint32_t swap32(uint32_t x) { return __builtin_bswap32(x); } + static inline uint64_t swap64(uint64_t x) { return __builtin_bswap64(x); } +#else + static inline uint32_t swap32(uint32_t x) { return ((x << 24) & 0xff000000) | ((x << 8) & 0x00ff0000) | ((x >> 8) & 0x0000ff00) | ((x >> 24) & 0x000000ff); } + static inline uint64_t swap64(uint64_t x) { return ((x << 56) & 0xff00000000000000ULL) | ((x << 40) & 0x00ff000000000000ULL) | ((x << 24) & 0x0000ff0000000000ULL) | ((x << 8) & 0x000000ff00000000ULL) | ((x >> 8) & 0x00000000ff000000ULL) | ((x >> 24) & 0x0000000000ff0000ULL) | ((x >> 40) & 0x000000000000ff00ULL) | ((x >> 56) & 0x00000000000000ffULL); } +#endif + + +#if defined(_MSC_VER) && defined(_M_IX86) // Only for 32-bit MSVC. + XXH_FORCE_INLINE uint64_t mult32to64(uint32_t x, uint32_t y) { return __emulu(x, y); } +#else + XXH_FORCE_INLINE uint64_t mult32to64(uint32_t x, uint32_t y) { return (uint64_t)(uint32_t)(x) * (uint64_t)(uint32_t)(y); } +#endif + + +#if defined(__GNUC__) && !defined(__clang__) && defined(__i386__) + __attribute__((__target__("no-sse"))) +#endif + static inline uint128_t mult64to128(uint64_t lhs, uint64_t rhs) + { + +#if defined(__GNUC__) && !defined(__wasm__) \ + && defined(__SIZEOF_INT128__) \ + || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 128) + + __uint128_t product = (__uint128_t)lhs * (__uint128_t)rhs; + uint128_t r128; + r128.low64 = (uint64_t)(product); + r128.high64 = (uint64_t)(product >> 64); + return r128; + +#elif defined(_M_X64) || defined(_M_IA64) + +#ifndef _MSC_VER +# pragma intrinsic(_umul128) +#endif + uint64_t product_high; + uint64_t const product_low = _umul128(lhs, rhs, &product_high); + uint128_t r128; + r128.low64 = product_low; + r128.high64 = product_high; + return r128; + +#else + uint64_t const lo_lo = bit_ops::mult32to64(lhs & 0xFFFFFFFF, rhs & 0xFFFFFFFF); + uint64_t const hi_lo = bit_ops::mult32to64(lhs >> 32, rhs & 0xFFFFFFFF); + uint64_t const lo_hi = bit_ops::mult32to64(lhs & 0xFFFFFFFF, rhs >> 32); + uint64_t const hi_hi = bit_ops::mult32to64(lhs >> 32, rhs >> 32); + + /* Now add the products together. These will never overflow. */ + uint64_t const cross = (lo_lo >> 32) + (hi_lo & 0xFFFFFFFF) + lo_hi; + uint64_t const upper = (hi_lo >> 32) + (cross >> 32) + hi_hi; + uint64_t const lower = (cross << 32) | (lo_lo & 0xFFFFFFFF); + + uint128_t r128; + r128.low64 = lower; + r128.high64 = upper; + return r128; +#endif + } + } + } + + + /* ************************************* + * Basic Types - Everything else + ***************************************/ + + namespace typedefs + { + /* ************************************* + * Basic Types - Detail + ***************************************/ + + template + struct hash_type + { + using type = void; + }; + + template <> + struct hash_type<32> + { + using type = uint32_t; + }; + + template <> + struct hash_type<64> + { + using type = uint64_t; + }; + + template <> + struct hash_type<128> + { + using type = uint128_t; + }; + + + template + struct vec_type + { + using type = void; + }; + + template <> + struct vec_type<64> + { + using type = uint64_t; + }; + + template <> + struct vec_type<128> + { + using type = intrin::sse2_underlying; + }; + + template <> + struct vec_type<256> + { + using type = intrin::avx2_underlying; + }; + + template <> + struct vec_type<512> + { + using type = intrin::avx512_underlying; + }; + + /* Rationale + * On the surface level uint_type appears to be pointless, + * as it is just a copy of hash_type. They do use the same types, + * that is true, but the reasoning for the difference is aimed at humans, + * not the compiler, as a difference between values that are 'just' numbers, + * and those that represent actual hash values. + */ + template + struct uint_type + { + using type = void; + }; + + template <> + struct uint_type<32> + { + using type = uint32_t; + }; + + template <> + struct uint_type<64> + { + using type = uint64_t; + }; + + template <> + struct uint_type<128> + { + using type = uint128_t; + }; + } + + template + using hash_t = typename typedefs::hash_type::type; + using hash32_t = hash_t<32>; + using hash64_t = hash_t<64>; + using hash128_t = hash_t<128>; + + template + using vec_t = typename typedefs::vec_type::type; + using vec64_t = vec_t<64>; + using vec128_t = vec_t<128>; + using vec256_t = vec_t<256>; + using vec512_t = vec_t<512>; + + template + using uint_t = typename typedefs::uint_type::type; + + + + /* ************************************* + * Bit Operations + ***************************************/ + + namespace bit_ops + { + /* **************************************** + * Bit Operations + ******************************************/ + + template + static inline uint_t rotl(uint_t n, int32_t r) + { + if constexpr (N == 32) + { + return intrin::bit_ops::rotl32(n, r); + } + + if constexpr (N == 64) + { + return intrin::bit_ops::rotl64(n, r); + } + } + + template + static inline uint_t rotr(uint_t n, int32_t r) + { + if constexpr (N == 32) + { + return intrin::bit_ops::rotr32(n, r); + } + + if constexpr (N == 64) + { + return intrin::bit_ops::rotr64(n, r); + } + } + + template + static inline uint_t swap(uint_t n) + { + if constexpr (N == 32) + { + return intrin::bit_ops::swap32(n); + } + + if constexpr (N == 64) + { + return intrin::bit_ops::swap64(n); + } + } + + template + static inline vec_t mul32to64(vec_t x, vec_t y) + { + if constexpr (N == 64) + { + return intrin::bit_ops::mult32to64(static_cast(x), static_cast(y)); + } + else + { + return 0; + } + } + + static inline uint128_t mul64to128(uint64_t x, uint64_t y) + { + return intrin::bit_ops::mult64to128(x, y); + } + + static inline uint64_t mul128fold64(uint64_t x, uint64_t y) + { + uint128_t product = mul64to128(x, y); + + return (product.low64 ^ product.high64); + } + } + + + /* ************************************* + * Memory Functions + ***************************************/ + + namespace mem_ops + { + + /* ************************************* + * Endianness + ***************************************/ + + constexpr bool is_little_endian() + { + return (XXH_CPU_LITTLE_ENDIAN == 1); + } + + + /* ************************************* + * Memory Access + ***************************************/ + + template + static inline uint_t read(const void* memPtr) + { + uint_t val; + + memcpy(&val, memPtr, sizeof(val)); + return val; + } + + template + static inline uint_t readLE(const void* ptr) + { + if constexpr (is_little_endian()) + { + return read(ptr); + } + else + { + return bit_ops::swap(read(ptr)); + } + } + + template + static inline uint_t readBE(const void* ptr) + { + if constexpr (is_little_endian()) + { + return bit_ops::swap(read(ptr)); + } + else + { + return read(ptr); + } + } + + template + static void writeLE(void* dst, uint_t v) + { + if constexpr (!is_little_endian()) + { + v = bit_ops::swap(v); + } + + memcpy(dst, &v, sizeof(v)); + } + } + + + /* ************************************* + * Vector Functions + ***************************************/ + + namespace vec_ops + { + template + XXH_FORCE_INLINE vec_t loadu(const vec_t* input) + { + static_assert(!(N != 128 && N != 256 && N != 64 && N != 512), "Invalid template argument passed to xxh::vec_ops::loadu"); + + if constexpr (N == 128) + { + return _mm_loadu_si128(input); + } + + if constexpr (N == 256) + { + return _mm256_loadu_si256(input); + } + + if constexpr (N == 512) + { + return _mm512_loadu_si512(input); + } + + if constexpr (N == 64) + { + return mem_ops::readLE<64>(input); + } + + } + + + // 'xorv' instead of 'xor' because 'xor' is a weird wacky alternate operator expression thing. + template + XXH_FORCE_INLINE vec_t xorv(vec_t a, vec_t b) + { + static_assert(!(N != 128 && N != 256 && N != 64 && N != 512), "Invalid argument passed to xxh::vec_ops::xorv"); + + if constexpr (N == 128) + { + return _mm_xor_si128(a, b); + } + + if constexpr (N == 256) + { + return _mm256_xor_si256(a, b); + } + + if constexpr (N == 512) + { + return _mm512_xor_si512(a, b); + } + + if constexpr (N == 64) + { + return a ^ b; + } + } + + + template + XXH_FORCE_INLINE vec_t mul(vec_t a, vec_t b) + { + static_assert(!(N != 128 && N != 256 && N != 64 && N != 512), "Invalid argument passed to xxh::vec_ops::mul"); + + if constexpr (N == 128) + { + return _mm_mul_epu32(a, b); + } + + if constexpr (N == 256) + { + return _mm256_mul_epu32(a, b); + } + + if constexpr (N == 512) + { + return _mm512_mul_epu32(a, b); + } + + if constexpr (N == 64) + { + return a * b; + } + } + + + template + XXH_FORCE_INLINE vec_t add(vec_t a, vec_t b) + { + static_assert(!(N != 128 && N != 256 && N != 64 && N != 512), "Invalid argument passed to xxh::vec_ops::add"); + + if constexpr (N == 128) + { + return _mm_add_epi64(a, b); + } + + if constexpr (N == 256) + { + return _mm256_add_epi64(a, b); + } + + if constexpr (N == 512) + { + return _mm512_add_epi64(a, b); + } + + if constexpr (N == 64) + { + return a + b; + } + } + + + template + XXH_FORCE_INLINE vec_t shuffle(vec_t a) + { + static_assert(!(N != 128 && N != 256 && N != 64 && N != 512), "Invalid argument passed to xxh::vec_ops::shuffle"); + + if constexpr (N == 128) + { + return _mm_shuffle_epi32(a, _MM_SHUFFLE(S1, S2, S3, S4)); + } + + if constexpr (N == 256) + { + return _mm256_shuffle_epi32(a, _MM_SHUFFLE(S1, S2, S3, S4)); + } + + if constexpr (N == 512) + { + return _mm512_shuffle_epi32(a, _MM_SHUFFLE(S1, S2, S3, S4)); + } + + if constexpr (N == 64) + { + return a; + } + } + + + template + XXH_FORCE_INLINE vec_t set1(int64_t a) + { + +#if (defined(__ARM_NEON) && defined(__APPLE__)) + static_assert(!(N != 128 && N != 64), "Invalid argument passed to xxh::vec_ops::set1"); +#else + static_assert(!(N != 128 && N != 256 && N != 64 && N != 512), "Invalid argument passed to xxh::vec_ops::set1"); + if constexpr (N == 256) + { + return _mm256_set1_epi32(static_cast(a)); + } + + if constexpr (N == 512) + { + return _mm512_set1_epi32(static_cast(a)); + } +#endif + + if constexpr (N == 128) + { + return _mm_set1_epi32(static_cast(a)); + } + + if constexpr (N == 64) + { + return a; + } + } + + + template + XXH_FORCE_INLINE vec_t srli(vec_t n, int a) + { + static_assert(!(N != 128 && N != 256 && N != 64 && N != 512), "Invalid argument passed to xxh::vec_ops::srli"); + + if constexpr (N == 128) + { + return _mm_srli_epi64(n, a); + } + + if constexpr (N == 256) + { + return _mm256_srli_epi64(n, a); + } + + if constexpr (N == 512) + { + return _mm512_srli_epi64(n, a); + } + + if constexpr (N == 64) + { + return n >> a; + } + } + + + template + XXH_FORCE_INLINE vec_t slli(vec_t n, int a) + { + static_assert(!(N != 128 && N != 256 && N != 64 && N != 512), "Invalid argument passed to xxh::vec_ops::slli"); + + if constexpr (N == 128) + { + return _mm_slli_epi64(n, a); + } + + if constexpr (N == 256) + { + return _mm256_slli_epi64(n, a); + } + + if constexpr (N == 512) + { + return _mm512_slli_epi64(n, a); + } + + if constexpr (N == 64) + { + return n << a; + } + } + } + + /* ************************************* + * Canonical represenation + ***************************************/ + + template + struct canonical_t + { + std::array digest{ 0 }; + + canonical_t(hash_t hash) + { + if constexpr (bit_mode < 128) + { + if (mem_ops::is_little_endian()) + { + hash = bit_ops::swap(hash); + } + + memcpy(digest.data(), &hash, sizeof(canonical_t)); + } + else + { + if (mem_ops::is_little_endian()) + { + hash.low64 = bit_ops::swap<64>(hash.low64); + hash.high64 = bit_ops::swap<64>(hash.high64); + } + + memcpy(digest.data(), &hash.high64, sizeof(hash.high64)); + memcpy(digest.data() + sizeof(hash.high64), &hash.low64, sizeof(hash.low64)); + } + } + + hash_t get_hash() const + { + if constexpr (bit_mode < 128) + { + return mem_ops::readBE(&digest); + } + else + { + return { mem_ops::readBE<64>(&digest[8]), mem_ops::readBE<64>(&digest) }; + } + } + }; + + using canonical32_t = canonical_t<32>; + using canonical64_t = canonical_t<64>; + using canonical128_t = canonical_t<128>; + + template + inline hash_t to_canonical(hash_t hash) + { + static_assert(!(bit_mode != 128 && bit_mode != 64 && bit_mode != 32), "Canonical form can only be obtained from 32, 64 and 128 bit hashes."); + canonical_t canon(hash); + hash_t res; + memcpy(&res, &canon, bit_mode / 8); + + return res; + } + + + /* ************************************* + * Algorithm Implementation - xxhash + ***************************************/ + + namespace detail + { + using namespace mem_ops; + using namespace bit_ops; + + + /* ************************************* + * Constants + ***************************************/ + + constexpr static std::array primes32 = { 2654435761U, 2246822519U, 3266489917U, 668265263U, 374761393U }; + constexpr static std::array primes64 = { 11400714785074694791ULL, 14029467366897019727ULL, 1609587929392839161ULL, 9650029242287828579ULL, 2870177450012600261ULL }; + + template + constexpr uint_t PRIME(uint64_t n) + { + if constexpr (N == 32) + { + return primes32[n - 1]; + } + else + { + return primes64[n - 1]; + } + } + + + /* ************************************* + * Functions + ***************************************/ + + template + XXH_FORCE_INLINE uint_t avalanche(uint_t hash) + { + if constexpr (N == 32) + { + hash ^= hash >> 15; + hash *= PRIME<32>(2); + hash ^= hash >> 13; + hash *= PRIME<32>(3); + hash ^= hash >> 16; + return hash; + } + else if constexpr (N == 64) + { + hash ^= hash >> 33; + hash *= PRIME<64>(2); + hash ^= hash >> 29; + hash *= PRIME<64>(3); + hash ^= hash >> 32; + return hash; + } + else return 0; + } + + template + XXH_FORCE_INLINE uint_t round(uint_t seed, uint_t input) + { + seed += input * PRIME(2); + + if constexpr (N == 32) + { + seed = rotl(seed, 13); + } + else + { + seed = rotl(seed, 31); + } + + seed *= PRIME(1); + return seed; + } + + XXH_FORCE_INLINE uint64_t mergeRound64(hash64_t acc, uint64_t val) + { + val = round<64>(0, val); + acc ^= val; + acc = acc * PRIME<64>(1) + PRIME<64>(4); + return acc; + } + + XXH_FORCE_INLINE void endian_align_sub_mergeround(hash64_t& hash_ret, uint64_t v1, uint64_t v2, uint64_t v3, uint64_t v4) + { + hash_ret = mergeRound64(hash_ret, v1); + hash_ret = mergeRound64(hash_ret, v2); + hash_ret = mergeRound64(hash_ret, v3); + hash_ret = mergeRound64(hash_ret, v4); + } + + template + static inline hash_t endian_align_sub_ending(hash_t hash_ret, const uint8_t* p, const uint8_t* bEnd) + { + if constexpr (N == 32) + { + while ((p + 4) <= bEnd) + { + hash_ret += readLE<32>(p) * PRIME<32>(3); + hash_ret = rotl<32>(hash_ret, 17) * PRIME<32>(4); + p += 4; + } + + while (p < bEnd) + { + hash_ret += (*p) * PRIME<32>(5); + hash_ret = rotl<32>(hash_ret, 11) * PRIME<32>(1); + p++; + } + + return avalanche<32>(hash_ret); + } + else + { + while (p + 8 <= bEnd) + { + const uint64_t k1 = round<64>(0, readLE<64>(p)); + + hash_ret ^= k1; + hash_ret = rotl<64>(hash_ret, 27) * PRIME<64>(1) + PRIME<64>(4); + p += 8; + } + + if (p + 4 <= bEnd) + { + hash_ret ^= static_cast(readLE<32>(p))* PRIME<64>(1); + hash_ret = rotl<64>(hash_ret, 23) * PRIME<64>(2) + PRIME<64>(3); + p += 4; + } + + while (p < bEnd) + { + hash_ret ^= (*p) * PRIME<64>(5); + hash_ret = rotl<64>(hash_ret, 11) * PRIME<64>(1); + p++; + } + + return avalanche<64>(hash_ret); + } + } + + template + static inline hash_t endian_align(const void* input, size_t len, uint_t seed) + { + static_assert(!(N != 32 && N != 64), "You can only call endian_align in 32 or 64 bit mode."); + + const uint8_t* p = static_cast(input); + const uint8_t* bEnd = p + len; + hash_t hash_ret; + + if (len >= (N / 2)) + { + const uint8_t* const limit = bEnd - (N / 2); + uint_t v1 = seed + PRIME(1) + PRIME(2); + uint_t v2 = seed + PRIME(2); + uint_t v3 = seed + 0; + uint_t v4 = seed - PRIME(1); + + do + { + v1 = round(v1, readLE(p)); + p += (N / 8); + v2 = round(v2, readLE(p)); + p += (N / 8); + v3 = round(v3, readLE(p)); + p += (N / 8); + v4 = round(v4, readLE(p)); + p += (N / 8); + } + while (p <= limit); + + hash_ret = rotl(v1, 1) + rotl(v2, 7) + rotl(v3, 12) + rotl(v4, 18); + + if constexpr (N == 64) + { + endian_align_sub_mergeround(hash_ret, v1, v2, v3, v4); + } + } + else + { + hash_ret = seed + PRIME(5); + } + + hash_ret += static_cast>(len); + + return endian_align_sub_ending(hash_ret, p, bEnd); + } + } + + + /* ************************************* + * Algorithm Implementation - xxhash3 + ***************************************/ + + namespace detail3 + { + using namespace vec_ops; + using namespace detail; + using namespace mem_ops; + using namespace bit_ops; + + + /* ************************************* + * Enums + ***************************************/ + + enum class vec_mode : uint8_t { scalar = 0, sse2 = 1, avx2 = 2, avx512 = 3 }; + + + /* ************************************* + * Constants + ***************************************/ + + constexpr uint64_t secret_default_size = 192; + constexpr uint64_t secret_size_min = 136; + constexpr uint64_t secret_consume_rate = 8; + constexpr uint64_t stripe_len = 64; + constexpr uint64_t acc_nb = 8; + constexpr uint64_t prefetch_distance = 384; + constexpr uint64_t secret_lastacc_start = 7; + constexpr uint64_t secret_mergeaccs_start = 11; + constexpr uint64_t midsize_max = 240; + constexpr uint64_t midsize_startoffset = 3; + constexpr uint64_t midsize_lastoffset = 17; + + constexpr vec_mode vector_mode = static_cast(intrin::vector_mode); + constexpr uint64_t acc_align = intrin::acc_align; + constexpr std::array vector_bit_width { 64, 128, 256, 512 }; + + + /* ************************************* + * Defaults + ***************************************/ + + alignas(64) constexpr uint8_t default_secret[secret_default_size] = { + 0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, 0xf7, 0x21, 0xad, 0x1c, + 0xde, 0xd4, 0x6d, 0xe9, 0x83, 0x90, 0x97, 0xdb, 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f, + 0xcb, 0x79, 0xe6, 0x4e, 0xcc, 0xc0, 0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21, + 0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0, 0x35, 0x90, 0xe6, 0x81, 0x3a, 0x26, 0x4c, + 0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, 0x88, 0xd0, 0x65, 0x8b, 0x1b, 0x53, 0x2e, 0xa3, + 0x71, 0x64, 0x48, 0x97, 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac, 0xd8, + 0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, 0xc7, 0x0b, 0x4f, 0x1d, + 0x8a, 0x51, 0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64, + 0xea, 0xc5, 0xac, 0x83, 0x34, 0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb, + 0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49, 0xd3, 0x16, 0x55, 0x26, 0x29, 0xd4, 0x68, 0x9e, + 0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, 0x8f, 0xf8, 0xb8, 0xd1, 0x7a, 0xd0, 0x31, 0xce, + 0x45, 0xcb, 0x3a, 0x8f, 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e, + }; + + constexpr std::array init_acc = { PRIME<32>(3), PRIME<64>(1), PRIME<64>(2), PRIME<64>(3), PRIME<64>(4), PRIME<32>(2), PRIME<64>(5), PRIME<32>(1) }; + + + /* ************************************* + * Functions + ***************************************/ + + XXH_FORCE_INLINE hash_t<64> avalanche(hash_t<64> h64) + { + constexpr uint64_t avalanche_mul_prime = 0x165667919E3779F9ULL; + + h64 ^= h64 >> 37; + h64 *= avalanche_mul_prime; + h64 ^= h64 >> 32; + return h64; + } + + XXH_FORCE_INLINE hash_t<64> rrmxmx(hash_t<64> h64, uint64_t len) + { + h64 ^= rotl<64>(h64, 49) ^ rotl<64>(h64, 24); + h64 *= 0x9FB21C651E98DF25ULL; + h64 ^= (h64 >> 35) + len; + h64 *= 0x9FB21C651E98DF25ULL; + h64 ^= (h64 >> 28); + return h64; + } + + XXH_FORCE_INLINE void combine_16(void* dest, hash128_t h128) + { + writeLE<64>(dest, readLE<64>(dest) ^ h128.low64); + writeLE<64>((uint8_t*)dest + 8, readLE<64>((uint8_t*)dest + 8) ^ h128.high64); + } + + XXH_FORCE_INLINE void accumulate_512(void* XXH_RESTRICT acc, const void* XXH_RESTRICT input, const void* XXH_RESTRICT secret) + { + constexpr uint64_t bits = vector_bit_width[static_cast(vector_mode)]; + + using vec_t = vec_t; + + alignas(sizeof(vec_t)) vec_t* const xacc = static_cast(acc); + const vec_t* const xinput = static_cast(input); + const vec_t* const xsecret = static_cast(secret); + + for (size_t i = 0; i < stripe_len / sizeof(vec_t); i++) + { + vec_t const data_vec = loadu(xinput + i); + vec_t const key_vec = loadu(xsecret + i); + vec_t const data_key = xorv(data_vec, key_vec); + vec_t product = set1(0); + + if constexpr (vector_mode == vec_mode::scalar) + { + product = mul32to64(srli(slli(data_key, 32),32), srli(data_key, 32)); + xacc[i ^ 1] = add(xacc[i ^ 1], data_vec); + xacc[i] = add(xacc[i], product); + } + else + { + vec_t const data_key_lo = shuffle(data_key); + product = mul(data_key, data_key_lo); + + vec_t const data_swap = shuffle(data_vec); + vec_t const sum = add(xacc[i], data_swap); + xacc[i] = add(sum, product); + } + } + } + + XXH_FORCE_INLINE void scramble_acc(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) + { + constexpr uint64_t bits = vector_bit_width[static_cast(vector_mode)];; + + using vec_t = vec_t; + + alignas(sizeof(vec_t)) vec_t* const xacc = (vec_t*)acc; + const vec_t* const xsecret = (const vec_t*)secret; + + for (size_t i = 0; i < stripe_len / sizeof(vec_t); i++) + { + vec_t const acc_vec = xacc[i]; + vec_t const shifted = srli(acc_vec, 47); + vec_t const data_vec = xorv(acc_vec, shifted); + vec_t const key_vec = loadu(xsecret + i); + vec_t const data_key = xorv(data_vec, key_vec); + + if constexpr (vector_mode == vec_mode::scalar) + { + xacc[i] = mul(data_key, set1(PRIME<32>(1))); + } + else + { + vec_t const prime32 = set1(PRIME<32>(1)); + vec_t const data_key_hi = shuffle(data_key); + vec_t const prod_lo = mul(data_key, prime32); + vec_t const prod_hi = mul(data_key_hi, prime32); + + xacc[i] = add(prod_lo, vec_ops::slli(prod_hi, 32)); + } + } + } + + XXH_FORCE_INLINE void accumulate(uint64_t* XXH_RESTRICT acc, const uint8_t* XXH_RESTRICT input, const uint8_t* XXH_RESTRICT secret, size_t nbStripes) + { + for (size_t n = 0; n < nbStripes; n++) + { + const uint8_t* const in = input + n * stripe_len; + + intrin::prefetch(in + prefetch_distance); + accumulate_512(acc, in, secret + n * secret_consume_rate); + } + } + + XXH_FORCE_INLINE void hash_long_internal_loop(uint64_t* XXH_RESTRICT acc, const uint8_t* XXH_RESTRICT input, size_t len, const uint8_t* XXH_RESTRICT secret, size_t secretSize) + { + size_t const nb_rounds = (secretSize - stripe_len) / secret_consume_rate; + size_t const block_len = stripe_len * nb_rounds; + size_t const nb_blocks = (len-1) / block_len; + + for (size_t n = 0; n < nb_blocks; n++) + { + accumulate(acc, input + n * block_len, secret, nb_rounds); + scramble_acc(acc, secret + secretSize - stripe_len); + } + + /* last partial block */ + size_t const nbStripes = ((len - 1) - (block_len * nb_blocks)) / stripe_len; + + accumulate(acc, input + nb_blocks * block_len, secret, nbStripes); + + /* last stripe */ + const uint8_t* const p = input + len - stripe_len; + + accumulate_512(acc, p, secret + secretSize - stripe_len - secret_lastacc_start); + } + + XXH_FORCE_INLINE uint64_t mix_2_accs(const uint64_t* XXH_RESTRICT acc, const uint8_t* XXH_RESTRICT secret) + { + return mul128fold64(acc[0] ^ readLE<64>(secret), acc[1] ^ readLE<64>(secret + 8)); + } + + XXH_FORCE_INLINE uint64_t merge_accs(const uint64_t* XXH_RESTRICT acc, const uint8_t* XXH_RESTRICT secret, uint64_t start) + { + uint64_t result64 = start; + + result64 += mix_2_accs(acc + 0, secret + 0); + result64 += mix_2_accs(acc + 2, secret + 16); + result64 += mix_2_accs(acc + 4, secret + 32); + result64 += mix_2_accs(acc + 6, secret + 48); + + return avalanche(result64); + } + + XXH_FORCE_INLINE void init_custom_secret(uint8_t* customSecret, uint64_t seed) + { + for (uint64_t i = 0; i < secret_default_size / 16; i++) + { + writeLE<64>(customSecret + i * 16, readLE<64>(default_secret + i * 16) + seed); + writeLE<64>(customSecret + i * 16 + 8, readLE<64>(default_secret + i * 16 + 8) - seed); + } + } + + template + XXH_FORCE_INLINE hash_t len_1to3(const uint8_t* input, size_t len, const uint8_t* secret, uint64_t seed) + { + if constexpr (N == 64) + { + uint8_t const c1 = input[0]; + uint8_t const c2 = input[len >> 1]; + uint8_t const c3 = input[len - 1]; + uint32_t const combined = ((uint32_t)c1 << 16) | (((uint32_t)c2) << 24) | (((uint32_t)c3) << 0) | (((uint32_t)len) << 8); + uint64_t const bitflip = (readLE<32>(secret) ^ readLE<32>(secret + 4)) + seed; + uint64_t const keyed = (uint64_t)combined ^ bitflip; + return detail::avalanche<64>(keyed); + } + else + { + uint8_t const c1 = input[0]; + uint8_t const c2 = input[len >> 1]; + uint8_t const c3 = input[len - 1]; + uint32_t const combinedl = ((uint32_t)c1 << 16) + (((uint32_t)c2) << 24) + (((uint32_t)c3) << 0) + (((uint32_t)len) << 8); + uint32_t const combinedh = rotl<32>(swap<32>(combinedl), 13); + uint64_t const bitflipl = (readLE<32>(secret) ^ readLE<32>(secret + 4)) + seed; + uint64_t const bitfliph = (readLE<32>(secret + 8) ^ readLE<32>(secret + 12)) - seed; + uint64_t const keyed_lo = (uint64_t)combinedl ^ bitflipl; + uint64_t const keyed_hi = (uint64_t)combinedh ^ bitfliph; + hash128_t const h128 = { detail::avalanche<64>(keyed_lo), detail::avalanche<64>(keyed_hi)}; + + return h128; + } + } + + template + XXH_FORCE_INLINE hash_t len_4to8(const uint8_t* input, size_t len, const uint8_t* secret, uint64_t seed) + { + constexpr uint64_t mix_constant = 0x9FB21C651E98DF25ULL; + + seed ^= (uint64_t)swap<32>((uint32_t)seed) << 32; + + if constexpr (N == 64) + { + uint32_t const input1 = readLE<32>(input); + uint32_t const input2 = readLE<32>(input + len - 4); + uint64_t const bitflip = (readLE<64>(secret + 8) ^ readLE<64>(secret + 16)) - seed; + uint64_t const input64 = input2 + ((uint64_t)input1 << 32); + uint64_t keyed = input64 ^ bitflip; + + return rrmxmx(keyed, len); + } + else + { + uint32_t const input_lo = readLE<32>(input); + uint32_t const input_hi = readLE<32>(input + len - 4); + uint64_t const input_64 = input_lo + ((uint64_t)input_hi << 32); + uint64_t const bitflip = (readLE<64>(secret + 16) ^ readLE<64>(secret + 24)) + seed; + uint64_t const keyed = input_64 ^ bitflip; + uint128_t m128 = mul64to128(keyed, PRIME<64>(1) + (len << 2)); + + m128.high64 += (m128.low64 << 1); + m128.low64 ^= (m128.high64 >> 3); + m128.low64 ^= (m128.low64 >> 35); + m128.low64 *= mix_constant; + m128.low64 ^= (m128.low64 >> 28); + m128.high64 = avalanche(m128.high64); + + return m128; + } + } + + template + XXH_FORCE_INLINE hash_t len_9to16(const uint8_t* input, size_t len, const uint8_t* secret, uint64_t seed) + { + if constexpr (N == 64) + { + uint64_t const bitflip1 = (readLE<64>(secret + 24) ^ readLE<64>(secret + 32)) + seed; + uint64_t const bitflip2 = (readLE<64>(secret + 40) ^ readLE<64>(secret + 48)) - seed; + uint64_t const input_lo = readLE<64>(input) ^ bitflip1; + uint64_t const input_hi = readLE<64>(input + len - 8) ^ bitflip2; + uint64_t const acc = len + swap<64>(input_lo) + input_hi + mul128fold64(input_lo, input_hi); + + return avalanche(acc); + } + else + { + uint64_t const bitflipl = (readLE<64>(secret + 32) ^ readLE<64>(secret + 40)) - seed; + uint64_t const bitfliph = (readLE<64>(secret + 48) ^ readLE<64>(secret + 56)) + seed; + uint64_t const input_lo = readLE<64>(input); + uint64_t input_hi = readLE<64>(input + len - 8); + uint128_t m128 = mul64to128(input_lo ^ input_hi ^ bitflipl, PRIME<64>(1)); + + m128.low64 += (uint64_t)(len - 1) << 54; + input_hi ^= bitfliph; + + if constexpr (sizeof(void*) < sizeof(uint64_t)) // 32-bit version + { + m128.high64 += (input_hi & 0xFFFFFFFF00000000) + mul32to64((uint32_t)input_hi, PRIME<32>(2)); + } + else + { + m128.high64 += input_hi + mul32to64((uint32_t)input_hi, PRIME<32>(2) - 1); + } + + m128.low64 ^= swap<64>(m128.high64); + + hash128_t h128 = mul64to128(m128.low64, PRIME<64>(2)); + + h128.high64 += m128.high64 * PRIME<64>(2); + h128.low64 = avalanche(h128.low64); + h128.high64 = avalanche(h128.high64); + + return h128; + } + } + + template + XXH_FORCE_INLINE hash_t len_0to16(const uint8_t* input, size_t len, const uint8_t* secret, uint64_t seed) + { + if (XXH_likely(len > 8)) + { + return len_9to16(input, len, secret, seed); + } + else if (XXH_likely(len >= 4)) + { + return len_4to8(input, len, secret, seed); + } + else if (len) + { + return len_1to3(input, len, secret, seed); + } + else + { + if constexpr (N == 64) + { + return detail::avalanche<64>((seed) ^ (readLE<64>(secret + 56) ^ readLE<64>(secret + 64))); + } + else + { + uint64_t const bitflipl = readLE<64>(secret + 64) ^ readLE<64>(secret + 72); + uint64_t const bitfliph = readLE<64>(secret + 80) ^ readLE<64>(secret + 88); + + return hash128_t(detail::avalanche<64>(( seed) ^ bitflipl), detail::avalanche<64>(( seed) ^ bitfliph)); + } + } + } + + template + XXH_FORCE_INLINE hash_t hash_long_internal(const uint8_t* XXH_RESTRICT input, size_t len, const uint8_t* XXH_RESTRICT secret = default_secret, size_t secretSize = sizeof(default_secret)) + { + alignas(acc_align) std::array acc = init_acc; + + if constexpr (N == 64) + { + hash_long_internal_loop(acc.data(), input, len, secret, secretSize); + + /* converge into final hash */ + return merge_accs(acc.data(), secret + secret_mergeaccs_start, (uint64_t)len * PRIME<64>(1)); + } + else + { + hash_long_internal_loop(acc.data(), input, len, secret, secretSize); + + /* converge into final hash */ + uint64_t const low64 = merge_accs(acc.data(), secret + secret_mergeaccs_start, (uint64_t)len * PRIME<64>(1)); + uint64_t const high64 = merge_accs(acc.data(), secret + secretSize - sizeof(acc) - secret_mergeaccs_start, ~((uint64_t)len * PRIME<64>(2))); + + return hash128_t(low64, high64); + } + } + + XXH_FORCE_INLINE uint64_t mix_16b(const uint8_t* XXH_RESTRICT input, const uint8_t* XXH_RESTRICT secret, uint64_t seed) + { + uint64_t const input_lo = readLE<64>(input); + uint64_t const input_hi = readLE<64>(input + 8); + + return mul128fold64(input_lo ^ (readLE<64>(secret) + seed), input_hi ^ (readLE<64>(secret + 8) - seed)); + } + + XXH_FORCE_INLINE uint128_t mix_32b(uint128_t acc, const uint8_t* input1, const uint8_t* input2, const uint8_t* secret, uint64_t seed) + { + acc.low64 += mix_16b(input1, secret + 0, seed); + acc.low64 ^= readLE<64>(input2) + readLE<64>(input2 + 8); + acc.high64 += mix_16b(input2, secret + 16, seed); + acc.high64 ^= readLE<64>(input1) + readLE<64>(input1 + 8); + + return acc; + } + + template + XXH_FORCE_INLINE hash_t len_17to128(const uint8_t* XXH_RESTRICT input, size_t len, const uint8_t* XXH_RESTRICT secret, uint64_t seed) + { + if constexpr (N == 64) + { + hash64_t acc = len * PRIME<64>(1); + + if (len > 32) + { + if (len > 64) + { + if (len > 96) + { + acc += mix_16b(input + 48, secret + 96, seed); + acc += mix_16b(input + len - 64, secret + 112, seed); + } + + acc += mix_16b(input + 32, secret + 64, seed); + acc += mix_16b(input + len - 48, secret + 80, seed); + } + + acc += mix_16b(input + 16, secret + 32, seed); + acc += mix_16b(input + len - 32, secret + 48, seed); + } + + acc += mix_16b(input + 0, secret + 0, seed); + acc += mix_16b(input + len - 16, secret + 16, seed); + + return avalanche(acc); + } + else + { + hash128_t acc = { len * PRIME<64>(1), 0 }; + + if (len > 32) + { + if (len > 64) + { + if (len > 96) + { + acc = mix_32b(acc, input + 48, input + len - 64, secret + 96, seed); + } + + acc = mix_32b(acc, input + 32, input + len - 48, secret + 64, seed); + } + + acc = mix_32b(acc, input + 16, input + len - 32, secret + 32, seed); + } + + acc = mix_32b(acc, input, input + len - 16, secret, seed); + + uint64_t const low64 = acc.low64 + acc.high64; + uint64_t const high64 = (acc.low64 * PRIME<64>(1)) + (acc.high64 * PRIME<64>(4)) + ((len - seed) * PRIME<64>(2)); + + return { avalanche(low64), (uint64_t)0 - avalanche(high64) }; + } + } + + template + XXH_NO_INLINE hash_t len_129to240(const uint8_t* XXH_RESTRICT input, size_t len, const uint8_t* XXH_RESTRICT secret, uint64_t seed) + { + if constexpr (N == 64) + { + uint64_t acc = len * PRIME<64>(1); + size_t const nbRounds = len / 16; + + for (size_t i = 0; i < 8; i++) + { + acc += mix_16b(input + (i * 16), secret + (i * 16), seed); + } + + acc = avalanche(acc); + + for (size_t i = 8; i < nbRounds; i++) + { + acc += mix_16b(input + (i * 16), secret + ((i - 8) * 16) + midsize_startoffset, seed); + } + + /* last bytes */ + acc += mix_16b(input + len - 16, secret + secret_size_min - midsize_lastoffset, seed); + + return avalanche(acc); + } + else + { + hash128_t acc; + uint64_t const nbRounds = len / 32; + + acc.low64 = len * PRIME<64>(1); + acc.high64 = 0; + + for (size_t i = 0; i < 4; i++) + { + acc = mix_32b(acc, input + (i * 32), input + (i * 32) + 16, secret + (i * 32), seed); + } + + acc.low64 = avalanche(acc.low64); + acc.high64 = avalanche(acc.high64); + + for (size_t i = 4; i < nbRounds; i++) + { + acc = mix_32b(acc, input + (i * 32), input + (i * 32) + 16, secret + midsize_startoffset + ((i - 4) * 32), seed); + } + + /* last bytes */ + acc = mix_32b(acc, input + len - 16, input + len - 32, secret + secret_size_min - midsize_lastoffset - 16, 0ULL - seed); + + uint64_t const low64 = acc.low64 + acc.high64; + uint64_t const high64 = (acc.low64 * PRIME<64>(1)) + (acc.high64 * PRIME<64>(4)) + ((len - seed) * PRIME<64>(2)); + + return { avalanche(low64), (uint64_t)0 - avalanche(high64) }; + } + + } + + template + XXH_NO_INLINE hash_t xxhash3_impl(const void* XXH_RESTRICT input, size_t len, hash64_t seed, const void* XXH_RESTRICT secret = default_secret, size_t secretSize = secret_default_size) + { + + alignas(64) uint8_t custom_secret[secret_default_size]; + + const void* short_secret = secret; + + if (seed != 0) + { + init_custom_secret(custom_secret, seed); + short_secret = default_secret; + } + + if (len <= 16) + { + return len_0to16(static_cast(input), len, static_cast(short_secret), seed); + } + else if (len <= 128) + { + return len_17to128(static_cast(input), len, static_cast(short_secret), seed); + } + else if (len <= midsize_max) + { + return len_129to240(static_cast(input), len, static_cast(short_secret), seed); + } + else + { + return hash_long_internal(static_cast(input), len, static_cast(((seed == 0) ? secret : ((secret == default_secret) ? custom_secret : secret))), ((seed == 0) ? secretSize : ((secret == default_secret) ? secret_default_size : secretSize))); + } + } + + XXH_NO_INLINE void generate_secret(void* secret_buffer, size_t secret_size, const void* custom_seed, size_t seed_size) + { + if (seed_size == 0) + { + custom_seed = default_secret; + seed_size = secret_default_size; + } + + size_t pos = 0; + while (pos < secret_size) + { + size_t const copy_len = std::min(secret_size - pos, seed_size); + memcpy((uint8_t*)secret_buffer + pos, custom_seed, copy_len); + pos += copy_len; + } + + size_t const nbseg16 = secret_size / 16; + canonical128_t scrambled(xxhash3_impl<128>(custom_seed, seed_size, 0)); + for (size_t n = 0; n < nbseg16; n++) + { + hash128_t const h128 = xxhash3_impl<128>(&scrambled, sizeof(scrambled), n); + combine_16((uint8_t*)secret_buffer + n * 16, h128); + } + + combine_16((uint8_t*)secret_buffer + secret_size - 16, scrambled.get_hash()); + } + } + + + /* ************************************* + * Public Access Point - xxhash + ***************************************/ + + template + inline hash_t xxhash(const void* input, size_t len, uint_t seed = 0) + { + static_assert(!(bit_mode != 32 && bit_mode != 64), "xxhash can only be used in 32 and 64 bit modes."); + return detail::endian_align(input, len, seed); + } + + template + inline hash_t xxhash(const std::basic_string& input, uint_t seed = 0) + { + static_assert(!(bit_mode != 32 && bit_mode != 64), "xxhash can only be used in 32 and 64 bit modes."); + return detail::endian_align(static_cast(input.data()), input.length() * sizeof(T), seed); + } + + template + inline hash_t xxhash(ContiguousIterator begin, ContiguousIterator end, uint_t seed = 0) + { + static_assert(!(bit_mode != 32 && bit_mode != 64), "xxhash can only be used in 32 and 64 bit modes."); + using T = typename std::decay_t; + return detail::endian_align(static_cast(&*begin), (end - begin) * sizeof(T), seed); + } + + template + inline hash_t xxhash(const std::vector& input, uint_t seed = 0) + { + static_assert(!(bit_mode != 32 && bit_mode != 64), "xxhash can only be used in 32 and 64 bit modes."); + return detail::endian_align(static_cast(input.data()), input.size() * sizeof(T), seed); + } + + template + inline hash_t xxhash(const std::array& input, uint_t seed = 0) + { + static_assert(!(bit_mode != 32 && bit_mode != 64), "xxhash can only be used in 32 and 64 bit modes."); + return detail::endian_align(static_cast(input.data()), AN * sizeof(T), seed); + } + + template + inline hash_t xxhash(const std::initializer_list& input, uint_t seed = 0) + { + static_assert(!(bit_mode != 32 && bit_mode != 64), "xxhash can only be used in 32 and 64 bit modes."); + return detail::endian_align(static_cast(input.begin()), input.size() * sizeof(T), seed); + } + + + /* ************************************* + * Public Access Point - xxhash3 + ***************************************/ + + template + inline hash_t xxhash3(const void* input, size_t len, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(input, len, seed); + } + + template + inline hash_t xxhash3(const void* input, size_t len, const void* secret, size_t secretSize, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(input, len, seed, secret, secretSize); + } + + template + inline hash_t xxhash3(const std::basic_string& input, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(static_cast(input.data()), input.length() * sizeof(T), seed); + } + + template + inline hash_t xxhash3(const std::basic_string& input, const void* secret, size_t secretSize, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(static_cast(input.data()), input.length() * sizeof(T), seed, secret, secretSize); + } + + template + inline hash_t xxhash3(ContiguousIterator begin, ContiguousIterator end, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + using T = typename std::decay_t; + return detail3::xxhash3_impl(static_cast(&*begin), (end - begin) * sizeof(T), seed); + } + + template + inline hash_t xxhash3(ContiguousIterator begin, ContiguousIterator end, const void* secret, size_t secretSize, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + using T = typename std::decay_t; + return detail3::xxhash3_impl(static_cast(&*begin), (end - begin) * sizeof(T), seed, secret, secretSize); + } + + template + inline hash_t xxhash3(const std::vector& input, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(static_cast(input.data()), input.size() * sizeof(T), seed); + } + + template + inline hash_t xxhash3(const std::vector& input, const void* secret, size_t secretSize, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(static_cast(input.data()), input.size() * sizeof(T), seed, secret, secretSize); + } + + template + inline hash_t xxhash3(const std::array& input, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(static_cast(input.data()), AN * sizeof(T), seed); + } + + template + inline hash_t xxhash3(const std::array& input, const void* secret, size_t secretSize, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(static_cast(input.data()), AN * sizeof(T), seed, secret, secretSize); + } + + template + inline hash_t xxhash3(const std::initializer_list& input, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(static_cast(input.begin()), input.size() * sizeof(T), seed); + } + + template + inline hash_t xxhash3(const std::initializer_list& input, const void* secret, size_t secretSize, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 can only be used in 64 and 128 bit modes."); + return detail3::xxhash3_impl(static_cast(input.begin()), input.size() * sizeof(T), seed, secret, secretSize); + } + + + /* ************************************* + * Secret Generation Functions + ***************************************/ + + inline void generate_secret(void* secret_buffer, size_t secret_size, const void* custom_seed = detail3::default_secret, size_t seed_length = 0) + { + detail3::generate_secret(secret_buffer, secret_size, custom_seed, seed_length); + } + + template + inline void generate_secret(void* secret_buffer, size_t secret_size, const std::array& custom_seed) + { + detail3::generate_secret(secret_buffer, secret_size, static_cast(custom_seed.data()), AN * sizeof(T)); + } + + template + inline void generate_secret(void* secret_buffer, size_t secret_size, const std::initializer_list& custom_seed) + { + detail3::generate_secret(secret_buffer, secret_size, static_cast(custom_seed.begin()), custom_seed.size() * sizeof(T)); + } + + template + inline void generate_secret(void* secret_buffer, size_t secret_size, const std::vector& custom_seed) + { + detail3::generate_secret(secret_buffer, secret_size, static_cast(custom_seed.data()), custom_seed.size() * sizeof(T)); + } + + template + inline void generate_secret(void* secret_buffer, size_t secret_size, const std::basic_string& custom_seed) + { + detail3::generate_secret(secret_buffer, secret_size, static_cast(custom_seed.data()), custom_seed.length() * sizeof(T)); + } + + template + inline void generate_secret(void* secret_buffer, size_t secret_size, ContiguousIterator begin, ContiguousIterator end) + { + using T = typename std::decay_t; + detail3::generate_secret(secret_buffer, secret_size, static_cast(&*begin), (end - begin) * sizeof(T)); + } + + inline void generate_secret_from_seed(void* secret_buffer, uint64_t seed = 0) + { + alignas(64) uint8_t custom_secret[detail3::secret_default_size]; + detail3::init_custom_secret(custom_secret, seed); + memcpy(secret_buffer, custom_secret, detail3::secret_default_size); + } + + + /* ************************************* + * Hash streaming - xxhash + ***************************************/ + + template + class hash_state_t + { + uint64_t total_len = 0; + uint_t v1 = 0, v2 = 0, v3 = 0, v4 = 0; + std::array, 4> mem = {0, 0, 0, 0}; + uint32_t memsize = 0; + + inline void update_impl(const void* input, size_t length) + { + const uint8_t* p = reinterpret_cast(input); + const uint8_t* const bEnd = p + length; + + total_len += length; + + if (memsize + length < (bit_mode / 2)) + { /* fill in tmp buffer */ + memcpy(reinterpret_cast(mem.data()) + memsize, input, length); + memsize += static_cast(length); + return; + } + + if (memsize > 0) + { /* some data left from previous update */ + memcpy(reinterpret_cast(mem.data()) + memsize, input, (bit_mode / 2) - memsize); + + const uint_t* ptr = mem.data(); + + v1 = detail::round(v1, mem_ops::readLE(ptr)); + ptr++; + v2 = detail::round(v2, mem_ops::readLE(ptr)); + ptr++; + v3 = detail::round(v3, mem_ops::readLE(ptr)); + ptr++; + v4 = detail::round(v4, mem_ops::readLE(ptr)); + + p += (bit_mode / 2) - memsize; + memsize = 0; + } + + while (p + (bit_mode / 2) <= bEnd) + { + v1 = detail::round(v1, mem_ops::readLE(p)); + p += (bit_mode / 8); + v2 = detail::round(v2, mem_ops::readLE(p)); + p += (bit_mode / 8); + v3 = detail::round(v3, mem_ops::readLE(p)); + p += (bit_mode / 8); + v4 = detail::round(v4, mem_ops::readLE(p)); + p += (bit_mode / 8); + } + + if (p < bEnd) + { + memcpy(mem.data(), p, static_cast(bEnd - p)); + memsize = static_cast(bEnd - p); + } + } + + inline hash_t digest_impl() const + { + const uint8_t* p = reinterpret_cast(mem.data()); + const uint8_t* const bEnd = reinterpret_cast(mem.data()) + memsize; + hash_t hash_ret; + + if (total_len >= (bit_mode / 2)) + { + hash_ret = bit_ops::rotl(v1, 1) + bit_ops::rotl(v2, 7) + bit_ops::rotl(v3, 12) + bit_ops::rotl(v4, 18); + + if constexpr (bit_mode == 64) + { + detail::endian_align_sub_mergeround(hash_ret, v1, v2, v3, v4); + } + } + else + { + hash_ret = v3 + detail::PRIME(5); + } + + hash_ret += static_cast>(total_len); + + return detail::endian_align_sub_ending(hash_ret, p, bEnd); + } + + public: + + hash_state_t(uint_t seed = 0) + { + static_assert(!(bit_mode != 32 && bit_mode != 64), "xxhash streaming can only be used in 32 and 64 bit modes."); + v1 = seed + detail::PRIME(1) + detail::PRIME(2); + v2 = seed + detail::PRIME(2); + v3 = seed + 0; + v4 = seed - detail::PRIME(1); + }; + + void reset(uint_t seed = 0) + { + memset(this, 0, sizeof(hash_state_t)); + v1 = seed + detail::PRIME(1) + detail::PRIME(2); + v2 = seed + detail::PRIME(2); + v3 = seed + 0; + v4 = seed - detail::PRIME(1); + } + + void update(const void* input, size_t length) + { + return update_impl(input, length); + } + + template + void update(const std::basic_string& input) + { + return update_impl(static_cast(input.data()), input.length() * sizeof(T)); + } + + template + void update(ContiguousIterator begin, ContiguousIterator end) + { + using T = typename std::decay_t; + return update_impl(static_cast(&*begin), (end - begin) * sizeof(T)); + } + + template + void update(const std::vector& input) + { + return update_impl(static_cast(input.data()), input.size() * sizeof(T)); + } + + template + void update(const std::array& input) + { + return update_impl(static_cast(input.data()), AN * sizeof(T)); + } + + template + void update(const std::initializer_list& input) + { + return update_impl(static_cast(input.begin()), input.size() * sizeof(T)); + } + + hash_t digest() const + { + return digest_impl(); + } + }; + + using hash_state32_t = hash_state_t<32>; + using hash_state64_t = hash_state_t<64>; + + + /* ************************************* + * Hash streaming - xxhash3 + ***************************************/ + + template + class alignas(64) hash3_state_t + { + constexpr static int internal_buffer_size = 256; + constexpr static int internal_buffer_stripes = (internal_buffer_size / detail3::stripe_len); + + alignas(64) uint64_t acc[8]; + alignas(64) uint8_t customSecret[detail3::secret_default_size]; /* used to store a custom secret generated from the seed. Makes state larger. Design might change */ + alignas(64) uint8_t buffer[internal_buffer_size]; + uint32_t bufferedSize = 0; + uint32_t nbStripesPerBlock = 0; + uint32_t nbStripesSoFar = 0; + uint32_t secretLimit = 0; + uint32_t reserved32 = 0; + uint32_t reserved32_2 = 0; + uint64_t totalLen = 0; + uint64_t seed = 0; + bool useSeed = false; + uint64_t reserved64 = 0; + const uint8_t* secret = nullptr; /* note : there is some padding after, due to alignment on 64 bytes */ + + + void consume_stripes(uint64_t* acc, uint32_t& nbStripesSoFar, size_t totalStripes, const uint8_t* input) + { + if (nbStripesPerBlock - nbStripesSoFar <= totalStripes) /* need a scrambling operation */ + { + size_t const nbStripes = nbStripesPerBlock - nbStripesSoFar; + + detail3::accumulate(acc, input, secret + (nbStripesSoFar * detail3::secret_consume_rate), nbStripes); + detail3::scramble_acc(acc, secret + secretLimit); + detail3::accumulate(acc, input + nbStripes * detail3::stripe_len, secret, totalStripes - nbStripes); + nbStripesSoFar = (uint32_t)(totalStripes - nbStripes); + } + else + { + detail3::accumulate(acc, input, secret + (nbStripesSoFar * detail3::secret_consume_rate), totalStripes); + nbStripesSoFar += (uint32_t)totalStripes; + } + } + + void update_impl(const void* input_, size_t len) + { + const uint8_t* input = static_cast(input_); + const uint8_t* const bEnd = input + len; + + totalLen += len; + + if (bufferedSize + len <= internal_buffer_size) + { /* fill in tmp buffer */ + memcpy(buffer + bufferedSize, input, len); + bufferedSize += (uint32_t)len; + return; + } + /* input now > XXH3_INTERNALBUFFER_SIZE */ + + if (bufferedSize > 0) + { /* some input within internal buffer: fill then consume it */ + size_t const loadSize = internal_buffer_size - bufferedSize; + + memcpy(buffer + bufferedSize, input, loadSize); + input += loadSize; + consume_stripes(acc, nbStripesSoFar, internal_buffer_stripes, buffer); + bufferedSize = 0; + } + + /* consume input by full buffer quantities */ + if (input + internal_buffer_size <= bEnd) + { + const uint8_t* const limit = bEnd - internal_buffer_size; + + do + { + consume_stripes(acc, nbStripesSoFar, internal_buffer_stripes, input); + input += internal_buffer_size; + } + while (input < limit); + + memcpy(buffer + sizeof(buffer) - detail3::stripe_len, input - detail3::stripe_len, detail3::stripe_len); + } + + if (input < bEnd) + { /* some remaining input input : buffer it */ + memcpy(buffer, input, (size_t)(bEnd - input)); + bufferedSize = (uint32_t)(bEnd - input); + } + } + + void digest_long(uint64_t* acc_) + { + memcpy(acc_, acc, sizeof(acc)); /* digest locally, state remains unaltered, and can continue ingesting more input afterwards */ + + if (bufferedSize >= detail3::stripe_len) + { + size_t const totalNbStripes = (bufferedSize - 1) / detail3::stripe_len; + uint32_t nbStripesSoFar = this->nbStripesSoFar; + + consume_stripes(acc_, nbStripesSoFar, totalNbStripes, buffer); + + /* one last partial stripe */ + detail3::accumulate_512(acc_, buffer + bufferedSize - detail3::stripe_len, secret + secretLimit - detail3::secret_lastacc_start); + } + else + { /* bufferedSize < STRIPE_LEN */ + /* one last stripe */ + uint8_t lastStripe[detail3::stripe_len]; + size_t const catchupSize = detail3::stripe_len - bufferedSize; + memcpy(lastStripe, buffer + sizeof(buffer) - catchupSize, catchupSize); + memcpy(lastStripe + catchupSize, buffer, bufferedSize); + detail3::accumulate_512(acc_, lastStripe, secret + secretLimit - detail3::secret_lastacc_start); + } + } + + void reset_internal(uint64_t seed_reset, const void* secret_reset, size_t secret_size) + { + memset(this, 0, sizeof(*this)); + memcpy(acc, detail3::init_acc.data(), sizeof(detail3::init_acc)); + seed = seed_reset; + useSeed = (seed != 0); + secret = (const uint8_t*)secret_reset; + secretLimit = (uint32_t)(secret_size - detail3::stripe_len); + nbStripesPerBlock = secretLimit / detail3::secret_consume_rate; + } + + public: + + hash3_state_t operator=(hash3_state_t& other) + { + memcpy(this, &other, sizeof(hash3_state_t)); + } + + hash3_state_t(uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 streaming can only be used in 64 and 128 bit modes."); + reset(seed); + } + + hash3_state_t(const void* secret, size_t secretSize, uint64_t seed = 0) + { + static_assert(!(bit_mode != 128 && bit_mode != 64), "xxhash3 streaming can only be used in 64 and 128 bit modes."); + reset(secret, secretSize, seed); + } + + void reset(uint64_t seed = 0) + { + reset_internal(seed, detail3::default_secret, detail3::secret_default_size); + detail3::init_custom_secret(customSecret, seed); + secret = customSecret; + } + + void reset(const void* secret, size_t secretSize, uint64_t seed = 0) + { + reset_internal(seed, secret, secretSize); + useSeed = true; + } + + void update(const void* input, size_t len) + { + return update_impl(static_cast(input), len); + } + + template + void update(const std::basic_string& input) + { + return update_impl(static_cast(input.data()), input.length() * sizeof(T)); + } + + template + void update(ContiguousIterator begin, ContiguousIterator end) + { + using T = typename std::decay_t; + return update_impl(static_cast(&*begin), (end - begin) * sizeof(T)); + } + + template + void update(const std::vector& input) + { + return update_impl(static_cast(input.data()), input.size() * sizeof(T)); + } + + template + void update(const std::array& input) + { + return update_impl(static_cast(input.data()), AN * sizeof(T)); + } + + template + void update(const std::initializer_list& input) + { + return update_impl(static_cast(input.begin()), input.size() * sizeof(T)); + } + + hash_t digest() + { + if (totalLen > detail3::midsize_max) + { + alignas(128) hash64_t acc[detail3::acc_nb]; + + digest_long(acc); + + if constexpr (bit_mode == 64) + { + return detail3::merge_accs(acc, secret + detail3::secret_mergeaccs_start, (uint64_t)totalLen * detail::PRIME<64>(1)); + } + else + { + uint64_t const low64 = detail3::merge_accs(acc, secret + detail3::secret_mergeaccs_start, (uint64_t)totalLen * detail::PRIME<64>(1)); + uint64_t const high64 = detail3::merge_accs(acc, secret + secretLimit + detail3::stripe_len - sizeof(acc) - detail3::secret_mergeaccs_start, ~((uint64_t)totalLen * detail::PRIME<64>(2))); + + return { low64, high64 }; + } + } + else + { + return detail3::xxhash3_impl(buffer, totalLen, seed, secret, secretLimit + detail3::stripe_len); + } + } + }; + + using hash3_state64_t = hash3_state_t<64>; + using hash3_state128_t = hash3_state_t<128>; +} diff --git a/client/rsh/inst/zmq.hpp b/client/rsh/inst/zmq.hpp deleted file mode 100644 index 8dee60e35..000000000 --- a/client/rsh/inst/zmq.hpp +++ /dev/null @@ -1,2561 +0,0 @@ -/* - Copyright (c) 2016-2017 ZeroMQ community - Copyright (c) 2009-2011 250bpm s.r.o. - Copyright (c) 2011 Botond Ballo - Copyright (c) 2007-2009 iMatix Corporation - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ - -#ifndef __ZMQ_HPP_INCLUDED__ -#define __ZMQ_HPP_INCLUDED__ - -#ifdef _WIN32 -#ifndef NOMINMAX -#define NOMINMAX -#endif -#endif - -// included here for _HAS_CXX* macros -#include - -#if defined(_MSVC_LANG) -#define CPPZMQ_LANG _MSVC_LANG -#else -#define CPPZMQ_LANG __cplusplus -#endif -// overwrite if specific language macros indicate higher version -#if defined(_HAS_CXX14) && _HAS_CXX14 && CPPZMQ_LANG < 201402L -#undef CPPZMQ_LANG -#define CPPZMQ_LANG 201402L -#endif -#if defined(_HAS_CXX17) && _HAS_CXX17 && CPPZMQ_LANG < 201703L -#undef CPPZMQ_LANG -#define CPPZMQ_LANG 201703L -#endif - -// macros defined if has a specific standard or greater -#if CPPZMQ_LANG >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900) -#define ZMQ_CPP11 -#endif -#if CPPZMQ_LANG >= 201402L -#define ZMQ_CPP14 -#endif -#if CPPZMQ_LANG >= 201703L -#define ZMQ_CPP17 -#endif - -#if defined(ZMQ_CPP14) && !defined(_MSC_VER) -#define ZMQ_DEPRECATED(msg) [[deprecated(msg)]] -#elif defined(_MSC_VER) -#define ZMQ_DEPRECATED(msg) __declspec(deprecated(msg)) -#elif defined(__GNUC__) -#define ZMQ_DEPRECATED(msg) __attribute__((deprecated(msg))) -#else -#define ZMQ_DEPRECATED(msg) -#endif - -#if defined(ZMQ_CPP17) -#define ZMQ_NODISCARD [[nodiscard]] -#else -#define ZMQ_NODISCARD -#endif - -#if defined(ZMQ_CPP11) -#define ZMQ_NOTHROW noexcept -#define ZMQ_EXPLICIT explicit -#define ZMQ_OVERRIDE override -#define ZMQ_NULLPTR nullptr -#define ZMQ_CONSTEXPR_FN constexpr -#define ZMQ_CONSTEXPR_VAR constexpr -#define ZMQ_CPP11_DEPRECATED(msg) ZMQ_DEPRECATED(msg) -#else -#define ZMQ_NOTHROW throw() -#define ZMQ_EXPLICIT -#define ZMQ_OVERRIDE -#define ZMQ_NULLPTR 0 -#define ZMQ_CONSTEXPR_FN -#define ZMQ_CONSTEXPR_VAR const -#define ZMQ_CPP11_DEPRECATED(msg) -#endif -#if defined(ZMQ_CPP14) && (!defined(_MSC_VER) || _MSC_VER > 1900) && (!defined(__GNUC__) || __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 3)) -#define ZMQ_EXTENDED_CONSTEXPR -#endif -#if defined(ZMQ_CPP17) -#define ZMQ_INLINE_VAR inline -#define ZMQ_CONSTEXPR_IF constexpr -#else -#define ZMQ_INLINE_VAR -#define ZMQ_CONSTEXPR_IF -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#ifdef ZMQ_CPP11 -#include -#include -#include -#include -#endif - -#if defined(__has_include) && defined(ZMQ_CPP17) -#define CPPZMQ_HAS_INCLUDE_CPP17(X) __has_include(X) -#else -#define CPPZMQ_HAS_INCLUDE_CPP17(X) 0 -#endif - -#if CPPZMQ_HAS_INCLUDE_CPP17() && !defined(CPPZMQ_HAS_OPTIONAL) -#define CPPZMQ_HAS_OPTIONAL 1 -#endif -#ifndef CPPZMQ_HAS_OPTIONAL -#define CPPZMQ_HAS_OPTIONAL 0 -#elif CPPZMQ_HAS_OPTIONAL -#include -#endif - -#if CPPZMQ_HAS_INCLUDE_CPP17() && !defined(CPPZMQ_HAS_STRING_VIEW) -#define CPPZMQ_HAS_STRING_VIEW 1 -#endif -#ifndef CPPZMQ_HAS_STRING_VIEW -#define CPPZMQ_HAS_STRING_VIEW 0 -#elif CPPZMQ_HAS_STRING_VIEW -#include -#endif - -/* Version macros for compile-time API version detection */ -#define CPPZMQ_VERSION_MAJOR 4 -#define CPPZMQ_VERSION_MINOR 10 -#define CPPZMQ_VERSION_PATCH 0 - -#define CPPZMQ_VERSION \ - ZMQ_MAKE_VERSION(CPPZMQ_VERSION_MAJOR, CPPZMQ_VERSION_MINOR, \ - CPPZMQ_VERSION_PATCH) - -// Detect whether the compiler supports C++11 rvalue references. -#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) \ - && defined(__GXX_EXPERIMENTAL_CXX0X__)) -#define ZMQ_HAS_RVALUE_REFS -#define ZMQ_DELETED_FUNCTION = delete -#elif defined(__clang__) -#if __has_feature(cxx_rvalue_references) -#define ZMQ_HAS_RVALUE_REFS -#endif - -#if __has_feature(cxx_deleted_functions) -#define ZMQ_DELETED_FUNCTION = delete -#else -#define ZMQ_DELETED_FUNCTION -#endif -#elif defined(_MSC_VER) && (_MSC_VER >= 1900) -#define ZMQ_HAS_RVALUE_REFS -#define ZMQ_DELETED_FUNCTION = delete -#elif defined(_MSC_VER) && (_MSC_VER >= 1600) -#define ZMQ_HAS_RVALUE_REFS -#define ZMQ_DELETED_FUNCTION -#else -#define ZMQ_DELETED_FUNCTION -#endif - -#if defined(ZMQ_CPP11) && !defined(__llvm__) && !defined(__INTEL_COMPILER) \ - && defined(__GNUC__) && __GNUC__ < 5 -#define ZMQ_CPP11_PARTIAL -#elif defined(__GLIBCXX__) && __GLIBCXX__ < 20160805 -//the date here is the last date of gcc 4.9.4, which -// effectively means libstdc++ from gcc 5.5 and higher won't trigger this branch -#define ZMQ_CPP11_PARTIAL -#endif - -#ifdef ZMQ_CPP11 -#ifdef ZMQ_CPP11_PARTIAL -#define ZMQ_IS_TRIVIALLY_COPYABLE(T) __has_trivial_copy(T) -#else -#include -#define ZMQ_IS_TRIVIALLY_COPYABLE(T) std::is_trivially_copyable::value -#endif -#endif - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3, 3, 0) -#define ZMQ_NEW_MONITOR_EVENT_LAYOUT -#endif - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 1, 0) -#define ZMQ_HAS_PROXY_STEERABLE -/* Socket event data */ -typedef struct -{ - uint16_t event; // id of the event as bitfield - int32_t value; // value is either error code, fd or reconnect interval -} zmq_event_t; -#endif - -// Avoid using deprecated message receive function when possible -#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3, 2, 0) -#define zmq_msg_recv(msg, socket, flags) zmq_recvmsg(socket, msg, flags) -#endif - - -// In order to prevent unused variable warnings when building in non-debug -// mode use this macro to make assertions. -#ifndef NDEBUG -#define ZMQ_ASSERT(expression) assert(expression) -#else -#define ZMQ_ASSERT(expression) (void) (expression) -#endif - -namespace zmq -{ -#ifdef ZMQ_CPP11 -namespace detail -{ -namespace ranges -{ -using std::begin; -using std::end; -template auto begin(T &&r) -> decltype(begin(std::forward(r))) -{ - return begin(std::forward(r)); -} -template auto end(T &&r) -> decltype(end(std::forward(r))) -{ - return end(std::forward(r)); -} -} // namespace ranges - -template using void_t = void; - -template -using iter_value_t = typename std::iterator_traits::value_type; - -template -using range_iter_t = decltype( - ranges::begin(std::declval::type &>())); - -template using range_value_t = iter_value_t>; - -template struct is_range : std::false_type -{ -}; - -template -struct is_range< - T, - void_t::type &>()) - == ranges::end(std::declval::type &>()))>> - : std::true_type -{ -}; - -} // namespace detail -#endif - -typedef zmq_free_fn free_fn; -typedef zmq_pollitem_t pollitem_t; - -// duplicate definition from libzmq 4.3.3 -#if defined _WIN32 -#if defined _WIN64 -typedef unsigned __int64 fd_t; -#else -typedef unsigned int fd_t; -#endif -#else -typedef int fd_t; -#endif - -class error_t : public std::exception -{ - public: - error_t() ZMQ_NOTHROW : errnum(zmq_errno()) {} - explicit error_t(int err) ZMQ_NOTHROW : errnum(err) {} - virtual const char *what() const ZMQ_NOTHROW ZMQ_OVERRIDE - { - return zmq_strerror(errnum); - } - int num() const ZMQ_NOTHROW { return errnum; } - - private: - int errnum; -}; - -namespace detail { -inline int poll(zmq_pollitem_t *items_, size_t nitems_, long timeout_) -{ - int rc = zmq_poll(items_, static_cast(nitems_), timeout_); - // if (rc < 0) - // throw error_t(); - return rc; -} -} - -#ifdef ZMQ_CPP11 -ZMQ_DEPRECATED("from 4.8.0, use poll taking std::chrono::duration instead of long") -inline int poll(zmq_pollitem_t *items_, size_t nitems_, long timeout_) -#else -inline int poll(zmq_pollitem_t *items_, size_t nitems_, long timeout_ = -1) -#endif -{ - return detail::poll(items_, nitems_, timeout_); -} - -ZMQ_DEPRECATED("from 4.3.1, use poll taking non-const items") -inline int poll(zmq_pollitem_t const *items_, size_t nitems_, long timeout_ = -1) -{ - return detail::poll(const_cast(items_), nitems_, timeout_); -} - -#ifdef ZMQ_CPP11 -ZMQ_DEPRECATED("from 4.3.1, use poll taking non-const items") -inline int -poll(zmq_pollitem_t const *items, size_t nitems, std::chrono::milliseconds timeout) -{ - return detail::poll(const_cast(items), nitems, - static_cast(timeout.count())); -} - -ZMQ_DEPRECATED("from 4.3.1, use poll taking non-const items") -inline int poll(std::vector const &items, - std::chrono::milliseconds timeout) -{ - return detail::poll(const_cast(items.data()), items.size(), - static_cast(timeout.count())); -} - -ZMQ_DEPRECATED("from 4.3.1, use poll taking non-const items") -inline int poll(std::vector const &items, long timeout_ = -1) -{ - return detail::poll(const_cast(items.data()), items.size(), timeout_); -} - -inline int -poll(zmq_pollitem_t *items, size_t nitems, std::chrono::milliseconds timeout = std::chrono::milliseconds{-1}) -{ - return detail::poll(items, nitems, static_cast(timeout.count())); -} - -inline int poll(std::vector &items, - std::chrono::milliseconds timeout = std::chrono::milliseconds{-1}) -{ - return detail::poll(items.data(), items.size(), static_cast(timeout.count())); -} - -ZMQ_DEPRECATED("from 4.3.1, use poll taking std::chrono::duration instead of long") -inline int poll(std::vector &items, long timeout_) -{ - return detail::poll(items.data(), items.size(), timeout_); -} - -template -inline int poll(std::array &items, - std::chrono::milliseconds timeout = std::chrono::milliseconds{-1}) -{ - return detail::poll(items.data(), items.size(), static_cast(timeout.count())); -} -#endif - - -inline void version(int *major_, int *minor_, int *patch_) -{ - zmq_version(major_, minor_, patch_); -} - -#ifdef ZMQ_CPP11 -inline std::tuple version() -{ - std::tuple v; - zmq_version(&std::get<0>(v), &std::get<1>(v), &std::get<2>(v)); - return v; -} - -#if !defined(ZMQ_CPP11_PARTIAL) -namespace detail -{ -template struct is_char_type -{ - // true if character type for string literals in C++11 - static constexpr bool value = - std::is_same::value || std::is_same::value - || std::is_same::value || std::is_same::value; -}; -} -#endif - -#endif - -class message_t -{ - public: - message_t() ZMQ_NOTHROW - { - int rc = zmq_msg_init(&msg); - ZMQ_ASSERT(rc == 0); - } - - explicit message_t(size_t size_) - { - int rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - } - - template message_t(ForwardIter first, ForwardIter last) - { - typedef typename std::iterator_traits::value_type value_t; - - assert(std::distance(first, last) >= 0); - size_t const size_ = - static_cast(std::distance(first, last)) * sizeof(value_t); - int const rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - std::copy(first, last, data()); - } - - message_t(const void *data_, size_t size_) - { - int rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - if (size_) { - // this constructor allows (nullptr, 0), - // memcpy with a null pointer is UB - memcpy(data(), data_, size_); - } - } - - message_t(void *data_, size_t size_, free_fn *ffn_, void *hint_ = ZMQ_NULLPTR) - { - int rc = zmq_msg_init_data(&msg, data_, size_, ffn_, hint_); - if (rc != 0) - throw error_t(); - } - - // overload set of string-like types and generic containers -#if defined(ZMQ_CPP11) && !defined(ZMQ_CPP11_PARTIAL) - // NOTE this constructor will include the null terminator - // when called with a string literal. - // An overload taking const char* can not be added because - // it would be preferred over this function and break compatiblity. - template< - class Char, - size_t N, - typename = typename std::enable_if::value>::type> - ZMQ_DEPRECATED("from 4.7.0, use constructors taking iterators, (pointer, size) " - "or strings instead") - explicit message_t(const Char (&data)[N]) : - message_t(detail::ranges::begin(data), detail::ranges::end(data)) - { - } - - template::value - && ZMQ_IS_TRIVIALLY_COPYABLE(detail::range_value_t) - && !detail::is_char_type>::value - && !std::is_same::value>::type> - explicit message_t(const Range &rng) : - message_t(detail::ranges::begin(rng), detail::ranges::end(rng)) - { - } - - explicit message_t(const std::string &str) : message_t(str.data(), str.size()) {} - -#if CPPZMQ_HAS_STRING_VIEW - explicit message_t(std::string_view str) : message_t(str.data(), str.size()) {} -#endif - -#endif - -#ifdef ZMQ_HAS_RVALUE_REFS - message_t(message_t &&rhs) ZMQ_NOTHROW : msg(rhs.msg) - { - int rc = zmq_msg_init(&rhs.msg); - ZMQ_ASSERT(rc == 0); - } - - message_t &operator=(message_t &&rhs) ZMQ_NOTHROW - { - std::swap(msg, rhs.msg); - return *this; - } -#endif - - ~message_t() ZMQ_NOTHROW - { - int rc = zmq_msg_close(&msg); - ZMQ_ASSERT(rc == 0); - } - - void rebuild() - { - int rc = zmq_msg_close(&msg); - if (rc != 0) - throw error_t(); - rc = zmq_msg_init(&msg); - ZMQ_ASSERT(rc == 0); - } - - void rebuild(size_t size_) - { - int rc = zmq_msg_close(&msg); - if (rc != 0) - throw error_t(); - rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - } - - void rebuild(const void *data_, size_t size_) - { - int rc = zmq_msg_close(&msg); - if (rc != 0) - throw error_t(); - rc = zmq_msg_init_size(&msg, size_); - if (rc != 0) - throw error_t(); - memcpy(data(), data_, size_); - } - - void rebuild(const std::string &str) - { - rebuild(str.data(), str.size()); - } - - void rebuild(void *data_, size_t size_, free_fn *ffn_, void *hint_ = ZMQ_NULLPTR) - { - int rc = zmq_msg_close(&msg); - if (rc != 0) - throw error_t(); - rc = zmq_msg_init_data(&msg, data_, size_, ffn_, hint_); - if (rc != 0) - throw error_t(); - } - - ZMQ_DEPRECATED("from 4.3.1, use move taking non-const reference instead") - void move(message_t const *msg_) - { - int rc = zmq_msg_move(&msg, const_cast(msg_->handle())); - if (rc != 0) - throw error_t(); - } - - void move(message_t &msg_) - { - int rc = zmq_msg_move(&msg, msg_.handle()); - if (rc != 0) - throw error_t(); - } - - ZMQ_DEPRECATED("from 4.3.1, use copy taking non-const reference instead") - void copy(message_t const *msg_) - { - int rc = zmq_msg_copy(&msg, const_cast(msg_->handle())); - if (rc != 0) - throw error_t(); - } - - void copy(message_t &msg_) - { - int rc = zmq_msg_copy(&msg, msg_.handle()); - if (rc != 0) - throw error_t(); - } - - bool more() const ZMQ_NOTHROW - { - int rc = zmq_msg_more(const_cast(&msg)); - return rc != 0; - } - - void *data() ZMQ_NOTHROW { return zmq_msg_data(&msg); } - - const void *data() const ZMQ_NOTHROW - { - return zmq_msg_data(const_cast(&msg)); - } - - size_t size() const ZMQ_NOTHROW - { - return zmq_msg_size(const_cast(&msg)); - } - - ZMQ_NODISCARD bool empty() const ZMQ_NOTHROW { return size() == 0u; } - - template T *data() ZMQ_NOTHROW { return static_cast(data()); } - - template T const *data() const ZMQ_NOTHROW { - return static_cast(data()); - } - - ZMQ_DEPRECATED("from 4.3.0, use operator== instead") - bool equal(const message_t *other) const ZMQ_NOTHROW { - return *this == *other; - } - - bool operator==(const message_t &other) const ZMQ_NOTHROW { - const size_t my_size = size(); - return my_size == other.size() && - 0 == memcmp(data(), other.data(), my_size); - } - - bool operator!=(const message_t &other) const ZMQ_NOTHROW { - return !(*this == other); - } - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3, 2, 0) - int get(int property_) { - int value = zmq_msg_get(&msg, property_); - if (value == -1) - throw error_t(); - return value; - } -#endif - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 1, 0) - const char *gets(const char *property_) { - const char *value = zmq_msg_gets(&msg, property_); - if (value == ZMQ_NULLPTR) - throw error_t(); - return value; - } -#endif - -#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0) - uint32_t routing_id() const { - return zmq_msg_routing_id(const_cast(&msg)); - } - - void set_routing_id(uint32_t routing_id) { - int rc = zmq_msg_set_routing_id(&msg, routing_id); - if (rc != 0) - throw error_t(); - } - - const char *group() const { - return zmq_msg_group(const_cast(&msg)); - } - - void set_group(const char *group) { - int rc = zmq_msg_set_group(&msg, group); - if (rc != 0) - throw error_t(); - } -#endif - - // interpret message content as a string - std::string to_string() const { - return std::string(static_cast(data()), size()); - } -#if CPPZMQ_HAS_STRING_VIEW - // interpret message content as a string - std::string_view to_string_view() const noexcept { - return std::string_view(static_cast(data()), size()); - } -#endif - - /** Dump content to string for debugging. - * Ascii chars are readable, the rest is printed as hex. - * Probably ridiculously slow. - * Use to_string() or to_string_view() for - * interpreting the message as a string. - */ - std::string str() const { - // Partly mutuated from the same method in zmq::multipart_t - std::stringstream os; - - const unsigned char *msg_data = this->data(); - unsigned char byte; - size_t size = this->size(); - int is_ascii[2] = {0, 0}; - - os << "zmq::message_t [size " << std::dec << std::setw(3) - << std::setfill('0') << size << "] ("; - // Totally arbitrary - if (size >= 1000) { - os << "... too big to print)"; - } else { - while (size--) { - byte = *msg_data++; - - is_ascii[1] = (byte >= 32 && byte < 127); - if (is_ascii[1] != is_ascii[0]) - os << " "; // Separate text/non text - - if (is_ascii[1]) { - os << byte; - } else { - os << std::hex << std::uppercase << std::setw(2) << std::setfill('0') - << static_cast(byte); - } - is_ascii[0] = is_ascii[1]; - } - os << ")"; - } - return os.str(); - } - - void swap(message_t &other) ZMQ_NOTHROW { - // this assumes zmq::msg_t from libzmq is trivially relocatable - std::swap(msg, other.msg); - } - - ZMQ_NODISCARD zmq_msg_t *handle() ZMQ_NOTHROW { return &msg; } - ZMQ_NODISCARD const zmq_msg_t *handle() const ZMQ_NOTHROW { return &msg; } - -private: - // The underlying message - zmq_msg_t msg; - - // Disable implicit message copying, so that users won't use shared - // messages (less efficient) without being aware of the fact. - message_t(const message_t &) ZMQ_DELETED_FUNCTION; - void operator=(const message_t &) ZMQ_DELETED_FUNCTION; -}; - -inline void swap(message_t &a, message_t &b) ZMQ_NOTHROW { a.swap(b); } - -#ifdef ZMQ_CPP11 -enum class ctxopt { -#ifdef ZMQ_BLOCKY - blocky = ZMQ_BLOCKY, -#endif -#ifdef ZMQ_IO_THREADS - io_threads = ZMQ_IO_THREADS, -#endif -#ifdef ZMQ_THREAD_SCHED_POLICY - thread_sched_policy = ZMQ_THREAD_SCHED_POLICY, -#endif -#ifdef ZMQ_THREAD_PRIORITY - thread_priority = ZMQ_THREAD_PRIORITY, -#endif -#ifdef ZMQ_THREAD_AFFINITY_CPU_ADD - thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, -#endif -#ifdef ZMQ_THREAD_AFFINITY_CPU_REMOVE - thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, -#endif -#ifdef ZMQ_THREAD_NAME_PREFIX - thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, -#endif -#ifdef ZMQ_MAX_MSGSZ - max_msgsz = ZMQ_MAX_MSGSZ, -#endif -#ifdef ZMQ_ZERO_COPY_RECV - zero_copy_recv = ZMQ_ZERO_COPY_RECV, -#endif -#ifdef ZMQ_MAX_SOCKETS - max_sockets = ZMQ_MAX_SOCKETS, -#endif -#ifdef ZMQ_SOCKET_LIMIT - socket_limit = ZMQ_SOCKET_LIMIT, -#endif -#ifdef ZMQ_IPV6 - ipv6 = ZMQ_IPV6, -#endif -#ifdef ZMQ_MSG_T_SIZE - msg_t_size = ZMQ_MSG_T_SIZE -#endif -}; -#endif - -class context_t { -public: - context_t() { - ptr = zmq_ctx_new(); - if (ptr == ZMQ_NULLPTR) - throw error_t(); - } - - explicit context_t(int io_threads_, int max_sockets_ = ZMQ_MAX_SOCKETS_DFLT) { - ptr = zmq_ctx_new(); - if (ptr == ZMQ_NULLPTR) - throw error_t(); - - int rc = zmq_ctx_set(ptr, ZMQ_IO_THREADS, io_threads_); - ZMQ_ASSERT(rc == 0); - - rc = zmq_ctx_set(ptr, ZMQ_MAX_SOCKETS, max_sockets_); - ZMQ_ASSERT(rc == 0); - } - -#ifdef ZMQ_HAS_RVALUE_REFS - context_t(context_t &&rhs) ZMQ_NOTHROW : ptr(rhs.ptr) { - rhs.ptr = ZMQ_NULLPTR; - } - context_t &operator=(context_t &&rhs) ZMQ_NOTHROW { - close(); - std::swap(ptr, rhs.ptr); - return *this; - } -#endif - - ~context_t() ZMQ_NOTHROW { close(); } - - ZMQ_CPP11_DEPRECATED("from 4.7.0, use set taking zmq::ctxopt instead") - int setctxopt(int option_, int optval_) { - int rc = zmq_ctx_set(ptr, option_, optval_); - ZMQ_ASSERT(rc == 0); - return rc; - } - - ZMQ_CPP11_DEPRECATED("from 4.7.0, use get taking zmq::ctxopt instead") - int getctxopt(int option_) { return zmq_ctx_get(ptr, option_); } - -#ifdef ZMQ_CPP11 - void set(ctxopt option, int optval) { - int rc = zmq_ctx_set(ptr, static_cast(option), optval); - if (rc == -1) - throw error_t(); - } - - ZMQ_NODISCARD int get(ctxopt option) { - int rc = zmq_ctx_get(ptr, static_cast(option)); - // some options have a default value of -1 - // which is unfortunate, and may result in errors - // that don't make sense - if (rc == -1) - throw error_t(); - return rc; - } -#endif - - // Terminates context (see also shutdown()). - void close() ZMQ_NOTHROW { - if (ptr == ZMQ_NULLPTR) - return; - - int rc; - do { - rc = zmq_ctx_term(ptr); - } while (rc == -1 && errno == EINTR); - - ZMQ_ASSERT(rc == 0); - ptr = ZMQ_NULLPTR; - } - - // Shutdown context in preparation for termination (close()). - // Causes all blocking socket operations and any further - // socket operations to return with ETERM. - void shutdown() ZMQ_NOTHROW { - if (ptr == ZMQ_NULLPTR) - return; - int rc = zmq_ctx_shutdown(ptr); - ZMQ_ASSERT(rc == 0); - } - - // Be careful with this, it's probably only useful for - // using the C api together with an existing C++ api. - // Normally you should never need to use this. - ZMQ_EXPLICIT operator void *() ZMQ_NOTHROW { return ptr; } - - ZMQ_EXPLICIT operator void const *() const ZMQ_NOTHROW { return ptr; } - - ZMQ_NODISCARD void *handle() ZMQ_NOTHROW { return ptr; } - - ZMQ_DEPRECATED("from 4.7.0, use handle() != nullptr instead") - operator bool() const ZMQ_NOTHROW { return ptr != ZMQ_NULLPTR; } - - void swap(context_t &other) ZMQ_NOTHROW { std::swap(ptr, other.ptr); } - -private: - void *ptr; - - context_t(const context_t &) ZMQ_DELETED_FUNCTION; - void operator=(const context_t &) ZMQ_DELETED_FUNCTION; -}; - -inline void swap(context_t &a, context_t &b) ZMQ_NOTHROW { a.swap(b); } - -#ifdef ZMQ_CPP11 - -struct recv_buffer_size { - size_t size; // number of bytes written to buffer - size_t untruncated_size; // untruncated message size in bytes - - ZMQ_NODISCARD bool truncated() const noexcept { - return size != untruncated_size; - } -}; - -#if CPPZMQ_HAS_OPTIONAL - -using send_result_t = std::optional; -using recv_result_t = std::optional; -using recv_buffer_result_t = std::optional; - -#else - -namespace detail { -// A C++11 type emulating the most basic -// operations of std::optional for trivial types -template class trivial_optional { -public: - static_assert(std::is_trivial::value, "T must be trivial"); - using value_type = T; - - trivial_optional() = default; - trivial_optional(T value) noexcept : _value(value), _has_value(true) {} - - const T *operator->() const noexcept { - assert(_has_value); - return &_value; - } - T *operator->() noexcept { - assert(_has_value); - return &_value; - } - - const T &operator*() const noexcept { - assert(_has_value); - return _value; - } - T &operator*() noexcept { - assert(_has_value); - return _value; - } - - T &value() { - if (!_has_value) - throw std::exception(); - return _value; - } - const T &value() const { - if (!_has_value) - throw std::exception(); - return _value; - } - - explicit operator bool() const noexcept { return _has_value; } - bool has_value() const noexcept { return _has_value; } - -private: - T _value{}; - bool _has_value{false}; -}; -} // namespace detail - -using send_result_t = detail::trivial_optional; -using recv_result_t = detail::trivial_optional; -using recv_buffer_result_t = detail::trivial_optional; - -#endif - -namespace detail { -template constexpr T enum_bit_or(T a, T b) noexcept { - static_assert(std::is_enum::value, "must be enum"); - using U = typename std::underlying_type::type; - return static_cast(static_cast(a) | static_cast(b)); -} -template constexpr T enum_bit_and(T a, T b) noexcept { - static_assert(std::is_enum::value, "must be enum"); - using U = typename std::underlying_type::type; - return static_cast(static_cast(a) & static_cast(b)); -} -template constexpr T enum_bit_xor(T a, T b) noexcept { - static_assert(std::is_enum::value, "must be enum"); - using U = typename std::underlying_type::type; - return static_cast(static_cast(a) ^ static_cast(b)); -} -template constexpr T enum_bit_not(T a) noexcept { - static_assert(std::is_enum::value, "must be enum"); - using U = typename std::underlying_type::type; - return static_cast(~static_cast(a)); -} -} // namespace detail - -// partially satisfies named requirement BitmaskType -enum class send_flags : int { - none = 0, - dontwait = ZMQ_DONTWAIT, - sndmore = ZMQ_SNDMORE -}; - -constexpr send_flags operator|(send_flags a, send_flags b) noexcept { - return detail::enum_bit_or(a, b); -} -constexpr send_flags operator&(send_flags a, send_flags b) noexcept { - return detail::enum_bit_and(a, b); -} -constexpr send_flags operator^(send_flags a, send_flags b) noexcept { - return detail::enum_bit_xor(a, b); -} -constexpr send_flags operator~(send_flags a) noexcept { - return detail::enum_bit_not(a); -} - -// partially satisfies named requirement BitmaskType -enum class recv_flags : int { none = 0, dontwait = ZMQ_DONTWAIT }; - -constexpr recv_flags operator|(recv_flags a, recv_flags b) noexcept { - return detail::enum_bit_or(a, b); -} -constexpr recv_flags operator&(recv_flags a, recv_flags b) noexcept { - return detail::enum_bit_and(a, b); -} -constexpr recv_flags operator^(recv_flags a, recv_flags b) noexcept { - return detail::enum_bit_xor(a, b); -} -constexpr recv_flags operator~(recv_flags a) noexcept { - return detail::enum_bit_not(a); -} - -// mutable_buffer, const_buffer and buffer are based on -// the Networking TS specification, draft: -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4771.pdf - -class mutable_buffer { -public: - constexpr mutable_buffer() noexcept : _data(nullptr), _size(0) {} - constexpr mutable_buffer(void *p, size_t n) noexcept : _data(p), _size(n) { -#ifdef ZMQ_EXTENDED_CONSTEXPR - assert(p != nullptr || n == 0); -#endif - } - - constexpr void *data() const noexcept { return _data; } - constexpr size_t size() const noexcept { return _size; } - mutable_buffer &operator+=(size_t n) noexcept { - // (std::min) is a workaround for when a min macro is defined - const auto shift = (std::min)(n, _size); - _data = static_cast(_data) + shift; - _size -= shift; - return *this; - } - -private: - void *_data; - size_t _size; -}; - -inline mutable_buffer operator+(const mutable_buffer &mb, size_t n) noexcept { - return mutable_buffer(static_cast(mb.data()) + - (std::min)(n, mb.size()), - mb.size() - (std::min)(n, mb.size())); -} -inline mutable_buffer operator+(size_t n, const mutable_buffer &mb) noexcept { - return mb + n; -} - -class const_buffer { -public: - constexpr const_buffer() noexcept : _data(nullptr), _size(0) {} - constexpr const_buffer(const void *p, size_t n) noexcept - : _data(p), _size(n) { -#ifdef ZMQ_EXTENDED_CONSTEXPR - assert(p != nullptr || n == 0); -#endif - } - constexpr const_buffer(const mutable_buffer &mb) noexcept - : _data(mb.data()), _size(mb.size()) {} - - constexpr const void *data() const noexcept { return _data; } - constexpr size_t size() const noexcept { return _size; } - const_buffer &operator+=(size_t n) noexcept { - const auto shift = (std::min)(n, _size); - _data = static_cast(_data) + shift; - _size -= shift; - return *this; - } - -private: - const void *_data; - size_t _size; -}; - -inline const_buffer operator+(const const_buffer &cb, size_t n) noexcept { - return const_buffer(static_cast(cb.data()) + - (std::min)(n, cb.size()), - cb.size() - (std::min)(n, cb.size())); -} -inline const_buffer operator+(size_t n, const const_buffer &cb) noexcept { - return cb + n; -} - -// buffer creation - -constexpr mutable_buffer buffer(void *p, size_t n) noexcept { - return mutable_buffer(p, n); -} -constexpr const_buffer buffer(const void *p, size_t n) noexcept { - return const_buffer(p, n); -} -constexpr mutable_buffer buffer(const mutable_buffer &mb) noexcept { - return mb; -} -inline mutable_buffer buffer(const mutable_buffer &mb, size_t n) noexcept { - return mutable_buffer(mb.data(), (std::min)(mb.size(), n)); -} -constexpr const_buffer buffer(const const_buffer &cb) noexcept { return cb; } -inline const_buffer buffer(const const_buffer &cb, size_t n) noexcept { - return const_buffer(cb.data(), (std::min)(cb.size(), n)); -} - -namespace detail { -template struct is_buffer { - static constexpr bool value = std::is_same::value || - std::is_same::value; -}; - -template struct is_pod_like { - // NOTE: The networking draft N4771 section 16.11 requires - // T in the buffer functions below to be - // trivially copyable OR standard layout. - // Here we decide to be conservative and require both. - static constexpr bool value = - ZMQ_IS_TRIVIALLY_COPYABLE(T) && std::is_standard_layout::value; -}; - -template -constexpr auto seq_size(const C &c) noexcept -> decltype(c.size()) { - return c.size(); -} -template -constexpr size_t seq_size(const T (& /*array*/)[N]) noexcept { - return N; -} - -template -auto buffer_contiguous_sequence(Seq &&seq) noexcept - -> decltype(buffer(std::addressof(*std::begin(seq)), size_t{})) { - using T = typename std::remove_cv< - typename std::remove_reference::type>::type; - static_assert(detail::is_pod_like::value, "T must be POD"); - - const auto size = seq_size(seq); - return buffer(size != 0u ? std::addressof(*std::begin(seq)) : nullptr, - size * sizeof(T)); -} -template -auto buffer_contiguous_sequence(Seq &&seq, size_t n_bytes) noexcept - -> decltype(buffer_contiguous_sequence(seq)) { - using T = typename std::remove_cv< - typename std::remove_reference::type>::type; - static_assert(detail::is_pod_like::value, "T must be POD"); - - const auto size = seq_size(seq); - return buffer(size != 0u ? std::addressof(*std::begin(seq)) : nullptr, - (std::min)(size * sizeof(T), n_bytes)); -} - -} // namespace detail - -// C array -template mutable_buffer buffer(T (&data)[N]) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -mutable_buffer buffer(T (&data)[N], size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} -template const_buffer buffer(const T (&data)[N]) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -const_buffer buffer(const T (&data)[N], size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} -// std::array -template -mutable_buffer buffer(std::array &data) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -mutable_buffer buffer(std::array &data, size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} -template -const_buffer buffer(std::array &data) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -const_buffer buffer(std::array &data, size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} -template -const_buffer buffer(const std::array &data) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -const_buffer buffer(const std::array &data, size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} -// std::vector -template -mutable_buffer buffer(std::vector &data) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -mutable_buffer buffer(std::vector &data, - size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} -template -const_buffer buffer(const std::vector &data) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -const_buffer buffer(const std::vector &data, - size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} -// std::basic_string -template -mutable_buffer buffer(std::basic_string &data) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -mutable_buffer buffer(std::basic_string &data, - size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} -template -const_buffer -buffer(const std::basic_string &data) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -const_buffer buffer(const std::basic_string &data, - size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} - -#if CPPZMQ_HAS_STRING_VIEW -// std::basic_string_view -template -const_buffer buffer(std::basic_string_view data) noexcept { - return detail::buffer_contiguous_sequence(data); -} -template -const_buffer buffer(std::basic_string_view data, - size_t n_bytes) noexcept { - return detail::buffer_contiguous_sequence(data, n_bytes); -} -#endif - -// Buffer for a string literal (null terminated) -// where the buffer size excludes the terminating character. -// Equivalent to zmq::buffer(std::string_view("...")). -template -constexpr const_buffer str_buffer(const Char (&data)[N]) noexcept { - static_assert(detail::is_pod_like::value, "Char must be POD"); -#ifdef ZMQ_EXTENDED_CONSTEXPR - assert(data[N - 1] == Char{0}); -#endif - return const_buffer(static_cast(data), (N - 1) * sizeof(Char)); -} - -namespace literals { -constexpr const_buffer operator"" _zbuf(const char *str, size_t len) noexcept { - return const_buffer(str, len * sizeof(char)); -} -constexpr const_buffer operator"" _zbuf(const wchar_t *str, - size_t len) noexcept { - return const_buffer(str, len * sizeof(wchar_t)); -} -constexpr const_buffer operator"" _zbuf(const char16_t *str, - size_t len) noexcept { - return const_buffer(str, len * sizeof(char16_t)); -} -constexpr const_buffer operator"" _zbuf(const char32_t *str, - size_t len) noexcept { - return const_buffer(str, len * sizeof(char32_t)); -} -} // namespace literals - -#ifdef ZMQ_CPP11 -enum class socket_type : int { - req = ZMQ_REQ, - rep = ZMQ_REP, - dealer = ZMQ_DEALER, - router = ZMQ_ROUTER, - pub = ZMQ_PUB, - sub = ZMQ_SUB, - xpub = ZMQ_XPUB, - xsub = ZMQ_XSUB, - push = ZMQ_PUSH, - pull = ZMQ_PULL, -#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0) - server = ZMQ_SERVER, - client = ZMQ_CLIENT, - radio = ZMQ_RADIO, - dish = ZMQ_DISH, - gather = ZMQ_GATHER, - scatter = ZMQ_SCATTER, - dgram = ZMQ_DGRAM, -#endif -#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 3) - peer = ZMQ_PEER, - channel = ZMQ_CHANNEL, -#endif -#if ZMQ_VERSION_MAJOR >= 4 - stream = ZMQ_STREAM, -#endif - pair = ZMQ_PAIR -}; -#endif - -namespace sockopt { -// There are two types of options, -// integral type with known compiler time size (int, bool, int64_t, uint64_t) -// and arrays with dynamic size (strings, binary data). - -// BoolUnit: if true accepts values of type bool (but passed as T into libzmq) -template struct integral_option {}; - -// NullTerm: -// 0: binary data -// 1: null-terminated string (`getsockopt` size includes null) -// 2: binary (size 32) or Z85 encoder string of size 41 (null included) -template struct array_option {}; - -#define ZMQ_DEFINE_INTEGRAL_OPT(OPT, NAME, TYPE) \ - using NAME##_t = integral_option; \ - ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {} -#define ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(OPT, NAME, TYPE) \ - using NAME##_t = integral_option; \ - ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {} -#define ZMQ_DEFINE_ARRAY_OPT(OPT, NAME) \ - using NAME##_t = array_option; \ - ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {} -#define ZMQ_DEFINE_ARRAY_OPT_BINARY(OPT, NAME) \ - using NAME##_t = array_option; \ - ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {} -#define ZMQ_DEFINE_ARRAY_OPT_BIN_OR_Z85(OPT, NAME) \ - using NAME##_t = array_option; \ - ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {} - -// deprecated, use zmq::fd_t -using cppzmq_fd_t = ::zmq::fd_t; - -#ifdef ZMQ_AFFINITY -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_AFFINITY, affinity, uint64_t); -#endif -#ifdef ZMQ_BACKLOG -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_BACKLOG, backlog, int); -#endif -#ifdef ZMQ_BINDTODEVICE -ZMQ_DEFINE_ARRAY_OPT_BINARY(ZMQ_BINDTODEVICE, bindtodevice); -#endif -#ifdef ZMQ_CONFLATE -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_CONFLATE, conflate, int); -#endif -#ifdef ZMQ_CONNECT_ROUTING_ID -ZMQ_DEFINE_ARRAY_OPT(ZMQ_CONNECT_ROUTING_ID, connect_routing_id); -#endif -#ifdef ZMQ_CONNECT_TIMEOUT -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_CONNECT_TIMEOUT, connect_timeout, int); -#endif -#ifdef ZMQ_CURVE_PUBLICKEY -ZMQ_DEFINE_ARRAY_OPT_BIN_OR_Z85(ZMQ_CURVE_PUBLICKEY, curve_publickey); -#endif -#ifdef ZMQ_CURVE_SECRETKEY -ZMQ_DEFINE_ARRAY_OPT_BIN_OR_Z85(ZMQ_CURVE_SECRETKEY, curve_secretkey); -#endif -#ifdef ZMQ_CURVE_SERVER -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_CURVE_SERVER, curve_server, int); -#endif -#ifdef ZMQ_CURVE_SERVERKEY -ZMQ_DEFINE_ARRAY_OPT_BIN_OR_Z85(ZMQ_CURVE_SERVERKEY, curve_serverkey); -#endif -#ifdef ZMQ_DISCONNECT_MSG -ZMQ_DEFINE_ARRAY_OPT_BINARY(ZMQ_DISCONNECT_MSG, disconnect_msg); -#endif -#ifdef ZMQ_EVENTS -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_EVENTS, events, int); -#endif -#ifdef ZMQ_FD -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_FD, fd, ::zmq::fd_t); -#endif -#ifdef ZMQ_GSSAPI_PLAINTEXT -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_GSSAPI_PLAINTEXT, gssapi_plaintext, int); -#endif -#ifdef ZMQ_GSSAPI_SERVER -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_GSSAPI_SERVER, gssapi_server, int); -#endif -#ifdef ZMQ_GSSAPI_SERVICE_PRINCIPAL -ZMQ_DEFINE_ARRAY_OPT(ZMQ_GSSAPI_SERVICE_PRINCIPAL, gssapi_service_principal); -#endif -#ifdef ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE, - gssapi_service_principal_nametype, int); -#endif -#ifdef ZMQ_GSSAPI_PRINCIPAL -ZMQ_DEFINE_ARRAY_OPT(ZMQ_GSSAPI_PRINCIPAL, gssapi_principal); -#endif -#ifdef ZMQ_GSSAPI_PRINCIPAL_NAMETYPE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_GSSAPI_PRINCIPAL_NAMETYPE, - gssapi_principal_nametype, int); -#endif -#ifdef ZMQ_HANDSHAKE_IVL -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_HANDSHAKE_IVL, handshake_ivl, int); -#endif -#ifdef ZMQ_HEARTBEAT_IVL -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_HEARTBEAT_IVL, heartbeat_ivl, int); -#endif -#ifdef ZMQ_HEARTBEAT_TIMEOUT -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_HEARTBEAT_TIMEOUT, heartbeat_timeout, int); -#endif -#ifdef ZMQ_HEARTBEAT_TTL -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_HEARTBEAT_TTL, heartbeat_ttl, int); -#endif -#ifdef ZMQ_HELLO_MSG -ZMQ_DEFINE_ARRAY_OPT_BINARY(ZMQ_HELLO_MSG, hello_msg); -#endif -#ifdef ZMQ_IMMEDIATE -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_IMMEDIATE, immediate, int); -#endif -#ifdef ZMQ_INVERT_MATCHING -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_INVERT_MATCHING, invert_matching, int); -#endif -#ifdef ZMQ_IPV6 -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_IPV6, ipv6, int); -#endif -#ifdef ZMQ_LAST_ENDPOINT -ZMQ_DEFINE_ARRAY_OPT(ZMQ_LAST_ENDPOINT, last_endpoint); -#endif -#ifdef ZMQ_LINGER -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_LINGER, linger, int); -#endif -#ifdef ZMQ_MAXMSGSIZE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_MAXMSGSIZE, maxmsgsize, int64_t); -#endif -#ifdef ZMQ_MECHANISM -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_MECHANISM, mechanism, int); -#endif -#ifdef ZMQ_METADATA -ZMQ_DEFINE_ARRAY_OPT(ZMQ_METADATA, metadata); -#endif -#ifdef ZMQ_MULTICAST_HOPS -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_MULTICAST_HOPS, multicast_hops, int); -#endif -#ifdef ZMQ_MULTICAST_LOOP -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_MULTICAST_LOOP, multicast_loop, int); -#endif -#ifdef ZMQ_MULTICAST_MAXTPDU -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_MULTICAST_MAXTPDU, multicast_maxtpdu, int); -#endif -#ifdef ZMQ_ONLY_FIRST_SUBSCRIBE -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_ONLY_FIRST_SUBSCRIBE, - only_first_subscribe, int); -#endif -#ifdef ZMQ_PLAIN_SERVER -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_PLAIN_SERVER, plain_server, int); -#endif -#ifdef ZMQ_PLAIN_PASSWORD -ZMQ_DEFINE_ARRAY_OPT(ZMQ_PLAIN_PASSWORD, plain_password); -#endif -#ifdef ZMQ_PLAIN_USERNAME -ZMQ_DEFINE_ARRAY_OPT(ZMQ_PLAIN_USERNAME, plain_username); -#endif -#ifdef ZMQ_PRIORITY -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_PRIORITY, priority, int); -#endif -#ifdef ZMQ_USE_FD -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_USE_FD, use_fd, int); -#endif -#ifdef ZMQ_PROBE_ROUTER -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_PROBE_ROUTER, probe_router, int); -#endif -#ifdef ZMQ_RATE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_RATE, rate, int); -#endif -#ifdef ZMQ_RCVBUF -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_RCVBUF, rcvbuf, int); -#endif -#ifdef ZMQ_RCVHWM -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_RCVHWM, rcvhwm, int); -#endif -#ifdef ZMQ_RCVMORE -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_RCVMORE, rcvmore, int); -#endif -#ifdef ZMQ_RCVTIMEO -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_RCVTIMEO, rcvtimeo, int); -#endif -#ifdef ZMQ_RECONNECT_IVL -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_RECONNECT_IVL, reconnect_ivl, int); -#endif -#ifdef ZMQ_RECONNECT_IVL_MAX -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_RECONNECT_IVL_MAX, reconnect_ivl_max, int); -#endif -#ifdef ZMQ_RECONNECT_STOP -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_RECONNECT_STOP, reconnect_stop, int); -#endif -#ifdef ZMQ_RECOVERY_IVL -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_RECOVERY_IVL, recovery_ivl, int); -#endif -#ifdef ZMQ_REQ_CORRELATE -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_REQ_CORRELATE, req_correlate, int); -#endif -#ifdef ZMQ_REQ_RELAXED -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_REQ_RELAXED, req_relaxed, int); -#endif -#ifdef ZMQ_ROUTER_HANDOVER -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_ROUTER_HANDOVER, router_handover, int); -#endif -#ifdef ZMQ_ROUTER_MANDATORY -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_ROUTER_MANDATORY, router_mandatory, int); -#endif -#ifdef ZMQ_ROUTER_NOTIFY -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_ROUTER_NOTIFY, router_notify, int); -#endif -#ifdef ZMQ_ROUTING_ID -ZMQ_DEFINE_ARRAY_OPT_BINARY(ZMQ_ROUTING_ID, routing_id); -#endif -#ifdef ZMQ_SNDBUF -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_SNDBUF, sndbuf, int); -#endif -#ifdef ZMQ_SNDHWM -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_SNDHWM, sndhwm, int); -#endif -#ifdef ZMQ_SNDTIMEO -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_SNDTIMEO, sndtimeo, int); -#endif -#ifdef ZMQ_SOCKS_PASSWORD -ZMQ_DEFINE_ARRAY_OPT(ZMQ_SOCKS_PASSWORD, socks_password); -#endif -#ifdef ZMQ_SOCKS_PROXY -ZMQ_DEFINE_ARRAY_OPT(ZMQ_SOCKS_PROXY, socks_proxy); -#endif -#ifdef ZMQ_SOCKS_USERNAME -ZMQ_DEFINE_ARRAY_OPT(ZMQ_SOCKS_USERNAME, socks_username); -#endif -#ifdef ZMQ_STREAM_NOTIFY -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_STREAM_NOTIFY, stream_notify, int); -#endif -#ifdef ZMQ_SUBSCRIBE -ZMQ_DEFINE_ARRAY_OPT(ZMQ_SUBSCRIBE, subscribe); -#endif -#ifdef ZMQ_TCP_KEEPALIVE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_TCP_KEEPALIVE, tcp_keepalive, int); -#endif -#ifdef ZMQ_TCP_KEEPALIVE_CNT -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_TCP_KEEPALIVE_CNT, tcp_keepalive_cnt, int); -#endif -#ifdef ZMQ_TCP_KEEPALIVE_IDLE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_TCP_KEEPALIVE_IDLE, tcp_keepalive_idle, int); -#endif -#ifdef ZMQ_TCP_KEEPALIVE_INTVL -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_TCP_KEEPALIVE_INTVL, tcp_keepalive_intvl, int); -#endif -#ifdef ZMQ_TCP_MAXRT -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_TCP_MAXRT, tcp_maxrt, int); -#endif -#ifdef ZMQ_THREAD_SAFE -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_THREAD_SAFE, thread_safe, int); -#endif -#ifdef ZMQ_TOS -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_TOS, tos, int); -#endif -#ifdef ZMQ_TYPE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_TYPE, type, int); -#ifdef ZMQ_CPP11 -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_TYPE, socket_type, socket_type); -#endif // ZMQ_CPP11 -#endif // ZMQ_TYPE -#ifdef ZMQ_UNSUBSCRIBE -ZMQ_DEFINE_ARRAY_OPT(ZMQ_UNSUBSCRIBE, unsubscribe); -#endif -#ifdef ZMQ_VMCI_BUFFER_SIZE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_VMCI_BUFFER_SIZE, vmci_buffer_size, uint64_t); -#endif -#ifdef ZMQ_VMCI_BUFFER_MIN_SIZE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_VMCI_BUFFER_MIN_SIZE, vmci_buffer_min_size, - uint64_t); -#endif -#ifdef ZMQ_VMCI_BUFFER_MAX_SIZE -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_VMCI_BUFFER_MAX_SIZE, vmci_buffer_max_size, - uint64_t); -#endif -#ifdef ZMQ_VMCI_CONNECT_TIMEOUT -ZMQ_DEFINE_INTEGRAL_OPT(ZMQ_VMCI_CONNECT_TIMEOUT, vmci_connect_timeout, int); -#endif -#ifdef ZMQ_XPUB_VERBOSE -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_XPUB_VERBOSE, xpub_verbose, int); -#endif -#ifdef ZMQ_XPUB_VERBOSER -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_XPUB_VERBOSER, xpub_verboser, int); -#endif -#ifdef ZMQ_XPUB_MANUAL -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_XPUB_MANUAL, xpub_manual, int); -#endif -#ifdef ZMQ_XPUB_MANUAL_LAST_VALUE -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_XPUB_MANUAL_LAST_VALUE, - xpub_manual_last_value, int); -#endif -#ifdef ZMQ_XPUB_NODROP -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_XPUB_NODROP, xpub_nodrop, int); -#endif -#ifdef ZMQ_XPUB_WELCOME_MSG -ZMQ_DEFINE_ARRAY_OPT(ZMQ_XPUB_WELCOME_MSG, xpub_welcome_msg); -#endif -#ifdef ZMQ_ZAP_ENFORCE_DOMAIN -ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(ZMQ_ZAP_ENFORCE_DOMAIN, zap_enforce_domain, - int); -#endif -#ifdef ZMQ_ZAP_DOMAIN -ZMQ_DEFINE_ARRAY_OPT(ZMQ_ZAP_DOMAIN, zap_domain); -#endif - -} // namespace sockopt -#endif // ZMQ_CPP11 - -namespace detail { -class socket_base { -public: - socket_base() ZMQ_NOTHROW : _handle(ZMQ_NULLPTR) {} - ZMQ_EXPLICIT socket_base(void *handle) ZMQ_NOTHROW : _handle(handle) {} - - template - ZMQ_CPP11_DEPRECATED("from 4.7.0, use `set` taking option from zmq::sockopt") - void setsockopt(int option_, T const &optval) { - setsockopt(option_, &optval, sizeof(T)); - } - - ZMQ_CPP11_DEPRECATED("from 4.7.0, use `set` taking option from zmq::sockopt") - void setsockopt(int option_, const void *optval_, size_t optvallen_) { - int rc = zmq_setsockopt(_handle, option_, optval_, optvallen_); - if (rc != 0) - throw error_t(); - } - - ZMQ_CPP11_DEPRECATED("from 4.7.0, use `get` taking option from zmq::sockopt") - void getsockopt(int option_, void *optval_, size_t *optvallen_) const { - int rc = zmq_getsockopt(_handle, option_, optval_, optvallen_); - if (rc != 0) - throw error_t(); - } - - template - ZMQ_CPP11_DEPRECATED("from 4.7.0, use `get` taking option from zmq::sockopt") - T getsockopt(int option_) const { - T optval; - size_t optlen = sizeof(T); - getsockopt(option_, &optval, &optlen); - return optval; - } - -#ifdef ZMQ_CPP11 - // Set integral socket option, e.g. - // `socket.set(zmq::sockopt::linger, 0)` - template - void set(sockopt::integral_option, const T &val) { - static_assert(std::is_integral::value, "T must be integral"); - set_option(Opt, &val, sizeof val); - } - - // Set integral socket option from boolean, e.g. - // `socket.set(zmq::sockopt::immediate, false)` - template - void set(sockopt::integral_option, bool val) { - static_assert(std::is_integral::value, "T must be integral"); - T rep_val = val; - set_option(Opt, &rep_val, sizeof rep_val); - } - - // Set array socket option, e.g. - // `socket.set(zmq::sockopt::plain_username, "foo123")` - template - void set(sockopt::array_option, const char *buf) { - set_option(Opt, buf, std::strlen(buf)); - } - - // Set array socket option, e.g. - // `socket.set(zmq::sockopt::routing_id, zmq::buffer(id))` - template - void set(sockopt::array_option, const_buffer buf) { - set_option(Opt, buf.data(), buf.size()); - } - - // Set array socket option, e.g. - // `socket.set(zmq::sockopt::routing_id, id_str)` - template - void set(sockopt::array_option, const std::string &buf) { - set_option(Opt, buf.data(), buf.size()); - } - -#if CPPZMQ_HAS_STRING_VIEW - // Set array socket option, e.g. - // `socket.set(zmq::sockopt::routing_id, id_str)` - template - void set(sockopt::array_option, std::string_view buf) { - set_option(Opt, buf.data(), buf.size()); - } -#endif - - // Get scalar socket option, e.g. - // `auto opt = socket.get(zmq::sockopt::linger)` - template - ZMQ_NODISCARD T get(sockopt::integral_option) const { - static_assert(std::is_scalar::value, "T must be scalar"); - T val; - size_t size = sizeof val; - get_option(Opt, &val, &size); - assert(size == sizeof val); - return val; - } - - // Get array socket option, writes to buf, returns option size in bytes, e.g. - // `size_t optsize = socket.get(zmq::sockopt::routing_id, zmq::buffer(id))` - template - ZMQ_NODISCARD size_t get(sockopt::array_option, - mutable_buffer buf) const { - size_t size = buf.size(); - get_option(Opt, buf.data(), &size); - return size; - } - - // Get array socket option as string (initializes the string buffer size to - // init_size) e.g. `auto s = socket.get(zmq::sockopt::routing_id)` Note: - // removes the null character from null-terminated string options, i.e. the - // string size excludes the null character. - template - ZMQ_NODISCARD std::string get(sockopt::array_option, - size_t init_size = 1024) const { - if ZMQ_CONSTEXPR_IF (NullTerm == 2) { - if (init_size == 1024) { - init_size = 41; // get as Z85 string - } - } - std::string str(init_size, '\0'); - size_t size = get(sockopt::array_option{}, buffer(str)); - if ZMQ_CONSTEXPR_IF (NullTerm == 1) { - if (size > 0) { - assert(str[size - 1] == '\0'); - --size; - } - } else if ZMQ_CONSTEXPR_IF (NullTerm == 2) { - assert(size == 32 || size == 41); - if (size == 41) { - assert(str[size - 1] == '\0'); - --size; - } - } - str.resize(size); - return str; - } -#endif - - void bind(std::string const &addr) { bind(addr.c_str()); } - - void bind(const char *addr_) { - int rc = zmq_bind(_handle, addr_); - if (rc != 0) - throw error_t(); - } - - void unbind(std::string const &addr) { unbind(addr.c_str()); } - - void unbind(const char *addr_) { - int rc = zmq_unbind(_handle, addr_); - if (rc != 0) - throw error_t(); - } - - void connect(std::string const &addr) { connect(addr.c_str()); } - - void connect(const char *addr_) { - int rc = zmq_connect(_handle, addr_); - if (rc != 0) - throw error_t(); - } - - void disconnect(std::string const &addr) { disconnect(addr.c_str()); } - - void disconnect(const char *addr_) { - int rc = zmq_disconnect(_handle, addr_); - if (rc != 0) - throw error_t(); - } - - ZMQ_DEPRECATED("from 4.7.1, use handle() != nullptr or operator bool") - bool connected() const ZMQ_NOTHROW { return (_handle != ZMQ_NULLPTR); } - - ZMQ_CPP11_DEPRECATED( - "from 4.3.1, use send taking a const_buffer and send_flags") - size_t send(const void *buf_, size_t len_, int flags_ = 0) { - int nbytes = zmq_send(_handle, buf_, len_, flags_); - if (nbytes >= 0) - return static_cast(nbytes); - if (zmq_errno() == EAGAIN) - return 0; - throw error_t(); - } - - ZMQ_CPP11_DEPRECATED("from 4.3.1, use send taking message_t and send_flags") - bool send(message_t &msg_, - int flags_ = 0) // default until removed - { - int nbytes = zmq_msg_send(msg_.handle(), _handle, flags_); - if (nbytes >= 0) - return true; - if (zmq_errno() == EAGAIN) - return false; - throw error_t(); - } - - template - ZMQ_CPP11_DEPRECATED( - "from 4.4.1, use send taking message_t or buffer (for contiguous " - "ranges), and send_flags") - bool send(T first, T last, int flags_ = 0) { - zmq::message_t msg(first, last); - int nbytes = zmq_msg_send(msg.handle(), _handle, flags_); - if (nbytes >= 0) - return true; - if (zmq_errno() == EAGAIN) - return false; - throw error_t(); - } - -#ifdef ZMQ_HAS_RVALUE_REFS - ZMQ_CPP11_DEPRECATED("from 4.3.1, use send taking message_t and send_flags") - bool send(message_t &&msg_, - int flags_ = 0) // default until removed - { -#ifdef ZMQ_CPP11 - return send(msg_, static_cast(flags_)).has_value(); -#else - return send(msg_, flags_); -#endif - } -#endif - -#ifdef ZMQ_CPP11 - send_result_t send(const_buffer buf, send_flags flags = send_flags::none) { - const int nbytes = - zmq_send(_handle, buf.data(), buf.size(), static_cast(flags)); - if (nbytes >= 0) - return static_cast(nbytes); - if (zmq_errno() == EAGAIN) - return {}; - throw error_t(); - } - - send_result_t send(message_t &msg, send_flags flags) { - int nbytes = zmq_msg_send(msg.handle(), _handle, static_cast(flags)); - if (nbytes >= 0) - return static_cast(nbytes); - if (zmq_errno() == EAGAIN) - return {}; - throw error_t(); - } - - send_result_t send(message_t &&msg, send_flags flags) { - return send(msg, flags); - } -#endif - - ZMQ_CPP11_DEPRECATED( - "from 4.3.1, use recv taking a mutable_buffer and recv_flags") - size_t recv(void *buf_, size_t len_, int flags_ = 0) { - int nbytes = zmq_recv(_handle, buf_, len_, flags_); - if (nbytes >= 0) - return static_cast(nbytes); - if (zmq_errno() == EAGAIN) - return 0; - throw error_t(); - } - - ZMQ_CPP11_DEPRECATED( - "from 4.3.1, use recv taking a reference to message_t and recv_flags") - bool recv(message_t *msg_, int flags_ = 0) { - int nbytes = zmq_msg_recv(msg_->handle(), _handle, flags_); - if (nbytes >= 0) - return true; - if (zmq_errno() == EAGAIN) - return false; - throw error_t(); - } - -#ifdef ZMQ_CPP11 - ZMQ_NODISCARD - recv_buffer_result_t recv(mutable_buffer buf, - recv_flags flags = recv_flags::none) { - const int nbytes = - zmq_recv(_handle, buf.data(), buf.size(), static_cast(flags)); - if (nbytes >= 0) { - return recv_buffer_size{ - (std::min)(static_cast(nbytes), buf.size()), - static_cast(nbytes)}; - } - if (zmq_errno() == EAGAIN) - return {}; - throw error_t(); - } - - ZMQ_NODISCARD - recv_result_t recv(message_t &msg, recv_flags flags = recv_flags::none) { - const int nbytes = - zmq_msg_recv(msg.handle(), _handle, static_cast(flags)); - if (nbytes >= 0) { - assert(msg.size() == static_cast(nbytes)); - return static_cast(nbytes); - } - if (zmq_errno() == EAGAIN) - return {}; - throw error_t(); - } -#endif - -#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0) - void join(const char *group) { - int rc = zmq_join(_handle, group); - if (rc != 0) - throw error_t(); - } - - void leave(const char *group) { - int rc = zmq_leave(_handle, group); - if (rc != 0) - throw error_t(); - } -#endif - - ZMQ_NODISCARD void *handle() ZMQ_NOTHROW { return _handle; } - ZMQ_NODISCARD const void *handle() const ZMQ_NOTHROW { return _handle; } - - ZMQ_EXPLICIT operator bool() const ZMQ_NOTHROW { - return _handle != ZMQ_NULLPTR; - } - // note: non-const operator bool can be removed once - // operator void* is removed from socket_t - ZMQ_EXPLICIT operator bool() ZMQ_NOTHROW { return _handle != ZMQ_NULLPTR; } - -protected: - void *_handle; - -private: - void set_option(int option_, const void *optval_, size_t optvallen_) { - int rc = zmq_setsockopt(_handle, option_, optval_, optvallen_); - if (rc != 0) - throw error_t(); - } - - void get_option(int option_, void *optval_, size_t *optvallen_) const { - int rc = zmq_getsockopt(_handle, option_, optval_, optvallen_); - if (rc != 0) - throw error_t(); - } -}; -} // namespace detail - -struct from_handle_t { - struct _private {}; // disabling use other than with from_handle - ZMQ_CONSTEXPR_FN ZMQ_EXPLICIT from_handle_t(_private /*p*/) ZMQ_NOTHROW {} -}; - -ZMQ_CONSTEXPR_VAR from_handle_t from_handle = - from_handle_t(from_handle_t::_private()); - -// A non-owning nullable reference to a socket. -// The reference is invalidated on socket close or destruction. -class socket_ref : public detail::socket_base { -public: - socket_ref() ZMQ_NOTHROW : detail::socket_base() {} -#ifdef ZMQ_CPP11 - socket_ref(std::nullptr_t) ZMQ_NOTHROW : detail::socket_base() {} -#endif - socket_ref(from_handle_t /*fh*/, void *handle) ZMQ_NOTHROW - : detail::socket_base(handle) {} -}; - -#ifdef ZMQ_CPP11 -inline bool operator==(socket_ref sr, std::nullptr_t /*p*/) ZMQ_NOTHROW { - return sr.handle() == nullptr; -} -inline bool operator==(std::nullptr_t /*p*/, socket_ref sr) ZMQ_NOTHROW { - return sr.handle() == nullptr; -} -inline bool operator!=(socket_ref sr, std::nullptr_t /*p*/) ZMQ_NOTHROW { - return !(sr == nullptr); -} -inline bool operator!=(std::nullptr_t /*p*/, socket_ref sr) ZMQ_NOTHROW { - return !(sr == nullptr); -} -#endif - -inline bool operator==(const detail::socket_base &a, - const detail::socket_base &b) ZMQ_NOTHROW { - return std::equal_to()(a.handle(), b.handle()); -} -inline bool operator!=(const detail::socket_base &a, - const detail::socket_base &b) ZMQ_NOTHROW { - return !(a == b); -} -inline bool operator<(const detail::socket_base &a, - const detail::socket_base &b) ZMQ_NOTHROW { - return std::less()(a.handle(), b.handle()); -} -inline bool operator>(const detail::socket_base &a, - const detail::socket_base &b) ZMQ_NOTHROW { - return b < a; -} -inline bool operator<=(const detail::socket_base &a, - const detail::socket_base &b) ZMQ_NOTHROW { - return !(a > b); -} -inline bool operator>=(const detail::socket_base &a, - const detail::socket_base &b) ZMQ_NOTHROW { - return !(a < b); -} - -} // namespace zmq - -#ifdef ZMQ_CPP11 -namespace std { -template <> struct hash { - size_t operator()(zmq::socket_ref sr) const ZMQ_NOTHROW { - return hash()(sr.handle()); - } -}; -} // namespace std -#endif - -namespace zmq { -class socket_t : public detail::socket_base { - friend class monitor_t; - -public: - socket_t() ZMQ_NOTHROW : detail::socket_base(ZMQ_NULLPTR), - ctxptr(ZMQ_NULLPTR) {} - - socket_t(context_t &context_, int type_) - : detail::socket_base(zmq_socket(context_.handle(), type_)), - ctxptr(context_.handle()) { - if (_handle == ZMQ_NULLPTR) - throw error_t(); - } - -#ifdef ZMQ_CPP11 - socket_t(context_t &context_, socket_type type_) - : socket_t(context_, static_cast(type_)) {} -#endif - -#ifdef ZMQ_HAS_RVALUE_REFS - socket_t(socket_t &&rhs) ZMQ_NOTHROW : detail::socket_base(rhs._handle), - ctxptr(rhs.ctxptr) { - rhs._handle = ZMQ_NULLPTR; - rhs.ctxptr = ZMQ_NULLPTR; - } - socket_t &operator=(socket_t &&rhs) ZMQ_NOTHROW { - close(); - std::swap(_handle, rhs._handle); - std::swap(ctxptr, rhs.ctxptr); - return *this; - } -#endif - - ~socket_t() ZMQ_NOTHROW { close(); } - - operator void *() ZMQ_NOTHROW { return _handle; } - - operator void const *() const ZMQ_NOTHROW { return _handle; } - - void close() ZMQ_NOTHROW { - if (_handle == ZMQ_NULLPTR) - // already closed - return; - int rc = zmq_close(_handle); - ZMQ_ASSERT(rc == 0); - _handle = ZMQ_NULLPTR; - ctxptr = ZMQ_NULLPTR; - } - - void swap(socket_t &other) ZMQ_NOTHROW { - std::swap(_handle, other._handle); - std::swap(ctxptr, other.ctxptr); - } - - operator socket_ref() ZMQ_NOTHROW { return socket_ref(from_handle, _handle); } - -private: - void *ctxptr; - - socket_t(const socket_t &) ZMQ_DELETED_FUNCTION; - void operator=(const socket_t &) ZMQ_DELETED_FUNCTION; - - // used by monitor_t - socket_t(void *context_, int type_) - : detail::socket_base(zmq_socket(context_, type_)), ctxptr(context_) { - if (_handle == ZMQ_NULLPTR) - throw error_t(); - if (ctxptr == ZMQ_NULLPTR) - throw error_t(); - } -}; - -inline void swap(socket_t &a, socket_t &b) ZMQ_NOTHROW { a.swap(b); } - -ZMQ_DEPRECATED("from 4.3.1, use proxy taking socket_t objects") -inline void proxy(void *frontend, void *backend, void *capture) { - int rc = zmq_proxy(frontend, backend, capture); - if (rc != 0) - throw error_t(); -} - -inline void proxy(socket_ref frontend, socket_ref backend, - socket_ref capture = socket_ref()) { - int rc = zmq_proxy(frontend.handle(), backend.handle(), capture.handle()); - if (rc != 0) - throw error_t(); -} - -#ifdef ZMQ_HAS_PROXY_STEERABLE -ZMQ_DEPRECATED("from 4.3.1, use proxy_steerable taking socket_t objects") -inline void proxy_steerable(void *frontend, void *backend, void *capture, - void *control) { - int rc = zmq_proxy_steerable(frontend, backend, capture, control); - if (rc != 0) - throw error_t(); -} - -inline void proxy_steerable(socket_ref frontend, socket_ref backend, - socket_ref capture, socket_ref control) { - int rc = zmq_proxy_steerable(frontend.handle(), backend.handle(), - capture.handle(), control.handle()); - if (rc != 0) - throw error_t(); -} -#endif - -class monitor_t { -public: - monitor_t() : _socket(), _monitor_socket() {} - - virtual ~monitor_t() { close(); } - -#ifdef ZMQ_HAS_RVALUE_REFS - monitor_t(monitor_t &&rhs) ZMQ_NOTHROW : _socket(), _monitor_socket() { - std::swap(_socket, rhs._socket); - std::swap(_monitor_socket, rhs._monitor_socket); - } - - monitor_t &operator=(monitor_t &&rhs) ZMQ_NOTHROW { - close(); - _socket = socket_ref(); - std::swap(_socket, rhs._socket); - std::swap(_monitor_socket, rhs._monitor_socket); - return *this; - } -#endif - - void monitor(socket_t &socket, std::string const &addr, - int events = ZMQ_EVENT_ALL) { - monitor(socket, addr.c_str(), events); - } - - void monitor(socket_t &socket, const char *addr_, - int events = ZMQ_EVENT_ALL) { - init(socket, addr_, events); - while (true) { - check_event(-1); - } - } - - void init(socket_t &socket, std::string const &addr, - int events = ZMQ_EVENT_ALL) { - init(socket, addr.c_str(), events); - } - - void init(socket_t &socket, const char *addr_, int events = ZMQ_EVENT_ALL) { - int rc = zmq_socket_monitor(socket.handle(), addr_, events); - if (rc != 0) - throw error_t(); - - _socket = socket; - _monitor_socket = socket_t(socket.ctxptr, ZMQ_PAIR); - _monitor_socket.connect(addr_); - - on_monitor_started(); - } - - bool check_event(int timeout = 0) { - assert(_monitor_socket); - - zmq::message_t eventMsg; - - zmq::pollitem_t items[] = { - {_monitor_socket.handle(), 0, ZMQ_POLLIN, 0}, - }; - -#ifdef ZMQ_CPP11 - zmq::poll(&items[0], 1, std::chrono::milliseconds(timeout)); -#else - zmq::poll(&items[0], 1, timeout); -#endif - - if (items[0].revents & ZMQ_POLLIN) { - int rc = zmq_msg_recv(eventMsg.handle(), _monitor_socket.handle(), 0); - if (rc == -1 && zmq_errno() == ETERM) - return false; - assert(rc != -1); - - } else { - return false; - } - -#if ZMQ_VERSION_MAJOR >= 4 - const char *data = static_cast(eventMsg.data()); - zmq_event_t msgEvent; - memcpy(&msgEvent.event, data, sizeof(uint16_t)); - data += sizeof(uint16_t); - memcpy(&msgEvent.value, data, sizeof(int32_t)); - zmq_event_t *event = &msgEvent; -#else - zmq_event_t *event = static_cast(eventMsg.data()); -#endif - -#ifdef ZMQ_NEW_MONITOR_EVENT_LAYOUT - zmq::message_t addrMsg; - int rc = zmq_msg_recv(addrMsg.handle(), _monitor_socket.handle(), 0); - if (rc == -1 && zmq_errno() == ETERM) { - return false; - } - - assert(rc != -1); - std::string address = addrMsg.to_string(); -#else - // Bit of a hack, but all events in the zmq_event_t union have the same - // layout so this will work for all event types. - std::string address = event->data.connected.addr; -#endif - -#ifdef ZMQ_EVENT_MONITOR_STOPPED - if (event->event == ZMQ_EVENT_MONITOR_STOPPED) { - return false; - } - -#endif - - switch (event->event) { - case ZMQ_EVENT_CONNECTED: - on_event_connected(*event, address.c_str()); - break; - case ZMQ_EVENT_CONNECT_DELAYED: - on_event_connect_delayed(*event, address.c_str()); - break; - case ZMQ_EVENT_CONNECT_RETRIED: - on_event_connect_retried(*event, address.c_str()); - break; - case ZMQ_EVENT_LISTENING: - on_event_listening(*event, address.c_str()); - break; - case ZMQ_EVENT_BIND_FAILED: - on_event_bind_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_ACCEPTED: - on_event_accepted(*event, address.c_str()); - break; - case ZMQ_EVENT_ACCEPT_FAILED: - on_event_accept_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_CLOSED: - on_event_closed(*event, address.c_str()); - break; - case ZMQ_EVENT_CLOSE_FAILED: - on_event_close_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_DISCONNECTED: - on_event_disconnected(*event, address.c_str()); - break; -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 0) || \ - (defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3)) - case ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL: - on_event_handshake_failed_no_detail(*event, address.c_str()); - break; - case ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL: - on_event_handshake_failed_protocol(*event, address.c_str()); - break; - case ZMQ_EVENT_HANDSHAKE_FAILED_AUTH: - on_event_handshake_failed_auth(*event, address.c_str()); - break; - case ZMQ_EVENT_HANDSHAKE_SUCCEEDED: - on_event_handshake_succeeded(*event, address.c_str()); - break; -#elif defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 1) - case ZMQ_EVENT_HANDSHAKE_FAILED: - on_event_handshake_failed(*event, address.c_str()); - break; - case ZMQ_EVENT_HANDSHAKE_SUCCEED: - on_event_handshake_succeed(*event, address.c_str()); - break; -#endif - default: - on_event_unknown(*event, address.c_str()); - break; - } - - return true; - } - -#ifdef ZMQ_EVENT_MONITOR_STOPPED - void abort() { - if (_socket) - zmq_socket_monitor(_socket.handle(), ZMQ_NULLPTR, 0); - - _socket = socket_ref(); - } -#endif - virtual void on_monitor_started() {} - virtual void on_event_connected(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_connect_delayed(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_connect_retried(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_listening(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_bind_failed(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_accepted(const zmq_event_t &event_, const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_accept_failed(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_closed(const zmq_event_t &event_, const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_close_failed(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_disconnected(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3) - virtual void on_event_handshake_failed_no_detail(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_handshake_failed_protocol(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_handshake_failed_auth(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_handshake_succeeded(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } -#elif ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 1) - virtual void on_event_handshake_failed(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } - virtual void on_event_handshake_succeed(const zmq_event_t &event_, - const char *addr_) { - (void)event_; - (void)addr_; - } -#endif - virtual void on_event_unknown(const zmq_event_t &event_, const char *addr_) { - (void)event_; - (void)addr_; - } - -private: - monitor_t(const monitor_t &) ZMQ_DELETED_FUNCTION; - void operator=(const monitor_t &) ZMQ_DELETED_FUNCTION; - - socket_ref _socket; - socket_t _monitor_socket; - - void close() ZMQ_NOTHROW { - if (_socket) - zmq_socket_monitor(_socket.handle(), ZMQ_NULLPTR, 0); - _monitor_socket.close(); - } -}; - -#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && \ - defined(ZMQ_HAVE_POLLER) - -// polling events -enum class event_flags : short { - none = 0, - pollin = ZMQ_POLLIN, - pollout = ZMQ_POLLOUT, - pollerr = ZMQ_POLLERR, - pollpri = ZMQ_POLLPRI -}; - -constexpr event_flags operator|(event_flags a, event_flags b) noexcept { - return detail::enum_bit_or(a, b); -} -constexpr event_flags operator&(event_flags a, event_flags b) noexcept { - return detail::enum_bit_and(a, b); -} -constexpr event_flags operator^(event_flags a, event_flags b) noexcept { - return detail::enum_bit_xor(a, b); -} -constexpr event_flags operator~(event_flags a) noexcept { - return detail::enum_bit_not(a); -} - -struct no_user_data; - -// layout compatible with zmq_poller_event_t -template struct poller_event { - socket_ref socket; - ::zmq::fd_t fd; - T *user_data; - event_flags events; -}; - -template class poller_t { -public: - using event_type = poller_event; - - poller_t() : poller_ptr(zmq_poller_new()) { - if (!poller_ptr) - throw error_t(); - } - - template ::value, Dummy>::type> - void add(zmq::socket_ref socket, event_flags events, T *user_data) { - add_impl(socket, events, user_data); - } - - void add(zmq::socket_ref socket, event_flags events) { - add_impl(socket, events, nullptr); - } - - template ::value, Dummy>::type> - void add(fd_t fd, event_flags events, T *user_data) { - add_impl(fd, events, user_data); - } - - void add(fd_t fd, event_flags events) { add_impl(fd, events, nullptr); } - - void remove(zmq::socket_ref socket) { - if (0 != zmq_poller_remove(poller_ptr.get(), socket.handle())) { - throw error_t(); - } - } - - void modify(zmq::socket_ref socket, event_flags events) { - if (0 != zmq_poller_modify(poller_ptr.get(), socket.handle(), - static_cast(events))) { - throw error_t(); - } - } - - size_t wait_all(std::vector &poller_events, - const std::chrono::milliseconds timeout) { - int rc = zmq_poller_wait_all( - poller_ptr.get(), - reinterpret_cast(poller_events.data()), - static_cast(poller_events.size()), - static_cast(timeout.count())); - if (rc > 0) - return static_cast(rc); - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3) - if (zmq_errno() == EAGAIN) -#else - if (zmq_errno() == ETIMEDOUT) -#endif - return 0; - - throw error_t(); - } - -#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 3) - size_t size() const noexcept { - int rc = zmq_poller_size(const_cast(poller_ptr.get())); - ZMQ_ASSERT(rc >= 0); - return static_cast(std::max(rc, 0)); - } -#endif - -private: - struct destroy_poller_t { - void operator()(void *ptr) noexcept { - int rc = zmq_poller_destroy(&ptr); - ZMQ_ASSERT(rc == 0); - } - }; - - std::unique_ptr poller_ptr; - - void add_impl(zmq::socket_ref socket, event_flags events, T *user_data) { - if (0 != zmq_poller_add(poller_ptr.get(), socket.handle(), user_data, - static_cast(events))) { - throw error_t(); - } - } - - void add_impl(fd_t fd, event_flags events, T *user_data) { - if (0 != zmq_poller_add_fd(poller_ptr.get(), fd, user_data, - static_cast(events))) { - throw error_t(); - } - } -}; -#endif // defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && - // defined(ZMQ_HAVE_POLLER) - -inline std::ostream &operator<<(std::ostream &os, const message_t &msg) { - return os << msg.str(); -} - -} // namespace zmq - -#endif // __ZMQ_HPP_INCLUDED__ diff --git a/client/rsh/inst/zmq_addon.hpp b/client/rsh/inst/zmq_addon.hpp deleted file mode 100644 index 958eec56d..000000000 --- a/client/rsh/inst/zmq_addon.hpp +++ /dev/null @@ -1,753 +0,0 @@ -/* - Copyright (c) 2016-2017 ZeroMQ community - Copyright (c) 2016 VOCA AS / Harald Nøkland - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ - -#ifndef __ZMQ_ADDON_HPP_INCLUDED__ -#define __ZMQ_ADDON_HPP_INCLUDED__ - -#include "zmq.hpp" - -#include -#include -#include -#include -#ifdef ZMQ_CPP11 -#include -#include -#include -#endif - -namespace zmq -{ -#ifdef ZMQ_CPP11 - -namespace detail -{ -template -recv_result_t -recv_multipart_n(socket_ref s, OutputIt out, size_t n, recv_flags flags) -{ - size_t msg_count = 0; - message_t msg; - while (true) { - if ZMQ_CONSTEXPR_IF (CheckN) { - if (msg_count >= n) - throw std::runtime_error( - "Too many message parts in recv_multipart_n"); - } - if (!s.recv(msg, flags)) { - // zmq ensures atomic delivery of messages - assert(msg_count == 0); - return {}; - } - ++msg_count; - const bool more = msg.more(); - *out++ = std::move(msg); - if (!more) - break; - } - return msg_count; -} - -inline bool is_little_endian() -{ - const uint16_t i = 0x01; - return *reinterpret_cast(&i) == 0x01; -} - -inline void write_network_order(unsigned char *buf, const uint32_t value) -{ - if (is_little_endian()) { - ZMQ_CONSTEXPR_VAR uint32_t mask = (std::numeric_limits::max)(); - *buf++ = static_cast((value >> 24) & mask); - *buf++ = static_cast((value >> 16) & mask); - *buf++ = static_cast((value >> 8) & mask); - *buf++ = static_cast(value & mask); - } else { - std::memcpy(buf, &value, sizeof(value)); - } -} - -inline uint32_t read_u32_network_order(const unsigned char *buf) -{ - if (is_little_endian()) { - return (static_cast(buf[0]) << 24) - + (static_cast(buf[1]) << 16) - + (static_cast(buf[2]) << 8) - + static_cast(buf[3]); - } else { - uint32_t value; - std::memcpy(&value, buf, sizeof(value)); - return value; - } -} -} // namespace detail - -/* Receive a multipart message. - - Writes the zmq::message_t objects to OutputIterator out. - The out iterator must handle an unspecified number of writes, - e.g. by using std::back_inserter. - - Returns: the number of messages received or nullopt (on EAGAIN). - Throws: if recv throws. Any exceptions thrown - by the out iterator will be propagated and the message - may have been only partially received with pending - message parts. It is adviced to close this socket in that event. -*/ -template -ZMQ_NODISCARD recv_result_t recv_multipart(socket_ref s, - OutputIt out, - recv_flags flags = recv_flags::none) -{ - return detail::recv_multipart_n(s, std::move(out), 0, flags); -} - -/* Receive a multipart message. - - Writes at most n zmq::message_t objects to OutputIterator out. - If the number of message parts of the incoming message exceeds n - then an exception will be thrown. - - Returns: the number of messages received or nullopt (on EAGAIN). - Throws: if recv throws. Throws std::runtime_error if the number - of message parts exceeds n (exactly n messages will have been written - to out). Any exceptions thrown - by the out iterator will be propagated and the message - may have been only partially received with pending - message parts. It is adviced to close this socket in that event. -*/ -template -ZMQ_NODISCARD recv_result_t recv_multipart_n(socket_ref s, - OutputIt out, - size_t n, - recv_flags flags = recv_flags::none) -{ - return detail::recv_multipart_n(s, std::move(out), n, flags); -} - -/* Send a multipart message. - - The range must be a ForwardRange of zmq::message_t, - zmq::const_buffer or zmq::mutable_buffer. - The flags may be zmq::send_flags::sndmore if there are - more message parts to be sent after the call to this function. - - Returns: the number of messages sent (exactly msgs.size()) or nullopt (on EAGAIN). - Throws: if send throws. Any exceptions thrown - by the msgs range will be propagated and the message - may have been only partially sent. It is adviced to close this socket in that event. -*/ -template::value - && (std::is_same, message_t>::value - || detail::is_buffer>::value)>::type -#endif - > -send_result_t -send_multipart(socket_ref s, Range &&msgs, send_flags flags = send_flags::none) -{ - using std::begin; - using std::end; - auto it = begin(msgs); - const auto end_it = end(msgs); - size_t msg_count = 0; - while (it != end_it) { - const auto next = std::next(it); - const auto msg_flags = - flags | (next == end_it ? send_flags::none : send_flags::sndmore); - if (!s.send(*it, msg_flags)) { - // zmq ensures atomic delivery of messages - assert(it == begin(msgs)); - return {}; - } - ++msg_count; - it = next; - } - return msg_count; -} - -/* Encode a multipart message. - - The range must be a ForwardRange of zmq::message_t. A - zmq::multipart_t or STL container may be passed for encoding. - - Returns: a zmq::message_t holding the encoded multipart data. - - Throws: std::range_error is thrown if the size of any single part - can not fit in an unsigned 32 bit integer. - - The encoding is compatible with that used by the CZMQ function - zmsg_encode(), see https://rfc.zeromq.org/spec/50/. - Each part consists of a size followed by the data. - These are placed contiguously into the output message. A part of - size less than 255 bytes will have a single byte size value. - Larger parts will have a five byte size value with the first byte - set to 0xFF and the remaining four bytes holding the size of the - part's data. -*/ -template::value - && (std::is_same, message_t>::value - || detail::is_buffer>::value)>::type -#endif - > -message_t encode(const Range &parts) -{ - size_t mmsg_size = 0; - - // First pass check sizes - for (const auto &part : parts) { - const size_t part_size = part.size(); - if (part_size > (std::numeric_limits::max)()) { - // Size value must fit into uint32_t. - throw std::range_error("Invalid size, message part too large"); - } - const size_t count_size = - part_size < (std::numeric_limits::max)() ? 1 : 5; - mmsg_size += part_size + count_size; - } - - message_t encoded(mmsg_size); - unsigned char *buf = encoded.data(); - for (const auto &part : parts) { - const uint32_t part_size = static_cast(part.size()); - const unsigned char *part_data = - static_cast(part.data()); - - if (part_size < (std::numeric_limits::max)()) { - // small part - *buf++ = (unsigned char) part_size; - } else { - // big part - *buf++ = (std::numeric_limits::max)(); - detail::write_network_order(buf, part_size); - buf += sizeof(part_size); - } - std::memcpy(buf, part_data, part_size); - buf += part_size; - } - - assert(static_cast(buf - encoded.data()) == mmsg_size); - return encoded; -} - -/* Decode an encoded message to multiple parts. - - The given output iterator must be a ForwardIterator to a container - holding zmq::message_t such as a zmq::multipart_t or various STL - containers. - - Returns the ForwardIterator advanced once past the last decoded - part. - - Throws: a std::out_of_range is thrown if the encoded part sizes - lead to exceeding the message data bounds. - - The decoding assumes the message is encoded in the manner - performed by zmq::encode(), see https://rfc.zeromq.org/spec/50/. - */ -template OutputIt decode(const message_t &encoded, OutputIt out) -{ - const unsigned char *source = encoded.data(); - const unsigned char *const limit = source + encoded.size(); - - while (source < limit) { - size_t part_size = *source++; - if (part_size == (std::numeric_limits::max)()) { - if (static_cast(limit - source) < sizeof(uint32_t)) { - throw std::out_of_range( - "Malformed encoding, overflow in reading size"); - } - part_size = detail::read_u32_network_order(source); - // the part size is allowed to be less than 0xFF - source += sizeof(uint32_t); - } - - if (static_cast(limit - source) < part_size) { - throw std::out_of_range("Malformed encoding, overflow in reading part"); - } - *out = message_t(source, part_size); - ++out; - source += part_size; - } - - assert(source == limit); - return out; -} - -#endif - - -#ifdef ZMQ_HAS_RVALUE_REFS - -/* - This class handles multipart messaging. It is the C++ equivalent of zmsg.h, - which is part of CZMQ (the high-level C binding). Furthermore, it is a major - improvement compared to zmsg.hpp, which is part of the examples in the ØMQ - Guide. Unnecessary copying is avoided by using move semantics to efficiently - add/remove parts. -*/ -class multipart_t -{ - private: - std::deque m_parts; - - public: - typedef std::deque::value_type value_type; - - typedef std::deque::iterator iterator; - typedef std::deque::const_iterator const_iterator; - - typedef std::deque::reverse_iterator reverse_iterator; - typedef std::deque::const_reverse_iterator const_reverse_iterator; - - // Default constructor - multipart_t() {} - - // Construct from socket receive - multipart_t(socket_ref socket) { recv(socket); } - - // Construct from memory block - multipart_t(const void *src, size_t size) { addmem(src, size); } - - // Construct from string - multipart_t(const std::string &string) { addstr(string); } - - // Construct from message part - multipart_t(message_t &&message) { add(std::move(message)); } - - // Move constructor - multipart_t(multipart_t &&other) ZMQ_NOTHROW { m_parts = std::move(other.m_parts); } - - // Move assignment operator - multipart_t &operator=(multipart_t &&other) ZMQ_NOTHROW - { - m_parts = std::move(other.m_parts); - return *this; - } - - // Destructor - virtual ~multipart_t() { clear(); } - - message_t &operator[](size_t n) { return m_parts[n]; } - - const message_t &operator[](size_t n) const { return m_parts[n]; } - - message_t &at(size_t n) { return m_parts.at(n); } - - const message_t &at(size_t n) const { return m_parts.at(n); } - - iterator begin() { return m_parts.begin(); } - - const_iterator begin() const { return m_parts.begin(); } - - const_iterator cbegin() const { return m_parts.cbegin(); } - - reverse_iterator rbegin() { return m_parts.rbegin(); } - - const_reverse_iterator rbegin() const { return m_parts.rbegin(); } - - iterator end() { return m_parts.end(); } - - const_iterator end() const { return m_parts.end(); } - - const_iterator cend() const { return m_parts.cend(); } - - reverse_iterator rend() { return m_parts.rend(); } - - const_reverse_iterator rend() const { return m_parts.rend(); } - - // Delete all parts - void clear() { m_parts.clear(); } - - // Get number of parts - size_t size() const { return m_parts.size(); } - - // Check if number of parts is zero - bool empty() const { return m_parts.empty(); } - - // Receive multipart message from socket - bool recv(socket_ref socket, int flags = 0) - { - clear(); - bool more = true; - while (more) { - message_t message; -#ifdef ZMQ_CPP11 - if (!socket.recv(message, static_cast(flags))) - return false; -#else - if (!socket.recv(&message, flags)) - return false; -#endif - more = message.more(); - add(std::move(message)); - } - return true; - } - - // Send multipart message to socket - bool send(socket_ref socket, int flags = 0) - { - flags &= ~(ZMQ_SNDMORE); - bool more = size() > 0; - while (more) { - message_t message = pop(); - more = size() > 0; -#ifdef ZMQ_CPP11 - if (!socket.send(message, static_cast( - (more ? ZMQ_SNDMORE : 0) | flags))) - return false; -#else - if (!socket.send(message, (more ? ZMQ_SNDMORE : 0) | flags)) - return false; -#endif - } - clear(); - return true; - } - - // Concatenate other multipart to front - void prepend(multipart_t &&other) - { - while (!other.empty()) - push(other.remove()); - } - - // Concatenate other multipart to back - void append(multipart_t &&other) - { - while (!other.empty()) - add(other.pop()); - } - - // Push memory block to front - void pushmem(const void *src, size_t size) - { - m_parts.push_front(message_t(src, size)); - } - - // Push memory block to back - void addmem(const void *src, size_t size) - { - m_parts.push_back(message_t(src, size)); - } - - // Push string to front - void pushstr(const std::string &string) - { - m_parts.push_front(message_t(string.data(), string.size())); - } - - // Push string to back - void addstr(const std::string &string) - { - m_parts.push_back(message_t(string.data(), string.size())); - } - - // Push type (fixed-size) to front - template void pushtyp(const T &type) - { - static_assert(!std::is_same::value, - "Use pushstr() instead of pushtyp()"); - m_parts.push_front(message_t(&type, sizeof(type))); - } - - // Push type (fixed-size) to back - template void addtyp(const T &type) - { - static_assert(!std::is_same::value, - "Use addstr() instead of addtyp()"); - m_parts.push_back(message_t(&type, sizeof(type))); - } - - // Push message part to front - void push(message_t &&message) { m_parts.push_front(std::move(message)); } - - // Push message part to back - void add(message_t &&message) { m_parts.push_back(std::move(message)); } - - // Alias to allow std::back_inserter() - void push_back(message_t &&message) { m_parts.push_back(std::move(message)); } - - // Pop string from front - std::string popstr() - { - std::string string(m_parts.front().data(), m_parts.front().size()); - m_parts.pop_front(); - return string; - } - - // Pop type (fixed-size) from front - template T poptyp() - { - static_assert(!std::is_same::value, - "Use popstr() instead of poptyp()"); - if (sizeof(T) != m_parts.front().size()) - throw std::runtime_error( - "Invalid type, size does not match the message size"); - T type = *m_parts.front().data(); - m_parts.pop_front(); - return type; - } - - // Pop message part from front - message_t pop() - { - message_t message = std::move(m_parts.front()); - m_parts.pop_front(); - return message; - } - - // Pop message part from back - message_t remove() - { - message_t message = std::move(m_parts.back()); - m_parts.pop_back(); - return message; - } - - // get message part from front - const message_t &front() { return m_parts.front(); } - - // get message part from back - const message_t &back() { return m_parts.back(); } - - // Get pointer to a specific message part - const message_t *peek(size_t index) const { return &m_parts[index]; } - - // Get a string copy of a specific message part - std::string peekstr(size_t index) const - { - std::string string(m_parts[index].data(), m_parts[index].size()); - return string; - } - - // Peek type (fixed-size) from front - template T peektyp(size_t index) const - { - static_assert(!std::is_same::value, - "Use peekstr() instead of peektyp()"); - if (sizeof(T) != m_parts[index].size()) - throw std::runtime_error( - "Invalid type, size does not match the message size"); - T type = *m_parts[index].data(); - return type; - } - - // Create multipart from type (fixed-size) - template static multipart_t create(const T &type) - { - multipart_t multipart; - multipart.addtyp(type); - return multipart; - } - - // Copy multipart - multipart_t clone() const - { - multipart_t multipart; - for (size_t i = 0; i < size(); i++) - multipart.addmem(m_parts[i].data(), m_parts[i].size()); - return multipart; - } - - // Dump content to string - std::string str() const - { - std::stringstream ss; - for (size_t i = 0; i < m_parts.size(); i++) { - const unsigned char *data = m_parts[i].data(); - size_t size = m_parts[i].size(); - - // Dump the message as text or binary - bool isText = true; - for (size_t j = 0; j < size; j++) { - if (data[j] < 32 || data[j] > 127) { - isText = false; - break; - } - } - ss << "\n[" << std::dec << std::setw(3) << std::setfill('0') << size - << "] "; - if (size >= 1000) { - ss << "... (too big to print)"; - continue; - } - for (size_t j = 0; j < size; j++) { - if (isText) - ss << static_cast(data[j]); - else - ss << std::hex << std::setw(2) << std::setfill('0') - << static_cast(data[j]); - } - } - return ss.str(); - } - - // Check if equal to other multipart - bool equal(const multipart_t *other) const ZMQ_NOTHROW - { - return *this == *other; - } - - bool operator==(const multipart_t &other) const ZMQ_NOTHROW - { - if (size() != other.size()) - return false; - for (size_t i = 0; i < size(); i++) - if (at(i) != other.at(i)) - return false; - return true; - } - - bool operator!=(const multipart_t &other) const ZMQ_NOTHROW - { - return !(*this == other); - } - -#ifdef ZMQ_CPP11 - - // Return single part message_t encoded from this multipart_t. - message_t encode() const { return zmq::encode(*this); } - - // Decode encoded message into multiple parts and append to self. - void decode_append(const message_t &encoded) - { - zmq::decode(encoded, std::back_inserter(*this)); - } - - // Return a new multipart_t containing the decoded message_t. - static multipart_t decode(const message_t &encoded) - { - multipart_t tmp; - zmq::decode(encoded, std::back_inserter(tmp)); - return tmp; - } - -#endif - - private: - // Disable implicit copying (moving is more efficient) - multipart_t(const multipart_t &other) ZMQ_DELETED_FUNCTION; - void operator=(const multipart_t &other) ZMQ_DELETED_FUNCTION; -}; // class multipart_t - -inline std::ostream &operator<<(std::ostream &os, const multipart_t &msg) -{ - return os << msg.str(); -} - -#endif // ZMQ_HAS_RVALUE_REFS - -#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER) -class active_poller_t -{ - public: - active_poller_t() = default; - ~active_poller_t() = default; - - active_poller_t(const active_poller_t &) = delete; - active_poller_t &operator=(const active_poller_t &) = delete; - - active_poller_t(active_poller_t &&src) = default; - active_poller_t &operator=(active_poller_t &&src) = default; - - using handler_type = std::function; - - void add(zmq::socket_ref socket, event_flags events, handler_type handler) - { - if (!handler) - throw std::invalid_argument("null handler in active_poller_t::add"); - auto ret = handlers.emplace( - socket, std::make_shared(std::move(handler))); - if (!ret.second) - throw error_t(EINVAL); // already added - try { - base_poller.add(socket, events, ret.first->second.get()); - need_rebuild = true; - } - catch (...) { - // rollback - handlers.erase(socket); - throw; - } - } - - void remove(zmq::socket_ref socket) - { - base_poller.remove(socket); - handlers.erase(socket); - need_rebuild = true; - } - - void modify(zmq::socket_ref socket, event_flags events) - { - base_poller.modify(socket, events); - } - - size_t wait(std::chrono::milliseconds timeout) - { - if (need_rebuild) { - poller_events.resize(handlers.size()); - poller_handlers.clear(); - poller_handlers.reserve(handlers.size()); - for (const auto &handler : handlers) { - poller_handlers.push_back(handler.second); - } - need_rebuild = false; - } - const auto count = base_poller.wait_all(poller_events, timeout); - std::for_each(poller_events.begin(), - poller_events.begin() + static_cast(count), - [](decltype(base_poller)::event_type &event) { - assert(event.user_data != nullptr); - (*event.user_data)(event.events); - }); - return count; - } - - ZMQ_NODISCARD bool empty() const noexcept { return handlers.empty(); } - - size_t size() const noexcept { return handlers.size(); } - - private: - bool need_rebuild{false}; - - poller_t base_poller{}; - std::unordered_map> handlers{}; - std::vector poller_events{}; - std::vector> poller_handlers{}; -}; // class active_poller_t -#endif // defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER) - - -} // namespace zmq - -#endif // __ZMQ_ADDON_HPP_INCLUDED__ diff --git a/client/rsh/src/Makevars b/client/rsh/src/Makevars index d6bc17941..bb091ecf8 100644 --- a/client/rsh/src/Makevars +++ b/client/rsh/src/Makevars @@ -3,17 +3,22 @@ LLVM_CONFIG := llvm-config-17 LLVM_CPPFLAGS != $(LLVM_CONFIG) --cxxflags LLVM_LIBS != $(LLVM_CONFIG) --libs +DEBUGFLAGS := -O0 -ggdb + PB_CPPFLAGS != pkg-config --cflags protobuf PB_LIBS != pkg-config --libs protobuf +GRPC_CPPFLAGS != pkg-config --cflags grpc++ +GRPC_LIBS != pkg-config --libs grpc++ # Both C/C++ flags -PKG_CPPFLAGS := -DR_NO_REMAP -DSTRICT_R_HEADERS -DUSE_RINTERNALS +PKG_CPPFLAGS := -DR_NO_REMAP -DSTRICT_R_HEADERS -DUSE_RINTERNALS $(DEBUGFLAGS) # C++ flags -PKG_CXXFLAGS := $(LLVM_CPPFLAGS) $(PB_CPPFLAGS) -fexceptions -I../inst +PKG_CXXFLAGS := $(LLVM_CPPFLAGS) $(PB_CPPFLAGS) $(GRPC_CPPFLAGS) -fexceptions -I../inst # C flags PKG_CFLAGS := # Linker flags -PKG_LIBS := $(LLVM_LIBS) $(PB_LIBS) -lzmq +PKG_LIBS := $(LLVM_LIBS) $(PB_LIBS) $(GRPC_LIBS) -lzmq $(DEBUGFLAGS) + # Allow sources in subdirectories CPP_FILES = $(wildcard *.cpp **/*.cpp) diff --git a/client/rsh/src/client.cpp b/client/rsh/src/client.cpp index f5353caf9..6225079ef 100644 --- a/client/rsh/src/client.cpp +++ b/client/rsh/src/client.cpp @@ -1,44 +1,149 @@ #include "client.hpp" -#include "protocol.pb.h" -#include +#include "xxhash.hpp" +#include "serialize.hpp" + +#include +#include +#include +#include #include -#include -#include namespace rsh { -using namespace server::protocol; -CompileResponse remote_compile(std::vector const &rds_closure, - CompilerOptions const &options) { - zmq::context_t context(1); - zmq::socket_t socket(context, zmq::socket_type::req); +Client::Client(std::shared_ptr channel, std::vector installed_packages) : stub_(protocol::CompileService::NewStub(channel)) { + using namespace protocol; + InitRequest request; + // Rsh version + request.mutable_rsh_version()->set_major(0); + request.mutable_rsh_version()->set_minor(1); + request.mutable_rsh_version()->set_patch(0); - std::cout << "Connecting to compile server..." << std::endl; - socket.connect("tcp://localhost:5555"); + // R version (see Rversion.h) + request.mutable_r_version()->set_major(R_VERSION / 65536); + request.mutable_r_version()->set_minor(R_VERSION % 65536 / 256); + request.mutable_r_version()->set_patch(R_VERSION % 256); - Request request; - request.mutable_compile()->set_name(options.name); - request.mutable_compile()->set_bc_optimization(options.bc_opt); - request.mutable_compile()->set_cc_optimization(options.cc_opt); - request.mutable_compile()->set_closure(rds_closure.data(), - rds_closure.size()); + SEXP r_platform = Rf_findVar(Rf_install("R.version"), R_BaseEnv); + // we could also extract the R version from there + // the platform is R.version$platform and is the st element of the list + request.set_platform(CHAR(STRING_ELT(VECTOR_ELT(r_platform, 0), 0))); // or R_PLATFORM? - zmq::message_t msg(request.ByteSizeLong()); - request.SerializeToArray(msg.data(), msg.size()); - socket.send(msg, zmq::send_flags::none); + // TODO: compute hashes of package contents (maybe rdb/rdx and so on) + // instead of just writing package names here. + for(auto const& package : installed_packages) { + request.add_package_hash(package); + } - zmq::message_t reply; - auto res = socket.recv(reply, zmq::recv_flags::none); - if (!res.has_value()) { - CompileResponse response; - response.set_failure("Error receiving reply"); - return response; + + InitResponse response; + grpc::ClientContext context; + grpc::Status status = stub_->Init(&context, request, &response); + if(!status.ok()) { + Rf_error("Failed to connect to the server: %d %s\n", status.error_code(), status.error_message().c_str()); + } + else { + Rprintf("Connected to the server\n"); + } } +std::variant Client::remote_compile(std::vector const &rds_closure, + CompilerOptions const& options) { + using namespace protocol; + + CompileRequest request; + request.set_tier(options.tier); + request.set_bc_opt(options.bc_opt); + request.mutable_function()->set_name(options.name); + request.set_cc_opt(options.cc_opt); + request.mutable_function()->set_body(rds_closure.data(), rds_closure.size()); + + // We replace the body of a function with its compiled version so it would not make + //sense to compute its hash again, except if its body has changed. + uint64_t hash = xxh::xxhash3<64>(rds_closure.data(), rds_closure.size()); + request.mutable_function()->set_hash(hash); + + total_request_bytes += request.ByteSizeLong(); + Rprintf("Sending request, with serialized size %ld\n", request.GetCachedSize()); + + grpc::ClientContext context; CompileResponse response; - response.ParseFromArray(reply.data(), reply.size()); + grpc::Status status = stub_->Compile(&context, request, &response); + total_response_bytes += response.ByteSizeLong(); + if(!status.ok()) { + std::cerr << status.error_code() << ": " << status.error_message() + << std::endl; + return status.error_message(); + } + else { + Rprintf("Received response, with serialized size %ld\n", response.GetCachedSize()); + return response; + } +} + +SEXP Client::make_client(SEXP address, SEXP port, SEXP installed_packages) { + auto addr = CHAR(STRING_ELT(address, 0)); + auto p = INTEGER(port)[0]; + std::string address_str(addr); + address_str += ":" + std::to_string(p); + + std::vector packages; + for(int i = 0; i < LENGTH(installed_packages); ++i) { + packages.push_back(CHAR(STRING_ELT(installed_packages, i))); + } + + auto channel = grpc::CreateChannel(address_str, grpc::InsecureChannelCredentials()); + auto client = new Client(channel, packages); + - return response; + SEXP ptr = PROTECT(R_MakeExternalPtr(client, RSH_CLIENT_PTR, R_NilValue)); + // Removed because it was causing a segfault (memory not mapped) + //R_RegisterCFinalizerEx(ptr, &Client::remove_client, FALSE);// TRUE because we want to shutdown the client when R quits + + UNPROTECT(1); + return ptr; +} + +void Client::remove_client(SEXP ptr) { + if(ptr == nullptr) { + Rf_warning("Client already removed"); + } + auto client = static_cast(R_ExternalPtrAddr(ptr)); + delete client; +} + +Client* Client::get_client() { + if(Client::CLIENT_INSTANCE != nullptr) { + return static_cast(R_ExternalPtrAddr(CLIENT_INSTANCE)); + } + else { + Rf_error("Client not initialized"); + } } + +SEXP init_client(SEXP address, SEXP port, SEXP installed_packages) { + if(Client::CLIENT_INSTANCE != nullptr) { + Rf_warning("Client already initialized, replacing it"); + } + + Client::CLIENT_INSTANCE = Client::make_client(address, port, installed_packages); + + return Client::CLIENT_INSTANCE; +} + +SEXP get_total_size() { + auto client = Client::get_client(); + auto [req, res] = client->get_total_size(); + SEXP out = PROTECT(Rf_allocVector(INTSXP, 2)); + INTEGER(out)[0] = req; + INTEGER(out)[1] = res; + // Add names + SEXP names = PROTECT(Rf_allocVector(STRSXP, 2)); + SET_STRING_ELT(names, 0, Rf_mkChar("request")); + SET_STRING_ELT(names, 1, Rf_mkChar("response")); + Rf_setAttrib(out, R_NamesSymbol, names); + UNPROTECT(2); + return out; +} + } // namespace rsh diff --git a/client/rsh/src/client.hpp b/client/rsh/src/client.hpp index 862df2f71..026a3effe 100644 --- a/client/rsh/src/client.hpp +++ b/client/rsh/src/client.hpp @@ -1,13 +1,53 @@ #pragma once +#include "messages.pb.h" +#include "routes.pb.h" +#include "routes.grpc.pb.h" +#include "rsh.hpp" #include "compiler.hpp" -#include "protocol.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace rsh { -using namespace server::protocol; +class Client { +private: + std::unique_ptr stub_; + static inline SEXP CLIENT_INSTANCE = nullptr; + static inline SEXP RSH_CLIENT_PTR = Rf_install("RSH_CLIENT"); + static void remove_client(SEXP ptr); + + size_t total_request_bytes = 0; + size_t total_response_bytes = 0; + + // For it to be able to access the client instance + friend SEXP init_client(SEXP address, SEXP port, SEXP installed_packages); +public: + Client(std::shared_ptr channel, std::vector installed_packages); + + std::variant remote_compile( + std::vector const &rds_closure, + CompilerOptions const &opts); + + // Total size of requests and responses since the start of the client + std::pair get_total_size() const { + return {total_request_bytes, total_response_bytes}; + } + + static SEXP make_client(SEXP address, SEXP port, SEXP installed_packages); + static Client* get_client(); +}; + +SEXP get_total_size(); -// TODO: compiler a CLOSXP -CompileResponse remote_compile(std::vector const &rds_closure, - CompilerOptions const &opts); +SEXP init_client(SEXP address, SEXP port, SEXP installed_packages); } // namespace rsh diff --git a/client/rsh/src/compiler.cpp b/client/rsh/src/compiler.cpp index df4e76228..50f34f173 100644 --- a/client/rsh/src/compiler.cpp +++ b/client/rsh/src/compiler.cpp @@ -1,6 +1,5 @@ #include "compiler.hpp" #include "client.hpp" -#include "protocol.pb.h" #include "rsh.hpp" #include "serialize.hpp" #include "util.hpp" @@ -35,76 +34,38 @@ namespace rsh { SEXP RSH_JIT_FUN_PTR = Rf_install("RSH_JIT_FUN_PTR"); -static CompileResponse compile_closure(SEXP closure, CompilerOptions options) { - auto closure_bytes = rsh::serialize(closure); - return rsh::remote_compile(closure_bytes, options); +static std::variant compile_closure(SEXP closure, CompilerOptions options) { + // If a function has already been compiled to native code + if(Rf_asLogical(is_compiled(closure))) { + return "Function already compiled"; + } + + std::vector closure_bytes; + + if(IS_BYTECODE(BODY(closure))) { + // Build the closure AST to get the correct hash + // The AST is the first element in the constant pool of the BCODESXP + SEXP body = BODY_EXPR(closure); + auto ast_clos = Rf_mkCLOSXP(FORMALS(closure), body, CLOENV(closure)); + closure_bytes = rsh::serialize(ast_clos); + } + else { + closure_bytes = rsh::serialize(closure); + } + auto client = rsh::Client::get_client(); + return client->remote_compile(closure_bytes, options); } -static void *insert_into_jit(CompiledFunction const &compiled_fun) { - auto native_code = compiled_fun.native_code(); +static void *insert_into_jit(const char* name, protocol::CompileResponse const &compiled_fun) { + auto native_code = compiled_fun.code(); GJIT->add_object(native_code); - auto ptr = GJIT->lookup(compiled_fun.name().c_str()); + auto ptr = GJIT->lookup(name); if (!ptr) { Rf_error("Unable to find the function in the JIT"); } return ptr; } -// static SEXP create_constant_pool(void *fun_ptr, -// CompiledFunction const &compiled_fun) { -// auto pool = PROTECT(Rf_allocVector(VECSXP, 2)); -// -// // create an external pointer to the JITed function with a finalizer -// auto p = R_MakeExternalPtr(fun_ptr, RSH_JIT_FUN_PTR, -// Rf_mkString(compiled_fun.name().c_str())); -// R_RegisterCFinalizerEx(p, &jit_fun_destructor, FALSE); -// -// // slot 0: the pointer to the compiled function -// SET_VECTOR_ELT(pool, 0, p); -// -// // slot 1: the contants used by the compiled function -// auto consts_vec = rsh::deserialize(compiled_fun.constants()); -// SET_VECTOR_ELT(pool, 1, consts_vec); -// -// UNPROTECT(1); // consts -// -// return pool; -// } - -// static SEXP create_wrapper_body(SEXP body, SEXP c_cp) { -// auto bc_size = sizeof(CALL_FUN_BC) / sizeof(i32); -// -// auto bc = PROTECT(Rf_allocVector(INTSXP, bc_size)); -// memcpy(INTEGER(bc), CALL_FUN_BC, sizeof(CALL_FUN_BC)); -// bc = R_bcEncode(bc); -// -// auto expr_index = PROTECT(Rf_allocVector(INTSXP, bc_size)); -// INTEGER(expr_index)[0] = NA_INTEGER; -// memset(INTEGER(expr_index) + 1, 0, (bc_size - 1) * sizeof(i32)); -// -// auto cp = PROTECT(Rf_allocVector(VECSXP, 5)); -// int i = 0; -// -// // store the original AST (consequently it will not correspond to the AST) -// SET_VECTOR_ELT(cp, i++, body); -// SET_VECTOR_ELT(cp, i++, Rf_install(".External2")); -// SET_VECTOR_ELT(cp, i++, BC2C_CALL_TRAMPOLINE_SXP); -// SET_VECTOR_ELT(cp, i++, c_cp); -// SET_VECTOR_ELT(cp, i++, expr_index); -// -// // properly name the expression index (the last element of the constant -// pool) auto cp_names = Rf_allocVector(STRSXP, 5); Rf_setAttrib(cp, -// R_NamesSymbol, cp_names); for (i = 0; i < 4; i++) { -// SET_STRING_ELT(cp_names, i, R_BlankString); -// } -// SET_STRING_ELT(cp_names, 4, Rf_mkChar("expressionIndex")); -// -// auto new_body = Rf_cons(bc, cp); -// SET_TYPEOF(new_body, BCODESXP); -// -// UNPROTECT(3); -// return new_body; -// } CompilerOptions CompilerOptions::from_list(SEXP listsxp) { if (TYPEOF(listsxp) != VECSXP) { @@ -138,6 +99,18 @@ CompilerOptions CompilerOptions::from_list(SEXP listsxp) { } else if (!strcmp(name, "inplace")) { opts.inplace = vec_element_as_bool(listsxp, i, "inplace option must be a logical"); + } + else if(!strcmp(name, "tier")) { + SEXP tier_sxp = VECTOR_ELT(listsxp, i); + if(TYPEOF(tier_sxp) != STRSXP) { + Rf_error("Expected a string for the tier option"); + } + opts.tier = protocol::Tier::OPTIMIZED; + std::string tier_s = CHAR(STRING_ELT(tier_sxp, 0)); + protocol::Tier tier = protocol::Tier::OPTIMIZED; + if(tier_s == "bytecode") { + opts.tier = protocol::Tier::BASELINE; + } } else { Rf_error("Unknown compiler option %s", name); } @@ -145,6 +118,12 @@ CompilerOptions CompilerOptions::from_list(SEXP listsxp) { return opts; } + +std::string genSymbol(uint64_t hash, int index) { + + return "gen_" + std::to_string(hash) + "_" + std::to_string(index); +} + SEXP compile(SEXP closure, SEXP options) { if (!RSH_JIT_FUN_PTR) { Rf_error("The package was not initialized"); @@ -155,41 +134,76 @@ SEXP compile(SEXP closure, SEXP options) { } auto opts = CompilerOptions::from_list(options); + auto response = compile_closure(closure, opts); - if (!response.has_result()) { - Rf_error("Compilation failed: %s", response.failure().c_str()); + if (!std::holds_alternative(response)) { + Rf_error("Compilation failed: %s", std::get(response).c_str()); return closure; } - auto compiled_fun = response.result(); - auto fun_ptr = insert_into_jit(compiled_fun); - // create an external pointer to the JITed function with a finalizer - auto fun_ptr_sxp = R_MakeExternalPtr( - fun_ptr, RSH_JIT_FUN_PTR, Rf_mkString(compiled_fun.name().c_str())); - R_RegisterCFinalizerEx(fun_ptr_sxp, &jit_fun_destructor, FALSE); + auto compiled_fun = std::get(response); - auto c_cp = rsh::deserialize(compiled_fun.constants()); + // If the code is empty, we keep the SEXP + if(!compiled_fun.has_code() || compiled_fun.code().empty()) { + Rf_warning("Empty body returned for function %s. Most likely because of browser in the body", opts.name.c_str()); + return closure; + } - // FIXME: add logging primitives - SEXP body = PROTECT(create_wrapper_body(BODY(closure), fun_ptr_sxp, c_cp)); + SEXP body = nullptr; + SEXP c_cp = nullptr; + void* fun_ptr = nullptr; + SEXP fun_ptr_sxp = nullptr; + + std::string name = genSymbol(compiled_fun.hash(), 0); + // Native or bytecode? + if(opts.tier == protocol::Tier::OPTIMIZED) { + fun_ptr = insert_into_jit(name.c_str(), compiled_fun); + auto fun_ptr_sxp = R_MakeExternalPtr( + fun_ptr, RSH_JIT_FUN_PTR, Rf_mkString(name.c_str())); + R_RegisterCFinalizerEx(fun_ptr_sxp, &jit_fun_destructor, FALSE); + + auto c_cp = rsh::deserialize(compiled_fun.constants()); + body = PROTECT(create_wrapper_body(closure, fun_ptr_sxp, c_cp));//P1 + } + else if(opts.tier == protocol::Tier::BASELINE) { + body = PROTECT(rsh::deserialize(compiled_fun.code())); // P2 + if(TYPEOF(body) != BCODESXP) { + Rf_error("Expected bytecode, got %s", Rf_type2char(TYPEOF(body))); + } + } + // Inplace or not (i.e. through through an explicit call to `compile` or through the R JIT) if (opts.inplace) { SET_BODY(closure, body); - - Rprintf("Compiled in place fun %s (symbol=%s, fun=%p, jit=%p, body=%p)\n", - opts.name.c_str(), compiled_fun.name().c_str(), closure, fun_ptr, + UNPROTECT(1); // For P1 or P2 + // FIXME: add logging primitives + Rprintf("Compiled in place fun %s (fun=%p, body=%p) ; ", + opts.name.c_str(), closure, body); + if(opts.tier == protocol::Tier::OPTIMIZED) { + Rprintf("Jit-compiled: jit=%p\n", fun_ptr); + } + else { + Rprintf("Bytecode-compiled\n"); + } } else { - SEXP orig_closure = closure; - closure = Rf_mkCLOSXP(FORMALS(closure), body, CLOENV(closure)); - - Rprintf("Compiled fun %s (symbol=%s, orig_fun=%p, new_fun=%p, jit=%p, " - "body=%p)\n", - opts.name.c_str(), compiled_fun.name().c_str(), orig_closure, - closure, fun_ptr, body); + SEXP orig = closure; + closure = PROTECT(Rf_mkCLOSXP(FORMALS(closure), body, CLOENV(closure))); // P3 + // FIXME: add logging primitive + UNPROTECT(1);// P1 or P2 + Rprintf( + "Replaced compiled fun %s -- %p (fun=%p, body=%p) ; ", + opts.name.c_str(), orig, closure, + body); + if(opts.tier == protocol::Tier::OPTIMIZED) { + Rprintf("Jit-compiled: jit=%p\n", fun_ptr); + } + else { + Rprintf("Bytecode-compiled\n"); + } } - UNPROTECT(1); // c_cp, body + UNPROTECT(1); // P3 return closure; } diff --git a/client/rsh/src/compiler.hpp b/client/rsh/src/compiler.hpp index 8e8ac2461..fbf3e73f8 100644 --- a/client/rsh/src/compiler.hpp +++ b/client/rsh/src/compiler.hpp @@ -2,16 +2,17 @@ #ifndef RSH_COMPILER_HPP #define RSH_COMPILER_HPP #include "rsh.hpp" +#include "messages.pb.h" #include namespace rsh { -// TODO: could these options be part of the protocol? struct CompilerOptions { std::string name; - int bc_opt; - int cc_opt; + int bc_opt = 3; + int cc_opt = 3; bool inplace; + protocol::Tier tier = protocol::Tier::OPTIMIZED; static CompilerOptions from_list(SEXP listsxp); }; diff --git a/client/rsh/src/init.cpp b/client/rsh/src/init.cpp index 708b5f3c0..e6d48eb8b 100644 --- a/client/rsh/src/init.cpp +++ b/client/rsh/src/init.cpp @@ -1,6 +1,7 @@ #include #include "compiler.hpp" +#include "client.hpp" extern "C" { #include "bc2c/runtime.h" @@ -11,6 +12,8 @@ static const R_CallMethodDef callMethods[] = { {"initialize", (DL_FUNC)&rsh::initialize, 0}, {"compile", (DL_FUNC)&rsh::compile, 2}, {"is_compiled", (DL_FUNC)&rsh::is_compiled, 1}, + {"init_client", (DL_FUNC)&rsh::init_client, 3}, + {"get_total_size", (DL_FUNC)&rsh::get_total_size, 0}, {NULL, NULL, 0}}; static const R_ExternalMethodDef externalMethods[] = { diff --git a/client/rsh/src/messages.pb.cc b/client/rsh/src/messages.pb.cc new file mode 100644 index 000000000..463876889 --- /dev/null +++ b/client/rsh/src/messages.pb.cc @@ -0,0 +1,6868 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: messages.proto + +#include "messages.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace rsh { +namespace protocol { +PROTOBUF_CONSTEXPR Version::Version( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.major_)*/0 + , /*decltype(_impl_.minor_)*/0 + , /*decltype(_impl_.patch_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct VersionDefaultTypeInternal { + PROTOBUF_CONSTEXPR VersionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~VersionDefaultTypeInternal() {} + union { + Version _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VersionDefaultTypeInternal _Version_default_instance_; +PROTOBUF_CONSTEXPR InitRequest::InitRequest( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.package_hash_)*/{} + , /*decltype(_impl_.platform_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.rsh_version_)*/nullptr + , /*decltype(_impl_.r_version_)*/nullptr + , /*decltype(_impl_._cached_size_)*/{}} {} +struct InitRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR InitRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~InitRequestDefaultTypeInternal() {} + union { + InitRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InitRequestDefaultTypeInternal _InitRequest_default_instance_; +PROTOBUF_CONSTEXPR InitResponse::InitResponse( + ::_pbi::ConstantInitialized) {} +struct InitResponseDefaultTypeInternal { + PROTOBUF_CONSTEXPR InitResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~InitResponseDefaultTypeInternal() {} + union { + InitResponse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InitResponseDefaultTypeInternal _InitResponse_default_instance_; +PROTOBUF_CONSTEXPR CompileRequest::CompileRequest( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.function_)*/nullptr + , /*decltype(_impl_.context_)*/nullptr + , /*decltype(_impl_.environment_)*/nullptr + , /*decltype(_impl_.tier_)*/0 + , /*decltype(_impl_.cc_opt_)*/0 + , /*decltype(_impl_.bc_opt_)*/0} {} +struct CompileRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR CompileRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~CompileRequestDefaultTypeInternal() {} + union { + CompileRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompileRequestDefaultTypeInternal _CompileRequest_default_instance_; +PROTOBUF_CONSTEXPR CompileResponse::CompileResponse( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.code_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.constants_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.hash_)*/uint64_t{0u} + , /*decltype(_impl_.tier_)*/0} {} +struct CompileResponseDefaultTypeInternal { + PROTOBUF_CONSTEXPR CompileResponseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~CompileResponseDefaultTypeInternal() {} + union { + CompileResponse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompileResponseDefaultTypeInternal _CompileResponse_default_instance_; +PROTOBUF_CONSTEXPR Function::Function( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.body_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.package_hash_)*/uint64_t{0u} + , /*decltype(_impl_.hash_)*/uint64_t{0u}} {} +struct FunctionDefaultTypeInternal { + PROTOBUF_CONSTEXPR FunctionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~FunctionDefaultTypeInternal() {} + union { + Function _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FunctionDefaultTypeInternal _Function_default_instance_; +PROTOBUF_CONSTEXPR FunctionRequest::FunctionRequest( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.hash_)*/uint64_t{0u} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct FunctionRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR FunctionRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~FunctionRequestDefaultTypeInternal() {} + union { + FunctionRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FunctionRequestDefaultTypeInternal _FunctionRequest_default_instance_; +PROTOBUF_CONSTEXPR Environment_ValuesEntry_DoNotUse::Environment_ValuesEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct Environment_ValuesEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR Environment_ValuesEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~Environment_ValuesEntry_DoNotUseDefaultTypeInternal() {} + union { + Environment_ValuesEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Environment_ValuesEntry_DoNotUseDefaultTypeInternal _Environment_ValuesEntry_DoNotUse_default_instance_; +PROTOBUF_CONSTEXPR Environment::Environment( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.values_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct EnvironmentDefaultTypeInternal { + PROTOBUF_CONSTEXPR EnvironmentDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~EnvironmentDefaultTypeInternal() {} + union { + Environment _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EnvironmentDefaultTypeInternal _Environment_default_instance_; +PROTOBUF_CONSTEXPR ValueRequest::ValueRequest( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.hash_)*/{} + , /*decltype(_impl_._hash_cached_byte_size_)*/{0} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct ValueRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR ValueRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ValueRequestDefaultTypeInternal() {} + union { + ValueRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ValueRequestDefaultTypeInternal _ValueRequest_default_instance_; +PROTOBUF_CONSTEXPR Value::Value( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.value_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.hash_)*/uint64_t{0u} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct ValueDefaultTypeInternal { + PROTOBUF_CONSTEXPR ValueDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ValueDefaultTypeInternal() {} + union { + Value _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ValueDefaultTypeInternal _Value_default_instance_; +PROTOBUF_CONSTEXPR Values::Values( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.values_)*/{} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct ValuesDefaultTypeInternal { + PROTOBUF_CONSTEXPR ValuesDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ValuesDefaultTypeInternal() {} + union { + Values _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ValuesDefaultTypeInternal _Values_default_instance_; +PROTOBUF_CONSTEXPR Empty::Empty( + ::_pbi::ConstantInitialized) {} +struct EmptyDefaultTypeInternal { + PROTOBUF_CONSTEXPR EmptyDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~EmptyDefaultTypeInternal() {} + union { + Empty _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EmptyDefaultTypeInternal _Empty_default_instance_; +PROTOBUF_CONSTEXPR CallContext::CallContext( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.args_statically_matched_)*/false + , /*decltype(_impl_.correct_number_of_args_)*/false + , /*decltype(_impl_.correct_order_of_args_)*/false + , /*decltype(_impl_.no_missing_args_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct CallContextDefaultTypeInternal { + PROTOBUF_CONSTEXPR CallContextDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~CallContextDefaultTypeInternal() {} + union { + CallContext _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CallContextDefaultTypeInternal _CallContext_default_instance_; +PROTOBUF_CONSTEXPR ArgumentContext::ArgumentContext( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.eager_)*/false + , /*decltype(_impl_.reflection_)*/false + , /*decltype(_impl_.object_)*/false + , /*decltype(_impl_.type_)*/0} {} +struct ArgumentContextDefaultTypeInternal { + PROTOBUF_CONSTEXPR ArgumentContextDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ArgumentContextDefaultTypeInternal() {} + union { + ArgumentContext _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ArgumentContextDefaultTypeInternal _ArgumentContext_default_instance_; +PROTOBUF_CONSTEXPR Context::Context( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.argument_context_)*/{} + , /*decltype(_impl_.call_context_)*/nullptr + , /*decltype(_impl_._cached_size_)*/{}} {} +struct ContextDefaultTypeInternal { + PROTOBUF_CONSTEXPR ContextDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ContextDefaultTypeInternal() {} + union { + Context _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ContextDefaultTypeInternal _Context_default_instance_; +PROTOBUF_CONSTEXPR ContextRequest::ContextRequest( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.function_)*/nullptr + , /*decltype(_impl_._cached_size_)*/{}} {} +struct ContextRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR ContextRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ContextRequestDefaultTypeInternal() {} + union { + ContextRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ContextRequestDefaultTypeInternal _ContextRequest_default_instance_; +PROTOBUF_CONSTEXPR TestFeedback::TestFeedback( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.test_lattice_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct TestFeedbackDefaultTypeInternal { + PROTOBUF_CONSTEXPR TestFeedbackDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~TestFeedbackDefaultTypeInternal() {} + union { + TestFeedback _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TestFeedbackDefaultTypeInternal _TestFeedback_default_instance_; +PROTOBUF_CONSTEXPR CallFeedback::CallFeedback( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.n_calls_)*/int64_t{0} + , /*decltype(_impl_.callee_hash_)*/uint64_t{0u} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct CallFeedbackDefaultTypeInternal { + PROTOBUF_CONSTEXPR CallFeedbackDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~CallFeedbackDefaultTypeInternal() {} + union { + CallFeedback _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CallFeedbackDefaultTypeInternal _CallFeedback_default_instance_; +PROTOBUF_CONSTEXPR ValueFeedback::ValueFeedback( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.scalar_)*/false + , /*decltype(_impl_.object_)*/false + , /*decltype(_impl_.accessed_attributes_)*/false + , /*decltype(_impl_.vectorizable_)*/false + , /*decltype(_impl_.is_promise_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct ValueFeedbackDefaultTypeInternal { + PROTOBUF_CONSTEXPR ValueFeedbackDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ValueFeedbackDefaultTypeInternal() {} + union { + ValueFeedback _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ValueFeedbackDefaultTypeInternal _ValueFeedback_default_instance_; +PROTOBUF_CONSTEXPR TypeFeedback_Feedback::TypeFeedback_Feedback( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.feedback_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}} {} +struct TypeFeedback_FeedbackDefaultTypeInternal { + PROTOBUF_CONSTEXPR TypeFeedback_FeedbackDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~TypeFeedback_FeedbackDefaultTypeInternal() {} + union { + TypeFeedback_Feedback _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TypeFeedback_FeedbackDefaultTypeInternal _TypeFeedback_Feedback_default_instance_; +PROTOBUF_CONSTEXPR TypeFeedback_TypesEntry_DoNotUse::TypeFeedback_TypesEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct TypeFeedback_TypesEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR TypeFeedback_TypesEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~TypeFeedback_TypesEntry_DoNotUseDefaultTypeInternal() {} + union { + TypeFeedback_TypesEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TypeFeedback_TypesEntry_DoNotUseDefaultTypeInternal _TypeFeedback_TypesEntry_DoNotUse_default_instance_; +PROTOBUF_CONSTEXPR TypeFeedback::TypeFeedback( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.types_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct TypeFeedbackDefaultTypeInternal { + PROTOBUF_CONSTEXPR TypeFeedbackDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~TypeFeedbackDefaultTypeInternal() {} + union { + TypeFeedback _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TypeFeedbackDefaultTypeInternal _TypeFeedback_default_instance_; +PROTOBUF_CONSTEXPR FeedbackRequest::FeedbackRequest( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.function_)*/nullptr + , /*decltype(_impl_._cached_size_)*/{}} {} +struct FeedbackRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR FeedbackRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~FeedbackRequestDefaultTypeInternal() {} + union { + FeedbackRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FeedbackRequestDefaultTypeInternal _FeedbackRequest_default_instance_; +PROTOBUF_CONSTEXPR PackageSource::PackageSource( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.source_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}} {} +struct PackageSourceDefaultTypeInternal { + PROTOBUF_CONSTEXPR PackageSourceDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PackageSourceDefaultTypeInternal() {} + union { + PackageSource _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PackageSourceDefaultTypeInternal _PackageSource_default_instance_; +PROTOBUF_CONSTEXPR Package::Package( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.function_hashes_)*/{} + , /*decltype(_impl_._function_hashes_cached_byte_size_)*/{0} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.version_)*/nullptr + , /*decltype(_impl_.source_)*/nullptr} {} +struct PackageDefaultTypeInternal { + PROTOBUF_CONSTEXPR PackageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PackageDefaultTypeInternal() {} + union { + Package _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PackageDefaultTypeInternal _Package_default_instance_; +PROTOBUF_CONSTEXPR PackageRequest::PackageRequest( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.hash_)*/uint64_t{0u} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct PackageRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR PackageRequestDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PackageRequestDefaultTypeInternal() {} + union { + PackageRequest _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PackageRequestDefaultTypeInternal _PackageRequest_default_instance_; +} // namespace protocol +} // namespace rsh +static ::_pb::Metadata file_level_metadata_messages_2eproto[27]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_messages_2eproto[3]; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_messages_2eproto = nullptr; + +const uint32_t TableStruct_messages_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Version, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Version, _impl_.major_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Version, _impl_.minor_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Version, _impl_.patch_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::InitRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::InitRequest, _impl_.rsh_version_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::InitRequest, _impl_.r_version_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::InitRequest, _impl_.platform_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::InitRequest, _impl_.package_hash_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::InitResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileRequest, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileRequest, _impl_.function_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileRequest, _impl_.tier_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileRequest, _impl_.cc_opt_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileRequest, _impl_.bc_opt_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileRequest, _impl_.context_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileRequest, _impl_.environment_), + ~0u, + 2, + 3, + 4, + 0, + 1, + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileResponse, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileResponse, _impl_.hash_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileResponse, _impl_.tier_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileResponse, _impl_.code_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CompileResponse, _impl_.constants_), + ~0u, + ~0u, + 0, + 1, + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Function, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Function, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Function, _impl_.package_hash_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Function, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Function, _impl_.hash_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Function, _impl_.body_), + ~0u, + ~0u, + ~0u, + 0, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::FunctionRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::FunctionRequest, _impl_.hash_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Environment_ValuesEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Environment_ValuesEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Environment_ValuesEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Environment_ValuesEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Environment, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Environment, _impl_.values_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ValueRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ValueRequest, _impl_.hash_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Value, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Value, _impl_.hash_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Value, _impl_.value_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Values, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Values, _impl_.values_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Empty, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CallContext, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CallContext, _impl_.args_statically_matched_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CallContext, _impl_.correct_number_of_args_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CallContext, _impl_.correct_order_of_args_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CallContext, _impl_.no_missing_args_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ArgumentContext, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ArgumentContext, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ArgumentContext, _impl_.eager_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ArgumentContext, _impl_.reflection_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ArgumentContext, _impl_.object_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ArgumentContext, _impl_.type_), + ~0u, + ~0u, + ~0u, + 0, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Context, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Context, _impl_.call_context_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Context, _impl_.argument_context_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ContextRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ContextRequest, _impl_.function_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TestFeedback, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TestFeedback, _impl_.test_lattice_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CallFeedback, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CallFeedback, _impl_.n_calls_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::CallFeedback, _impl_.callee_hash_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ValueFeedback, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ValueFeedback, _impl_.scalar_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ValueFeedback, _impl_.object_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ValueFeedback, _impl_.accessed_attributes_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ValueFeedback, _impl_.vectorizable_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::ValueFeedback, _impl_.is_promise_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TypeFeedback_Feedback, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TypeFeedback_Feedback, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TypeFeedback_Feedback, _impl_.feedback_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TypeFeedback, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::TypeFeedback, _impl_.types_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::FeedbackRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::FeedbackRequest, _impl_.function_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::PackageSource, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::PackageSource, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::rsh::protocol::PackageSource, _impl_.source_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Package, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Package, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Package, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Package, _impl_.version_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Package, _impl_.function_hashes_), + PROTOBUF_FIELD_OFFSET(::rsh::protocol::Package, _impl_.source_), + ~0u, + ~0u, + ~0u, + 0, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::PackageRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::rsh::protocol::PackageRequest, _impl_.hash_), +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, -1, sizeof(::rsh::protocol::Version)}, + { 9, -1, -1, sizeof(::rsh::protocol::InitRequest)}, + { 19, -1, -1, sizeof(::rsh::protocol::InitResponse)}, + { 25, 37, -1, sizeof(::rsh::protocol::CompileRequest)}, + { 43, 53, -1, sizeof(::rsh::protocol::CompileResponse)}, + { 57, 67, -1, sizeof(::rsh::protocol::Function)}, + { 71, -1, -1, sizeof(::rsh::protocol::FunctionRequest)}, + { 78, 86, -1, sizeof(::rsh::protocol::Environment_ValuesEntry_DoNotUse)}, + { 88, -1, -1, sizeof(::rsh::protocol::Environment)}, + { 95, -1, -1, sizeof(::rsh::protocol::ValueRequest)}, + { 102, -1, -1, sizeof(::rsh::protocol::Value)}, + { 110, -1, -1, sizeof(::rsh::protocol::Values)}, + { 117, -1, -1, sizeof(::rsh::protocol::Empty)}, + { 123, -1, -1, sizeof(::rsh::protocol::CallContext)}, + { 133, 143, -1, sizeof(::rsh::protocol::ArgumentContext)}, + { 147, -1, -1, sizeof(::rsh::protocol::Context)}, + { 155, -1, -1, sizeof(::rsh::protocol::ContextRequest)}, + { 162, -1, -1, sizeof(::rsh::protocol::TestFeedback)}, + { 169, -1, -1, sizeof(::rsh::protocol::CallFeedback)}, + { 177, -1, -1, sizeof(::rsh::protocol::ValueFeedback)}, + { 188, -1, -1, sizeof(::rsh::protocol::TypeFeedback_Feedback)}, + { 198, 206, -1, sizeof(::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse)}, + { 208, -1, -1, sizeof(::rsh::protocol::TypeFeedback)}, + { 215, -1, -1, sizeof(::rsh::protocol::FeedbackRequest)}, + { 222, -1, -1, sizeof(::rsh::protocol::PackageSource)}, + { 231, 241, -1, sizeof(::rsh::protocol::Package)}, + { 245, -1, -1, sizeof(::rsh::protocol::PackageRequest)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::rsh::protocol::_Version_default_instance_._instance, + &::rsh::protocol::_InitRequest_default_instance_._instance, + &::rsh::protocol::_InitResponse_default_instance_._instance, + &::rsh::protocol::_CompileRequest_default_instance_._instance, + &::rsh::protocol::_CompileResponse_default_instance_._instance, + &::rsh::protocol::_Function_default_instance_._instance, + &::rsh::protocol::_FunctionRequest_default_instance_._instance, + &::rsh::protocol::_Environment_ValuesEntry_DoNotUse_default_instance_._instance, + &::rsh::protocol::_Environment_default_instance_._instance, + &::rsh::protocol::_ValueRequest_default_instance_._instance, + &::rsh::protocol::_Value_default_instance_._instance, + &::rsh::protocol::_Values_default_instance_._instance, + &::rsh::protocol::_Empty_default_instance_._instance, + &::rsh::protocol::_CallContext_default_instance_._instance, + &::rsh::protocol::_ArgumentContext_default_instance_._instance, + &::rsh::protocol::_Context_default_instance_._instance, + &::rsh::protocol::_ContextRequest_default_instance_._instance, + &::rsh::protocol::_TestFeedback_default_instance_._instance, + &::rsh::protocol::_CallFeedback_default_instance_._instance, + &::rsh::protocol::_ValueFeedback_default_instance_._instance, + &::rsh::protocol::_TypeFeedback_Feedback_default_instance_._instance, + &::rsh::protocol::_TypeFeedback_TypesEntry_DoNotUse_default_instance_._instance, + &::rsh::protocol::_TypeFeedback_default_instance_._instance, + &::rsh::protocol::_FeedbackRequest_default_instance_._instance, + &::rsh::protocol::_PackageSource_default_instance_._instance, + &::rsh::protocol::_Package_default_instance_._instance, + &::rsh::protocol::_PackageRequest_default_instance_._instance, +}; + +const char descriptor_table_protodef_messages_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\016messages.proto\022\014rsh.protocol\"6\n\007Versio" + "n\022\r\n\005major\030\001 \001(\005\022\r\n\005minor\030\002 \001(\005\022\r\n\005patch" + "\030\003 \001(\005\"\213\001\n\013InitRequest\022*\n\013Rsh_version\030\001 " + "\001(\0132\025.rsh.protocol.Version\022(\n\tR_version\030" + "\002 \001(\0132\025.rsh.protocol.Version\022\020\n\010platform" + "\030\003 \001(\t\022\024\n\014package_hash\030\004 \003(\014\"\016\n\014InitResp" + "onse\"\250\002\n\016CompileRequest\022(\n\010function\030\002 \001(" + "\0132\026.rsh.protocol.Function\022%\n\004tier\030\004 \001(\0162" + "\022.rsh.protocol.TierH\000\210\001\001\022\023\n\006cc_opt\030\005 \001(\005" + "H\001\210\001\001\022\023\n\006bc_opt\030\006 \001(\005H\002\210\001\001\022+\n\007context\030\007 " + "\001(\0132\025.rsh.protocol.ContextH\003\210\001\001\0223\n\013envir" + "onment\030\010 \001(\0132\031.rsh.protocol.EnvironmentH" + "\004\210\001\001B\007\n\005_tierB\t\n\007_cc_optB\t\n\007_bc_optB\n\n\010_" + "contextB\016\n\014_environment\"\203\001\n\017CompileRespo" + "nse\022\014\n\004hash\030\001 \001(\004\022 \n\004tier\030\002 \001(\0162\022.rsh.pr" + "otocol.Tier\022\021\n\004code\030\003 \001(\014H\000\210\001\001\022\026\n\tconsta" + "nts\030\004 \001(\014H\001\210\001\001B\007\n\005_codeB\014\n\n_constants\"X\n" + "\010Function\022\024\n\014package_hash\030\001 \001(\004\022\014\n\004name\030" + "\002 \001(\t\022\014\n\004hash\030\003 \001(\004\022\021\n\004body\030\004 \001(\014H\000\210\001\001B\007" + "\n\005_body\"\037\n\017FunctionRequest\022\014\n\004hash\030\001 \001(\004" + "\"s\n\013Environment\0225\n\006values\030\001 \003(\0132%.rsh.pr" + "otocol.Environment.ValuesEntry\032-\n\013Values" + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\004:\0028\001\"\034\n" + "\014ValueRequest\022\014\n\004hash\030\001 \003(\004\"$\n\005Value\022\014\n\004" + "hash\030\001 \001(\004\022\r\n\005value\030\002 \001(\014\"-\n\006Values\022#\n\006v" + "alues\030\001 \003(\0132\023.rsh.protocol.Value\"\007\n\005Empt" + "y\"\206\001\n\013CallContext\022\037\n\027args_statically_mat" + "ched\030\001 \001(\010\022\036\n\026correct_number_of_args\030\002 \001" + "(\010\022\035\n\025correct_order_of_args\030\003 \001(\010\022\027\n\017no_" + "missing_args\030\004 \001(\010\"t\n\017ArgumentContext\022\r\n" + "\005eager\030\001 \001(\010\022\022\n\nreflection\030\002 \001(\010\022\016\n\006obje" + "ct\030\003 \001(\010\022%\n\004type\030\004 \001(\0162\022.rsh.protocol.Ty" + "peH\000\210\001\001B\007\n\005_type\"s\n\007Context\022/\n\014call_cont" + "ext\030\001 \001(\0132\031.rsh.protocol.CallContext\0227\n\020" + "argument_context\030\002 \003(\0132\035.rsh.protocol.Ar" + "gumentContext\":\n\016ContextRequest\022(\n\010funct" + "ion\030\001 \001(\0132\026.rsh.protocol.Function\"\?\n\014Tes" + "tFeedback\022/\n\014test_lattice\030\001 \001(\0162\031.rsh.pr" + "otocol.TestLattice\"4\n\014CallFeedback\022\017\n\007n_" + "calls\030\001 \001(\003\022\023\n\013callee_hash\030\002 \001(\004\"v\n\rValu" + "eFeedback\022\016\n\006scalar\030\001 \001(\010\022\016\n\006object\030\002 \001(" + "\010\022\033\n\023accessed_attributes\030\003 \001(\010\022\024\n\014vector" + "izable\030\004 \001(\010\022\022\n\nis_promise\030\005 \001(\010\"\321\002\n\014Typ" + "eFeedback\0224\n\005types\030\002 \003(\0132%.rsh.protocol." + "TypeFeedback.TypesEntry\032\267\001\n\010Feedback\0223\n\r" + "test_feedback\030\001 \001(\0132\032.rsh.protocol.TestF" + "eedbackH\000\0223\n\rcall_feedback\030\002 \001(\0132\032.rsh.p" + "rotocol.CallFeedbackH\000\0225\n\016value_feedback" + "\030\003 \001(\0132\033.rsh.protocol.ValueFeedbackH\000B\n\n" + "\010feedback\032Q\n\nTypesEntry\022\013\n\003key\030\001 \001(\003\0222\n\005" + "value\030\002 \001(\0132#.rsh.protocol.TypeFeedback." + "Feedback:\0028\001\";\n\017FeedbackRequest\022(\n\010funct" + "ion\030\001 \001(\0132\026.rsh.protocol.Function\"C\n\rPac" + "kageSource\022\022\n\010r_mirror\030\002 \001(\tH\000\022\024\n\ngithub" + "_url\030\003 \001(\tH\000B\010\n\006source\"\225\001\n\007Package\022\014\n\004na" + "me\030\001 \001(\t\022&\n\007version\030\002 \001(\0132\025.rsh.protocol" + ".Version\022\027\n\017function_hashes\030\004 \003(\004\0220\n\006sou" + "rce\030\005 \001(\0132\033.rsh.protocol.PackageSourceH\000" + "\210\001\001B\t\n\007_source\"\036\n\016PackageRequest\022\014\n\004hash" + "\030\001 \001(\004*#\n\004Tier\022\014\n\010BASELINE\020\000\022\r\n\tOPTIMIZE" + "D\020\001*@\n\013TestLattice\022\010\n\004BOTH\020\000\022\r\n\tONLY_TRU" + "E\020\001\022\016\n\nONLY_FALSE\020\002\022\010\n\004NONE\020\003*&\n\004Type\022\007\n" + "\003ANY\020\000\022\013\n\007INTEGER\020\001\022\010\n\004REAL\020\002B\023\n\021org.prl" + "prg.serverb\006proto3" + ; +static ::_pbi::once_flag descriptor_table_messages_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_messages_2eproto = { + false, false, 2538, descriptor_table_protodef_messages_2eproto, + "messages.proto", + &descriptor_table_messages_2eproto_once, nullptr, 0, 27, + schemas, file_default_instances, TableStruct_messages_2eproto::offsets, + file_level_metadata_messages_2eproto, file_level_enum_descriptors_messages_2eproto, + file_level_service_descriptors_messages_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_messages_2eproto_getter() { + return &descriptor_table_messages_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_messages_2eproto(&descriptor_table_messages_2eproto); +namespace rsh { +namespace protocol { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Tier_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_messages_2eproto); + return file_level_enum_descriptors_messages_2eproto[0]; +} +bool Tier_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TestLattice_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_messages_2eproto); + return file_level_enum_descriptors_messages_2eproto[1]; +} +bool TestLattice_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Type_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_messages_2eproto); + return file_level_enum_descriptors_messages_2eproto[2]; +} +bool Type_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + + +// =================================================================== + +class Version::_Internal { + public: +}; + +Version::Version(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.Version) +} +Version::Version(const Version& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Version* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.major_){} + , decltype(_impl_.minor_){} + , decltype(_impl_.patch_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.major_, &from._impl_.major_, + static_cast(reinterpret_cast(&_impl_.patch_) - + reinterpret_cast(&_impl_.major_)) + sizeof(_impl_.patch_)); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.Version) +} + +inline void Version::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.major_){0} + , decltype(_impl_.minor_){0} + , decltype(_impl_.patch_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +Version::~Version() { + // @@protoc_insertion_point(destructor:rsh.protocol.Version) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Version::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void Version::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Version::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.Version) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.major_, 0, static_cast( + reinterpret_cast(&_impl_.patch_) - + reinterpret_cast(&_impl_.major_)) + sizeof(_impl_.patch_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Version::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // int32 major = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.major_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // int32 minor = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.minor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // int32 patch = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.patch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Version::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.Version) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // int32 major = 1; + if (this->_internal_major() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_major(), target); + } + + // int32 minor = 2; + if (this->_internal_minor() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_minor(), target); + } + + // int32 patch = 3; + if (this->_internal_patch() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_patch(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.Version) + return target; +} + +size_t Version::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.Version) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int32 major = 1; + if (this->_internal_major() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_major()); + } + + // int32 minor = 2; + if (this->_internal_minor() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_minor()); + } + + // int32 patch = 3; + if (this->_internal_patch() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_patch()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Version::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Version::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Version::GetClassData() const { return &_class_data_; } + + +void Version::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.Version) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_major() != 0) { + _this->_internal_set_major(from._internal_major()); + } + if (from._internal_minor() != 0) { + _this->_internal_set_minor(from._internal_minor()); + } + if (from._internal_patch() != 0) { + _this->_internal_set_patch(from._internal_patch()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Version::CopyFrom(const Version& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.Version) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Version::IsInitialized() const { + return true; +} + +void Version::InternalSwap(Version* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Version, _impl_.patch_) + + sizeof(Version::_impl_.patch_) + - PROTOBUF_FIELD_OFFSET(Version, _impl_.major_)>( + reinterpret_cast(&_impl_.major_), + reinterpret_cast(&other->_impl_.major_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Version::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[0]); +} + +// =================================================================== + +class InitRequest::_Internal { + public: + static const ::rsh::protocol::Version& rsh_version(const InitRequest* msg); + static const ::rsh::protocol::Version& r_version(const InitRequest* msg); +}; + +const ::rsh::protocol::Version& +InitRequest::_Internal::rsh_version(const InitRequest* msg) { + return *msg->_impl_.rsh_version_; +} +const ::rsh::protocol::Version& +InitRequest::_Internal::r_version(const InitRequest* msg) { + return *msg->_impl_.r_version_; +} +InitRequest::InitRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.InitRequest) +} +InitRequest::InitRequest(const InitRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + InitRequest* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.package_hash_){from._impl_.package_hash_} + , decltype(_impl_.platform_){} + , decltype(_impl_.rsh_version_){nullptr} + , decltype(_impl_.r_version_){nullptr} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.platform_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.platform_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_platform().empty()) { + _this->_impl_.platform_.Set(from._internal_platform(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_rsh_version()) { + _this->_impl_.rsh_version_ = new ::rsh::protocol::Version(*from._impl_.rsh_version_); + } + if (from._internal_has_r_version()) { + _this->_impl_.r_version_ = new ::rsh::protocol::Version(*from._impl_.r_version_); + } + // @@protoc_insertion_point(copy_constructor:rsh.protocol.InitRequest) +} + +inline void InitRequest::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.package_hash_){arena} + , decltype(_impl_.platform_){} + , decltype(_impl_.rsh_version_){nullptr} + , decltype(_impl_.r_version_){nullptr} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.platform_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.platform_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +InitRequest::~InitRequest() { + // @@protoc_insertion_point(destructor:rsh.protocol.InitRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void InitRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.package_hash_.~RepeatedPtrField(); + _impl_.platform_.Destroy(); + if (this != internal_default_instance()) delete _impl_.rsh_version_; + if (this != internal_default_instance()) delete _impl_.r_version_; +} + +void InitRequest::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void InitRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.InitRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.package_hash_.Clear(); + _impl_.platform_.ClearToEmpty(); + if (GetArenaForAllocation() == nullptr && _impl_.rsh_version_ != nullptr) { + delete _impl_.rsh_version_; + } + _impl_.rsh_version_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.r_version_ != nullptr) { + delete _impl_.r_version_; + } + _impl_.r_version_ = nullptr; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* InitRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .rsh.protocol.Version Rsh_version = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_rsh_version(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .rsh.protocol.Version R_version = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_r_version(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string platform = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_platform(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "rsh.protocol.InitRequest.platform")); + } else + goto handle_unusual; + continue; + // repeated bytes package_hash = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_package_hash(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* InitRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.InitRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .rsh.protocol.Version Rsh_version = 1; + if (this->_internal_has_rsh_version()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::rsh_version(this), + _Internal::rsh_version(this).GetCachedSize(), target, stream); + } + + // .rsh.protocol.Version R_version = 2; + if (this->_internal_has_r_version()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::r_version(this), + _Internal::r_version(this).GetCachedSize(), target, stream); + } + + // string platform = 3; + if (!this->_internal_platform().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_platform().data(), static_cast(this->_internal_platform().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "rsh.protocol.InitRequest.platform"); + target = stream->WriteStringMaybeAliased( + 3, this->_internal_platform(), target); + } + + // repeated bytes package_hash = 4; + for (int i = 0, n = this->_internal_package_hash_size(); i < n; i++) { + const auto& s = this->_internal_package_hash(i); + target = stream->WriteBytes(4, s, target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.InitRequest) + return target; +} + +size_t InitRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.InitRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated bytes package_hash = 4; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.package_hash_.size()); + for (int i = 0, n = _impl_.package_hash_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + _impl_.package_hash_.Get(i)); + } + + // string platform = 3; + if (!this->_internal_platform().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_platform()); + } + + // .rsh.protocol.Version Rsh_version = 1; + if (this->_internal_has_rsh_version()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.rsh_version_); + } + + // .rsh.protocol.Version R_version = 2; + if (this->_internal_has_r_version()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.r_version_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData InitRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + InitRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*InitRequest::GetClassData() const { return &_class_data_; } + + +void InitRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.InitRequest) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.package_hash_.MergeFrom(from._impl_.package_hash_); + if (!from._internal_platform().empty()) { + _this->_internal_set_platform(from._internal_platform()); + } + if (from._internal_has_rsh_version()) { + _this->_internal_mutable_rsh_version()->::rsh::protocol::Version::MergeFrom( + from._internal_rsh_version()); + } + if (from._internal_has_r_version()) { + _this->_internal_mutable_r_version()->::rsh::protocol::Version::MergeFrom( + from._internal_r_version()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void InitRequest::CopyFrom(const InitRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.InitRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InitRequest::IsInitialized() const { + return true; +} + +void InitRequest::InternalSwap(InitRequest* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.package_hash_.InternalSwap(&other->_impl_.package_hash_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.platform_, lhs_arena, + &other->_impl_.platform_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(InitRequest, _impl_.r_version_) + + sizeof(InitRequest::_impl_.r_version_) + - PROTOBUF_FIELD_OFFSET(InitRequest, _impl_.rsh_version_)>( + reinterpret_cast(&_impl_.rsh_version_), + reinterpret_cast(&other->_impl_.rsh_version_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata InitRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[1]); +} + +// =================================================================== + +class InitResponse::_Internal { + public: +}; + +InitResponse::InitResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { + // @@protoc_insertion_point(arena_constructor:rsh.protocol.InitResponse) +} +InitResponse::InitResponse(const InitResponse& from) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { + InitResponse* const _this = this; (void)_this; + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.InitResponse) +} + + + + + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData InitResponse::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*InitResponse::GetClassData() const { return &_class_data_; } + + + + + + + +::PROTOBUF_NAMESPACE_ID::Metadata InitResponse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[2]); +} + +// =================================================================== + +class CompileRequest::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static const ::rsh::protocol::Function& function(const CompileRequest* msg); + static void set_has_tier(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_cc_opt(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static void set_has_bc_opt(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static const ::rsh::protocol::Context& context(const CompileRequest* msg); + static void set_has_context(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static const ::rsh::protocol::Environment& environment(const CompileRequest* msg); + static void set_has_environment(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } +}; + +const ::rsh::protocol::Function& +CompileRequest::_Internal::function(const CompileRequest* msg) { + return *msg->_impl_.function_; +} +const ::rsh::protocol::Context& +CompileRequest::_Internal::context(const CompileRequest* msg) { + return *msg->_impl_.context_; +} +const ::rsh::protocol::Environment& +CompileRequest::_Internal::environment(const CompileRequest* msg) { + return *msg->_impl_.environment_; +} +CompileRequest::CompileRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.CompileRequest) +} +CompileRequest::CompileRequest(const CompileRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + CompileRequest* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.function_){nullptr} + , decltype(_impl_.context_){nullptr} + , decltype(_impl_.environment_){nullptr} + , decltype(_impl_.tier_){} + , decltype(_impl_.cc_opt_){} + , decltype(_impl_.bc_opt_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_function()) { + _this->_impl_.function_ = new ::rsh::protocol::Function(*from._impl_.function_); + } + if (from._internal_has_context()) { + _this->_impl_.context_ = new ::rsh::protocol::Context(*from._impl_.context_); + } + if (from._internal_has_environment()) { + _this->_impl_.environment_ = new ::rsh::protocol::Environment(*from._impl_.environment_); + } + ::memcpy(&_impl_.tier_, &from._impl_.tier_, + static_cast(reinterpret_cast(&_impl_.bc_opt_) - + reinterpret_cast(&_impl_.tier_)) + sizeof(_impl_.bc_opt_)); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.CompileRequest) +} + +inline void CompileRequest::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.function_){nullptr} + , decltype(_impl_.context_){nullptr} + , decltype(_impl_.environment_){nullptr} + , decltype(_impl_.tier_){0} + , decltype(_impl_.cc_opt_){0} + , decltype(_impl_.bc_opt_){0} + }; +} + +CompileRequest::~CompileRequest() { + // @@protoc_insertion_point(destructor:rsh.protocol.CompileRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void CompileRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.function_; + if (this != internal_default_instance()) delete _impl_.context_; + if (this != internal_default_instance()) delete _impl_.environment_; +} + +void CompileRequest::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void CompileRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.CompileRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && _impl_.function_ != nullptr) { + delete _impl_.function_; + } + _impl_.function_ = nullptr; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(_impl_.context_ != nullptr); + _impl_.context_->Clear(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(_impl_.environment_ != nullptr); + _impl_.environment_->Clear(); + } + } + if (cached_has_bits & 0x0000001cu) { + ::memset(&_impl_.tier_, 0, static_cast( + reinterpret_cast(&_impl_.bc_opt_) - + reinterpret_cast(&_impl_.tier_)) + sizeof(_impl_.bc_opt_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* CompileRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .rsh.protocol.Function function = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_function(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .rsh.protocol.Tier tier = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_tier(static_cast<::rsh::protocol::Tier>(val)); + } else + goto handle_unusual; + continue; + // optional int32 cc_opt = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + _Internal::set_has_cc_opt(&has_bits); + _impl_.cc_opt_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional int32 bc_opt = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _Internal::set_has_bc_opt(&has_bits); + _impl_.bc_opt_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .rsh.protocol.Context context = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr = ctx->ParseMessage(_internal_mutable_context(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .rsh.protocol.Environment environment = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_environment(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* CompileRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.CompileRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .rsh.protocol.Function function = 2; + if (this->_internal_has_function()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::function(this), + _Internal::function(this).GetCachedSize(), target, stream); + } + + // optional .rsh.protocol.Tier tier = 4; + if (_internal_has_tier()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_tier(), target); + } + + // optional int32 cc_opt = 5; + if (_internal_has_cc_opt()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_cc_opt(), target); + } + + // optional int32 bc_opt = 6; + if (_internal_has_bc_opt()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_bc_opt(), target); + } + + // optional .rsh.protocol.Context context = 7; + if (_internal_has_context()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::context(this), + _Internal::context(this).GetCachedSize(), target, stream); + } + + // optional .rsh.protocol.Environment environment = 8; + if (_internal_has_environment()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(8, _Internal::environment(this), + _Internal::environment(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.CompileRequest) + return target; +} + +size_t CompileRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.CompileRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .rsh.protocol.Function function = 2; + if (this->_internal_has_function()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.function_); + } + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000001fu) { + // optional .rsh.protocol.Context context = 7; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.context_); + } + + // optional .rsh.protocol.Environment environment = 8; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.environment_); + } + + // optional .rsh.protocol.Tier tier = 4; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_tier()); + } + + // optional int32 cc_opt = 5; + if (cached_has_bits & 0x00000008u) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_cc_opt()); + } + + // optional int32 bc_opt = 6; + if (cached_has_bits & 0x00000010u) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_bc_opt()); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CompileRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + CompileRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CompileRequest::GetClassData() const { return &_class_data_; } + + +void CompileRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.CompileRequest) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_function()) { + _this->_internal_mutable_function()->::rsh::protocol::Function::MergeFrom( + from._internal_function()); + } + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x0000001fu) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_mutable_context()->::rsh::protocol::Context::MergeFrom( + from._internal_context()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_mutable_environment()->::rsh::protocol::Environment::MergeFrom( + from._internal_environment()); + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.tier_ = from._impl_.tier_; + } + if (cached_has_bits & 0x00000008u) { + _this->_impl_.cc_opt_ = from._impl_.cc_opt_; + } + if (cached_has_bits & 0x00000010u) { + _this->_impl_.bc_opt_ = from._impl_.bc_opt_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void CompileRequest::CopyFrom(const CompileRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.CompileRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CompileRequest::IsInitialized() const { + return true; +} + +void CompileRequest::InternalSwap(CompileRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(CompileRequest, _impl_.bc_opt_) + + sizeof(CompileRequest::_impl_.bc_opt_) + - PROTOBUF_FIELD_OFFSET(CompileRequest, _impl_.function_)>( + reinterpret_cast(&_impl_.function_), + reinterpret_cast(&other->_impl_.function_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata CompileRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[3]); +} + +// =================================================================== + +class CompileResponse::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_code(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_constants(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } +}; + +CompileResponse::CompileResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.CompileResponse) +} +CompileResponse::CompileResponse(const CompileResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + CompileResponse* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.code_){} + , decltype(_impl_.constants_){} + , decltype(_impl_.hash_){} + , decltype(_impl_.tier_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.code_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.code_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_code()) { + _this->_impl_.code_.Set(from._internal_code(), + _this->GetArenaForAllocation()); + } + _impl_.constants_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.constants_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_constants()) { + _this->_impl_.constants_.Set(from._internal_constants(), + _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.hash_, &from._impl_.hash_, + static_cast(reinterpret_cast(&_impl_.tier_) - + reinterpret_cast(&_impl_.hash_)) + sizeof(_impl_.tier_)); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.CompileResponse) +} + +inline void CompileResponse::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.code_){} + , decltype(_impl_.constants_){} + , decltype(_impl_.hash_){uint64_t{0u}} + , decltype(_impl_.tier_){0} + }; + _impl_.code_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.code_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.constants_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.constants_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +CompileResponse::~CompileResponse() { + // @@protoc_insertion_point(destructor:rsh.protocol.CompileResponse) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void CompileResponse::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.code_.Destroy(); + _impl_.constants_.Destroy(); +} + +void CompileResponse::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void CompileResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.CompileResponse) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _impl_.code_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.constants_.ClearNonDefaultToEmpty(); + } + } + ::memset(&_impl_.hash_, 0, static_cast( + reinterpret_cast(&_impl_.tier_) - + reinterpret_cast(&_impl_.hash_)) + sizeof(_impl_.tier_)); + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* CompileResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint64 hash = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .rsh.protocol.Tier tier = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_tier(static_cast<::rsh::protocol::Tier>(val)); + } else + goto handle_unusual; + continue; + // optional bytes code = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_code(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bytes constants = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + auto str = _internal_mutable_constants(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* CompileResponse::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.CompileResponse) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 hash = 1; + if (this->_internal_hash() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_hash(), target); + } + + // .rsh.protocol.Tier tier = 2; + if (this->_internal_tier() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_tier(), target); + } + + // optional bytes code = 3; + if (_internal_has_code()) { + target = stream->WriteBytesMaybeAliased( + 3, this->_internal_code(), target); + } + + // optional bytes constants = 4; + if (_internal_has_constants()) { + target = stream->WriteBytesMaybeAliased( + 4, this->_internal_constants(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.CompileResponse) + return target; +} + +size_t CompileResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.CompileResponse) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional bytes code = 3; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_code()); + } + + // optional bytes constants = 4; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_constants()); + } + + } + // uint64 hash = 1; + if (this->_internal_hash() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_hash()); + } + + // .rsh.protocol.Tier tier = 2; + if (this->_internal_tier() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_tier()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CompileResponse::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + CompileResponse::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CompileResponse::GetClassData() const { return &_class_data_; } + + +void CompileResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.CompileResponse) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_code(from._internal_code()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_constants(from._internal_constants()); + } + } + if (from._internal_hash() != 0) { + _this->_internal_set_hash(from._internal_hash()); + } + if (from._internal_tier() != 0) { + _this->_internal_set_tier(from._internal_tier()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void CompileResponse::CopyFrom(const CompileResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.CompileResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CompileResponse::IsInitialized() const { + return true; +} + +void CompileResponse::InternalSwap(CompileResponse* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.code_, lhs_arena, + &other->_impl_.code_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.constants_, lhs_arena, + &other->_impl_.constants_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(CompileResponse, _impl_.tier_) + + sizeof(CompileResponse::_impl_.tier_) + - PROTOBUF_FIELD_OFFSET(CompileResponse, _impl_.hash_)>( + reinterpret_cast(&_impl_.hash_), + reinterpret_cast(&other->_impl_.hash_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata CompileResponse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[4]); +} + +// =================================================================== + +class Function::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_body(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +Function::Function(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.Function) +} +Function::Function(const Function& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Function* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){} + , decltype(_impl_.body_){} + , decltype(_impl_.package_hash_){} + , decltype(_impl_.hash_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_name().empty()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + _impl_.body_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.body_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_body()) { + _this->_impl_.body_.Set(from._internal_body(), + _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.package_hash_, &from._impl_.package_hash_, + static_cast(reinterpret_cast(&_impl_.hash_) - + reinterpret_cast(&_impl_.package_hash_)) + sizeof(_impl_.hash_)); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.Function) +} + +inline void Function::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){} + , decltype(_impl_.body_){} + , decltype(_impl_.package_hash_){uint64_t{0u}} + , decltype(_impl_.hash_){uint64_t{0u}} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.body_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.body_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Function::~Function() { + // @@protoc_insertion_point(destructor:rsh.protocol.Function) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Function::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.name_.Destroy(); + _impl_.body_.Destroy(); +} + +void Function::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Function::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.Function) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.name_.ClearToEmpty(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.body_.ClearNonDefaultToEmpty(); + } + ::memset(&_impl_.package_hash_, 0, static_cast( + reinterpret_cast(&_impl_.hash_) - + reinterpret_cast(&_impl_.package_hash_)) + sizeof(_impl_.hash_)); + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Function::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint64 package_hash = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.package_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string name = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "rsh.protocol.Function.name")); + } else + goto handle_unusual; + continue; + // uint64 hash = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional bytes body = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + auto str = _internal_mutable_body(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Function::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.Function) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 package_hash = 1; + if (this->_internal_package_hash() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_package_hash(), target); + } + + // string name = 2; + if (!this->_internal_name().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "rsh.protocol.Function.name"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); + } + + // uint64 hash = 3; + if (this->_internal_hash() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_hash(), target); + } + + // optional bytes body = 4; + if (_internal_has_body()) { + target = stream->WriteBytesMaybeAliased( + 4, this->_internal_body(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.Function) + return target; +} + +size_t Function::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.Function) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string name = 2; + if (!this->_internal_name().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // optional bytes body = 4; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_body()); + } + + // uint64 package_hash = 1; + if (this->_internal_package_hash() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_package_hash()); + } + + // uint64 hash = 3; + if (this->_internal_hash() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_hash()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Function::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Function::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Function::GetClassData() const { return &_class_data_; } + + +void Function::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.Function) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_name().empty()) { + _this->_internal_set_name(from._internal_name()); + } + if (from._internal_has_body()) { + _this->_internal_set_body(from._internal_body()); + } + if (from._internal_package_hash() != 0) { + _this->_internal_set_package_hash(from._internal_package_hash()); + } + if (from._internal_hash() != 0) { + _this->_internal_set_hash(from._internal_hash()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Function::CopyFrom(const Function& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.Function) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Function::IsInitialized() const { + return true; +} + +void Function::InternalSwap(Function* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.body_, lhs_arena, + &other->_impl_.body_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Function, _impl_.hash_) + + sizeof(Function::_impl_.hash_) + - PROTOBUF_FIELD_OFFSET(Function, _impl_.package_hash_)>( + reinterpret_cast(&_impl_.package_hash_), + reinterpret_cast(&other->_impl_.package_hash_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Function::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[5]); +} + +// =================================================================== + +class FunctionRequest::_Internal { + public: +}; + +FunctionRequest::FunctionRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.FunctionRequest) +} +FunctionRequest::FunctionRequest(const FunctionRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + FunctionRequest* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.hash_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.hash_ = from._impl_.hash_; + // @@protoc_insertion_point(copy_constructor:rsh.protocol.FunctionRequest) +} + +inline void FunctionRequest::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.hash_){uint64_t{0u}} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +FunctionRequest::~FunctionRequest() { + // @@protoc_insertion_point(destructor:rsh.protocol.FunctionRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void FunctionRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void FunctionRequest::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void FunctionRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.FunctionRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.hash_ = uint64_t{0u}; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* FunctionRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint64 hash = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* FunctionRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.FunctionRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 hash = 1; + if (this->_internal_hash() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_hash(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.FunctionRequest) + return target; +} + +size_t FunctionRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.FunctionRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // uint64 hash = 1; + if (this->_internal_hash() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_hash()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FunctionRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + FunctionRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FunctionRequest::GetClassData() const { return &_class_data_; } + + +void FunctionRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.FunctionRequest) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_hash() != 0) { + _this->_internal_set_hash(from._internal_hash()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void FunctionRequest::CopyFrom(const FunctionRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.FunctionRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FunctionRequest::IsInitialized() const { + return true; +} + +void FunctionRequest::InternalSwap(FunctionRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.hash_, other->_impl_.hash_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata FunctionRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[6]); +} + +// =================================================================== + +Environment_ValuesEntry_DoNotUse::Environment_ValuesEntry_DoNotUse() {} +Environment_ValuesEntry_DoNotUse::Environment_ValuesEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void Environment_ValuesEntry_DoNotUse::MergeFrom(const Environment_ValuesEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata Environment_ValuesEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[7]); +} + +// =================================================================== + +class Environment::_Internal { + public: +}; + +Environment::Environment(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + if (arena != nullptr && !is_message_owned) { + arena->OwnCustomDestructor(this, &Environment::ArenaDtor); + } + // @@protoc_insertion_point(arena_constructor:rsh.protocol.Environment) +} +Environment::Environment(const Environment& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Environment* const _this = this; (void)_this; + new (&_impl_) Impl_{ + /*decltype(_impl_.values_)*/{} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.values_.MergeFrom(from._impl_.values_); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.Environment) +} + +inline void Environment::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + /*decltype(_impl_.values_)*/{::_pbi::ArenaInitialized(), arena} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +Environment::~Environment() { + // @@protoc_insertion_point(destructor:rsh.protocol.Environment) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + ArenaDtor(this); + return; + } + SharedDtor(); +} + +inline void Environment::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.values_.Destruct(); + _impl_.values_.~MapField(); +} + +void Environment::ArenaDtor(void* object) { + Environment* _this = reinterpret_cast< Environment* >(object); + _this->_impl_.values_.Destruct(); +} +void Environment::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Environment::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.Environment) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.values_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Environment::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // map values = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&_impl_.values_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Environment::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.Environment) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // map values = 1; + if (!this->_internal_values().empty()) { + using MapType = ::_pb::Map; + using WireHelper = Environment_ValuesEntry_DoNotUse::Funcs; + const auto& map_field = this->_internal_values(); + auto check_utf8 = [](const MapType::value_type& entry) { + (void)entry; + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "rsh.protocol.Environment.ValuesEntry.key"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(1, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(1, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.Environment) + return target; +} + +size_t Environment::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.Environment) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // map values = 1; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_values_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >::const_iterator + it = this->_internal_values().begin(); + it != this->_internal_values().end(); ++it) { + total_size += Environment_ValuesEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Environment::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Environment::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Environment::GetClassData() const { return &_class_data_; } + + +void Environment::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.Environment) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.values_.MergeFrom(from._impl_.values_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Environment::CopyFrom(const Environment& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.Environment) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Environment::IsInitialized() const { + return true; +} + +void Environment::InternalSwap(Environment* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.values_.InternalSwap(&other->_impl_.values_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Environment::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[8]); +} + +// =================================================================== + +class ValueRequest::_Internal { + public: +}; + +ValueRequest::ValueRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.ValueRequest) +} +ValueRequest::ValueRequest(const ValueRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ValueRequest* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.hash_){from._impl_.hash_} + , /*decltype(_impl_._hash_cached_byte_size_)*/{0} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.ValueRequest) +} + +inline void ValueRequest::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.hash_){arena} + , /*decltype(_impl_._hash_cached_byte_size_)*/{0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +ValueRequest::~ValueRequest() { + // @@protoc_insertion_point(destructor:rsh.protocol.ValueRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ValueRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.hash_.~RepeatedField(); +} + +void ValueRequest::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ValueRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.ValueRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.hash_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ValueRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // repeated uint64 hash = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_hash(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 8) { + _internal_add_hash(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ValueRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.ValueRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // repeated uint64 hash = 1; + { + int byte_size = _impl_._hash_cached_byte_size_.load(std::memory_order_relaxed); + if (byte_size > 0) { + target = stream->WriteUInt64Packed( + 1, _internal_hash(), byte_size, target); + } + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.ValueRequest) + return target; +} + +size_t ValueRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.ValueRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated uint64 hash = 1; + { + size_t data_size = ::_pbi::WireFormatLite:: + UInt64Size(this->_impl_.hash_); + if (data_size > 0) { + total_size += 1 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + int cached_size = ::_pbi::ToCachedSize(data_size); + _impl_._hash_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ValueRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ValueRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ValueRequest::GetClassData() const { return &_class_data_; } + + +void ValueRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.ValueRequest) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.hash_.MergeFrom(from._impl_.hash_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ValueRequest::CopyFrom(const ValueRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.ValueRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ValueRequest::IsInitialized() const { + return true; +} + +void ValueRequest::InternalSwap(ValueRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.hash_.InternalSwap(&other->_impl_.hash_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ValueRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[9]); +} + +// =================================================================== + +class Value::_Internal { + public: +}; + +Value::Value(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.Value) +} +Value::Value(const Value& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Value* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.value_){} + , decltype(_impl_.hash_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.value_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_value().empty()) { + _this->_impl_.value_.Set(from._internal_value(), + _this->GetArenaForAllocation()); + } + _this->_impl_.hash_ = from._impl_.hash_; + // @@protoc_insertion_point(copy_constructor:rsh.protocol.Value) +} + +inline void Value::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.value_){} + , decltype(_impl_.hash_){uint64_t{0u}} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.value_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.value_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Value::~Value() { + // @@protoc_insertion_point(destructor:rsh.protocol.Value) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Value::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.value_.Destroy(); +} + +void Value::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Value::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.Value) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.value_.ClearToEmpty(); + _impl_.hash_ = uint64_t{0u}; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Value::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint64 hash = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bytes value = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_value(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Value::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.Value) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 hash = 1; + if (this->_internal_hash() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_hash(), target); + } + + // bytes value = 2; + if (!this->_internal_value().empty()) { + target = stream->WriteBytesMaybeAliased( + 2, this->_internal_value(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.Value) + return target; +} + +size_t Value::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.Value) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bytes value = 2; + if (!this->_internal_value().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->_internal_value()); + } + + // uint64 hash = 1; + if (this->_internal_hash() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_hash()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Value::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Value::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Value::GetClassData() const { return &_class_data_; } + + +void Value::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.Value) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_value().empty()) { + _this->_internal_set_value(from._internal_value()); + } + if (from._internal_hash() != 0) { + _this->_internal_set_hash(from._internal_hash()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Value::CopyFrom(const Value& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.Value) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Value::IsInitialized() const { + return true; +} + +void Value::InternalSwap(Value* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.value_, lhs_arena, + &other->_impl_.value_, rhs_arena + ); + swap(_impl_.hash_, other->_impl_.hash_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Value::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[10]); +} + +// =================================================================== + +class Values::_Internal { + public: +}; + +Values::Values(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.Values) +} +Values::Values(const Values& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Values* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.values_){from._impl_.values_} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.Values) +} + +inline void Values::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.values_){arena} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +Values::~Values() { + // @@protoc_insertion_point(destructor:rsh.protocol.Values) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Values::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.values_.~RepeatedPtrField(); +} + +void Values::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Values::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.Values) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.values_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Values::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // repeated .rsh.protocol.Value values = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_values(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Values::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.Values) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .rsh.protocol.Value values = 1; + for (unsigned i = 0, + n = static_cast(this->_internal_values_size()); i < n; i++) { + const auto& repfield = this->_internal_values(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.Values) + return target; +} + +size_t Values::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.Values) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .rsh.protocol.Value values = 1; + total_size += 1UL * this->_internal_values_size(); + for (const auto& msg : this->_impl_.values_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Values::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Values::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Values::GetClassData() const { return &_class_data_; } + + +void Values::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.Values) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.values_.MergeFrom(from._impl_.values_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Values::CopyFrom(const Values& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.Values) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Values::IsInitialized() const { + return true; +} + +void Values::InternalSwap(Values* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.values_.InternalSwap(&other->_impl_.values_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Values::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[11]); +} + +// =================================================================== + +class Empty::_Internal { + public: +}; + +Empty::Empty(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { + // @@protoc_insertion_point(arena_constructor:rsh.protocol.Empty) +} +Empty::Empty(const Empty& from) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { + Empty* const _this = this; (void)_this; + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.Empty) +} + + + + + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Empty::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Empty::GetClassData() const { return &_class_data_; } + + + + + + + +::PROTOBUF_NAMESPACE_ID::Metadata Empty::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[12]); +} + +// =================================================================== + +class CallContext::_Internal { + public: +}; + +CallContext::CallContext(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.CallContext) +} +CallContext::CallContext(const CallContext& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + CallContext* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.args_statically_matched_){} + , decltype(_impl_.correct_number_of_args_){} + , decltype(_impl_.correct_order_of_args_){} + , decltype(_impl_.no_missing_args_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.args_statically_matched_, &from._impl_.args_statically_matched_, + static_cast(reinterpret_cast(&_impl_.no_missing_args_) - + reinterpret_cast(&_impl_.args_statically_matched_)) + sizeof(_impl_.no_missing_args_)); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.CallContext) +} + +inline void CallContext::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.args_statically_matched_){false} + , decltype(_impl_.correct_number_of_args_){false} + , decltype(_impl_.correct_order_of_args_){false} + , decltype(_impl_.no_missing_args_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +CallContext::~CallContext() { + // @@protoc_insertion_point(destructor:rsh.protocol.CallContext) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void CallContext::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void CallContext::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void CallContext::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.CallContext) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.args_statically_matched_, 0, static_cast( + reinterpret_cast(&_impl_.no_missing_args_) - + reinterpret_cast(&_impl_.args_statically_matched_)) + sizeof(_impl_.no_missing_args_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* CallContext::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool args_statically_matched = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.args_statically_matched_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool correct_number_of_args = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.correct_number_of_args_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool correct_order_of_args = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.correct_order_of_args_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool no_missing_args = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.no_missing_args_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* CallContext::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.CallContext) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool args_statically_matched = 1; + if (this->_internal_args_statically_matched() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_args_statically_matched(), target); + } + + // bool correct_number_of_args = 2; + if (this->_internal_correct_number_of_args() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_correct_number_of_args(), target); + } + + // bool correct_order_of_args = 3; + if (this->_internal_correct_order_of_args() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_correct_order_of_args(), target); + } + + // bool no_missing_args = 4; + if (this->_internal_no_missing_args() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_no_missing_args(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.CallContext) + return target; +} + +size_t CallContext::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.CallContext) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool args_statically_matched = 1; + if (this->_internal_args_statically_matched() != 0) { + total_size += 1 + 1; + } + + // bool correct_number_of_args = 2; + if (this->_internal_correct_number_of_args() != 0) { + total_size += 1 + 1; + } + + // bool correct_order_of_args = 3; + if (this->_internal_correct_order_of_args() != 0) { + total_size += 1 + 1; + } + + // bool no_missing_args = 4; + if (this->_internal_no_missing_args() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CallContext::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + CallContext::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CallContext::GetClassData() const { return &_class_data_; } + + +void CallContext::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.CallContext) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_args_statically_matched() != 0) { + _this->_internal_set_args_statically_matched(from._internal_args_statically_matched()); + } + if (from._internal_correct_number_of_args() != 0) { + _this->_internal_set_correct_number_of_args(from._internal_correct_number_of_args()); + } + if (from._internal_correct_order_of_args() != 0) { + _this->_internal_set_correct_order_of_args(from._internal_correct_order_of_args()); + } + if (from._internal_no_missing_args() != 0) { + _this->_internal_set_no_missing_args(from._internal_no_missing_args()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void CallContext::CopyFrom(const CallContext& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.CallContext) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CallContext::IsInitialized() const { + return true; +} + +void CallContext::InternalSwap(CallContext* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(CallContext, _impl_.no_missing_args_) + + sizeof(CallContext::_impl_.no_missing_args_) + - PROTOBUF_FIELD_OFFSET(CallContext, _impl_.args_statically_matched_)>( + reinterpret_cast(&_impl_.args_statically_matched_), + reinterpret_cast(&other->_impl_.args_statically_matched_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata CallContext::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[13]); +} + +// =================================================================== + +class ArgumentContext::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_type(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +ArgumentContext::ArgumentContext(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.ArgumentContext) +} +ArgumentContext::ArgumentContext(const ArgumentContext& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ArgumentContext* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.eager_){} + , decltype(_impl_.reflection_){} + , decltype(_impl_.object_){} + , decltype(_impl_.type_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.eager_, &from._impl_.eager_, + static_cast(reinterpret_cast(&_impl_.type_) - + reinterpret_cast(&_impl_.eager_)) + sizeof(_impl_.type_)); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.ArgumentContext) +} + +inline void ArgumentContext::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.eager_){false} + , decltype(_impl_.reflection_){false} + , decltype(_impl_.object_){false} + , decltype(_impl_.type_){0} + }; +} + +ArgumentContext::~ArgumentContext() { + // @@protoc_insertion_point(destructor:rsh.protocol.ArgumentContext) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ArgumentContext::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void ArgumentContext::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ArgumentContext::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.ArgumentContext) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.eager_, 0, static_cast( + reinterpret_cast(&_impl_.object_) - + reinterpret_cast(&_impl_.eager_)) + sizeof(_impl_.object_)); + _impl_.type_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ArgumentContext::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool eager = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.eager_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool reflection = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.reflection_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool object = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.object_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .rsh.protocol.Type type = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_type(static_cast<::rsh::protocol::Type>(val)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ArgumentContext::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.ArgumentContext) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool eager = 1; + if (this->_internal_eager() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_eager(), target); + } + + // bool reflection = 2; + if (this->_internal_reflection() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_reflection(), target); + } + + // bool object = 3; + if (this->_internal_object() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_object(), target); + } + + // optional .rsh.protocol.Type type = 4; + if (_internal_has_type()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_type(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.ArgumentContext) + return target; +} + +size_t ArgumentContext::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.ArgumentContext) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool eager = 1; + if (this->_internal_eager() != 0) { + total_size += 1 + 1; + } + + // bool reflection = 2; + if (this->_internal_reflection() != 0) { + total_size += 1 + 1; + } + + // bool object = 3; + if (this->_internal_object() != 0) { + total_size += 1 + 1; + } + + // optional .rsh.protocol.Type type = 4; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ArgumentContext::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ArgumentContext::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ArgumentContext::GetClassData() const { return &_class_data_; } + + +void ArgumentContext::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.ArgumentContext) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_eager() != 0) { + _this->_internal_set_eager(from._internal_eager()); + } + if (from._internal_reflection() != 0) { + _this->_internal_set_reflection(from._internal_reflection()); + } + if (from._internal_object() != 0) { + _this->_internal_set_object(from._internal_object()); + } + if (from._internal_has_type()) { + _this->_internal_set_type(from._internal_type()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ArgumentContext::CopyFrom(const ArgumentContext& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.ArgumentContext) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ArgumentContext::IsInitialized() const { + return true; +} + +void ArgumentContext::InternalSwap(ArgumentContext* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(ArgumentContext, _impl_.type_) + + sizeof(ArgumentContext::_impl_.type_) + - PROTOBUF_FIELD_OFFSET(ArgumentContext, _impl_.eager_)>( + reinterpret_cast(&_impl_.eager_), + reinterpret_cast(&other->_impl_.eager_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ArgumentContext::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[14]); +} + +// =================================================================== + +class Context::_Internal { + public: + static const ::rsh::protocol::CallContext& call_context(const Context* msg); +}; + +const ::rsh::protocol::CallContext& +Context::_Internal::call_context(const Context* msg) { + return *msg->_impl_.call_context_; +} +Context::Context(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.Context) +} +Context::Context(const Context& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Context* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.argument_context_){from._impl_.argument_context_} + , decltype(_impl_.call_context_){nullptr} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_call_context()) { + _this->_impl_.call_context_ = new ::rsh::protocol::CallContext(*from._impl_.call_context_); + } + // @@protoc_insertion_point(copy_constructor:rsh.protocol.Context) +} + +inline void Context::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.argument_context_){arena} + , decltype(_impl_.call_context_){nullptr} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +Context::~Context() { + // @@protoc_insertion_point(destructor:rsh.protocol.Context) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Context::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.argument_context_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.call_context_; +} + +void Context::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Context::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.Context) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.argument_context_.Clear(); + if (GetArenaForAllocation() == nullptr && _impl_.call_context_ != nullptr) { + delete _impl_.call_context_; + } + _impl_.call_context_ = nullptr; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Context::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .rsh.protocol.CallContext call_context = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_call_context(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated .rsh.protocol.ArgumentContext argument_context = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_argument_context(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Context::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.Context) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .rsh.protocol.CallContext call_context = 1; + if (this->_internal_has_call_context()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::call_context(this), + _Internal::call_context(this).GetCachedSize(), target, stream); + } + + // repeated .rsh.protocol.ArgumentContext argument_context = 2; + for (unsigned i = 0, + n = static_cast(this->_internal_argument_context_size()); i < n; i++) { + const auto& repfield = this->_internal_argument_context(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.Context) + return target; +} + +size_t Context::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.Context) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .rsh.protocol.ArgumentContext argument_context = 2; + total_size += 1UL * this->_internal_argument_context_size(); + for (const auto& msg : this->_impl_.argument_context_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // .rsh.protocol.CallContext call_context = 1; + if (this->_internal_has_call_context()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.call_context_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Context::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Context::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Context::GetClassData() const { return &_class_data_; } + + +void Context::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.Context) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.argument_context_.MergeFrom(from._impl_.argument_context_); + if (from._internal_has_call_context()) { + _this->_internal_mutable_call_context()->::rsh::protocol::CallContext::MergeFrom( + from._internal_call_context()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Context::CopyFrom(const Context& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.Context) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Context::IsInitialized() const { + return true; +} + +void Context::InternalSwap(Context* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.argument_context_.InternalSwap(&other->_impl_.argument_context_); + swap(_impl_.call_context_, other->_impl_.call_context_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Context::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[15]); +} + +// =================================================================== + +class ContextRequest::_Internal { + public: + static const ::rsh::protocol::Function& function(const ContextRequest* msg); +}; + +const ::rsh::protocol::Function& +ContextRequest::_Internal::function(const ContextRequest* msg) { + return *msg->_impl_.function_; +} +ContextRequest::ContextRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.ContextRequest) +} +ContextRequest::ContextRequest(const ContextRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ContextRequest* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.function_){nullptr} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_function()) { + _this->_impl_.function_ = new ::rsh::protocol::Function(*from._impl_.function_); + } + // @@protoc_insertion_point(copy_constructor:rsh.protocol.ContextRequest) +} + +inline void ContextRequest::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.function_){nullptr} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +ContextRequest::~ContextRequest() { + // @@protoc_insertion_point(destructor:rsh.protocol.ContextRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ContextRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.function_; +} + +void ContextRequest::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ContextRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.ContextRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && _impl_.function_ != nullptr) { + delete _impl_.function_; + } + _impl_.function_ = nullptr; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ContextRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .rsh.protocol.Function function = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_function(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ContextRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.ContextRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .rsh.protocol.Function function = 1; + if (this->_internal_has_function()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::function(this), + _Internal::function(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.ContextRequest) + return target; +} + +size_t ContextRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.ContextRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .rsh.protocol.Function function = 1; + if (this->_internal_has_function()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.function_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ContextRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ContextRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ContextRequest::GetClassData() const { return &_class_data_; } + + +void ContextRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.ContextRequest) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_function()) { + _this->_internal_mutable_function()->::rsh::protocol::Function::MergeFrom( + from._internal_function()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ContextRequest::CopyFrom(const ContextRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.ContextRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ContextRequest::IsInitialized() const { + return true; +} + +void ContextRequest::InternalSwap(ContextRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.function_, other->_impl_.function_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ContextRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[16]); +} + +// =================================================================== + +class TestFeedback::_Internal { + public: +}; + +TestFeedback::TestFeedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.TestFeedback) +} +TestFeedback::TestFeedback(const TestFeedback& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + TestFeedback* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.test_lattice_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.test_lattice_ = from._impl_.test_lattice_; + // @@protoc_insertion_point(copy_constructor:rsh.protocol.TestFeedback) +} + +inline void TestFeedback::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.test_lattice_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +TestFeedback::~TestFeedback() { + // @@protoc_insertion_point(destructor:rsh.protocol.TestFeedback) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void TestFeedback::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void TestFeedback::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void TestFeedback::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.TestFeedback) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.test_lattice_ = 0; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* TestFeedback::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .rsh.protocol.TestLattice test_lattice = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_test_lattice(static_cast<::rsh::protocol::TestLattice>(val)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* TestFeedback::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.TestFeedback) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .rsh.protocol.TestLattice test_lattice = 1; + if (this->_internal_test_lattice() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_test_lattice(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.TestFeedback) + return target; +} + +size_t TestFeedback::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.TestFeedback) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .rsh.protocol.TestLattice test_lattice = 1; + if (this->_internal_test_lattice() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_test_lattice()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TestFeedback::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + TestFeedback::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TestFeedback::GetClassData() const { return &_class_data_; } + + +void TestFeedback::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.TestFeedback) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_test_lattice() != 0) { + _this->_internal_set_test_lattice(from._internal_test_lattice()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void TestFeedback::CopyFrom(const TestFeedback& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.TestFeedback) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TestFeedback::IsInitialized() const { + return true; +} + +void TestFeedback::InternalSwap(TestFeedback* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.test_lattice_, other->_impl_.test_lattice_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata TestFeedback::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[17]); +} + +// =================================================================== + +class CallFeedback::_Internal { + public: +}; + +CallFeedback::CallFeedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.CallFeedback) +} +CallFeedback::CallFeedback(const CallFeedback& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + CallFeedback* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.n_calls_){} + , decltype(_impl_.callee_hash_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.n_calls_, &from._impl_.n_calls_, + static_cast(reinterpret_cast(&_impl_.callee_hash_) - + reinterpret_cast(&_impl_.n_calls_)) + sizeof(_impl_.callee_hash_)); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.CallFeedback) +} + +inline void CallFeedback::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.n_calls_){int64_t{0}} + , decltype(_impl_.callee_hash_){uint64_t{0u}} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +CallFeedback::~CallFeedback() { + // @@protoc_insertion_point(destructor:rsh.protocol.CallFeedback) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void CallFeedback::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void CallFeedback::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void CallFeedback::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.CallFeedback) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.n_calls_, 0, static_cast( + reinterpret_cast(&_impl_.callee_hash_) - + reinterpret_cast(&_impl_.n_calls_)) + sizeof(_impl_.callee_hash_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* CallFeedback::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // int64 n_calls = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.n_calls_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // uint64 callee_hash = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.callee_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* CallFeedback::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.CallFeedback) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // int64 n_calls = 1; + if (this->_internal_n_calls() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_n_calls(), target); + } + + // uint64 callee_hash = 2; + if (this->_internal_callee_hash() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_callee_hash(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.CallFeedback) + return target; +} + +size_t CallFeedback::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.CallFeedback) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int64 n_calls = 1; + if (this->_internal_n_calls() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_n_calls()); + } + + // uint64 callee_hash = 2; + if (this->_internal_callee_hash() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_callee_hash()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CallFeedback::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + CallFeedback::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CallFeedback::GetClassData() const { return &_class_data_; } + + +void CallFeedback::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.CallFeedback) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_n_calls() != 0) { + _this->_internal_set_n_calls(from._internal_n_calls()); + } + if (from._internal_callee_hash() != 0) { + _this->_internal_set_callee_hash(from._internal_callee_hash()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void CallFeedback::CopyFrom(const CallFeedback& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.CallFeedback) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CallFeedback::IsInitialized() const { + return true; +} + +void CallFeedback::InternalSwap(CallFeedback* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(CallFeedback, _impl_.callee_hash_) + + sizeof(CallFeedback::_impl_.callee_hash_) + - PROTOBUF_FIELD_OFFSET(CallFeedback, _impl_.n_calls_)>( + reinterpret_cast(&_impl_.n_calls_), + reinterpret_cast(&other->_impl_.n_calls_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata CallFeedback::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[18]); +} + +// =================================================================== + +class ValueFeedback::_Internal { + public: +}; + +ValueFeedback::ValueFeedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.ValueFeedback) +} +ValueFeedback::ValueFeedback(const ValueFeedback& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ValueFeedback* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.scalar_){} + , decltype(_impl_.object_){} + , decltype(_impl_.accessed_attributes_){} + , decltype(_impl_.vectorizable_){} + , decltype(_impl_.is_promise_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.scalar_, &from._impl_.scalar_, + static_cast(reinterpret_cast(&_impl_.is_promise_) - + reinterpret_cast(&_impl_.scalar_)) + sizeof(_impl_.is_promise_)); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.ValueFeedback) +} + +inline void ValueFeedback::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.scalar_){false} + , decltype(_impl_.object_){false} + , decltype(_impl_.accessed_attributes_){false} + , decltype(_impl_.vectorizable_){false} + , decltype(_impl_.is_promise_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +ValueFeedback::~ValueFeedback() { + // @@protoc_insertion_point(destructor:rsh.protocol.ValueFeedback) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ValueFeedback::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void ValueFeedback::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ValueFeedback::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.ValueFeedback) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.scalar_, 0, static_cast( + reinterpret_cast(&_impl_.is_promise_) - + reinterpret_cast(&_impl_.scalar_)) + sizeof(_impl_.is_promise_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ValueFeedback::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool scalar = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.scalar_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool object = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.object_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool accessed_attributes = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.accessed_attributes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool vectorizable = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.vectorizable_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool is_promise = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + _impl_.is_promise_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ValueFeedback::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.ValueFeedback) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool scalar = 1; + if (this->_internal_scalar() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_scalar(), target); + } + + // bool object = 2; + if (this->_internal_object() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_object(), target); + } + + // bool accessed_attributes = 3; + if (this->_internal_accessed_attributes() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_accessed_attributes(), target); + } + + // bool vectorizable = 4; + if (this->_internal_vectorizable() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_vectorizable(), target); + } + + // bool is_promise = 5; + if (this->_internal_is_promise() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_is_promise(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.ValueFeedback) + return target; +} + +size_t ValueFeedback::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.ValueFeedback) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool scalar = 1; + if (this->_internal_scalar() != 0) { + total_size += 1 + 1; + } + + // bool object = 2; + if (this->_internal_object() != 0) { + total_size += 1 + 1; + } + + // bool accessed_attributes = 3; + if (this->_internal_accessed_attributes() != 0) { + total_size += 1 + 1; + } + + // bool vectorizable = 4; + if (this->_internal_vectorizable() != 0) { + total_size += 1 + 1; + } + + // bool is_promise = 5; + if (this->_internal_is_promise() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ValueFeedback::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ValueFeedback::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ValueFeedback::GetClassData() const { return &_class_data_; } + + +void ValueFeedback::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.ValueFeedback) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_scalar() != 0) { + _this->_internal_set_scalar(from._internal_scalar()); + } + if (from._internal_object() != 0) { + _this->_internal_set_object(from._internal_object()); + } + if (from._internal_accessed_attributes() != 0) { + _this->_internal_set_accessed_attributes(from._internal_accessed_attributes()); + } + if (from._internal_vectorizable() != 0) { + _this->_internal_set_vectorizable(from._internal_vectorizable()); + } + if (from._internal_is_promise() != 0) { + _this->_internal_set_is_promise(from._internal_is_promise()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ValueFeedback::CopyFrom(const ValueFeedback& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.ValueFeedback) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ValueFeedback::IsInitialized() const { + return true; +} + +void ValueFeedback::InternalSwap(ValueFeedback* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(ValueFeedback, _impl_.is_promise_) + + sizeof(ValueFeedback::_impl_.is_promise_) + - PROTOBUF_FIELD_OFFSET(ValueFeedback, _impl_.scalar_)>( + reinterpret_cast(&_impl_.scalar_), + reinterpret_cast(&other->_impl_.scalar_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ValueFeedback::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[19]); +} + +// =================================================================== + +class TypeFeedback_Feedback::_Internal { + public: + static const ::rsh::protocol::TestFeedback& test_feedback(const TypeFeedback_Feedback* msg); + static const ::rsh::protocol::CallFeedback& call_feedback(const TypeFeedback_Feedback* msg); + static const ::rsh::protocol::ValueFeedback& value_feedback(const TypeFeedback_Feedback* msg); +}; + +const ::rsh::protocol::TestFeedback& +TypeFeedback_Feedback::_Internal::test_feedback(const TypeFeedback_Feedback* msg) { + return *msg->_impl_.feedback_.test_feedback_; +} +const ::rsh::protocol::CallFeedback& +TypeFeedback_Feedback::_Internal::call_feedback(const TypeFeedback_Feedback* msg) { + return *msg->_impl_.feedback_.call_feedback_; +} +const ::rsh::protocol::ValueFeedback& +TypeFeedback_Feedback::_Internal::value_feedback(const TypeFeedback_Feedback* msg) { + return *msg->_impl_.feedback_.value_feedback_; +} +void TypeFeedback_Feedback::set_allocated_test_feedback(::rsh::protocol::TestFeedback* test_feedback) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_feedback(); + if (test_feedback) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(test_feedback); + if (message_arena != submessage_arena) { + test_feedback = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, test_feedback, submessage_arena); + } + set_has_test_feedback(); + _impl_.feedback_.test_feedback_ = test_feedback; + } + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.TypeFeedback.Feedback.test_feedback) +} +void TypeFeedback_Feedback::set_allocated_call_feedback(::rsh::protocol::CallFeedback* call_feedback) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_feedback(); + if (call_feedback) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(call_feedback); + if (message_arena != submessage_arena) { + call_feedback = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, call_feedback, submessage_arena); + } + set_has_call_feedback(); + _impl_.feedback_.call_feedback_ = call_feedback; + } + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.TypeFeedback.Feedback.call_feedback) +} +void TypeFeedback_Feedback::set_allocated_value_feedback(::rsh::protocol::ValueFeedback* value_feedback) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_feedback(); + if (value_feedback) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(value_feedback); + if (message_arena != submessage_arena) { + value_feedback = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, value_feedback, submessage_arena); + } + set_has_value_feedback(); + _impl_.feedback_.value_feedback_ = value_feedback; + } + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.TypeFeedback.Feedback.value_feedback) +} +TypeFeedback_Feedback::TypeFeedback_Feedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.TypeFeedback.Feedback) +} +TypeFeedback_Feedback::TypeFeedback_Feedback(const TypeFeedback_Feedback& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + TypeFeedback_Feedback* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.feedback_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + clear_has_feedback(); + switch (from.feedback_case()) { + case kTestFeedback: { + _this->_internal_mutable_test_feedback()->::rsh::protocol::TestFeedback::MergeFrom( + from._internal_test_feedback()); + break; + } + case kCallFeedback: { + _this->_internal_mutable_call_feedback()->::rsh::protocol::CallFeedback::MergeFrom( + from._internal_call_feedback()); + break; + } + case kValueFeedback: { + _this->_internal_mutable_value_feedback()->::rsh::protocol::ValueFeedback::MergeFrom( + from._internal_value_feedback()); + break; + } + case FEEDBACK_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:rsh.protocol.TypeFeedback.Feedback) +} + +inline void TypeFeedback_Feedback::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.feedback_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{} + }; + clear_has_feedback(); +} + +TypeFeedback_Feedback::~TypeFeedback_Feedback() { + // @@protoc_insertion_point(destructor:rsh.protocol.TypeFeedback.Feedback) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void TypeFeedback_Feedback::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (has_feedback()) { + clear_feedback(); + } +} + +void TypeFeedback_Feedback::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void TypeFeedback_Feedback::clear_feedback() { +// @@protoc_insertion_point(one_of_clear_start:rsh.protocol.TypeFeedback.Feedback) + switch (feedback_case()) { + case kTestFeedback: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.feedback_.test_feedback_; + } + break; + } + case kCallFeedback: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.feedback_.call_feedback_; + } + break; + } + case kValueFeedback: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.feedback_.value_feedback_; + } + break; + } + case FEEDBACK_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = FEEDBACK_NOT_SET; +} + + +void TypeFeedback_Feedback::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.TypeFeedback.Feedback) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_feedback(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* TypeFeedback_Feedback::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .rsh.protocol.TestFeedback test_feedback = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_test_feedback(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .rsh.protocol.CallFeedback call_feedback = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_call_feedback(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .rsh.protocol.ValueFeedback value_feedback = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_value_feedback(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* TypeFeedback_Feedback::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.TypeFeedback.Feedback) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .rsh.protocol.TestFeedback test_feedback = 1; + if (_internal_has_test_feedback()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::test_feedback(this), + _Internal::test_feedback(this).GetCachedSize(), target, stream); + } + + // .rsh.protocol.CallFeedback call_feedback = 2; + if (_internal_has_call_feedback()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::call_feedback(this), + _Internal::call_feedback(this).GetCachedSize(), target, stream); + } + + // .rsh.protocol.ValueFeedback value_feedback = 3; + if (_internal_has_value_feedback()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::value_feedback(this), + _Internal::value_feedback(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.TypeFeedback.Feedback) + return target; +} + +size_t TypeFeedback_Feedback::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.TypeFeedback.Feedback) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + switch (feedback_case()) { + // .rsh.protocol.TestFeedback test_feedback = 1; + case kTestFeedback: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.feedback_.test_feedback_); + break; + } + // .rsh.protocol.CallFeedback call_feedback = 2; + case kCallFeedback: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.feedback_.call_feedback_); + break; + } + // .rsh.protocol.ValueFeedback value_feedback = 3; + case kValueFeedback: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.feedback_.value_feedback_); + break; + } + case FEEDBACK_NOT_SET: { + break; + } + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TypeFeedback_Feedback::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + TypeFeedback_Feedback::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TypeFeedback_Feedback::GetClassData() const { return &_class_data_; } + + +void TypeFeedback_Feedback::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.TypeFeedback.Feedback) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.feedback_case()) { + case kTestFeedback: { + _this->_internal_mutable_test_feedback()->::rsh::protocol::TestFeedback::MergeFrom( + from._internal_test_feedback()); + break; + } + case kCallFeedback: { + _this->_internal_mutable_call_feedback()->::rsh::protocol::CallFeedback::MergeFrom( + from._internal_call_feedback()); + break; + } + case kValueFeedback: { + _this->_internal_mutable_value_feedback()->::rsh::protocol::ValueFeedback::MergeFrom( + from._internal_value_feedback()); + break; + } + case FEEDBACK_NOT_SET: { + break; + } + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void TypeFeedback_Feedback::CopyFrom(const TypeFeedback_Feedback& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.TypeFeedback.Feedback) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TypeFeedback_Feedback::IsInitialized() const { + return true; +} + +void TypeFeedback_Feedback::InternalSwap(TypeFeedback_Feedback* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.feedback_, other->_impl_.feedback_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata TypeFeedback_Feedback::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[20]); +} + +// =================================================================== + +TypeFeedback_TypesEntry_DoNotUse::TypeFeedback_TypesEntry_DoNotUse() {} +TypeFeedback_TypesEntry_DoNotUse::TypeFeedback_TypesEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void TypeFeedback_TypesEntry_DoNotUse::MergeFrom(const TypeFeedback_TypesEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata TypeFeedback_TypesEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[21]); +} + +// =================================================================== + +class TypeFeedback::_Internal { + public: +}; + +TypeFeedback::TypeFeedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + if (arena != nullptr && !is_message_owned) { + arena->OwnCustomDestructor(this, &TypeFeedback::ArenaDtor); + } + // @@protoc_insertion_point(arena_constructor:rsh.protocol.TypeFeedback) +} +TypeFeedback::TypeFeedback(const TypeFeedback& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + TypeFeedback* const _this = this; (void)_this; + new (&_impl_) Impl_{ + /*decltype(_impl_.types_)*/{} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.types_.MergeFrom(from._impl_.types_); + // @@protoc_insertion_point(copy_constructor:rsh.protocol.TypeFeedback) +} + +inline void TypeFeedback::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + /*decltype(_impl_.types_)*/{::_pbi::ArenaInitialized(), arena} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +TypeFeedback::~TypeFeedback() { + // @@protoc_insertion_point(destructor:rsh.protocol.TypeFeedback) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + ArenaDtor(this); + return; + } + SharedDtor(); +} + +inline void TypeFeedback::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.types_.Destruct(); + _impl_.types_.~MapField(); +} + +void TypeFeedback::ArenaDtor(void* object) { + TypeFeedback* _this = reinterpret_cast< TypeFeedback* >(object); + _this->_impl_.types_.Destruct(); +} +void TypeFeedback::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void TypeFeedback::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.TypeFeedback) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.types_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* TypeFeedback::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // map types = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&_impl_.types_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* TypeFeedback::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.TypeFeedback) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // map types = 2; + if (!this->_internal_types().empty()) { + using MapType = ::_pb::Map; + using WireHelper = TypeFeedback_TypesEntry_DoNotUse::Funcs; + const auto& map_field = this->_internal_types(); + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterFlat(map_field)) { + target = WireHelper::InternalSerialize(2, entry.first, entry.second, target, stream); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(2, entry.first, entry.second, target, stream); + } + } + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.TypeFeedback) + return target; +} + +size_t TypeFeedback::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.TypeFeedback) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // map types = 2; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_types_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::rsh::protocol::TypeFeedback_Feedback >::const_iterator + it = this->_internal_types().begin(); + it != this->_internal_types().end(); ++it) { + total_size += TypeFeedback_TypesEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TypeFeedback::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + TypeFeedback::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TypeFeedback::GetClassData() const { return &_class_data_; } + + +void TypeFeedback::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.TypeFeedback) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.types_.MergeFrom(from._impl_.types_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void TypeFeedback::CopyFrom(const TypeFeedback& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.TypeFeedback) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TypeFeedback::IsInitialized() const { + return true; +} + +void TypeFeedback::InternalSwap(TypeFeedback* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.types_.InternalSwap(&other->_impl_.types_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata TypeFeedback::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[22]); +} + +// =================================================================== + +class FeedbackRequest::_Internal { + public: + static const ::rsh::protocol::Function& function(const FeedbackRequest* msg); +}; + +const ::rsh::protocol::Function& +FeedbackRequest::_Internal::function(const FeedbackRequest* msg) { + return *msg->_impl_.function_; +} +FeedbackRequest::FeedbackRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.FeedbackRequest) +} +FeedbackRequest::FeedbackRequest(const FeedbackRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + FeedbackRequest* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.function_){nullptr} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_function()) { + _this->_impl_.function_ = new ::rsh::protocol::Function(*from._impl_.function_); + } + // @@protoc_insertion_point(copy_constructor:rsh.protocol.FeedbackRequest) +} + +inline void FeedbackRequest::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.function_){nullptr} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +FeedbackRequest::~FeedbackRequest() { + // @@protoc_insertion_point(destructor:rsh.protocol.FeedbackRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void FeedbackRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.function_; +} + +void FeedbackRequest::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void FeedbackRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.FeedbackRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && _impl_.function_ != nullptr) { + delete _impl_.function_; + } + _impl_.function_ = nullptr; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* FeedbackRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .rsh.protocol.Function function = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_function(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* FeedbackRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.FeedbackRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .rsh.protocol.Function function = 1; + if (this->_internal_has_function()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::function(this), + _Internal::function(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.FeedbackRequest) + return target; +} + +size_t FeedbackRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.FeedbackRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .rsh.protocol.Function function = 1; + if (this->_internal_has_function()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.function_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FeedbackRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + FeedbackRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FeedbackRequest::GetClassData() const { return &_class_data_; } + + +void FeedbackRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.FeedbackRequest) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_function()) { + _this->_internal_mutable_function()->::rsh::protocol::Function::MergeFrom( + from._internal_function()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void FeedbackRequest::CopyFrom(const FeedbackRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.FeedbackRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FeedbackRequest::IsInitialized() const { + return true; +} + +void FeedbackRequest::InternalSwap(FeedbackRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.function_, other->_impl_.function_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata FeedbackRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[23]); +} + +// =================================================================== + +class PackageSource::_Internal { + public: +}; + +PackageSource::PackageSource(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.PackageSource) +} +PackageSource::PackageSource(const PackageSource& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + PackageSource* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.source_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + clear_has_source(); + switch (from.source_case()) { + case kRMirror: { + _this->_internal_set_r_mirror(from._internal_r_mirror()); + break; + } + case kGithubUrl: { + _this->_internal_set_github_url(from._internal_github_url()); + break; + } + case SOURCE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:rsh.protocol.PackageSource) +} + +inline void PackageSource::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.source_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{} + }; + clear_has_source(); +} + +PackageSource::~PackageSource() { + // @@protoc_insertion_point(destructor:rsh.protocol.PackageSource) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void PackageSource::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (has_source()) { + clear_source(); + } +} + +void PackageSource::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void PackageSource::clear_source() { +// @@protoc_insertion_point(one_of_clear_start:rsh.protocol.PackageSource) + switch (source_case()) { + case kRMirror: { + _impl_.source_.r_mirror_.Destroy(); + break; + } + case kGithubUrl: { + _impl_.source_.github_url_.Destroy(); + break; + } + case SOURCE_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = SOURCE_NOT_SET; +} + + +void PackageSource::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.PackageSource) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_source(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PackageSource::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string r_mirror = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_r_mirror(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "rsh.protocol.PackageSource.r_mirror")); + } else + goto handle_unusual; + continue; + // string github_url = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + auto str = _internal_mutable_github_url(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "rsh.protocol.PackageSource.github_url")); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* PackageSource::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.PackageSource) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string r_mirror = 2; + if (_internal_has_r_mirror()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_r_mirror().data(), static_cast(this->_internal_r_mirror().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "rsh.protocol.PackageSource.r_mirror"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_r_mirror(), target); + } + + // string github_url = 3; + if (_internal_has_github_url()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_github_url().data(), static_cast(this->_internal_github_url().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "rsh.protocol.PackageSource.github_url"); + target = stream->WriteStringMaybeAliased( + 3, this->_internal_github_url(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.PackageSource) + return target; +} + +size_t PackageSource::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.PackageSource) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + switch (source_case()) { + // string r_mirror = 2; + case kRMirror: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_r_mirror()); + break; + } + // string github_url = 3; + case kGithubUrl: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_github_url()); + break; + } + case SOURCE_NOT_SET: { + break; + } + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PackageSource::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + PackageSource::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PackageSource::GetClassData() const { return &_class_data_; } + + +void PackageSource::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.PackageSource) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.source_case()) { + case kRMirror: { + _this->_internal_set_r_mirror(from._internal_r_mirror()); + break; + } + case kGithubUrl: { + _this->_internal_set_github_url(from._internal_github_url()); + break; + } + case SOURCE_NOT_SET: { + break; + } + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PackageSource::CopyFrom(const PackageSource& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.PackageSource) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PackageSource::IsInitialized() const { + return true; +} + +void PackageSource::InternalSwap(PackageSource* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.source_, other->_impl_.source_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PackageSource::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[24]); +} + +// =================================================================== + +class Package::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static const ::rsh::protocol::Version& version(const Package* msg); + static const ::rsh::protocol::PackageSource& source(const Package* msg); + static void set_has_source(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +const ::rsh::protocol::Version& +Package::_Internal::version(const Package* msg) { + return *msg->_impl_.version_; +} +const ::rsh::protocol::PackageSource& +Package::_Internal::source(const Package* msg) { + return *msg->_impl_.source_; +} +Package::Package(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.Package) +} +Package::Package(const Package& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Package* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.function_hashes_){from._impl_.function_hashes_} + , /*decltype(_impl_._function_hashes_cached_byte_size_)*/{0} + , decltype(_impl_.name_){} + , decltype(_impl_.version_){nullptr} + , decltype(_impl_.source_){nullptr}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_name().empty()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_version()) { + _this->_impl_.version_ = new ::rsh::protocol::Version(*from._impl_.version_); + } + if (from._internal_has_source()) { + _this->_impl_.source_ = new ::rsh::protocol::PackageSource(*from._impl_.source_); + } + // @@protoc_insertion_point(copy_constructor:rsh.protocol.Package) +} + +inline void Package::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.function_hashes_){arena} + , /*decltype(_impl_._function_hashes_cached_byte_size_)*/{0} + , decltype(_impl_.name_){} + , decltype(_impl_.version_){nullptr} + , decltype(_impl_.source_){nullptr} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Package::~Package() { + // @@protoc_insertion_point(destructor:rsh.protocol.Package) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Package::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.function_hashes_.~RepeatedField(); + _impl_.name_.Destroy(); + if (this != internal_default_instance()) delete _impl_.version_; + if (this != internal_default_instance()) delete _impl_.source_; +} + +void Package::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Package::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.Package) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.function_hashes_.Clear(); + _impl_.name_.ClearToEmpty(); + if (GetArenaForAllocation() == nullptr && _impl_.version_ != nullptr) { + delete _impl_.version_; + } + _impl_.version_ = nullptr; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(_impl_.source_ != nullptr); + _impl_.source_->Clear(); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Package::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string name = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "rsh.protocol.Package.name")); + } else + goto handle_unusual; + continue; + // .rsh.protocol.Version version = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_version(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated uint64 function_hashes = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_function_hashes(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 32) { + _internal_add_function_hashes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .rsh.protocol.PackageSource source = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_source(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Package::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.Package) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (!this->_internal_name().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "rsh.protocol.Package.name"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_name(), target); + } + + // .rsh.protocol.Version version = 2; + if (this->_internal_has_version()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::version(this), + _Internal::version(this).GetCachedSize(), target, stream); + } + + // repeated uint64 function_hashes = 4; + { + int byte_size = _impl_._function_hashes_cached_byte_size_.load(std::memory_order_relaxed); + if (byte_size > 0) { + target = stream->WriteUInt64Packed( + 4, _internal_function_hashes(), byte_size, target); + } + } + + // optional .rsh.protocol.PackageSource source = 5; + if (_internal_has_source()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(5, _Internal::source(this), + _Internal::source(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.Package) + return target; +} + +size_t Package::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.Package) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated uint64 function_hashes = 4; + { + size_t data_size = ::_pbi::WireFormatLite:: + UInt64Size(this->_impl_.function_hashes_); + if (data_size > 0) { + total_size += 1 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + int cached_size = ::_pbi::ToCachedSize(data_size); + _impl_._function_hashes_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // string name = 1; + if (!this->_internal_name().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // .rsh.protocol.Version version = 2; + if (this->_internal_has_version()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.version_); + } + + // optional .rsh.protocol.PackageSource source = 5; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.source_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Package::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Package::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Package::GetClassData() const { return &_class_data_; } + + +void Package::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.Package) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.function_hashes_.MergeFrom(from._impl_.function_hashes_); + if (!from._internal_name().empty()) { + _this->_internal_set_name(from._internal_name()); + } + if (from._internal_has_version()) { + _this->_internal_mutable_version()->::rsh::protocol::Version::MergeFrom( + from._internal_version()); + } + if (from._internal_has_source()) { + _this->_internal_mutable_source()->::rsh::protocol::PackageSource::MergeFrom( + from._internal_source()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Package::CopyFrom(const Package& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.Package) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Package::IsInitialized() const { + return true; +} + +void Package::InternalSwap(Package* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.function_hashes_.InternalSwap(&other->_impl_.function_hashes_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Package, _impl_.source_) + + sizeof(Package::_impl_.source_) + - PROTOBUF_FIELD_OFFSET(Package, _impl_.version_)>( + reinterpret_cast(&_impl_.version_), + reinterpret_cast(&other->_impl_.version_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Package::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[25]); +} + +// =================================================================== + +class PackageRequest::_Internal { + public: +}; + +PackageRequest::PackageRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:rsh.protocol.PackageRequest) +} +PackageRequest::PackageRequest(const PackageRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + PackageRequest* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.hash_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.hash_ = from._impl_.hash_; + // @@protoc_insertion_point(copy_constructor:rsh.protocol.PackageRequest) +} + +inline void PackageRequest::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.hash_){uint64_t{0u}} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +PackageRequest::~PackageRequest() { + // @@protoc_insertion_point(destructor:rsh.protocol.PackageRequest) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void PackageRequest::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void PackageRequest::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void PackageRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:rsh.protocol.PackageRequest) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.hash_ = uint64_t{0u}; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PackageRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint64 hash = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* PackageRequest::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:rsh.protocol.PackageRequest) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 hash = 1; + if (this->_internal_hash() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_hash(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:rsh.protocol.PackageRequest) + return target; +} + +size_t PackageRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:rsh.protocol.PackageRequest) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // uint64 hash = 1; + if (this->_internal_hash() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_hash()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PackageRequest::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + PackageRequest::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PackageRequest::GetClassData() const { return &_class_data_; } + + +void PackageRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:rsh.protocol.PackageRequest) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_hash() != 0) { + _this->_internal_set_hash(from._internal_hash()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PackageRequest::CopyFrom(const PackageRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:rsh.protocol.PackageRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PackageRequest::IsInitialized() const { + return true; +} + +void PackageRequest::InternalSwap(PackageRequest* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.hash_, other->_impl_.hash_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PackageRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_messages_2eproto_getter, &descriptor_table_messages_2eproto_once, + file_level_metadata_messages_2eproto[26]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace protocol +} // namespace rsh +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::rsh::protocol::Version* +Arena::CreateMaybeMessage< ::rsh::protocol::Version >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::Version >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::InitRequest* +Arena::CreateMaybeMessage< ::rsh::protocol::InitRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::InitRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::InitResponse* +Arena::CreateMaybeMessage< ::rsh::protocol::InitResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::InitResponse >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::CompileRequest* +Arena::CreateMaybeMessage< ::rsh::protocol::CompileRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::CompileRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::CompileResponse* +Arena::CreateMaybeMessage< ::rsh::protocol::CompileResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::CompileResponse >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::Function* +Arena::CreateMaybeMessage< ::rsh::protocol::Function >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::Function >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::FunctionRequest* +Arena::CreateMaybeMessage< ::rsh::protocol::FunctionRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::FunctionRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::Environment_ValuesEntry_DoNotUse* +Arena::CreateMaybeMessage< ::rsh::protocol::Environment_ValuesEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::Environment_ValuesEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::Environment* +Arena::CreateMaybeMessage< ::rsh::protocol::Environment >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::Environment >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::ValueRequest* +Arena::CreateMaybeMessage< ::rsh::protocol::ValueRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::ValueRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::Value* +Arena::CreateMaybeMessage< ::rsh::protocol::Value >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::Value >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::Values* +Arena::CreateMaybeMessage< ::rsh::protocol::Values >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::Values >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::Empty* +Arena::CreateMaybeMessage< ::rsh::protocol::Empty >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::Empty >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::CallContext* +Arena::CreateMaybeMessage< ::rsh::protocol::CallContext >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::CallContext >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::ArgumentContext* +Arena::CreateMaybeMessage< ::rsh::protocol::ArgumentContext >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::ArgumentContext >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::Context* +Arena::CreateMaybeMessage< ::rsh::protocol::Context >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::Context >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::ContextRequest* +Arena::CreateMaybeMessage< ::rsh::protocol::ContextRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::ContextRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::TestFeedback* +Arena::CreateMaybeMessage< ::rsh::protocol::TestFeedback >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::TestFeedback >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::CallFeedback* +Arena::CreateMaybeMessage< ::rsh::protocol::CallFeedback >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::CallFeedback >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::ValueFeedback* +Arena::CreateMaybeMessage< ::rsh::protocol::ValueFeedback >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::ValueFeedback >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::TypeFeedback_Feedback* +Arena::CreateMaybeMessage< ::rsh::protocol::TypeFeedback_Feedback >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::TypeFeedback_Feedback >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse* +Arena::CreateMaybeMessage< ::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::TypeFeedback* +Arena::CreateMaybeMessage< ::rsh::protocol::TypeFeedback >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::TypeFeedback >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::FeedbackRequest* +Arena::CreateMaybeMessage< ::rsh::protocol::FeedbackRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::FeedbackRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::PackageSource* +Arena::CreateMaybeMessage< ::rsh::protocol::PackageSource >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::PackageSource >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::Package* +Arena::CreateMaybeMessage< ::rsh::protocol::Package >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::Package >(arena); +} +template<> PROTOBUF_NOINLINE ::rsh::protocol::PackageRequest* +Arena::CreateMaybeMessage< ::rsh::protocol::PackageRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::rsh::protocol::PackageRequest >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/client/rsh/src/messages.pb.h b/client/rsh/src/messages.pb.h new file mode 100644 index 000000000..153b6cced --- /dev/null +++ b/client/rsh/src/messages.pb.h @@ -0,0 +1,7469 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: messages.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_messages_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_messages_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_messages_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_messages_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_messages_2eproto; +namespace rsh { +namespace protocol { +class ArgumentContext; +struct ArgumentContextDefaultTypeInternal; +extern ArgumentContextDefaultTypeInternal _ArgumentContext_default_instance_; +class CallContext; +struct CallContextDefaultTypeInternal; +extern CallContextDefaultTypeInternal _CallContext_default_instance_; +class CallFeedback; +struct CallFeedbackDefaultTypeInternal; +extern CallFeedbackDefaultTypeInternal _CallFeedback_default_instance_; +class CompileRequest; +struct CompileRequestDefaultTypeInternal; +extern CompileRequestDefaultTypeInternal _CompileRequest_default_instance_; +class CompileResponse; +struct CompileResponseDefaultTypeInternal; +extern CompileResponseDefaultTypeInternal _CompileResponse_default_instance_; +class Context; +struct ContextDefaultTypeInternal; +extern ContextDefaultTypeInternal _Context_default_instance_; +class ContextRequest; +struct ContextRequestDefaultTypeInternal; +extern ContextRequestDefaultTypeInternal _ContextRequest_default_instance_; +class Empty; +struct EmptyDefaultTypeInternal; +extern EmptyDefaultTypeInternal _Empty_default_instance_; +class Environment; +struct EnvironmentDefaultTypeInternal; +extern EnvironmentDefaultTypeInternal _Environment_default_instance_; +class Environment_ValuesEntry_DoNotUse; +struct Environment_ValuesEntry_DoNotUseDefaultTypeInternal; +extern Environment_ValuesEntry_DoNotUseDefaultTypeInternal _Environment_ValuesEntry_DoNotUse_default_instance_; +class FeedbackRequest; +struct FeedbackRequestDefaultTypeInternal; +extern FeedbackRequestDefaultTypeInternal _FeedbackRequest_default_instance_; +class Function; +struct FunctionDefaultTypeInternal; +extern FunctionDefaultTypeInternal _Function_default_instance_; +class FunctionRequest; +struct FunctionRequestDefaultTypeInternal; +extern FunctionRequestDefaultTypeInternal _FunctionRequest_default_instance_; +class InitRequest; +struct InitRequestDefaultTypeInternal; +extern InitRequestDefaultTypeInternal _InitRequest_default_instance_; +class InitResponse; +struct InitResponseDefaultTypeInternal; +extern InitResponseDefaultTypeInternal _InitResponse_default_instance_; +class Package; +struct PackageDefaultTypeInternal; +extern PackageDefaultTypeInternal _Package_default_instance_; +class PackageRequest; +struct PackageRequestDefaultTypeInternal; +extern PackageRequestDefaultTypeInternal _PackageRequest_default_instance_; +class PackageSource; +struct PackageSourceDefaultTypeInternal; +extern PackageSourceDefaultTypeInternal _PackageSource_default_instance_; +class TestFeedback; +struct TestFeedbackDefaultTypeInternal; +extern TestFeedbackDefaultTypeInternal _TestFeedback_default_instance_; +class TypeFeedback; +struct TypeFeedbackDefaultTypeInternal; +extern TypeFeedbackDefaultTypeInternal _TypeFeedback_default_instance_; +class TypeFeedback_Feedback; +struct TypeFeedback_FeedbackDefaultTypeInternal; +extern TypeFeedback_FeedbackDefaultTypeInternal _TypeFeedback_Feedback_default_instance_; +class TypeFeedback_TypesEntry_DoNotUse; +struct TypeFeedback_TypesEntry_DoNotUseDefaultTypeInternal; +extern TypeFeedback_TypesEntry_DoNotUseDefaultTypeInternal _TypeFeedback_TypesEntry_DoNotUse_default_instance_; +class Value; +struct ValueDefaultTypeInternal; +extern ValueDefaultTypeInternal _Value_default_instance_; +class ValueFeedback; +struct ValueFeedbackDefaultTypeInternal; +extern ValueFeedbackDefaultTypeInternal _ValueFeedback_default_instance_; +class ValueRequest; +struct ValueRequestDefaultTypeInternal; +extern ValueRequestDefaultTypeInternal _ValueRequest_default_instance_; +class Values; +struct ValuesDefaultTypeInternal; +extern ValuesDefaultTypeInternal _Values_default_instance_; +class Version; +struct VersionDefaultTypeInternal; +extern VersionDefaultTypeInternal _Version_default_instance_; +} // namespace protocol +} // namespace rsh +PROTOBUF_NAMESPACE_OPEN +template<> ::rsh::protocol::ArgumentContext* Arena::CreateMaybeMessage<::rsh::protocol::ArgumentContext>(Arena*); +template<> ::rsh::protocol::CallContext* Arena::CreateMaybeMessage<::rsh::protocol::CallContext>(Arena*); +template<> ::rsh::protocol::CallFeedback* Arena::CreateMaybeMessage<::rsh::protocol::CallFeedback>(Arena*); +template<> ::rsh::protocol::CompileRequest* Arena::CreateMaybeMessage<::rsh::protocol::CompileRequest>(Arena*); +template<> ::rsh::protocol::CompileResponse* Arena::CreateMaybeMessage<::rsh::protocol::CompileResponse>(Arena*); +template<> ::rsh::protocol::Context* Arena::CreateMaybeMessage<::rsh::protocol::Context>(Arena*); +template<> ::rsh::protocol::ContextRequest* Arena::CreateMaybeMessage<::rsh::protocol::ContextRequest>(Arena*); +template<> ::rsh::protocol::Empty* Arena::CreateMaybeMessage<::rsh::protocol::Empty>(Arena*); +template<> ::rsh::protocol::Environment* Arena::CreateMaybeMessage<::rsh::protocol::Environment>(Arena*); +template<> ::rsh::protocol::Environment_ValuesEntry_DoNotUse* Arena::CreateMaybeMessage<::rsh::protocol::Environment_ValuesEntry_DoNotUse>(Arena*); +template<> ::rsh::protocol::FeedbackRequest* Arena::CreateMaybeMessage<::rsh::protocol::FeedbackRequest>(Arena*); +template<> ::rsh::protocol::Function* Arena::CreateMaybeMessage<::rsh::protocol::Function>(Arena*); +template<> ::rsh::protocol::FunctionRequest* Arena::CreateMaybeMessage<::rsh::protocol::FunctionRequest>(Arena*); +template<> ::rsh::protocol::InitRequest* Arena::CreateMaybeMessage<::rsh::protocol::InitRequest>(Arena*); +template<> ::rsh::protocol::InitResponse* Arena::CreateMaybeMessage<::rsh::protocol::InitResponse>(Arena*); +template<> ::rsh::protocol::Package* Arena::CreateMaybeMessage<::rsh::protocol::Package>(Arena*); +template<> ::rsh::protocol::PackageRequest* Arena::CreateMaybeMessage<::rsh::protocol::PackageRequest>(Arena*); +template<> ::rsh::protocol::PackageSource* Arena::CreateMaybeMessage<::rsh::protocol::PackageSource>(Arena*); +template<> ::rsh::protocol::TestFeedback* Arena::CreateMaybeMessage<::rsh::protocol::TestFeedback>(Arena*); +template<> ::rsh::protocol::TypeFeedback* Arena::CreateMaybeMessage<::rsh::protocol::TypeFeedback>(Arena*); +template<> ::rsh::protocol::TypeFeedback_Feedback* Arena::CreateMaybeMessage<::rsh::protocol::TypeFeedback_Feedback>(Arena*); +template<> ::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse* Arena::CreateMaybeMessage<::rsh::protocol::TypeFeedback_TypesEntry_DoNotUse>(Arena*); +template<> ::rsh::protocol::Value* Arena::CreateMaybeMessage<::rsh::protocol::Value>(Arena*); +template<> ::rsh::protocol::ValueFeedback* Arena::CreateMaybeMessage<::rsh::protocol::ValueFeedback>(Arena*); +template<> ::rsh::protocol::ValueRequest* Arena::CreateMaybeMessage<::rsh::protocol::ValueRequest>(Arena*); +template<> ::rsh::protocol::Values* Arena::CreateMaybeMessage<::rsh::protocol::Values>(Arena*); +template<> ::rsh::protocol::Version* Arena::CreateMaybeMessage<::rsh::protocol::Version>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace rsh { +namespace protocol { + +enum Tier : int { + BASELINE = 0, + OPTIMIZED = 1, + Tier_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + Tier_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool Tier_IsValid(int value); +constexpr Tier Tier_MIN = BASELINE; +constexpr Tier Tier_MAX = OPTIMIZED; +constexpr int Tier_ARRAYSIZE = Tier_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Tier_descriptor(); +template +inline const std::string& Tier_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Tier_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Tier_descriptor(), enum_t_value); +} +inline bool Tier_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Tier* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Tier_descriptor(), name, value); +} +enum TestLattice : int { + BOTH = 0, + ONLY_TRUE = 1, + ONLY_FALSE = 2, + NONE = 3, + TestLattice_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + TestLattice_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool TestLattice_IsValid(int value); +constexpr TestLattice TestLattice_MIN = BOTH; +constexpr TestLattice TestLattice_MAX = NONE; +constexpr int TestLattice_ARRAYSIZE = TestLattice_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* TestLattice_descriptor(); +template +inline const std::string& TestLattice_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function TestLattice_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + TestLattice_descriptor(), enum_t_value); +} +inline bool TestLattice_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TestLattice* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + TestLattice_descriptor(), name, value); +} +enum Type : int { + ANY = 0, + INTEGER = 1, + REAL = 2, + Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool Type_IsValid(int value); +constexpr Type Type_MIN = ANY; +constexpr Type Type_MAX = REAL; +constexpr int Type_ARRAYSIZE = Type_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Type_descriptor(); +template +inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Type_descriptor(), enum_t_value); +} +inline bool Type_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Type* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Type_descriptor(), name, value); +} +// =================================================================== + +class Version final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.Version) */ { + public: + inline Version() : Version(nullptr) {} + ~Version() override; + explicit PROTOBUF_CONSTEXPR Version(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Version(const Version& from); + Version(Version&& from) noexcept + : Version() { + *this = ::std::move(from); + } + + inline Version& operator=(const Version& from) { + CopyFrom(from); + return *this; + } + inline Version& operator=(Version&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Version& default_instance() { + return *internal_default_instance(); + } + static inline const Version* internal_default_instance() { + return reinterpret_cast( + &_Version_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Version& a, Version& b) { + a.Swap(&b); + } + inline void Swap(Version* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Version* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Version* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Version& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Version& from) { + Version::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Version* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.Version"; + } + protected: + explicit Version(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kMajorFieldNumber = 1, + kMinorFieldNumber = 2, + kPatchFieldNumber = 3, + }; + // int32 major = 1; + void clear_major(); + int32_t major() const; + void set_major(int32_t value); + private: + int32_t _internal_major() const; + void _internal_set_major(int32_t value); + public: + + // int32 minor = 2; + void clear_minor(); + int32_t minor() const; + void set_minor(int32_t value); + private: + int32_t _internal_minor() const; + void _internal_set_minor(int32_t value); + public: + + // int32 patch = 3; + void clear_patch(); + int32_t patch() const; + void set_patch(int32_t value); + private: + int32_t _internal_patch() const; + void _internal_set_patch(int32_t value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.Version) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + int32_t major_; + int32_t minor_; + int32_t patch_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class InitRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.InitRequest) */ { + public: + inline InitRequest() : InitRequest(nullptr) {} + ~InitRequest() override; + explicit PROTOBUF_CONSTEXPR InitRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + InitRequest(const InitRequest& from); + InitRequest(InitRequest&& from) noexcept + : InitRequest() { + *this = ::std::move(from); + } + + inline InitRequest& operator=(const InitRequest& from) { + CopyFrom(from); + return *this; + } + inline InitRequest& operator=(InitRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const InitRequest& default_instance() { + return *internal_default_instance(); + } + static inline const InitRequest* internal_default_instance() { + return reinterpret_cast( + &_InitRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(InitRequest& a, InitRequest& b) { + a.Swap(&b); + } + inline void Swap(InitRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(InitRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + InitRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const InitRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const InitRequest& from) { + InitRequest::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(InitRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.InitRequest"; + } + protected: + explicit InitRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kPackageHashFieldNumber = 4, + kPlatformFieldNumber = 3, + kRshVersionFieldNumber = 1, + kRVersionFieldNumber = 2, + }; + // repeated bytes package_hash = 4; + int package_hash_size() const; + private: + int _internal_package_hash_size() const; + public: + void clear_package_hash(); + const std::string& package_hash(int index) const; + std::string* mutable_package_hash(int index); + void set_package_hash(int index, const std::string& value); + void set_package_hash(int index, std::string&& value); + void set_package_hash(int index, const char* value); + void set_package_hash(int index, const void* value, size_t size); + std::string* add_package_hash(); + void add_package_hash(const std::string& value); + void add_package_hash(std::string&& value); + void add_package_hash(const char* value); + void add_package_hash(const void* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& package_hash() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_package_hash(); + private: + const std::string& _internal_package_hash(int index) const; + std::string* _internal_add_package_hash(); + public: + + // string platform = 3; + void clear_platform(); + const std::string& platform() const; + template + void set_platform(ArgT0&& arg0, ArgT... args); + std::string* mutable_platform(); + PROTOBUF_NODISCARD std::string* release_platform(); + void set_allocated_platform(std::string* platform); + private: + const std::string& _internal_platform() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_platform(const std::string& value); + std::string* _internal_mutable_platform(); + public: + + // .rsh.protocol.Version Rsh_version = 1; + bool has_rsh_version() const; + private: + bool _internal_has_rsh_version() const; + public: + void clear_rsh_version(); + const ::rsh::protocol::Version& rsh_version() const; + PROTOBUF_NODISCARD ::rsh::protocol::Version* release_rsh_version(); + ::rsh::protocol::Version* mutable_rsh_version(); + void set_allocated_rsh_version(::rsh::protocol::Version* rsh_version); + private: + const ::rsh::protocol::Version& _internal_rsh_version() const; + ::rsh::protocol::Version* _internal_mutable_rsh_version(); + public: + void unsafe_arena_set_allocated_rsh_version( + ::rsh::protocol::Version* rsh_version); + ::rsh::protocol::Version* unsafe_arena_release_rsh_version(); + + // .rsh.protocol.Version R_version = 2; + bool has_r_version() const; + private: + bool _internal_has_r_version() const; + public: + void clear_r_version(); + const ::rsh::protocol::Version& r_version() const; + PROTOBUF_NODISCARD ::rsh::protocol::Version* release_r_version(); + ::rsh::protocol::Version* mutable_r_version(); + void set_allocated_r_version(::rsh::protocol::Version* r_version); + private: + const ::rsh::protocol::Version& _internal_r_version() const; + ::rsh::protocol::Version* _internal_mutable_r_version(); + public: + void unsafe_arena_set_allocated_r_version( + ::rsh::protocol::Version* r_version); + ::rsh::protocol::Version* unsafe_arena_release_r_version(); + + // @@protoc_insertion_point(class_scope:rsh.protocol.InitRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField package_hash_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr platform_; + ::rsh::protocol::Version* rsh_version_; + ::rsh::protocol::Version* r_version_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class InitResponse final : + public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:rsh.protocol.InitResponse) */ { + public: + inline InitResponse() : InitResponse(nullptr) {} + explicit PROTOBUF_CONSTEXPR InitResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + InitResponse(const InitResponse& from); + InitResponse(InitResponse&& from) noexcept + : InitResponse() { + *this = ::std::move(from); + } + + inline InitResponse& operator=(const InitResponse& from) { + CopyFrom(from); + return *this; + } + inline InitResponse& operator=(InitResponse&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const InitResponse& default_instance() { + return *internal_default_instance(); + } + static inline const InitResponse* internal_default_instance() { + return reinterpret_cast( + &_InitResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(InitResponse& a, InitResponse& b) { + a.Swap(&b); + } + inline void Swap(InitResponse* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(InitResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + InitResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; + inline void CopyFrom(const InitResponse& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; + void MergeFrom(const InitResponse& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); + } + public: + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.InitResponse"; + } + protected: + explicit InitResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:rsh.protocol.InitResponse) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class CompileRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.CompileRequest) */ { + public: + inline CompileRequest() : CompileRequest(nullptr) {} + ~CompileRequest() override; + explicit PROTOBUF_CONSTEXPR CompileRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + CompileRequest(const CompileRequest& from); + CompileRequest(CompileRequest&& from) noexcept + : CompileRequest() { + *this = ::std::move(from); + } + + inline CompileRequest& operator=(const CompileRequest& from) { + CopyFrom(from); + return *this; + } + inline CompileRequest& operator=(CompileRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const CompileRequest& default_instance() { + return *internal_default_instance(); + } + static inline const CompileRequest* internal_default_instance() { + return reinterpret_cast( + &_CompileRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(CompileRequest& a, CompileRequest& b) { + a.Swap(&b); + } + inline void Swap(CompileRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(CompileRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + CompileRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const CompileRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const CompileRequest& from) { + CompileRequest::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CompileRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.CompileRequest"; + } + protected: + explicit CompileRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kFunctionFieldNumber = 2, + kContextFieldNumber = 7, + kEnvironmentFieldNumber = 8, + kTierFieldNumber = 4, + kCcOptFieldNumber = 5, + kBcOptFieldNumber = 6, + }; + // .rsh.protocol.Function function = 2; + bool has_function() const; + private: + bool _internal_has_function() const; + public: + void clear_function(); + const ::rsh::protocol::Function& function() const; + PROTOBUF_NODISCARD ::rsh::protocol::Function* release_function(); + ::rsh::protocol::Function* mutable_function(); + void set_allocated_function(::rsh::protocol::Function* function); + private: + const ::rsh::protocol::Function& _internal_function() const; + ::rsh::protocol::Function* _internal_mutable_function(); + public: + void unsafe_arena_set_allocated_function( + ::rsh::protocol::Function* function); + ::rsh::protocol::Function* unsafe_arena_release_function(); + + // optional .rsh.protocol.Context context = 7; + bool has_context() const; + private: + bool _internal_has_context() const; + public: + void clear_context(); + const ::rsh::protocol::Context& context() const; + PROTOBUF_NODISCARD ::rsh::protocol::Context* release_context(); + ::rsh::protocol::Context* mutable_context(); + void set_allocated_context(::rsh::protocol::Context* context); + private: + const ::rsh::protocol::Context& _internal_context() const; + ::rsh::protocol::Context* _internal_mutable_context(); + public: + void unsafe_arena_set_allocated_context( + ::rsh::protocol::Context* context); + ::rsh::protocol::Context* unsafe_arena_release_context(); + + // optional .rsh.protocol.Environment environment = 8; + bool has_environment() const; + private: + bool _internal_has_environment() const; + public: + void clear_environment(); + const ::rsh::protocol::Environment& environment() const; + PROTOBUF_NODISCARD ::rsh::protocol::Environment* release_environment(); + ::rsh::protocol::Environment* mutable_environment(); + void set_allocated_environment(::rsh::protocol::Environment* environment); + private: + const ::rsh::protocol::Environment& _internal_environment() const; + ::rsh::protocol::Environment* _internal_mutable_environment(); + public: + void unsafe_arena_set_allocated_environment( + ::rsh::protocol::Environment* environment); + ::rsh::protocol::Environment* unsafe_arena_release_environment(); + + // optional .rsh.protocol.Tier tier = 4; + bool has_tier() const; + private: + bool _internal_has_tier() const; + public: + void clear_tier(); + ::rsh::protocol::Tier tier() const; + void set_tier(::rsh::protocol::Tier value); + private: + ::rsh::protocol::Tier _internal_tier() const; + void _internal_set_tier(::rsh::protocol::Tier value); + public: + + // optional int32 cc_opt = 5; + bool has_cc_opt() const; + private: + bool _internal_has_cc_opt() const; + public: + void clear_cc_opt(); + int32_t cc_opt() const; + void set_cc_opt(int32_t value); + private: + int32_t _internal_cc_opt() const; + void _internal_set_cc_opt(int32_t value); + public: + + // optional int32 bc_opt = 6; + bool has_bc_opt() const; + private: + bool _internal_has_bc_opt() const; + public: + void clear_bc_opt(); + int32_t bc_opt() const; + void set_bc_opt(int32_t value); + private: + int32_t _internal_bc_opt() const; + void _internal_set_bc_opt(int32_t value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.CompileRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::rsh::protocol::Function* function_; + ::rsh::protocol::Context* context_; + ::rsh::protocol::Environment* environment_; + int tier_; + int32_t cc_opt_; + int32_t bc_opt_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class CompileResponse final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.CompileResponse) */ { + public: + inline CompileResponse() : CompileResponse(nullptr) {} + ~CompileResponse() override; + explicit PROTOBUF_CONSTEXPR CompileResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + CompileResponse(const CompileResponse& from); + CompileResponse(CompileResponse&& from) noexcept + : CompileResponse() { + *this = ::std::move(from); + } + + inline CompileResponse& operator=(const CompileResponse& from) { + CopyFrom(from); + return *this; + } + inline CompileResponse& operator=(CompileResponse&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const CompileResponse& default_instance() { + return *internal_default_instance(); + } + static inline const CompileResponse* internal_default_instance() { + return reinterpret_cast( + &_CompileResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(CompileResponse& a, CompileResponse& b) { + a.Swap(&b); + } + inline void Swap(CompileResponse* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(CompileResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + CompileResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const CompileResponse& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const CompileResponse& from) { + CompileResponse::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CompileResponse* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.CompileResponse"; + } + protected: + explicit CompileResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kCodeFieldNumber = 3, + kConstantsFieldNumber = 4, + kHashFieldNumber = 1, + kTierFieldNumber = 2, + }; + // optional bytes code = 3; + bool has_code() const; + private: + bool _internal_has_code() const; + public: + void clear_code(); + const std::string& code() const; + template + void set_code(ArgT0&& arg0, ArgT... args); + std::string* mutable_code(); + PROTOBUF_NODISCARD std::string* release_code(); + void set_allocated_code(std::string* code); + private: + const std::string& _internal_code() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_code(const std::string& value); + std::string* _internal_mutable_code(); + public: + + // optional bytes constants = 4; + bool has_constants() const; + private: + bool _internal_has_constants() const; + public: + void clear_constants(); + const std::string& constants() const; + template + void set_constants(ArgT0&& arg0, ArgT... args); + std::string* mutable_constants(); + PROTOBUF_NODISCARD std::string* release_constants(); + void set_allocated_constants(std::string* constants); + private: + const std::string& _internal_constants() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_constants(const std::string& value); + std::string* _internal_mutable_constants(); + public: + + // uint64 hash = 1; + void clear_hash(); + uint64_t hash() const; + void set_hash(uint64_t value); + private: + uint64_t _internal_hash() const; + void _internal_set_hash(uint64_t value); + public: + + // .rsh.protocol.Tier tier = 2; + void clear_tier(); + ::rsh::protocol::Tier tier() const; + void set_tier(::rsh::protocol::Tier value); + private: + ::rsh::protocol::Tier _internal_tier() const; + void _internal_set_tier(::rsh::protocol::Tier value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.CompileResponse) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr code_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr constants_; + uint64_t hash_; + int tier_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class Function final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.Function) */ { + public: + inline Function() : Function(nullptr) {} + ~Function() override; + explicit PROTOBUF_CONSTEXPR Function(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Function(const Function& from); + Function(Function&& from) noexcept + : Function() { + *this = ::std::move(from); + } + + inline Function& operator=(const Function& from) { + CopyFrom(from); + return *this; + } + inline Function& operator=(Function&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Function& default_instance() { + return *internal_default_instance(); + } + static inline const Function* internal_default_instance() { + return reinterpret_cast( + &_Function_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + friend void swap(Function& a, Function& b) { + a.Swap(&b); + } + inline void Swap(Function* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Function* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Function* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Function& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Function& from) { + Function::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Function* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.Function"; + } + protected: + explicit Function(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameFieldNumber = 2, + kBodyFieldNumber = 4, + kPackageHashFieldNumber = 1, + kHashFieldNumber = 3, + }; + // string name = 2; + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // optional bytes body = 4; + bool has_body() const; + private: + bool _internal_has_body() const; + public: + void clear_body(); + const std::string& body() const; + template + void set_body(ArgT0&& arg0, ArgT... args); + std::string* mutable_body(); + PROTOBUF_NODISCARD std::string* release_body(); + void set_allocated_body(std::string* body); + private: + const std::string& _internal_body() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_body(const std::string& value); + std::string* _internal_mutable_body(); + public: + + // uint64 package_hash = 1; + void clear_package_hash(); + uint64_t package_hash() const; + void set_package_hash(uint64_t value); + private: + uint64_t _internal_package_hash() const; + void _internal_set_package_hash(uint64_t value); + public: + + // uint64 hash = 3; + void clear_hash(); + uint64_t hash() const; + void set_hash(uint64_t value); + private: + uint64_t _internal_hash() const; + void _internal_set_hash(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.Function) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr body_; + uint64_t package_hash_; + uint64_t hash_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class FunctionRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.FunctionRequest) */ { + public: + inline FunctionRequest() : FunctionRequest(nullptr) {} + ~FunctionRequest() override; + explicit PROTOBUF_CONSTEXPR FunctionRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + FunctionRequest(const FunctionRequest& from); + FunctionRequest(FunctionRequest&& from) noexcept + : FunctionRequest() { + *this = ::std::move(from); + } + + inline FunctionRequest& operator=(const FunctionRequest& from) { + CopyFrom(from); + return *this; + } + inline FunctionRequest& operator=(FunctionRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const FunctionRequest& default_instance() { + return *internal_default_instance(); + } + static inline const FunctionRequest* internal_default_instance() { + return reinterpret_cast( + &_FunctionRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + friend void swap(FunctionRequest& a, FunctionRequest& b) { + a.Swap(&b); + } + inline void Swap(FunctionRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(FunctionRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + FunctionRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const FunctionRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const FunctionRequest& from) { + FunctionRequest::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FunctionRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.FunctionRequest"; + } + protected: + explicit FunctionRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kHashFieldNumber = 1, + }; + // uint64 hash = 1; + void clear_hash(); + uint64_t hash() const; + void set_hash(uint64_t value); + private: + uint64_t _internal_hash() const; + void _internal_set_hash(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.FunctionRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + uint64_t hash_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class Environment_ValuesEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + Environment_ValuesEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR Environment_ValuesEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit Environment_ValuesEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const Environment_ValuesEntry_DoNotUse& other); + static const Environment_ValuesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Environment_ValuesEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { + return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "rsh.protocol.Environment.ValuesEntry.key"); + } + static bool ValidateValue(void*) { return true; } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_messages_2eproto; +}; + +// ------------------------------------------------------------------- + +class Environment final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.Environment) */ { + public: + inline Environment() : Environment(nullptr) {} + ~Environment() override; + explicit PROTOBUF_CONSTEXPR Environment(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Environment(const Environment& from); + Environment(Environment&& from) noexcept + : Environment() { + *this = ::std::move(from); + } + + inline Environment& operator=(const Environment& from) { + CopyFrom(from); + return *this; + } + inline Environment& operator=(Environment&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Environment& default_instance() { + return *internal_default_instance(); + } + static inline const Environment* internal_default_instance() { + return reinterpret_cast( + &_Environment_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + friend void swap(Environment& a, Environment& b) { + a.Swap(&b); + } + inline void Swap(Environment* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Environment* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Environment* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Environment& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Environment& from) { + Environment::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Environment* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.Environment"; + } + protected: + explicit Environment(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + private: + static void ArenaDtor(void* object); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + enum : int { + kValuesFieldNumber = 1, + }; + // map values = 1; + int values_size() const; + private: + int _internal_values_size() const; + public: + void clear_values(); + private: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >& + _internal_values() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >* + _internal_mutable_values(); + public: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >& + values() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >* + mutable_values(); + + // @@protoc_insertion_point(class_scope:rsh.protocol.Environment) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + Environment_ValuesEntry_DoNotUse, + std::string, uint64_t, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64> values_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class ValueRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.ValueRequest) */ { + public: + inline ValueRequest() : ValueRequest(nullptr) {} + ~ValueRequest() override; + explicit PROTOBUF_CONSTEXPR ValueRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ValueRequest(const ValueRequest& from); + ValueRequest(ValueRequest&& from) noexcept + : ValueRequest() { + *this = ::std::move(from); + } + + inline ValueRequest& operator=(const ValueRequest& from) { + CopyFrom(from); + return *this; + } + inline ValueRequest& operator=(ValueRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const ValueRequest& default_instance() { + return *internal_default_instance(); + } + static inline const ValueRequest* internal_default_instance() { + return reinterpret_cast( + &_ValueRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + friend void swap(ValueRequest& a, ValueRequest& b) { + a.Swap(&b); + } + inline void Swap(ValueRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ValueRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ValueRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ValueRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ValueRequest& from) { + ValueRequest::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ValueRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.ValueRequest"; + } + protected: + explicit ValueRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kHashFieldNumber = 1, + }; + // repeated uint64 hash = 1; + int hash_size() const; + private: + int _internal_hash_size() const; + public: + void clear_hash(); + private: + uint64_t _internal_hash(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& + _internal_hash() const; + void _internal_add_hash(uint64_t value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* + _internal_mutable_hash(); + public: + uint64_t hash(int index) const; + void set_hash(int index, uint64_t value); + void add_hash(uint64_t value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& + hash() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* + mutable_hash(); + + // @@protoc_insertion_point(class_scope:rsh.protocol.ValueRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t > hash_; + mutable std::atomic _hash_cached_byte_size_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class Value final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.Value) */ { + public: + inline Value() : Value(nullptr) {} + ~Value() override; + explicit PROTOBUF_CONSTEXPR Value(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Value(const Value& from); + Value(Value&& from) noexcept + : Value() { + *this = ::std::move(from); + } + + inline Value& operator=(const Value& from) { + CopyFrom(from); + return *this; + } + inline Value& operator=(Value&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Value& default_instance() { + return *internal_default_instance(); + } + static inline const Value* internal_default_instance() { + return reinterpret_cast( + &_Value_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + friend void swap(Value& a, Value& b) { + a.Swap(&b); + } + inline void Swap(Value* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Value* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Value* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Value& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Value& from) { + Value::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Value* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.Value"; + } + protected: + explicit Value(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kValueFieldNumber = 2, + kHashFieldNumber = 1, + }; + // bytes value = 2; + void clear_value(); + const std::string& value() const; + template + void set_value(ArgT0&& arg0, ArgT... args); + std::string* mutable_value(); + PROTOBUF_NODISCARD std::string* release_value(); + void set_allocated_value(std::string* value); + private: + const std::string& _internal_value() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_value(const std::string& value); + std::string* _internal_mutable_value(); + public: + + // uint64 hash = 1; + void clear_hash(); + uint64_t hash() const; + void set_hash(uint64_t value); + private: + uint64_t _internal_hash() const; + void _internal_set_hash(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.Value) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; + uint64_t hash_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class Values final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.Values) */ { + public: + inline Values() : Values(nullptr) {} + ~Values() override; + explicit PROTOBUF_CONSTEXPR Values(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Values(const Values& from); + Values(Values&& from) noexcept + : Values() { + *this = ::std::move(from); + } + + inline Values& operator=(const Values& from) { + CopyFrom(from); + return *this; + } + inline Values& operator=(Values&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Values& default_instance() { + return *internal_default_instance(); + } + static inline const Values* internal_default_instance() { + return reinterpret_cast( + &_Values_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + friend void swap(Values& a, Values& b) { + a.Swap(&b); + } + inline void Swap(Values* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Values* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Values* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Values& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Values& from) { + Values::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Values* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.Values"; + } + protected: + explicit Values(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kValuesFieldNumber = 1, + }; + // repeated .rsh.protocol.Value values = 1; + int values_size() const; + private: + int _internal_values_size() const; + public: + void clear_values(); + ::rsh::protocol::Value* mutable_values(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::Value >* + mutable_values(); + private: + const ::rsh::protocol::Value& _internal_values(int index) const; + ::rsh::protocol::Value* _internal_add_values(); + public: + const ::rsh::protocol::Value& values(int index) const; + ::rsh::protocol::Value* add_values(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::Value >& + values() const; + + // @@protoc_insertion_point(class_scope:rsh.protocol.Values) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::Value > values_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class Empty final : + public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:rsh.protocol.Empty) */ { + public: + inline Empty() : Empty(nullptr) {} + explicit PROTOBUF_CONSTEXPR Empty(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Empty(const Empty& from); + Empty(Empty&& from) noexcept + : Empty() { + *this = ::std::move(from); + } + + inline Empty& operator=(const Empty& from) { + CopyFrom(from); + return *this; + } + inline Empty& operator=(Empty&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Empty& default_instance() { + return *internal_default_instance(); + } + static inline const Empty* internal_default_instance() { + return reinterpret_cast( + &_Empty_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + friend void swap(Empty& a, Empty& b) { + a.Swap(&b); + } + inline void Swap(Empty* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Empty* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Empty* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; + inline void CopyFrom(const Empty& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; + void MergeFrom(const Empty& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); + } + public: + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.Empty"; + } + protected: + explicit Empty(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:rsh.protocol.Empty) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class CallContext final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.CallContext) */ { + public: + inline CallContext() : CallContext(nullptr) {} + ~CallContext() override; + explicit PROTOBUF_CONSTEXPR CallContext(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + CallContext(const CallContext& from); + CallContext(CallContext&& from) noexcept + : CallContext() { + *this = ::std::move(from); + } + + inline CallContext& operator=(const CallContext& from) { + CopyFrom(from); + return *this; + } + inline CallContext& operator=(CallContext&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const CallContext& default_instance() { + return *internal_default_instance(); + } + static inline const CallContext* internal_default_instance() { + return reinterpret_cast( + &_CallContext_default_instance_); + } + static constexpr int kIndexInFileMessages = + 13; + + friend void swap(CallContext& a, CallContext& b) { + a.Swap(&b); + } + inline void Swap(CallContext* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(CallContext* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + CallContext* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const CallContext& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const CallContext& from) { + CallContext::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CallContext* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.CallContext"; + } + protected: + explicit CallContext(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kArgsStaticallyMatchedFieldNumber = 1, + kCorrectNumberOfArgsFieldNumber = 2, + kCorrectOrderOfArgsFieldNumber = 3, + kNoMissingArgsFieldNumber = 4, + }; + // bool args_statically_matched = 1; + void clear_args_statically_matched(); + bool args_statically_matched() const; + void set_args_statically_matched(bool value); + private: + bool _internal_args_statically_matched() const; + void _internal_set_args_statically_matched(bool value); + public: + + // bool correct_number_of_args = 2; + void clear_correct_number_of_args(); + bool correct_number_of_args() const; + void set_correct_number_of_args(bool value); + private: + bool _internal_correct_number_of_args() const; + void _internal_set_correct_number_of_args(bool value); + public: + + // bool correct_order_of_args = 3; + void clear_correct_order_of_args(); + bool correct_order_of_args() const; + void set_correct_order_of_args(bool value); + private: + bool _internal_correct_order_of_args() const; + void _internal_set_correct_order_of_args(bool value); + public: + + // bool no_missing_args = 4; + void clear_no_missing_args(); + bool no_missing_args() const; + void set_no_missing_args(bool value); + private: + bool _internal_no_missing_args() const; + void _internal_set_no_missing_args(bool value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.CallContext) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool args_statically_matched_; + bool correct_number_of_args_; + bool correct_order_of_args_; + bool no_missing_args_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class ArgumentContext final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.ArgumentContext) */ { + public: + inline ArgumentContext() : ArgumentContext(nullptr) {} + ~ArgumentContext() override; + explicit PROTOBUF_CONSTEXPR ArgumentContext(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ArgumentContext(const ArgumentContext& from); + ArgumentContext(ArgumentContext&& from) noexcept + : ArgumentContext() { + *this = ::std::move(from); + } + + inline ArgumentContext& operator=(const ArgumentContext& from) { + CopyFrom(from); + return *this; + } + inline ArgumentContext& operator=(ArgumentContext&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const ArgumentContext& default_instance() { + return *internal_default_instance(); + } + static inline const ArgumentContext* internal_default_instance() { + return reinterpret_cast( + &_ArgumentContext_default_instance_); + } + static constexpr int kIndexInFileMessages = + 14; + + friend void swap(ArgumentContext& a, ArgumentContext& b) { + a.Swap(&b); + } + inline void Swap(ArgumentContext* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ArgumentContext* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ArgumentContext* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ArgumentContext& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ArgumentContext& from) { + ArgumentContext::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ArgumentContext* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.ArgumentContext"; + } + protected: + explicit ArgumentContext(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kEagerFieldNumber = 1, + kReflectionFieldNumber = 2, + kObjectFieldNumber = 3, + kTypeFieldNumber = 4, + }; + // bool eager = 1; + void clear_eager(); + bool eager() const; + void set_eager(bool value); + private: + bool _internal_eager() const; + void _internal_set_eager(bool value); + public: + + // bool reflection = 2; + void clear_reflection(); + bool reflection() const; + void set_reflection(bool value); + private: + bool _internal_reflection() const; + void _internal_set_reflection(bool value); + public: + + // bool object = 3; + void clear_object(); + bool object() const; + void set_object(bool value); + private: + bool _internal_object() const; + void _internal_set_object(bool value); + public: + + // optional .rsh.protocol.Type type = 4; + bool has_type() const; + private: + bool _internal_has_type() const; + public: + void clear_type(); + ::rsh::protocol::Type type() const; + void set_type(::rsh::protocol::Type value); + private: + ::rsh::protocol::Type _internal_type() const; + void _internal_set_type(::rsh::protocol::Type value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.ArgumentContext) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + bool eager_; + bool reflection_; + bool object_; + int type_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class Context final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.Context) */ { + public: + inline Context() : Context(nullptr) {} + ~Context() override; + explicit PROTOBUF_CONSTEXPR Context(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Context(const Context& from); + Context(Context&& from) noexcept + : Context() { + *this = ::std::move(from); + } + + inline Context& operator=(const Context& from) { + CopyFrom(from); + return *this; + } + inline Context& operator=(Context&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Context& default_instance() { + return *internal_default_instance(); + } + static inline const Context* internal_default_instance() { + return reinterpret_cast( + &_Context_default_instance_); + } + static constexpr int kIndexInFileMessages = + 15; + + friend void swap(Context& a, Context& b) { + a.Swap(&b); + } + inline void Swap(Context* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Context* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Context* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Context& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Context& from) { + Context::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Context* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.Context"; + } + protected: + explicit Context(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kArgumentContextFieldNumber = 2, + kCallContextFieldNumber = 1, + }; + // repeated .rsh.protocol.ArgumentContext argument_context = 2; + int argument_context_size() const; + private: + int _internal_argument_context_size() const; + public: + void clear_argument_context(); + ::rsh::protocol::ArgumentContext* mutable_argument_context(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::ArgumentContext >* + mutable_argument_context(); + private: + const ::rsh::protocol::ArgumentContext& _internal_argument_context(int index) const; + ::rsh::protocol::ArgumentContext* _internal_add_argument_context(); + public: + const ::rsh::protocol::ArgumentContext& argument_context(int index) const; + ::rsh::protocol::ArgumentContext* add_argument_context(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::ArgumentContext >& + argument_context() const; + + // .rsh.protocol.CallContext call_context = 1; + bool has_call_context() const; + private: + bool _internal_has_call_context() const; + public: + void clear_call_context(); + const ::rsh::protocol::CallContext& call_context() const; + PROTOBUF_NODISCARD ::rsh::protocol::CallContext* release_call_context(); + ::rsh::protocol::CallContext* mutable_call_context(); + void set_allocated_call_context(::rsh::protocol::CallContext* call_context); + private: + const ::rsh::protocol::CallContext& _internal_call_context() const; + ::rsh::protocol::CallContext* _internal_mutable_call_context(); + public: + void unsafe_arena_set_allocated_call_context( + ::rsh::protocol::CallContext* call_context); + ::rsh::protocol::CallContext* unsafe_arena_release_call_context(); + + // @@protoc_insertion_point(class_scope:rsh.protocol.Context) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::ArgumentContext > argument_context_; + ::rsh::protocol::CallContext* call_context_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class ContextRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.ContextRequest) */ { + public: + inline ContextRequest() : ContextRequest(nullptr) {} + ~ContextRequest() override; + explicit PROTOBUF_CONSTEXPR ContextRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ContextRequest(const ContextRequest& from); + ContextRequest(ContextRequest&& from) noexcept + : ContextRequest() { + *this = ::std::move(from); + } + + inline ContextRequest& operator=(const ContextRequest& from) { + CopyFrom(from); + return *this; + } + inline ContextRequest& operator=(ContextRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const ContextRequest& default_instance() { + return *internal_default_instance(); + } + static inline const ContextRequest* internal_default_instance() { + return reinterpret_cast( + &_ContextRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 16; + + friend void swap(ContextRequest& a, ContextRequest& b) { + a.Swap(&b); + } + inline void Swap(ContextRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ContextRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ContextRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ContextRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ContextRequest& from) { + ContextRequest::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ContextRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.ContextRequest"; + } + protected: + explicit ContextRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kFunctionFieldNumber = 1, + }; + // .rsh.protocol.Function function = 1; + bool has_function() const; + private: + bool _internal_has_function() const; + public: + void clear_function(); + const ::rsh::protocol::Function& function() const; + PROTOBUF_NODISCARD ::rsh::protocol::Function* release_function(); + ::rsh::protocol::Function* mutable_function(); + void set_allocated_function(::rsh::protocol::Function* function); + private: + const ::rsh::protocol::Function& _internal_function() const; + ::rsh::protocol::Function* _internal_mutable_function(); + public: + void unsafe_arena_set_allocated_function( + ::rsh::protocol::Function* function); + ::rsh::protocol::Function* unsafe_arena_release_function(); + + // @@protoc_insertion_point(class_scope:rsh.protocol.ContextRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::rsh::protocol::Function* function_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class TestFeedback final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.TestFeedback) */ { + public: + inline TestFeedback() : TestFeedback(nullptr) {} + ~TestFeedback() override; + explicit PROTOBUF_CONSTEXPR TestFeedback(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + TestFeedback(const TestFeedback& from); + TestFeedback(TestFeedback&& from) noexcept + : TestFeedback() { + *this = ::std::move(from); + } + + inline TestFeedback& operator=(const TestFeedback& from) { + CopyFrom(from); + return *this; + } + inline TestFeedback& operator=(TestFeedback&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const TestFeedback& default_instance() { + return *internal_default_instance(); + } + static inline const TestFeedback* internal_default_instance() { + return reinterpret_cast( + &_TestFeedback_default_instance_); + } + static constexpr int kIndexInFileMessages = + 17; + + friend void swap(TestFeedback& a, TestFeedback& b) { + a.Swap(&b); + } + inline void Swap(TestFeedback* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(TestFeedback* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + TestFeedback* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const TestFeedback& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const TestFeedback& from) { + TestFeedback::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TestFeedback* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.TestFeedback"; + } + protected: + explicit TestFeedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kTestLatticeFieldNumber = 1, + }; + // .rsh.protocol.TestLattice test_lattice = 1; + void clear_test_lattice(); + ::rsh::protocol::TestLattice test_lattice() const; + void set_test_lattice(::rsh::protocol::TestLattice value); + private: + ::rsh::protocol::TestLattice _internal_test_lattice() const; + void _internal_set_test_lattice(::rsh::protocol::TestLattice value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.TestFeedback) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + int test_lattice_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class CallFeedback final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.CallFeedback) */ { + public: + inline CallFeedback() : CallFeedback(nullptr) {} + ~CallFeedback() override; + explicit PROTOBUF_CONSTEXPR CallFeedback(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + CallFeedback(const CallFeedback& from); + CallFeedback(CallFeedback&& from) noexcept + : CallFeedback() { + *this = ::std::move(from); + } + + inline CallFeedback& operator=(const CallFeedback& from) { + CopyFrom(from); + return *this; + } + inline CallFeedback& operator=(CallFeedback&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const CallFeedback& default_instance() { + return *internal_default_instance(); + } + static inline const CallFeedback* internal_default_instance() { + return reinterpret_cast( + &_CallFeedback_default_instance_); + } + static constexpr int kIndexInFileMessages = + 18; + + friend void swap(CallFeedback& a, CallFeedback& b) { + a.Swap(&b); + } + inline void Swap(CallFeedback* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(CallFeedback* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + CallFeedback* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const CallFeedback& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const CallFeedback& from) { + CallFeedback::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(CallFeedback* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.CallFeedback"; + } + protected: + explicit CallFeedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNCallsFieldNumber = 1, + kCalleeHashFieldNumber = 2, + }; + // int64 n_calls = 1; + void clear_n_calls(); + int64_t n_calls() const; + void set_n_calls(int64_t value); + private: + int64_t _internal_n_calls() const; + void _internal_set_n_calls(int64_t value); + public: + + // uint64 callee_hash = 2; + void clear_callee_hash(); + uint64_t callee_hash() const; + void set_callee_hash(uint64_t value); + private: + uint64_t _internal_callee_hash() const; + void _internal_set_callee_hash(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.CallFeedback) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + int64_t n_calls_; + uint64_t callee_hash_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class ValueFeedback final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.ValueFeedback) */ { + public: + inline ValueFeedback() : ValueFeedback(nullptr) {} + ~ValueFeedback() override; + explicit PROTOBUF_CONSTEXPR ValueFeedback(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ValueFeedback(const ValueFeedback& from); + ValueFeedback(ValueFeedback&& from) noexcept + : ValueFeedback() { + *this = ::std::move(from); + } + + inline ValueFeedback& operator=(const ValueFeedback& from) { + CopyFrom(from); + return *this; + } + inline ValueFeedback& operator=(ValueFeedback&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const ValueFeedback& default_instance() { + return *internal_default_instance(); + } + static inline const ValueFeedback* internal_default_instance() { + return reinterpret_cast( + &_ValueFeedback_default_instance_); + } + static constexpr int kIndexInFileMessages = + 19; + + friend void swap(ValueFeedback& a, ValueFeedback& b) { + a.Swap(&b); + } + inline void Swap(ValueFeedback* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(ValueFeedback* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ValueFeedback* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ValueFeedback& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ValueFeedback& from) { + ValueFeedback::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ValueFeedback* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.ValueFeedback"; + } + protected: + explicit ValueFeedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kScalarFieldNumber = 1, + kObjectFieldNumber = 2, + kAccessedAttributesFieldNumber = 3, + kVectorizableFieldNumber = 4, + kIsPromiseFieldNumber = 5, + }; + // bool scalar = 1; + void clear_scalar(); + bool scalar() const; + void set_scalar(bool value); + private: + bool _internal_scalar() const; + void _internal_set_scalar(bool value); + public: + + // bool object = 2; + void clear_object(); + bool object() const; + void set_object(bool value); + private: + bool _internal_object() const; + void _internal_set_object(bool value); + public: + + // bool accessed_attributes = 3; + void clear_accessed_attributes(); + bool accessed_attributes() const; + void set_accessed_attributes(bool value); + private: + bool _internal_accessed_attributes() const; + void _internal_set_accessed_attributes(bool value); + public: + + // bool vectorizable = 4; + void clear_vectorizable(); + bool vectorizable() const; + void set_vectorizable(bool value); + private: + bool _internal_vectorizable() const; + void _internal_set_vectorizable(bool value); + public: + + // bool is_promise = 5; + void clear_is_promise(); + bool is_promise() const; + void set_is_promise(bool value); + private: + bool _internal_is_promise() const; + void _internal_set_is_promise(bool value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.ValueFeedback) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool scalar_; + bool object_; + bool accessed_attributes_; + bool vectorizable_; + bool is_promise_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class TypeFeedback_Feedback final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.TypeFeedback.Feedback) */ { + public: + inline TypeFeedback_Feedback() : TypeFeedback_Feedback(nullptr) {} + ~TypeFeedback_Feedback() override; + explicit PROTOBUF_CONSTEXPR TypeFeedback_Feedback(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + TypeFeedback_Feedback(const TypeFeedback_Feedback& from); + TypeFeedback_Feedback(TypeFeedback_Feedback&& from) noexcept + : TypeFeedback_Feedback() { + *this = ::std::move(from); + } + + inline TypeFeedback_Feedback& operator=(const TypeFeedback_Feedback& from) { + CopyFrom(from); + return *this; + } + inline TypeFeedback_Feedback& operator=(TypeFeedback_Feedback&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const TypeFeedback_Feedback& default_instance() { + return *internal_default_instance(); + } + enum FeedbackCase { + kTestFeedback = 1, + kCallFeedback = 2, + kValueFeedback = 3, + FEEDBACK_NOT_SET = 0, + }; + + static inline const TypeFeedback_Feedback* internal_default_instance() { + return reinterpret_cast( + &_TypeFeedback_Feedback_default_instance_); + } + static constexpr int kIndexInFileMessages = + 20; + + friend void swap(TypeFeedback_Feedback& a, TypeFeedback_Feedback& b) { + a.Swap(&b); + } + inline void Swap(TypeFeedback_Feedback* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(TypeFeedback_Feedback* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + TypeFeedback_Feedback* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const TypeFeedback_Feedback& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const TypeFeedback_Feedback& from) { + TypeFeedback_Feedback::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TypeFeedback_Feedback* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.TypeFeedback.Feedback"; + } + protected: + explicit TypeFeedback_Feedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kTestFeedbackFieldNumber = 1, + kCallFeedbackFieldNumber = 2, + kValueFeedbackFieldNumber = 3, + }; + // .rsh.protocol.TestFeedback test_feedback = 1; + bool has_test_feedback() const; + private: + bool _internal_has_test_feedback() const; + public: + void clear_test_feedback(); + const ::rsh::protocol::TestFeedback& test_feedback() const; + PROTOBUF_NODISCARD ::rsh::protocol::TestFeedback* release_test_feedback(); + ::rsh::protocol::TestFeedback* mutable_test_feedback(); + void set_allocated_test_feedback(::rsh::protocol::TestFeedback* test_feedback); + private: + const ::rsh::protocol::TestFeedback& _internal_test_feedback() const; + ::rsh::protocol::TestFeedback* _internal_mutable_test_feedback(); + public: + void unsafe_arena_set_allocated_test_feedback( + ::rsh::protocol::TestFeedback* test_feedback); + ::rsh::protocol::TestFeedback* unsafe_arena_release_test_feedback(); + + // .rsh.protocol.CallFeedback call_feedback = 2; + bool has_call_feedback() const; + private: + bool _internal_has_call_feedback() const; + public: + void clear_call_feedback(); + const ::rsh::protocol::CallFeedback& call_feedback() const; + PROTOBUF_NODISCARD ::rsh::protocol::CallFeedback* release_call_feedback(); + ::rsh::protocol::CallFeedback* mutable_call_feedback(); + void set_allocated_call_feedback(::rsh::protocol::CallFeedback* call_feedback); + private: + const ::rsh::protocol::CallFeedback& _internal_call_feedback() const; + ::rsh::protocol::CallFeedback* _internal_mutable_call_feedback(); + public: + void unsafe_arena_set_allocated_call_feedback( + ::rsh::protocol::CallFeedback* call_feedback); + ::rsh::protocol::CallFeedback* unsafe_arena_release_call_feedback(); + + // .rsh.protocol.ValueFeedback value_feedback = 3; + bool has_value_feedback() const; + private: + bool _internal_has_value_feedback() const; + public: + void clear_value_feedback(); + const ::rsh::protocol::ValueFeedback& value_feedback() const; + PROTOBUF_NODISCARD ::rsh::protocol::ValueFeedback* release_value_feedback(); + ::rsh::protocol::ValueFeedback* mutable_value_feedback(); + void set_allocated_value_feedback(::rsh::protocol::ValueFeedback* value_feedback); + private: + const ::rsh::protocol::ValueFeedback& _internal_value_feedback() const; + ::rsh::protocol::ValueFeedback* _internal_mutable_value_feedback(); + public: + void unsafe_arena_set_allocated_value_feedback( + ::rsh::protocol::ValueFeedback* value_feedback); + ::rsh::protocol::ValueFeedback* unsafe_arena_release_value_feedback(); + + void clear_feedback(); + FeedbackCase feedback_case() const; + // @@protoc_insertion_point(class_scope:rsh.protocol.TypeFeedback.Feedback) + private: + class _Internal; + void set_has_test_feedback(); + void set_has_call_feedback(); + void set_has_value_feedback(); + + inline bool has_feedback() const; + inline void clear_has_feedback(); + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + union FeedbackUnion { + constexpr FeedbackUnion() : _constinit_{} {} + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; + ::rsh::protocol::TestFeedback* test_feedback_; + ::rsh::protocol::CallFeedback* call_feedback_; + ::rsh::protocol::ValueFeedback* value_feedback_; + } feedback_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + uint32_t _oneof_case_[1]; + + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class TypeFeedback_TypesEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + TypeFeedback_TypesEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR TypeFeedback_TypesEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit TypeFeedback_TypesEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const TypeFeedback_TypesEntry_DoNotUse& other); + static const TypeFeedback_TypesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_TypeFeedback_TypesEntry_DoNotUse_default_instance_); } + static bool ValidateKey(void*) { return true; } + static bool ValidateValue(void*) { return true; } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_messages_2eproto; +}; + +// ------------------------------------------------------------------- + +class TypeFeedback final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.TypeFeedback) */ { + public: + inline TypeFeedback() : TypeFeedback(nullptr) {} + ~TypeFeedback() override; + explicit PROTOBUF_CONSTEXPR TypeFeedback(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + TypeFeedback(const TypeFeedback& from); + TypeFeedback(TypeFeedback&& from) noexcept + : TypeFeedback() { + *this = ::std::move(from); + } + + inline TypeFeedback& operator=(const TypeFeedback& from) { + CopyFrom(from); + return *this; + } + inline TypeFeedback& operator=(TypeFeedback&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const TypeFeedback& default_instance() { + return *internal_default_instance(); + } + static inline const TypeFeedback* internal_default_instance() { + return reinterpret_cast( + &_TypeFeedback_default_instance_); + } + static constexpr int kIndexInFileMessages = + 22; + + friend void swap(TypeFeedback& a, TypeFeedback& b) { + a.Swap(&b); + } + inline void Swap(TypeFeedback* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(TypeFeedback* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + TypeFeedback* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const TypeFeedback& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const TypeFeedback& from) { + TypeFeedback::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TypeFeedback* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.TypeFeedback"; + } + protected: + explicit TypeFeedback(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + private: + static void ArenaDtor(void* object); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef TypeFeedback_Feedback Feedback; + + // accessors ------------------------------------------------------- + + enum : int { + kTypesFieldNumber = 2, + }; + // map types = 2; + int types_size() const; + private: + int _internal_types_size() const; + public: + void clear_types(); + private: + const ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::rsh::protocol::TypeFeedback_Feedback >& + _internal_types() const; + ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::rsh::protocol::TypeFeedback_Feedback >* + _internal_mutable_types(); + public: + const ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::rsh::protocol::TypeFeedback_Feedback >& + types() const; + ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::rsh::protocol::TypeFeedback_Feedback >* + mutable_types(); + + // @@protoc_insertion_point(class_scope:rsh.protocol.TypeFeedback) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + TypeFeedback_TypesEntry_DoNotUse, + int64_t, ::rsh::protocol::TypeFeedback_Feedback, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> types_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class FeedbackRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.FeedbackRequest) */ { + public: + inline FeedbackRequest() : FeedbackRequest(nullptr) {} + ~FeedbackRequest() override; + explicit PROTOBUF_CONSTEXPR FeedbackRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + FeedbackRequest(const FeedbackRequest& from); + FeedbackRequest(FeedbackRequest&& from) noexcept + : FeedbackRequest() { + *this = ::std::move(from); + } + + inline FeedbackRequest& operator=(const FeedbackRequest& from) { + CopyFrom(from); + return *this; + } + inline FeedbackRequest& operator=(FeedbackRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const FeedbackRequest& default_instance() { + return *internal_default_instance(); + } + static inline const FeedbackRequest* internal_default_instance() { + return reinterpret_cast( + &_FeedbackRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 23; + + friend void swap(FeedbackRequest& a, FeedbackRequest& b) { + a.Swap(&b); + } + inline void Swap(FeedbackRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(FeedbackRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + FeedbackRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const FeedbackRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const FeedbackRequest& from) { + FeedbackRequest::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(FeedbackRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.FeedbackRequest"; + } + protected: + explicit FeedbackRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kFunctionFieldNumber = 1, + }; + // .rsh.protocol.Function function = 1; + bool has_function() const; + private: + bool _internal_has_function() const; + public: + void clear_function(); + const ::rsh::protocol::Function& function() const; + PROTOBUF_NODISCARD ::rsh::protocol::Function* release_function(); + ::rsh::protocol::Function* mutable_function(); + void set_allocated_function(::rsh::protocol::Function* function); + private: + const ::rsh::protocol::Function& _internal_function() const; + ::rsh::protocol::Function* _internal_mutable_function(); + public: + void unsafe_arena_set_allocated_function( + ::rsh::protocol::Function* function); + ::rsh::protocol::Function* unsafe_arena_release_function(); + + // @@protoc_insertion_point(class_scope:rsh.protocol.FeedbackRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::rsh::protocol::Function* function_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class PackageSource final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.PackageSource) */ { + public: + inline PackageSource() : PackageSource(nullptr) {} + ~PackageSource() override; + explicit PROTOBUF_CONSTEXPR PackageSource(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PackageSource(const PackageSource& from); + PackageSource(PackageSource&& from) noexcept + : PackageSource() { + *this = ::std::move(from); + } + + inline PackageSource& operator=(const PackageSource& from) { + CopyFrom(from); + return *this; + } + inline PackageSource& operator=(PackageSource&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PackageSource& default_instance() { + return *internal_default_instance(); + } + enum SourceCase { + kRMirror = 2, + kGithubUrl = 3, + SOURCE_NOT_SET = 0, + }; + + static inline const PackageSource* internal_default_instance() { + return reinterpret_cast( + &_PackageSource_default_instance_); + } + static constexpr int kIndexInFileMessages = + 24; + + friend void swap(PackageSource& a, PackageSource& b) { + a.Swap(&b); + } + inline void Swap(PackageSource* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PackageSource* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PackageSource* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PackageSource& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const PackageSource& from) { + PackageSource::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PackageSource* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.PackageSource"; + } + protected: + explicit PackageSource(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kRMirrorFieldNumber = 2, + kGithubUrlFieldNumber = 3, + }; + // string r_mirror = 2; + bool has_r_mirror() const; + private: + bool _internal_has_r_mirror() const; + public: + void clear_r_mirror(); + const std::string& r_mirror() const; + template + void set_r_mirror(ArgT0&& arg0, ArgT... args); + std::string* mutable_r_mirror(); + PROTOBUF_NODISCARD std::string* release_r_mirror(); + void set_allocated_r_mirror(std::string* r_mirror); + private: + const std::string& _internal_r_mirror() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_r_mirror(const std::string& value); + std::string* _internal_mutable_r_mirror(); + public: + + // string github_url = 3; + bool has_github_url() const; + private: + bool _internal_has_github_url() const; + public: + void clear_github_url(); + const std::string& github_url() const; + template + void set_github_url(ArgT0&& arg0, ArgT... args); + std::string* mutable_github_url(); + PROTOBUF_NODISCARD std::string* release_github_url(); + void set_allocated_github_url(std::string* github_url); + private: + const std::string& _internal_github_url() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_github_url(const std::string& value); + std::string* _internal_mutable_github_url(); + public: + + void clear_source(); + SourceCase source_case() const; + // @@protoc_insertion_point(class_scope:rsh.protocol.PackageSource) + private: + class _Internal; + void set_has_r_mirror(); + void set_has_github_url(); + + inline bool has_source() const; + inline void clear_has_source(); + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + union SourceUnion { + constexpr SourceUnion() : _constinit_{} {} + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr r_mirror_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr github_url_; + } source_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + uint32_t _oneof_case_[1]; + + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class Package final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.Package) */ { + public: + inline Package() : Package(nullptr) {} + ~Package() override; + explicit PROTOBUF_CONSTEXPR Package(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Package(const Package& from); + Package(Package&& from) noexcept + : Package() { + *this = ::std::move(from); + } + + inline Package& operator=(const Package& from) { + CopyFrom(from); + return *this; + } + inline Package& operator=(Package&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Package& default_instance() { + return *internal_default_instance(); + } + static inline const Package* internal_default_instance() { + return reinterpret_cast( + &_Package_default_instance_); + } + static constexpr int kIndexInFileMessages = + 25; + + friend void swap(Package& a, Package& b) { + a.Swap(&b); + } + inline void Swap(Package* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Package* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Package* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Package& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Package& from) { + Package::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Package* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.Package"; + } + protected: + explicit Package(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kFunctionHashesFieldNumber = 4, + kNameFieldNumber = 1, + kVersionFieldNumber = 2, + kSourceFieldNumber = 5, + }; + // repeated uint64 function_hashes = 4; + int function_hashes_size() const; + private: + int _internal_function_hashes_size() const; + public: + void clear_function_hashes(); + private: + uint64_t _internal_function_hashes(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& + _internal_function_hashes() const; + void _internal_add_function_hashes(uint64_t value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* + _internal_mutable_function_hashes(); + public: + uint64_t function_hashes(int index) const; + void set_function_hashes(int index, uint64_t value); + void add_function_hashes(uint64_t value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& + function_hashes() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* + mutable_function_hashes(); + + // string name = 1; + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // .rsh.protocol.Version version = 2; + bool has_version() const; + private: + bool _internal_has_version() const; + public: + void clear_version(); + const ::rsh::protocol::Version& version() const; + PROTOBUF_NODISCARD ::rsh::protocol::Version* release_version(); + ::rsh::protocol::Version* mutable_version(); + void set_allocated_version(::rsh::protocol::Version* version); + private: + const ::rsh::protocol::Version& _internal_version() const; + ::rsh::protocol::Version* _internal_mutable_version(); + public: + void unsafe_arena_set_allocated_version( + ::rsh::protocol::Version* version); + ::rsh::protocol::Version* unsafe_arena_release_version(); + + // optional .rsh.protocol.PackageSource source = 5; + bool has_source() const; + private: + bool _internal_has_source() const; + public: + void clear_source(); + const ::rsh::protocol::PackageSource& source() const; + PROTOBUF_NODISCARD ::rsh::protocol::PackageSource* release_source(); + ::rsh::protocol::PackageSource* mutable_source(); + void set_allocated_source(::rsh::protocol::PackageSource* source); + private: + const ::rsh::protocol::PackageSource& _internal_source() const; + ::rsh::protocol::PackageSource* _internal_mutable_source(); + public: + void unsafe_arena_set_allocated_source( + ::rsh::protocol::PackageSource* source); + ::rsh::protocol::PackageSource* unsafe_arena_release_source(); + + // @@protoc_insertion_point(class_scope:rsh.protocol.Package) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t > function_hashes_; + mutable std::atomic _function_hashes_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::rsh::protocol::Version* version_; + ::rsh::protocol::PackageSource* source_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// ------------------------------------------------------------------- + +class PackageRequest final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.protocol.PackageRequest) */ { + public: + inline PackageRequest() : PackageRequest(nullptr) {} + ~PackageRequest() override; + explicit PROTOBUF_CONSTEXPR PackageRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PackageRequest(const PackageRequest& from); + PackageRequest(PackageRequest&& from) noexcept + : PackageRequest() { + *this = ::std::move(from); + } + + inline PackageRequest& operator=(const PackageRequest& from) { + CopyFrom(from); + return *this; + } + inline PackageRequest& operator=(PackageRequest&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PackageRequest& default_instance() { + return *internal_default_instance(); + } + static inline const PackageRequest* internal_default_instance() { + return reinterpret_cast( + &_PackageRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 26; + + friend void swap(PackageRequest& a, PackageRequest& b) { + a.Swap(&b); + } + inline void Swap(PackageRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PackageRequest* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PackageRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PackageRequest& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const PackageRequest& from) { + PackageRequest::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PackageRequest* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "rsh.protocol.PackageRequest"; + } + protected: + explicit PackageRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kHashFieldNumber = 1, + }; + // uint64 hash = 1; + void clear_hash(); + uint64_t hash() const; + void set_hash(uint64_t value); + private: + uint64_t _internal_hash() const; + void _internal_set_hash(uint64_t value); + public: + + // @@protoc_insertion_point(class_scope:rsh.protocol.PackageRequest) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + uint64_t hash_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_messages_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Version + +// int32 major = 1; +inline void Version::clear_major() { + _impl_.major_ = 0; +} +inline int32_t Version::_internal_major() const { + return _impl_.major_; +} +inline int32_t Version::major() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Version.major) + return _internal_major(); +} +inline void Version::_internal_set_major(int32_t value) { + + _impl_.major_ = value; +} +inline void Version::set_major(int32_t value) { + _internal_set_major(value); + // @@protoc_insertion_point(field_set:rsh.protocol.Version.major) +} + +// int32 minor = 2; +inline void Version::clear_minor() { + _impl_.minor_ = 0; +} +inline int32_t Version::_internal_minor() const { + return _impl_.minor_; +} +inline int32_t Version::minor() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Version.minor) + return _internal_minor(); +} +inline void Version::_internal_set_minor(int32_t value) { + + _impl_.minor_ = value; +} +inline void Version::set_minor(int32_t value) { + _internal_set_minor(value); + // @@protoc_insertion_point(field_set:rsh.protocol.Version.minor) +} + +// int32 patch = 3; +inline void Version::clear_patch() { + _impl_.patch_ = 0; +} +inline int32_t Version::_internal_patch() const { + return _impl_.patch_; +} +inline int32_t Version::patch() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Version.patch) + return _internal_patch(); +} +inline void Version::_internal_set_patch(int32_t value) { + + _impl_.patch_ = value; +} +inline void Version::set_patch(int32_t value) { + _internal_set_patch(value); + // @@protoc_insertion_point(field_set:rsh.protocol.Version.patch) +} + +// ------------------------------------------------------------------- + +// InitRequest + +// .rsh.protocol.Version Rsh_version = 1; +inline bool InitRequest::_internal_has_rsh_version() const { + return this != internal_default_instance() && _impl_.rsh_version_ != nullptr; +} +inline bool InitRequest::has_rsh_version() const { + return _internal_has_rsh_version(); +} +inline void InitRequest::clear_rsh_version() { + if (GetArenaForAllocation() == nullptr && _impl_.rsh_version_ != nullptr) { + delete _impl_.rsh_version_; + } + _impl_.rsh_version_ = nullptr; +} +inline const ::rsh::protocol::Version& InitRequest::_internal_rsh_version() const { + const ::rsh::protocol::Version* p = _impl_.rsh_version_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_Version_default_instance_); +} +inline const ::rsh::protocol::Version& InitRequest::rsh_version() const { + // @@protoc_insertion_point(field_get:rsh.protocol.InitRequest.Rsh_version) + return _internal_rsh_version(); +} +inline void InitRequest::unsafe_arena_set_allocated_rsh_version( + ::rsh::protocol::Version* rsh_version) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.rsh_version_); + } + _impl_.rsh_version_ = rsh_version; + if (rsh_version) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.InitRequest.Rsh_version) +} +inline ::rsh::protocol::Version* InitRequest::release_rsh_version() { + + ::rsh::protocol::Version* temp = _impl_.rsh_version_; + _impl_.rsh_version_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::Version* InitRequest::unsafe_arena_release_rsh_version() { + // @@protoc_insertion_point(field_release:rsh.protocol.InitRequest.Rsh_version) + + ::rsh::protocol::Version* temp = _impl_.rsh_version_; + _impl_.rsh_version_ = nullptr; + return temp; +} +inline ::rsh::protocol::Version* InitRequest::_internal_mutable_rsh_version() { + + if (_impl_.rsh_version_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::Version>(GetArenaForAllocation()); + _impl_.rsh_version_ = p; + } + return _impl_.rsh_version_; +} +inline ::rsh::protocol::Version* InitRequest::mutable_rsh_version() { + ::rsh::protocol::Version* _msg = _internal_mutable_rsh_version(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.InitRequest.Rsh_version) + return _msg; +} +inline void InitRequest::set_allocated_rsh_version(::rsh::protocol::Version* rsh_version) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.rsh_version_; + } + if (rsh_version) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(rsh_version); + if (message_arena != submessage_arena) { + rsh_version = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, rsh_version, submessage_arena); + } + + } else { + + } + _impl_.rsh_version_ = rsh_version; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.InitRequest.Rsh_version) +} + +// .rsh.protocol.Version R_version = 2; +inline bool InitRequest::_internal_has_r_version() const { + return this != internal_default_instance() && _impl_.r_version_ != nullptr; +} +inline bool InitRequest::has_r_version() const { + return _internal_has_r_version(); +} +inline void InitRequest::clear_r_version() { + if (GetArenaForAllocation() == nullptr && _impl_.r_version_ != nullptr) { + delete _impl_.r_version_; + } + _impl_.r_version_ = nullptr; +} +inline const ::rsh::protocol::Version& InitRequest::_internal_r_version() const { + const ::rsh::protocol::Version* p = _impl_.r_version_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_Version_default_instance_); +} +inline const ::rsh::protocol::Version& InitRequest::r_version() const { + // @@protoc_insertion_point(field_get:rsh.protocol.InitRequest.R_version) + return _internal_r_version(); +} +inline void InitRequest::unsafe_arena_set_allocated_r_version( + ::rsh::protocol::Version* r_version) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.r_version_); + } + _impl_.r_version_ = r_version; + if (r_version) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.InitRequest.R_version) +} +inline ::rsh::protocol::Version* InitRequest::release_r_version() { + + ::rsh::protocol::Version* temp = _impl_.r_version_; + _impl_.r_version_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::Version* InitRequest::unsafe_arena_release_r_version() { + // @@protoc_insertion_point(field_release:rsh.protocol.InitRequest.R_version) + + ::rsh::protocol::Version* temp = _impl_.r_version_; + _impl_.r_version_ = nullptr; + return temp; +} +inline ::rsh::protocol::Version* InitRequest::_internal_mutable_r_version() { + + if (_impl_.r_version_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::Version>(GetArenaForAllocation()); + _impl_.r_version_ = p; + } + return _impl_.r_version_; +} +inline ::rsh::protocol::Version* InitRequest::mutable_r_version() { + ::rsh::protocol::Version* _msg = _internal_mutable_r_version(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.InitRequest.R_version) + return _msg; +} +inline void InitRequest::set_allocated_r_version(::rsh::protocol::Version* r_version) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.r_version_; + } + if (r_version) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(r_version); + if (message_arena != submessage_arena) { + r_version = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, r_version, submessage_arena); + } + + } else { + + } + _impl_.r_version_ = r_version; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.InitRequest.R_version) +} + +// string platform = 3; +inline void InitRequest::clear_platform() { + _impl_.platform_.ClearToEmpty(); +} +inline const std::string& InitRequest::platform() const { + // @@protoc_insertion_point(field_get:rsh.protocol.InitRequest.platform) + return _internal_platform(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void InitRequest::set_platform(ArgT0&& arg0, ArgT... args) { + + _impl_.platform_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:rsh.protocol.InitRequest.platform) +} +inline std::string* InitRequest::mutable_platform() { + std::string* _s = _internal_mutable_platform(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.InitRequest.platform) + return _s; +} +inline const std::string& InitRequest::_internal_platform() const { + return _impl_.platform_.Get(); +} +inline void InitRequest::_internal_set_platform(const std::string& value) { + + _impl_.platform_.Set(value, GetArenaForAllocation()); +} +inline std::string* InitRequest::_internal_mutable_platform() { + + return _impl_.platform_.Mutable(GetArenaForAllocation()); +} +inline std::string* InitRequest::release_platform() { + // @@protoc_insertion_point(field_release:rsh.protocol.InitRequest.platform) + return _impl_.platform_.Release(); +} +inline void InitRequest::set_allocated_platform(std::string* platform) { + if (platform != nullptr) { + + } else { + + } + _impl_.platform_.SetAllocated(platform, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.platform_.IsDefault()) { + _impl_.platform_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.InitRequest.platform) +} + +// repeated bytes package_hash = 4; +inline int InitRequest::_internal_package_hash_size() const { + return _impl_.package_hash_.size(); +} +inline int InitRequest::package_hash_size() const { + return _internal_package_hash_size(); +} +inline void InitRequest::clear_package_hash() { + _impl_.package_hash_.Clear(); +} +inline std::string* InitRequest::add_package_hash() { + std::string* _s = _internal_add_package_hash(); + // @@protoc_insertion_point(field_add_mutable:rsh.protocol.InitRequest.package_hash) + return _s; +} +inline const std::string& InitRequest::_internal_package_hash(int index) const { + return _impl_.package_hash_.Get(index); +} +inline const std::string& InitRequest::package_hash(int index) const { + // @@protoc_insertion_point(field_get:rsh.protocol.InitRequest.package_hash) + return _internal_package_hash(index); +} +inline std::string* InitRequest::mutable_package_hash(int index) { + // @@protoc_insertion_point(field_mutable:rsh.protocol.InitRequest.package_hash) + return _impl_.package_hash_.Mutable(index); +} +inline void InitRequest::set_package_hash(int index, const std::string& value) { + _impl_.package_hash_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:rsh.protocol.InitRequest.package_hash) +} +inline void InitRequest::set_package_hash(int index, std::string&& value) { + _impl_.package_hash_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:rsh.protocol.InitRequest.package_hash) +} +inline void InitRequest::set_package_hash(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.package_hash_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:rsh.protocol.InitRequest.package_hash) +} +inline void InitRequest::set_package_hash(int index, const void* value, size_t size) { + _impl_.package_hash_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:rsh.protocol.InitRequest.package_hash) +} +inline std::string* InitRequest::_internal_add_package_hash() { + return _impl_.package_hash_.Add(); +} +inline void InitRequest::add_package_hash(const std::string& value) { + _impl_.package_hash_.Add()->assign(value); + // @@protoc_insertion_point(field_add:rsh.protocol.InitRequest.package_hash) +} +inline void InitRequest::add_package_hash(std::string&& value) { + _impl_.package_hash_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:rsh.protocol.InitRequest.package_hash) +} +inline void InitRequest::add_package_hash(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.package_hash_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:rsh.protocol.InitRequest.package_hash) +} +inline void InitRequest::add_package_hash(const void* value, size_t size) { + _impl_.package_hash_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:rsh.protocol.InitRequest.package_hash) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +InitRequest::package_hash() const { + // @@protoc_insertion_point(field_list:rsh.protocol.InitRequest.package_hash) + return _impl_.package_hash_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +InitRequest::mutable_package_hash() { + // @@protoc_insertion_point(field_mutable_list:rsh.protocol.InitRequest.package_hash) + return &_impl_.package_hash_; +} + +// ------------------------------------------------------------------- + +// InitResponse + +// ------------------------------------------------------------------- + +// CompileRequest + +// .rsh.protocol.Function function = 2; +inline bool CompileRequest::_internal_has_function() const { + return this != internal_default_instance() && _impl_.function_ != nullptr; +} +inline bool CompileRequest::has_function() const { + return _internal_has_function(); +} +inline void CompileRequest::clear_function() { + if (GetArenaForAllocation() == nullptr && _impl_.function_ != nullptr) { + delete _impl_.function_; + } + _impl_.function_ = nullptr; +} +inline const ::rsh::protocol::Function& CompileRequest::_internal_function() const { + const ::rsh::protocol::Function* p = _impl_.function_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_Function_default_instance_); +} +inline const ::rsh::protocol::Function& CompileRequest::function() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileRequest.function) + return _internal_function(); +} +inline void CompileRequest::unsafe_arena_set_allocated_function( + ::rsh::protocol::Function* function) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.function_); + } + _impl_.function_ = function; + if (function) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.CompileRequest.function) +} +inline ::rsh::protocol::Function* CompileRequest::release_function() { + + ::rsh::protocol::Function* temp = _impl_.function_; + _impl_.function_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::Function* CompileRequest::unsafe_arena_release_function() { + // @@protoc_insertion_point(field_release:rsh.protocol.CompileRequest.function) + + ::rsh::protocol::Function* temp = _impl_.function_; + _impl_.function_ = nullptr; + return temp; +} +inline ::rsh::protocol::Function* CompileRequest::_internal_mutable_function() { + + if (_impl_.function_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::Function>(GetArenaForAllocation()); + _impl_.function_ = p; + } + return _impl_.function_; +} +inline ::rsh::protocol::Function* CompileRequest::mutable_function() { + ::rsh::protocol::Function* _msg = _internal_mutable_function(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.CompileRequest.function) + return _msg; +} +inline void CompileRequest::set_allocated_function(::rsh::protocol::Function* function) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.function_; + } + if (function) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(function); + if (message_arena != submessage_arena) { + function = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, function, submessage_arena); + } + + } else { + + } + _impl_.function_ = function; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.CompileRequest.function) +} + +// optional .rsh.protocol.Tier tier = 4; +inline bool CompileRequest::_internal_has_tier() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline bool CompileRequest::has_tier() const { + return _internal_has_tier(); +} +inline void CompileRequest::clear_tier() { + _impl_.tier_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline ::rsh::protocol::Tier CompileRequest::_internal_tier() const { + return static_cast< ::rsh::protocol::Tier >(_impl_.tier_); +} +inline ::rsh::protocol::Tier CompileRequest::tier() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileRequest.tier) + return _internal_tier(); +} +inline void CompileRequest::_internal_set_tier(::rsh::protocol::Tier value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.tier_ = value; +} +inline void CompileRequest::set_tier(::rsh::protocol::Tier value) { + _internal_set_tier(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CompileRequest.tier) +} + +// optional int32 cc_opt = 5; +inline bool CompileRequest::_internal_has_cc_opt() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + return value; +} +inline bool CompileRequest::has_cc_opt() const { + return _internal_has_cc_opt(); +} +inline void CompileRequest::clear_cc_opt() { + _impl_.cc_opt_ = 0; + _impl_._has_bits_[0] &= ~0x00000008u; +} +inline int32_t CompileRequest::_internal_cc_opt() const { + return _impl_.cc_opt_; +} +inline int32_t CompileRequest::cc_opt() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileRequest.cc_opt) + return _internal_cc_opt(); +} +inline void CompileRequest::_internal_set_cc_opt(int32_t value) { + _impl_._has_bits_[0] |= 0x00000008u; + _impl_.cc_opt_ = value; +} +inline void CompileRequest::set_cc_opt(int32_t value) { + _internal_set_cc_opt(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CompileRequest.cc_opt) +} + +// optional int32 bc_opt = 6; +inline bool CompileRequest::_internal_has_bc_opt() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline bool CompileRequest::has_bc_opt() const { + return _internal_has_bc_opt(); +} +inline void CompileRequest::clear_bc_opt() { + _impl_.bc_opt_ = 0; + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline int32_t CompileRequest::_internal_bc_opt() const { + return _impl_.bc_opt_; +} +inline int32_t CompileRequest::bc_opt() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileRequest.bc_opt) + return _internal_bc_opt(); +} +inline void CompileRequest::_internal_set_bc_opt(int32_t value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.bc_opt_ = value; +} +inline void CompileRequest::set_bc_opt(int32_t value) { + _internal_set_bc_opt(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CompileRequest.bc_opt) +} + +// optional .rsh.protocol.Context context = 7; +inline bool CompileRequest::_internal_has_context() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); + return value; +} +inline bool CompileRequest::has_context() const { + return _internal_has_context(); +} +inline void CompileRequest::clear_context() { + if (_impl_.context_ != nullptr) _impl_.context_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::rsh::protocol::Context& CompileRequest::_internal_context() const { + const ::rsh::protocol::Context* p = _impl_.context_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_Context_default_instance_); +} +inline const ::rsh::protocol::Context& CompileRequest::context() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileRequest.context) + return _internal_context(); +} +inline void CompileRequest::unsafe_arena_set_allocated_context( + ::rsh::protocol::Context* context) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.context_); + } + _impl_.context_ = context; + if (context) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.CompileRequest.context) +} +inline ::rsh::protocol::Context* CompileRequest::release_context() { + _impl_._has_bits_[0] &= ~0x00000001u; + ::rsh::protocol::Context* temp = _impl_.context_; + _impl_.context_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::Context* CompileRequest::unsafe_arena_release_context() { + // @@protoc_insertion_point(field_release:rsh.protocol.CompileRequest.context) + _impl_._has_bits_[0] &= ~0x00000001u; + ::rsh::protocol::Context* temp = _impl_.context_; + _impl_.context_ = nullptr; + return temp; +} +inline ::rsh::protocol::Context* CompileRequest::_internal_mutable_context() { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.context_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::Context>(GetArenaForAllocation()); + _impl_.context_ = p; + } + return _impl_.context_; +} +inline ::rsh::protocol::Context* CompileRequest::mutable_context() { + ::rsh::protocol::Context* _msg = _internal_mutable_context(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.CompileRequest.context) + return _msg; +} +inline void CompileRequest::set_allocated_context(::rsh::protocol::Context* context) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.context_; + } + if (context) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(context); + if (message_arena != submessage_arena) { + context = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, context, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.context_ = context; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.CompileRequest.context) +} + +// optional .rsh.protocol.Environment environment = 8; +inline bool CompileRequest::_internal_has_environment() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.environment_ != nullptr); + return value; +} +inline bool CompileRequest::has_environment() const { + return _internal_has_environment(); +} +inline void CompileRequest::clear_environment() { + if (_impl_.environment_ != nullptr) _impl_.environment_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const ::rsh::protocol::Environment& CompileRequest::_internal_environment() const { + const ::rsh::protocol::Environment* p = _impl_.environment_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_Environment_default_instance_); +} +inline const ::rsh::protocol::Environment& CompileRequest::environment() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileRequest.environment) + return _internal_environment(); +} +inline void CompileRequest::unsafe_arena_set_allocated_environment( + ::rsh::protocol::Environment* environment) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.environment_); + } + _impl_.environment_ = environment; + if (environment) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.CompileRequest.environment) +} +inline ::rsh::protocol::Environment* CompileRequest::release_environment() { + _impl_._has_bits_[0] &= ~0x00000002u; + ::rsh::protocol::Environment* temp = _impl_.environment_; + _impl_.environment_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::Environment* CompileRequest::unsafe_arena_release_environment() { + // @@protoc_insertion_point(field_release:rsh.protocol.CompileRequest.environment) + _impl_._has_bits_[0] &= ~0x00000002u; + ::rsh::protocol::Environment* temp = _impl_.environment_; + _impl_.environment_ = nullptr; + return temp; +} +inline ::rsh::protocol::Environment* CompileRequest::_internal_mutable_environment() { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.environment_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::Environment>(GetArenaForAllocation()); + _impl_.environment_ = p; + } + return _impl_.environment_; +} +inline ::rsh::protocol::Environment* CompileRequest::mutable_environment() { + ::rsh::protocol::Environment* _msg = _internal_mutable_environment(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.CompileRequest.environment) + return _msg; +} +inline void CompileRequest::set_allocated_environment(::rsh::protocol::Environment* environment) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.environment_; + } + if (environment) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(environment); + if (message_arena != submessage_arena) { + environment = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, environment, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.environment_ = environment; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.CompileRequest.environment) +} + +// ------------------------------------------------------------------- + +// CompileResponse + +// uint64 hash = 1; +inline void CompileResponse::clear_hash() { + _impl_.hash_ = uint64_t{0u}; +} +inline uint64_t CompileResponse::_internal_hash() const { + return _impl_.hash_; +} +inline uint64_t CompileResponse::hash() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileResponse.hash) + return _internal_hash(); +} +inline void CompileResponse::_internal_set_hash(uint64_t value) { + + _impl_.hash_ = value; +} +inline void CompileResponse::set_hash(uint64_t value) { + _internal_set_hash(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CompileResponse.hash) +} + +// .rsh.protocol.Tier tier = 2; +inline void CompileResponse::clear_tier() { + _impl_.tier_ = 0; +} +inline ::rsh::protocol::Tier CompileResponse::_internal_tier() const { + return static_cast< ::rsh::protocol::Tier >(_impl_.tier_); +} +inline ::rsh::protocol::Tier CompileResponse::tier() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileResponse.tier) + return _internal_tier(); +} +inline void CompileResponse::_internal_set_tier(::rsh::protocol::Tier value) { + + _impl_.tier_ = value; +} +inline void CompileResponse::set_tier(::rsh::protocol::Tier value) { + _internal_set_tier(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CompileResponse.tier) +} + +// optional bytes code = 3; +inline bool CompileResponse::_internal_has_code() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool CompileResponse::has_code() const { + return _internal_has_code(); +} +inline void CompileResponse::clear_code() { + _impl_.code_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& CompileResponse::code() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileResponse.code) + return _internal_code(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void CompileResponse::set_code(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.code_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:rsh.protocol.CompileResponse.code) +} +inline std::string* CompileResponse::mutable_code() { + std::string* _s = _internal_mutable_code(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.CompileResponse.code) + return _s; +} +inline const std::string& CompileResponse::_internal_code() const { + return _impl_.code_.Get(); +} +inline void CompileResponse::_internal_set_code(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.code_.Set(value, GetArenaForAllocation()); +} +inline std::string* CompileResponse::_internal_mutable_code() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.code_.Mutable(GetArenaForAllocation()); +} +inline std::string* CompileResponse::release_code() { + // @@protoc_insertion_point(field_release:rsh.protocol.CompileResponse.code) + if (!_internal_has_code()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.code_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.code_.IsDefault()) { + _impl_.code_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void CompileResponse::set_allocated_code(std::string* code) { + if (code != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.code_.SetAllocated(code, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.code_.IsDefault()) { + _impl_.code_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.CompileResponse.code) +} + +// optional bytes constants = 4; +inline bool CompileResponse::_internal_has_constants() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool CompileResponse::has_constants() const { + return _internal_has_constants(); +} +inline void CompileResponse::clear_constants() { + _impl_.constants_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& CompileResponse::constants() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CompileResponse.constants) + return _internal_constants(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void CompileResponse::set_constants(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.constants_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:rsh.protocol.CompileResponse.constants) +} +inline std::string* CompileResponse::mutable_constants() { + std::string* _s = _internal_mutable_constants(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.CompileResponse.constants) + return _s; +} +inline const std::string& CompileResponse::_internal_constants() const { + return _impl_.constants_.Get(); +} +inline void CompileResponse::_internal_set_constants(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.constants_.Set(value, GetArenaForAllocation()); +} +inline std::string* CompileResponse::_internal_mutable_constants() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.constants_.Mutable(GetArenaForAllocation()); +} +inline std::string* CompileResponse::release_constants() { + // @@protoc_insertion_point(field_release:rsh.protocol.CompileResponse.constants) + if (!_internal_has_constants()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.constants_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.constants_.IsDefault()) { + _impl_.constants_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void CompileResponse::set_allocated_constants(std::string* constants) { + if (constants != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.constants_.SetAllocated(constants, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.constants_.IsDefault()) { + _impl_.constants_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.CompileResponse.constants) +} + +// ------------------------------------------------------------------- + +// Function + +// uint64 package_hash = 1; +inline void Function::clear_package_hash() { + _impl_.package_hash_ = uint64_t{0u}; +} +inline uint64_t Function::_internal_package_hash() const { + return _impl_.package_hash_; +} +inline uint64_t Function::package_hash() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Function.package_hash) + return _internal_package_hash(); +} +inline void Function::_internal_set_package_hash(uint64_t value) { + + _impl_.package_hash_ = value; +} +inline void Function::set_package_hash(uint64_t value) { + _internal_set_package_hash(value); + // @@protoc_insertion_point(field_set:rsh.protocol.Function.package_hash) +} + +// string name = 2; +inline void Function::clear_name() { + _impl_.name_.ClearToEmpty(); +} +inline const std::string& Function::name() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Function.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Function::set_name(ArgT0&& arg0, ArgT... args) { + + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:rsh.protocol.Function.name) +} +inline std::string* Function::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.Function.name) + return _s; +} +inline const std::string& Function::_internal_name() const { + return _impl_.name_.Get(); +} +inline void Function::_internal_set_name(const std::string& value) { + + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Function::_internal_mutable_name() { + + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* Function::release_name() { + // @@protoc_insertion_point(field_release:rsh.protocol.Function.name) + return _impl_.name_.Release(); +} +inline void Function::set_allocated_name(std::string* name) { + if (name != nullptr) { + + } else { + + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.Function.name) +} + +// uint64 hash = 3; +inline void Function::clear_hash() { + _impl_.hash_ = uint64_t{0u}; +} +inline uint64_t Function::_internal_hash() const { + return _impl_.hash_; +} +inline uint64_t Function::hash() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Function.hash) + return _internal_hash(); +} +inline void Function::_internal_set_hash(uint64_t value) { + + _impl_.hash_ = value; +} +inline void Function::set_hash(uint64_t value) { + _internal_set_hash(value); + // @@protoc_insertion_point(field_set:rsh.protocol.Function.hash) +} + +// optional bytes body = 4; +inline bool Function::_internal_has_body() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool Function::has_body() const { + return _internal_has_body(); +} +inline void Function::clear_body() { + _impl_.body_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Function::body() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Function.body) + return _internal_body(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Function::set_body(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.body_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:rsh.protocol.Function.body) +} +inline std::string* Function::mutable_body() { + std::string* _s = _internal_mutable_body(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.Function.body) + return _s; +} +inline const std::string& Function::_internal_body() const { + return _impl_.body_.Get(); +} +inline void Function::_internal_set_body(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.body_.Set(value, GetArenaForAllocation()); +} +inline std::string* Function::_internal_mutable_body() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.body_.Mutable(GetArenaForAllocation()); +} +inline std::string* Function::release_body() { + // @@protoc_insertion_point(field_release:rsh.protocol.Function.body) + if (!_internal_has_body()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.body_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.body_.IsDefault()) { + _impl_.body_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Function::set_allocated_body(std::string* body) { + if (body != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.body_.SetAllocated(body, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.body_.IsDefault()) { + _impl_.body_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.Function.body) +} + +// ------------------------------------------------------------------- + +// FunctionRequest + +// uint64 hash = 1; +inline void FunctionRequest::clear_hash() { + _impl_.hash_ = uint64_t{0u}; +} +inline uint64_t FunctionRequest::_internal_hash() const { + return _impl_.hash_; +} +inline uint64_t FunctionRequest::hash() const { + // @@protoc_insertion_point(field_get:rsh.protocol.FunctionRequest.hash) + return _internal_hash(); +} +inline void FunctionRequest::_internal_set_hash(uint64_t value) { + + _impl_.hash_ = value; +} +inline void FunctionRequest::set_hash(uint64_t value) { + _internal_set_hash(value); + // @@protoc_insertion_point(field_set:rsh.protocol.FunctionRequest.hash) +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// Environment + +// map values = 1; +inline int Environment::_internal_values_size() const { + return _impl_.values_.size(); +} +inline int Environment::values_size() const { + return _internal_values_size(); +} +inline void Environment::clear_values() { + _impl_.values_.Clear(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >& +Environment::_internal_values() const { + return _impl_.values_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >& +Environment::values() const { + // @@protoc_insertion_point(field_map:rsh.protocol.Environment.values) + return _internal_values(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >* +Environment::_internal_mutable_values() { + return _impl_.values_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, uint64_t >* +Environment::mutable_values() { + // @@protoc_insertion_point(field_mutable_map:rsh.protocol.Environment.values) + return _internal_mutable_values(); +} + +// ------------------------------------------------------------------- + +// ValueRequest + +// repeated uint64 hash = 1; +inline int ValueRequest::_internal_hash_size() const { + return _impl_.hash_.size(); +} +inline int ValueRequest::hash_size() const { + return _internal_hash_size(); +} +inline void ValueRequest::clear_hash() { + _impl_.hash_.Clear(); +} +inline uint64_t ValueRequest::_internal_hash(int index) const { + return _impl_.hash_.Get(index); +} +inline uint64_t ValueRequest::hash(int index) const { + // @@protoc_insertion_point(field_get:rsh.protocol.ValueRequest.hash) + return _internal_hash(index); +} +inline void ValueRequest::set_hash(int index, uint64_t value) { + _impl_.hash_.Set(index, value); + // @@protoc_insertion_point(field_set:rsh.protocol.ValueRequest.hash) +} +inline void ValueRequest::_internal_add_hash(uint64_t value) { + _impl_.hash_.Add(value); +} +inline void ValueRequest::add_hash(uint64_t value) { + _internal_add_hash(value); + // @@protoc_insertion_point(field_add:rsh.protocol.ValueRequest.hash) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& +ValueRequest::_internal_hash() const { + return _impl_.hash_; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& +ValueRequest::hash() const { + // @@protoc_insertion_point(field_list:rsh.protocol.ValueRequest.hash) + return _internal_hash(); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* +ValueRequest::_internal_mutable_hash() { + return &_impl_.hash_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* +ValueRequest::mutable_hash() { + // @@protoc_insertion_point(field_mutable_list:rsh.protocol.ValueRequest.hash) + return _internal_mutable_hash(); +} + +// ------------------------------------------------------------------- + +// Value + +// uint64 hash = 1; +inline void Value::clear_hash() { + _impl_.hash_ = uint64_t{0u}; +} +inline uint64_t Value::_internal_hash() const { + return _impl_.hash_; +} +inline uint64_t Value::hash() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Value.hash) + return _internal_hash(); +} +inline void Value::_internal_set_hash(uint64_t value) { + + _impl_.hash_ = value; +} +inline void Value::set_hash(uint64_t value) { + _internal_set_hash(value); + // @@protoc_insertion_point(field_set:rsh.protocol.Value.hash) +} + +// bytes value = 2; +inline void Value::clear_value() { + _impl_.value_.ClearToEmpty(); +} +inline const std::string& Value::value() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Value.value) + return _internal_value(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Value::set_value(ArgT0&& arg0, ArgT... args) { + + _impl_.value_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:rsh.protocol.Value.value) +} +inline std::string* Value::mutable_value() { + std::string* _s = _internal_mutable_value(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.Value.value) + return _s; +} +inline const std::string& Value::_internal_value() const { + return _impl_.value_.Get(); +} +inline void Value::_internal_set_value(const std::string& value) { + + _impl_.value_.Set(value, GetArenaForAllocation()); +} +inline std::string* Value::_internal_mutable_value() { + + return _impl_.value_.Mutable(GetArenaForAllocation()); +} +inline std::string* Value::release_value() { + // @@protoc_insertion_point(field_release:rsh.protocol.Value.value) + return _impl_.value_.Release(); +} +inline void Value::set_allocated_value(std::string* value) { + if (value != nullptr) { + + } else { + + } + _impl_.value_.SetAllocated(value, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.value_.IsDefault()) { + _impl_.value_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.Value.value) +} + +// ------------------------------------------------------------------- + +// Values + +// repeated .rsh.protocol.Value values = 1; +inline int Values::_internal_values_size() const { + return _impl_.values_.size(); +} +inline int Values::values_size() const { + return _internal_values_size(); +} +inline void Values::clear_values() { + _impl_.values_.Clear(); +} +inline ::rsh::protocol::Value* Values::mutable_values(int index) { + // @@protoc_insertion_point(field_mutable:rsh.protocol.Values.values) + return _impl_.values_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::Value >* +Values::mutable_values() { + // @@protoc_insertion_point(field_mutable_list:rsh.protocol.Values.values) + return &_impl_.values_; +} +inline const ::rsh::protocol::Value& Values::_internal_values(int index) const { + return _impl_.values_.Get(index); +} +inline const ::rsh::protocol::Value& Values::values(int index) const { + // @@protoc_insertion_point(field_get:rsh.protocol.Values.values) + return _internal_values(index); +} +inline ::rsh::protocol::Value* Values::_internal_add_values() { + return _impl_.values_.Add(); +} +inline ::rsh::protocol::Value* Values::add_values() { + ::rsh::protocol::Value* _add = _internal_add_values(); + // @@protoc_insertion_point(field_add:rsh.protocol.Values.values) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::Value >& +Values::values() const { + // @@protoc_insertion_point(field_list:rsh.protocol.Values.values) + return _impl_.values_; +} + +// ------------------------------------------------------------------- + +// Empty + +// ------------------------------------------------------------------- + +// CallContext + +// bool args_statically_matched = 1; +inline void CallContext::clear_args_statically_matched() { + _impl_.args_statically_matched_ = false; +} +inline bool CallContext::_internal_args_statically_matched() const { + return _impl_.args_statically_matched_; +} +inline bool CallContext::args_statically_matched() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CallContext.args_statically_matched) + return _internal_args_statically_matched(); +} +inline void CallContext::_internal_set_args_statically_matched(bool value) { + + _impl_.args_statically_matched_ = value; +} +inline void CallContext::set_args_statically_matched(bool value) { + _internal_set_args_statically_matched(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CallContext.args_statically_matched) +} + +// bool correct_number_of_args = 2; +inline void CallContext::clear_correct_number_of_args() { + _impl_.correct_number_of_args_ = false; +} +inline bool CallContext::_internal_correct_number_of_args() const { + return _impl_.correct_number_of_args_; +} +inline bool CallContext::correct_number_of_args() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CallContext.correct_number_of_args) + return _internal_correct_number_of_args(); +} +inline void CallContext::_internal_set_correct_number_of_args(bool value) { + + _impl_.correct_number_of_args_ = value; +} +inline void CallContext::set_correct_number_of_args(bool value) { + _internal_set_correct_number_of_args(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CallContext.correct_number_of_args) +} + +// bool correct_order_of_args = 3; +inline void CallContext::clear_correct_order_of_args() { + _impl_.correct_order_of_args_ = false; +} +inline bool CallContext::_internal_correct_order_of_args() const { + return _impl_.correct_order_of_args_; +} +inline bool CallContext::correct_order_of_args() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CallContext.correct_order_of_args) + return _internal_correct_order_of_args(); +} +inline void CallContext::_internal_set_correct_order_of_args(bool value) { + + _impl_.correct_order_of_args_ = value; +} +inline void CallContext::set_correct_order_of_args(bool value) { + _internal_set_correct_order_of_args(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CallContext.correct_order_of_args) +} + +// bool no_missing_args = 4; +inline void CallContext::clear_no_missing_args() { + _impl_.no_missing_args_ = false; +} +inline bool CallContext::_internal_no_missing_args() const { + return _impl_.no_missing_args_; +} +inline bool CallContext::no_missing_args() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CallContext.no_missing_args) + return _internal_no_missing_args(); +} +inline void CallContext::_internal_set_no_missing_args(bool value) { + + _impl_.no_missing_args_ = value; +} +inline void CallContext::set_no_missing_args(bool value) { + _internal_set_no_missing_args(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CallContext.no_missing_args) +} + +// ------------------------------------------------------------------- + +// ArgumentContext + +// bool eager = 1; +inline void ArgumentContext::clear_eager() { + _impl_.eager_ = false; +} +inline bool ArgumentContext::_internal_eager() const { + return _impl_.eager_; +} +inline bool ArgumentContext::eager() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ArgumentContext.eager) + return _internal_eager(); +} +inline void ArgumentContext::_internal_set_eager(bool value) { + + _impl_.eager_ = value; +} +inline void ArgumentContext::set_eager(bool value) { + _internal_set_eager(value); + // @@protoc_insertion_point(field_set:rsh.protocol.ArgumentContext.eager) +} + +// bool reflection = 2; +inline void ArgumentContext::clear_reflection() { + _impl_.reflection_ = false; +} +inline bool ArgumentContext::_internal_reflection() const { + return _impl_.reflection_; +} +inline bool ArgumentContext::reflection() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ArgumentContext.reflection) + return _internal_reflection(); +} +inline void ArgumentContext::_internal_set_reflection(bool value) { + + _impl_.reflection_ = value; +} +inline void ArgumentContext::set_reflection(bool value) { + _internal_set_reflection(value); + // @@protoc_insertion_point(field_set:rsh.protocol.ArgumentContext.reflection) +} + +// bool object = 3; +inline void ArgumentContext::clear_object() { + _impl_.object_ = false; +} +inline bool ArgumentContext::_internal_object() const { + return _impl_.object_; +} +inline bool ArgumentContext::object() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ArgumentContext.object) + return _internal_object(); +} +inline void ArgumentContext::_internal_set_object(bool value) { + + _impl_.object_ = value; +} +inline void ArgumentContext::set_object(bool value) { + _internal_set_object(value); + // @@protoc_insertion_point(field_set:rsh.protocol.ArgumentContext.object) +} + +// optional .rsh.protocol.Type type = 4; +inline bool ArgumentContext::_internal_has_type() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool ArgumentContext::has_type() const { + return _internal_has_type(); +} +inline void ArgumentContext::clear_type() { + _impl_.type_ = 0; + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline ::rsh::protocol::Type ArgumentContext::_internal_type() const { + return static_cast< ::rsh::protocol::Type >(_impl_.type_); +} +inline ::rsh::protocol::Type ArgumentContext::type() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ArgumentContext.type) + return _internal_type(); +} +inline void ArgumentContext::_internal_set_type(::rsh::protocol::Type value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.type_ = value; +} +inline void ArgumentContext::set_type(::rsh::protocol::Type value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:rsh.protocol.ArgumentContext.type) +} + +// ------------------------------------------------------------------- + +// Context + +// .rsh.protocol.CallContext call_context = 1; +inline bool Context::_internal_has_call_context() const { + return this != internal_default_instance() && _impl_.call_context_ != nullptr; +} +inline bool Context::has_call_context() const { + return _internal_has_call_context(); +} +inline void Context::clear_call_context() { + if (GetArenaForAllocation() == nullptr && _impl_.call_context_ != nullptr) { + delete _impl_.call_context_; + } + _impl_.call_context_ = nullptr; +} +inline const ::rsh::protocol::CallContext& Context::_internal_call_context() const { + const ::rsh::protocol::CallContext* p = _impl_.call_context_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_CallContext_default_instance_); +} +inline const ::rsh::protocol::CallContext& Context::call_context() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Context.call_context) + return _internal_call_context(); +} +inline void Context::unsafe_arena_set_allocated_call_context( + ::rsh::protocol::CallContext* call_context) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.call_context_); + } + _impl_.call_context_ = call_context; + if (call_context) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.Context.call_context) +} +inline ::rsh::protocol::CallContext* Context::release_call_context() { + + ::rsh::protocol::CallContext* temp = _impl_.call_context_; + _impl_.call_context_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::CallContext* Context::unsafe_arena_release_call_context() { + // @@protoc_insertion_point(field_release:rsh.protocol.Context.call_context) + + ::rsh::protocol::CallContext* temp = _impl_.call_context_; + _impl_.call_context_ = nullptr; + return temp; +} +inline ::rsh::protocol::CallContext* Context::_internal_mutable_call_context() { + + if (_impl_.call_context_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::CallContext>(GetArenaForAllocation()); + _impl_.call_context_ = p; + } + return _impl_.call_context_; +} +inline ::rsh::protocol::CallContext* Context::mutable_call_context() { + ::rsh::protocol::CallContext* _msg = _internal_mutable_call_context(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.Context.call_context) + return _msg; +} +inline void Context::set_allocated_call_context(::rsh::protocol::CallContext* call_context) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.call_context_; + } + if (call_context) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(call_context); + if (message_arena != submessage_arena) { + call_context = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, call_context, submessage_arena); + } + + } else { + + } + _impl_.call_context_ = call_context; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.Context.call_context) +} + +// repeated .rsh.protocol.ArgumentContext argument_context = 2; +inline int Context::_internal_argument_context_size() const { + return _impl_.argument_context_.size(); +} +inline int Context::argument_context_size() const { + return _internal_argument_context_size(); +} +inline void Context::clear_argument_context() { + _impl_.argument_context_.Clear(); +} +inline ::rsh::protocol::ArgumentContext* Context::mutable_argument_context(int index) { + // @@protoc_insertion_point(field_mutable:rsh.protocol.Context.argument_context) + return _impl_.argument_context_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::ArgumentContext >* +Context::mutable_argument_context() { + // @@protoc_insertion_point(field_mutable_list:rsh.protocol.Context.argument_context) + return &_impl_.argument_context_; +} +inline const ::rsh::protocol::ArgumentContext& Context::_internal_argument_context(int index) const { + return _impl_.argument_context_.Get(index); +} +inline const ::rsh::protocol::ArgumentContext& Context::argument_context(int index) const { + // @@protoc_insertion_point(field_get:rsh.protocol.Context.argument_context) + return _internal_argument_context(index); +} +inline ::rsh::protocol::ArgumentContext* Context::_internal_add_argument_context() { + return _impl_.argument_context_.Add(); +} +inline ::rsh::protocol::ArgumentContext* Context::add_argument_context() { + ::rsh::protocol::ArgumentContext* _add = _internal_add_argument_context(); + // @@protoc_insertion_point(field_add:rsh.protocol.Context.argument_context) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::rsh::protocol::ArgumentContext >& +Context::argument_context() const { + // @@protoc_insertion_point(field_list:rsh.protocol.Context.argument_context) + return _impl_.argument_context_; +} + +// ------------------------------------------------------------------- + +// ContextRequest + +// .rsh.protocol.Function function = 1; +inline bool ContextRequest::_internal_has_function() const { + return this != internal_default_instance() && _impl_.function_ != nullptr; +} +inline bool ContextRequest::has_function() const { + return _internal_has_function(); +} +inline void ContextRequest::clear_function() { + if (GetArenaForAllocation() == nullptr && _impl_.function_ != nullptr) { + delete _impl_.function_; + } + _impl_.function_ = nullptr; +} +inline const ::rsh::protocol::Function& ContextRequest::_internal_function() const { + const ::rsh::protocol::Function* p = _impl_.function_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_Function_default_instance_); +} +inline const ::rsh::protocol::Function& ContextRequest::function() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ContextRequest.function) + return _internal_function(); +} +inline void ContextRequest::unsafe_arena_set_allocated_function( + ::rsh::protocol::Function* function) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.function_); + } + _impl_.function_ = function; + if (function) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.ContextRequest.function) +} +inline ::rsh::protocol::Function* ContextRequest::release_function() { + + ::rsh::protocol::Function* temp = _impl_.function_; + _impl_.function_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::Function* ContextRequest::unsafe_arena_release_function() { + // @@protoc_insertion_point(field_release:rsh.protocol.ContextRequest.function) + + ::rsh::protocol::Function* temp = _impl_.function_; + _impl_.function_ = nullptr; + return temp; +} +inline ::rsh::protocol::Function* ContextRequest::_internal_mutable_function() { + + if (_impl_.function_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::Function>(GetArenaForAllocation()); + _impl_.function_ = p; + } + return _impl_.function_; +} +inline ::rsh::protocol::Function* ContextRequest::mutable_function() { + ::rsh::protocol::Function* _msg = _internal_mutable_function(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.ContextRequest.function) + return _msg; +} +inline void ContextRequest::set_allocated_function(::rsh::protocol::Function* function) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.function_; + } + if (function) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(function); + if (message_arena != submessage_arena) { + function = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, function, submessage_arena); + } + + } else { + + } + _impl_.function_ = function; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.ContextRequest.function) +} + +// ------------------------------------------------------------------- + +// TestFeedback + +// .rsh.protocol.TestLattice test_lattice = 1; +inline void TestFeedback::clear_test_lattice() { + _impl_.test_lattice_ = 0; +} +inline ::rsh::protocol::TestLattice TestFeedback::_internal_test_lattice() const { + return static_cast< ::rsh::protocol::TestLattice >(_impl_.test_lattice_); +} +inline ::rsh::protocol::TestLattice TestFeedback::test_lattice() const { + // @@protoc_insertion_point(field_get:rsh.protocol.TestFeedback.test_lattice) + return _internal_test_lattice(); +} +inline void TestFeedback::_internal_set_test_lattice(::rsh::protocol::TestLattice value) { + + _impl_.test_lattice_ = value; +} +inline void TestFeedback::set_test_lattice(::rsh::protocol::TestLattice value) { + _internal_set_test_lattice(value); + // @@protoc_insertion_point(field_set:rsh.protocol.TestFeedback.test_lattice) +} + +// ------------------------------------------------------------------- + +// CallFeedback + +// int64 n_calls = 1; +inline void CallFeedback::clear_n_calls() { + _impl_.n_calls_ = int64_t{0}; +} +inline int64_t CallFeedback::_internal_n_calls() const { + return _impl_.n_calls_; +} +inline int64_t CallFeedback::n_calls() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CallFeedback.n_calls) + return _internal_n_calls(); +} +inline void CallFeedback::_internal_set_n_calls(int64_t value) { + + _impl_.n_calls_ = value; +} +inline void CallFeedback::set_n_calls(int64_t value) { + _internal_set_n_calls(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CallFeedback.n_calls) +} + +// uint64 callee_hash = 2; +inline void CallFeedback::clear_callee_hash() { + _impl_.callee_hash_ = uint64_t{0u}; +} +inline uint64_t CallFeedback::_internal_callee_hash() const { + return _impl_.callee_hash_; +} +inline uint64_t CallFeedback::callee_hash() const { + // @@protoc_insertion_point(field_get:rsh.protocol.CallFeedback.callee_hash) + return _internal_callee_hash(); +} +inline void CallFeedback::_internal_set_callee_hash(uint64_t value) { + + _impl_.callee_hash_ = value; +} +inline void CallFeedback::set_callee_hash(uint64_t value) { + _internal_set_callee_hash(value); + // @@protoc_insertion_point(field_set:rsh.protocol.CallFeedback.callee_hash) +} + +// ------------------------------------------------------------------- + +// ValueFeedback + +// bool scalar = 1; +inline void ValueFeedback::clear_scalar() { + _impl_.scalar_ = false; +} +inline bool ValueFeedback::_internal_scalar() const { + return _impl_.scalar_; +} +inline bool ValueFeedback::scalar() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ValueFeedback.scalar) + return _internal_scalar(); +} +inline void ValueFeedback::_internal_set_scalar(bool value) { + + _impl_.scalar_ = value; +} +inline void ValueFeedback::set_scalar(bool value) { + _internal_set_scalar(value); + // @@protoc_insertion_point(field_set:rsh.protocol.ValueFeedback.scalar) +} + +// bool object = 2; +inline void ValueFeedback::clear_object() { + _impl_.object_ = false; +} +inline bool ValueFeedback::_internal_object() const { + return _impl_.object_; +} +inline bool ValueFeedback::object() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ValueFeedback.object) + return _internal_object(); +} +inline void ValueFeedback::_internal_set_object(bool value) { + + _impl_.object_ = value; +} +inline void ValueFeedback::set_object(bool value) { + _internal_set_object(value); + // @@protoc_insertion_point(field_set:rsh.protocol.ValueFeedback.object) +} + +// bool accessed_attributes = 3; +inline void ValueFeedback::clear_accessed_attributes() { + _impl_.accessed_attributes_ = false; +} +inline bool ValueFeedback::_internal_accessed_attributes() const { + return _impl_.accessed_attributes_; +} +inline bool ValueFeedback::accessed_attributes() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ValueFeedback.accessed_attributes) + return _internal_accessed_attributes(); +} +inline void ValueFeedback::_internal_set_accessed_attributes(bool value) { + + _impl_.accessed_attributes_ = value; +} +inline void ValueFeedback::set_accessed_attributes(bool value) { + _internal_set_accessed_attributes(value); + // @@protoc_insertion_point(field_set:rsh.protocol.ValueFeedback.accessed_attributes) +} + +// bool vectorizable = 4; +inline void ValueFeedback::clear_vectorizable() { + _impl_.vectorizable_ = false; +} +inline bool ValueFeedback::_internal_vectorizable() const { + return _impl_.vectorizable_; +} +inline bool ValueFeedback::vectorizable() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ValueFeedback.vectorizable) + return _internal_vectorizable(); +} +inline void ValueFeedback::_internal_set_vectorizable(bool value) { + + _impl_.vectorizable_ = value; +} +inline void ValueFeedback::set_vectorizable(bool value) { + _internal_set_vectorizable(value); + // @@protoc_insertion_point(field_set:rsh.protocol.ValueFeedback.vectorizable) +} + +// bool is_promise = 5; +inline void ValueFeedback::clear_is_promise() { + _impl_.is_promise_ = false; +} +inline bool ValueFeedback::_internal_is_promise() const { + return _impl_.is_promise_; +} +inline bool ValueFeedback::is_promise() const { + // @@protoc_insertion_point(field_get:rsh.protocol.ValueFeedback.is_promise) + return _internal_is_promise(); +} +inline void ValueFeedback::_internal_set_is_promise(bool value) { + + _impl_.is_promise_ = value; +} +inline void ValueFeedback::set_is_promise(bool value) { + _internal_set_is_promise(value); + // @@protoc_insertion_point(field_set:rsh.protocol.ValueFeedback.is_promise) +} + +// ------------------------------------------------------------------- + +// TypeFeedback_Feedback + +// .rsh.protocol.TestFeedback test_feedback = 1; +inline bool TypeFeedback_Feedback::_internal_has_test_feedback() const { + return feedback_case() == kTestFeedback; +} +inline bool TypeFeedback_Feedback::has_test_feedback() const { + return _internal_has_test_feedback(); +} +inline void TypeFeedback_Feedback::set_has_test_feedback() { + _impl_._oneof_case_[0] = kTestFeedback; +} +inline void TypeFeedback_Feedback::clear_test_feedback() { + if (_internal_has_test_feedback()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.feedback_.test_feedback_; + } + clear_has_feedback(); + } +} +inline ::rsh::protocol::TestFeedback* TypeFeedback_Feedback::release_test_feedback() { + // @@protoc_insertion_point(field_release:rsh.protocol.TypeFeedback.Feedback.test_feedback) + if (_internal_has_test_feedback()) { + clear_has_feedback(); + ::rsh::protocol::TestFeedback* temp = _impl_.feedback_.test_feedback_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.feedback_.test_feedback_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::rsh::protocol::TestFeedback& TypeFeedback_Feedback::_internal_test_feedback() const { + return _internal_has_test_feedback() + ? *_impl_.feedback_.test_feedback_ + : reinterpret_cast< ::rsh::protocol::TestFeedback&>(::rsh::protocol::_TestFeedback_default_instance_); +} +inline const ::rsh::protocol::TestFeedback& TypeFeedback_Feedback::test_feedback() const { + // @@protoc_insertion_point(field_get:rsh.protocol.TypeFeedback.Feedback.test_feedback) + return _internal_test_feedback(); +} +inline ::rsh::protocol::TestFeedback* TypeFeedback_Feedback::unsafe_arena_release_test_feedback() { + // @@protoc_insertion_point(field_unsafe_arena_release:rsh.protocol.TypeFeedback.Feedback.test_feedback) + if (_internal_has_test_feedback()) { + clear_has_feedback(); + ::rsh::protocol::TestFeedback* temp = _impl_.feedback_.test_feedback_; + _impl_.feedback_.test_feedback_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void TypeFeedback_Feedback::unsafe_arena_set_allocated_test_feedback(::rsh::protocol::TestFeedback* test_feedback) { + clear_feedback(); + if (test_feedback) { + set_has_test_feedback(); + _impl_.feedback_.test_feedback_ = test_feedback; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.TypeFeedback.Feedback.test_feedback) +} +inline ::rsh::protocol::TestFeedback* TypeFeedback_Feedback::_internal_mutable_test_feedback() { + if (!_internal_has_test_feedback()) { + clear_feedback(); + set_has_test_feedback(); + _impl_.feedback_.test_feedback_ = CreateMaybeMessage< ::rsh::protocol::TestFeedback >(GetArenaForAllocation()); + } + return _impl_.feedback_.test_feedback_; +} +inline ::rsh::protocol::TestFeedback* TypeFeedback_Feedback::mutable_test_feedback() { + ::rsh::protocol::TestFeedback* _msg = _internal_mutable_test_feedback(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.TypeFeedback.Feedback.test_feedback) + return _msg; +} + +// .rsh.protocol.CallFeedback call_feedback = 2; +inline bool TypeFeedback_Feedback::_internal_has_call_feedback() const { + return feedback_case() == kCallFeedback; +} +inline bool TypeFeedback_Feedback::has_call_feedback() const { + return _internal_has_call_feedback(); +} +inline void TypeFeedback_Feedback::set_has_call_feedback() { + _impl_._oneof_case_[0] = kCallFeedback; +} +inline void TypeFeedback_Feedback::clear_call_feedback() { + if (_internal_has_call_feedback()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.feedback_.call_feedback_; + } + clear_has_feedback(); + } +} +inline ::rsh::protocol::CallFeedback* TypeFeedback_Feedback::release_call_feedback() { + // @@protoc_insertion_point(field_release:rsh.protocol.TypeFeedback.Feedback.call_feedback) + if (_internal_has_call_feedback()) { + clear_has_feedback(); + ::rsh::protocol::CallFeedback* temp = _impl_.feedback_.call_feedback_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.feedback_.call_feedback_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::rsh::protocol::CallFeedback& TypeFeedback_Feedback::_internal_call_feedback() const { + return _internal_has_call_feedback() + ? *_impl_.feedback_.call_feedback_ + : reinterpret_cast< ::rsh::protocol::CallFeedback&>(::rsh::protocol::_CallFeedback_default_instance_); +} +inline const ::rsh::protocol::CallFeedback& TypeFeedback_Feedback::call_feedback() const { + // @@protoc_insertion_point(field_get:rsh.protocol.TypeFeedback.Feedback.call_feedback) + return _internal_call_feedback(); +} +inline ::rsh::protocol::CallFeedback* TypeFeedback_Feedback::unsafe_arena_release_call_feedback() { + // @@protoc_insertion_point(field_unsafe_arena_release:rsh.protocol.TypeFeedback.Feedback.call_feedback) + if (_internal_has_call_feedback()) { + clear_has_feedback(); + ::rsh::protocol::CallFeedback* temp = _impl_.feedback_.call_feedback_; + _impl_.feedback_.call_feedback_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void TypeFeedback_Feedback::unsafe_arena_set_allocated_call_feedback(::rsh::protocol::CallFeedback* call_feedback) { + clear_feedback(); + if (call_feedback) { + set_has_call_feedback(); + _impl_.feedback_.call_feedback_ = call_feedback; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.TypeFeedback.Feedback.call_feedback) +} +inline ::rsh::protocol::CallFeedback* TypeFeedback_Feedback::_internal_mutable_call_feedback() { + if (!_internal_has_call_feedback()) { + clear_feedback(); + set_has_call_feedback(); + _impl_.feedback_.call_feedback_ = CreateMaybeMessage< ::rsh::protocol::CallFeedback >(GetArenaForAllocation()); + } + return _impl_.feedback_.call_feedback_; +} +inline ::rsh::protocol::CallFeedback* TypeFeedback_Feedback::mutable_call_feedback() { + ::rsh::protocol::CallFeedback* _msg = _internal_mutable_call_feedback(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.TypeFeedback.Feedback.call_feedback) + return _msg; +} + +// .rsh.protocol.ValueFeedback value_feedback = 3; +inline bool TypeFeedback_Feedback::_internal_has_value_feedback() const { + return feedback_case() == kValueFeedback; +} +inline bool TypeFeedback_Feedback::has_value_feedback() const { + return _internal_has_value_feedback(); +} +inline void TypeFeedback_Feedback::set_has_value_feedback() { + _impl_._oneof_case_[0] = kValueFeedback; +} +inline void TypeFeedback_Feedback::clear_value_feedback() { + if (_internal_has_value_feedback()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.feedback_.value_feedback_; + } + clear_has_feedback(); + } +} +inline ::rsh::protocol::ValueFeedback* TypeFeedback_Feedback::release_value_feedback() { + // @@protoc_insertion_point(field_release:rsh.protocol.TypeFeedback.Feedback.value_feedback) + if (_internal_has_value_feedback()) { + clear_has_feedback(); + ::rsh::protocol::ValueFeedback* temp = _impl_.feedback_.value_feedback_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.feedback_.value_feedback_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::rsh::protocol::ValueFeedback& TypeFeedback_Feedback::_internal_value_feedback() const { + return _internal_has_value_feedback() + ? *_impl_.feedback_.value_feedback_ + : reinterpret_cast< ::rsh::protocol::ValueFeedback&>(::rsh::protocol::_ValueFeedback_default_instance_); +} +inline const ::rsh::protocol::ValueFeedback& TypeFeedback_Feedback::value_feedback() const { + // @@protoc_insertion_point(field_get:rsh.protocol.TypeFeedback.Feedback.value_feedback) + return _internal_value_feedback(); +} +inline ::rsh::protocol::ValueFeedback* TypeFeedback_Feedback::unsafe_arena_release_value_feedback() { + // @@protoc_insertion_point(field_unsafe_arena_release:rsh.protocol.TypeFeedback.Feedback.value_feedback) + if (_internal_has_value_feedback()) { + clear_has_feedback(); + ::rsh::protocol::ValueFeedback* temp = _impl_.feedback_.value_feedback_; + _impl_.feedback_.value_feedback_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void TypeFeedback_Feedback::unsafe_arena_set_allocated_value_feedback(::rsh::protocol::ValueFeedback* value_feedback) { + clear_feedback(); + if (value_feedback) { + set_has_value_feedback(); + _impl_.feedback_.value_feedback_ = value_feedback; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.TypeFeedback.Feedback.value_feedback) +} +inline ::rsh::protocol::ValueFeedback* TypeFeedback_Feedback::_internal_mutable_value_feedback() { + if (!_internal_has_value_feedback()) { + clear_feedback(); + set_has_value_feedback(); + _impl_.feedback_.value_feedback_ = CreateMaybeMessage< ::rsh::protocol::ValueFeedback >(GetArenaForAllocation()); + } + return _impl_.feedback_.value_feedback_; +} +inline ::rsh::protocol::ValueFeedback* TypeFeedback_Feedback::mutable_value_feedback() { + ::rsh::protocol::ValueFeedback* _msg = _internal_mutable_value_feedback(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.TypeFeedback.Feedback.value_feedback) + return _msg; +} + +inline bool TypeFeedback_Feedback::has_feedback() const { + return feedback_case() != FEEDBACK_NOT_SET; +} +inline void TypeFeedback_Feedback::clear_has_feedback() { + _impl_._oneof_case_[0] = FEEDBACK_NOT_SET; +} +inline TypeFeedback_Feedback::FeedbackCase TypeFeedback_Feedback::feedback_case() const { + return TypeFeedback_Feedback::FeedbackCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// TypeFeedback + +// map types = 2; +inline int TypeFeedback::_internal_types_size() const { + return _impl_.types_.size(); +} +inline int TypeFeedback::types_size() const { + return _internal_types_size(); +} +inline void TypeFeedback::clear_types() { + _impl_.types_.Clear(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::rsh::protocol::TypeFeedback_Feedback >& +TypeFeedback::_internal_types() const { + return _impl_.types_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::rsh::protocol::TypeFeedback_Feedback >& +TypeFeedback::types() const { + // @@protoc_insertion_point(field_map:rsh.protocol.TypeFeedback.types) + return _internal_types(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::rsh::protocol::TypeFeedback_Feedback >* +TypeFeedback::_internal_mutable_types() { + return _impl_.types_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::rsh::protocol::TypeFeedback_Feedback >* +TypeFeedback::mutable_types() { + // @@protoc_insertion_point(field_mutable_map:rsh.protocol.TypeFeedback.types) + return _internal_mutable_types(); +} + +// ------------------------------------------------------------------- + +// FeedbackRequest + +// .rsh.protocol.Function function = 1; +inline bool FeedbackRequest::_internal_has_function() const { + return this != internal_default_instance() && _impl_.function_ != nullptr; +} +inline bool FeedbackRequest::has_function() const { + return _internal_has_function(); +} +inline void FeedbackRequest::clear_function() { + if (GetArenaForAllocation() == nullptr && _impl_.function_ != nullptr) { + delete _impl_.function_; + } + _impl_.function_ = nullptr; +} +inline const ::rsh::protocol::Function& FeedbackRequest::_internal_function() const { + const ::rsh::protocol::Function* p = _impl_.function_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_Function_default_instance_); +} +inline const ::rsh::protocol::Function& FeedbackRequest::function() const { + // @@protoc_insertion_point(field_get:rsh.protocol.FeedbackRequest.function) + return _internal_function(); +} +inline void FeedbackRequest::unsafe_arena_set_allocated_function( + ::rsh::protocol::Function* function) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.function_); + } + _impl_.function_ = function; + if (function) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.FeedbackRequest.function) +} +inline ::rsh::protocol::Function* FeedbackRequest::release_function() { + + ::rsh::protocol::Function* temp = _impl_.function_; + _impl_.function_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::Function* FeedbackRequest::unsafe_arena_release_function() { + // @@protoc_insertion_point(field_release:rsh.protocol.FeedbackRequest.function) + + ::rsh::protocol::Function* temp = _impl_.function_; + _impl_.function_ = nullptr; + return temp; +} +inline ::rsh::protocol::Function* FeedbackRequest::_internal_mutable_function() { + + if (_impl_.function_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::Function>(GetArenaForAllocation()); + _impl_.function_ = p; + } + return _impl_.function_; +} +inline ::rsh::protocol::Function* FeedbackRequest::mutable_function() { + ::rsh::protocol::Function* _msg = _internal_mutable_function(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.FeedbackRequest.function) + return _msg; +} +inline void FeedbackRequest::set_allocated_function(::rsh::protocol::Function* function) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.function_; + } + if (function) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(function); + if (message_arena != submessage_arena) { + function = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, function, submessage_arena); + } + + } else { + + } + _impl_.function_ = function; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.FeedbackRequest.function) +} + +// ------------------------------------------------------------------- + +// PackageSource + +// string r_mirror = 2; +inline bool PackageSource::_internal_has_r_mirror() const { + return source_case() == kRMirror; +} +inline bool PackageSource::has_r_mirror() const { + return _internal_has_r_mirror(); +} +inline void PackageSource::set_has_r_mirror() { + _impl_._oneof_case_[0] = kRMirror; +} +inline void PackageSource::clear_r_mirror() { + if (_internal_has_r_mirror()) { + _impl_.source_.r_mirror_.Destroy(); + clear_has_source(); + } +} +inline const std::string& PackageSource::r_mirror() const { + // @@protoc_insertion_point(field_get:rsh.protocol.PackageSource.r_mirror) + return _internal_r_mirror(); +} +template +inline void PackageSource::set_r_mirror(ArgT0&& arg0, ArgT... args) { + if (!_internal_has_r_mirror()) { + clear_source(); + set_has_r_mirror(); + _impl_.source_.r_mirror_.InitDefault(); + } + _impl_.source_.r_mirror_.Set( static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:rsh.protocol.PackageSource.r_mirror) +} +inline std::string* PackageSource::mutable_r_mirror() { + std::string* _s = _internal_mutable_r_mirror(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.PackageSource.r_mirror) + return _s; +} +inline const std::string& PackageSource::_internal_r_mirror() const { + if (_internal_has_r_mirror()) { + return _impl_.source_.r_mirror_.Get(); + } + return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); +} +inline void PackageSource::_internal_set_r_mirror(const std::string& value) { + if (!_internal_has_r_mirror()) { + clear_source(); + set_has_r_mirror(); + _impl_.source_.r_mirror_.InitDefault(); + } + _impl_.source_.r_mirror_.Set(value, GetArenaForAllocation()); +} +inline std::string* PackageSource::_internal_mutable_r_mirror() { + if (!_internal_has_r_mirror()) { + clear_source(); + set_has_r_mirror(); + _impl_.source_.r_mirror_.InitDefault(); + } + return _impl_.source_.r_mirror_.Mutable( GetArenaForAllocation()); +} +inline std::string* PackageSource::release_r_mirror() { + // @@protoc_insertion_point(field_release:rsh.protocol.PackageSource.r_mirror) + if (_internal_has_r_mirror()) { + clear_has_source(); + return _impl_.source_.r_mirror_.Release(); + } else { + return nullptr; + } +} +inline void PackageSource::set_allocated_r_mirror(std::string* r_mirror) { + if (has_source()) { + clear_source(); + } + if (r_mirror != nullptr) { + set_has_r_mirror(); + _impl_.source_.r_mirror_.InitAllocated(r_mirror, GetArenaForAllocation()); + } + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.PackageSource.r_mirror) +} + +// string github_url = 3; +inline bool PackageSource::_internal_has_github_url() const { + return source_case() == kGithubUrl; +} +inline bool PackageSource::has_github_url() const { + return _internal_has_github_url(); +} +inline void PackageSource::set_has_github_url() { + _impl_._oneof_case_[0] = kGithubUrl; +} +inline void PackageSource::clear_github_url() { + if (_internal_has_github_url()) { + _impl_.source_.github_url_.Destroy(); + clear_has_source(); + } +} +inline const std::string& PackageSource::github_url() const { + // @@protoc_insertion_point(field_get:rsh.protocol.PackageSource.github_url) + return _internal_github_url(); +} +template +inline void PackageSource::set_github_url(ArgT0&& arg0, ArgT... args) { + if (!_internal_has_github_url()) { + clear_source(); + set_has_github_url(); + _impl_.source_.github_url_.InitDefault(); + } + _impl_.source_.github_url_.Set( static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:rsh.protocol.PackageSource.github_url) +} +inline std::string* PackageSource::mutable_github_url() { + std::string* _s = _internal_mutable_github_url(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.PackageSource.github_url) + return _s; +} +inline const std::string& PackageSource::_internal_github_url() const { + if (_internal_has_github_url()) { + return _impl_.source_.github_url_.Get(); + } + return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); +} +inline void PackageSource::_internal_set_github_url(const std::string& value) { + if (!_internal_has_github_url()) { + clear_source(); + set_has_github_url(); + _impl_.source_.github_url_.InitDefault(); + } + _impl_.source_.github_url_.Set(value, GetArenaForAllocation()); +} +inline std::string* PackageSource::_internal_mutable_github_url() { + if (!_internal_has_github_url()) { + clear_source(); + set_has_github_url(); + _impl_.source_.github_url_.InitDefault(); + } + return _impl_.source_.github_url_.Mutable( GetArenaForAllocation()); +} +inline std::string* PackageSource::release_github_url() { + // @@protoc_insertion_point(field_release:rsh.protocol.PackageSource.github_url) + if (_internal_has_github_url()) { + clear_has_source(); + return _impl_.source_.github_url_.Release(); + } else { + return nullptr; + } +} +inline void PackageSource::set_allocated_github_url(std::string* github_url) { + if (has_source()) { + clear_source(); + } + if (github_url != nullptr) { + set_has_github_url(); + _impl_.source_.github_url_.InitAllocated(github_url, GetArenaForAllocation()); + } + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.PackageSource.github_url) +} + +inline bool PackageSource::has_source() const { + return source_case() != SOURCE_NOT_SET; +} +inline void PackageSource::clear_has_source() { + _impl_._oneof_case_[0] = SOURCE_NOT_SET; +} +inline PackageSource::SourceCase PackageSource::source_case() const { + return PackageSource::SourceCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Package + +// string name = 1; +inline void Package::clear_name() { + _impl_.name_.ClearToEmpty(); +} +inline const std::string& Package::name() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Package.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Package::set_name(ArgT0&& arg0, ArgT... args) { + + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:rsh.protocol.Package.name) +} +inline std::string* Package::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.Package.name) + return _s; +} +inline const std::string& Package::_internal_name() const { + return _impl_.name_.Get(); +} +inline void Package::_internal_set_name(const std::string& value) { + + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Package::_internal_mutable_name() { + + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* Package::release_name() { + // @@protoc_insertion_point(field_release:rsh.protocol.Package.name) + return _impl_.name_.Release(); +} +inline void Package::set_allocated_name(std::string* name) { + if (name != nullptr) { + + } else { + + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.Package.name) +} + +// .rsh.protocol.Version version = 2; +inline bool Package::_internal_has_version() const { + return this != internal_default_instance() && _impl_.version_ != nullptr; +} +inline bool Package::has_version() const { + return _internal_has_version(); +} +inline void Package::clear_version() { + if (GetArenaForAllocation() == nullptr && _impl_.version_ != nullptr) { + delete _impl_.version_; + } + _impl_.version_ = nullptr; +} +inline const ::rsh::protocol::Version& Package::_internal_version() const { + const ::rsh::protocol::Version* p = _impl_.version_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_Version_default_instance_); +} +inline const ::rsh::protocol::Version& Package::version() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Package.version) + return _internal_version(); +} +inline void Package::unsafe_arena_set_allocated_version( + ::rsh::protocol::Version* version) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.version_); + } + _impl_.version_ = version; + if (version) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.Package.version) +} +inline ::rsh::protocol::Version* Package::release_version() { + + ::rsh::protocol::Version* temp = _impl_.version_; + _impl_.version_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::Version* Package::unsafe_arena_release_version() { + // @@protoc_insertion_point(field_release:rsh.protocol.Package.version) + + ::rsh::protocol::Version* temp = _impl_.version_; + _impl_.version_ = nullptr; + return temp; +} +inline ::rsh::protocol::Version* Package::_internal_mutable_version() { + + if (_impl_.version_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::Version>(GetArenaForAllocation()); + _impl_.version_ = p; + } + return _impl_.version_; +} +inline ::rsh::protocol::Version* Package::mutable_version() { + ::rsh::protocol::Version* _msg = _internal_mutable_version(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.Package.version) + return _msg; +} +inline void Package::set_allocated_version(::rsh::protocol::Version* version) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.version_; + } + if (version) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(version); + if (message_arena != submessage_arena) { + version = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, version, submessage_arena); + } + + } else { + + } + _impl_.version_ = version; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.Package.version) +} + +// repeated uint64 function_hashes = 4; +inline int Package::_internal_function_hashes_size() const { + return _impl_.function_hashes_.size(); +} +inline int Package::function_hashes_size() const { + return _internal_function_hashes_size(); +} +inline void Package::clear_function_hashes() { + _impl_.function_hashes_.Clear(); +} +inline uint64_t Package::_internal_function_hashes(int index) const { + return _impl_.function_hashes_.Get(index); +} +inline uint64_t Package::function_hashes(int index) const { + // @@protoc_insertion_point(field_get:rsh.protocol.Package.function_hashes) + return _internal_function_hashes(index); +} +inline void Package::set_function_hashes(int index, uint64_t value) { + _impl_.function_hashes_.Set(index, value); + // @@protoc_insertion_point(field_set:rsh.protocol.Package.function_hashes) +} +inline void Package::_internal_add_function_hashes(uint64_t value) { + _impl_.function_hashes_.Add(value); +} +inline void Package::add_function_hashes(uint64_t value) { + _internal_add_function_hashes(value); + // @@protoc_insertion_point(field_add:rsh.protocol.Package.function_hashes) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& +Package::_internal_function_hashes() const { + return _impl_.function_hashes_; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& +Package::function_hashes() const { + // @@protoc_insertion_point(field_list:rsh.protocol.Package.function_hashes) + return _internal_function_hashes(); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* +Package::_internal_mutable_function_hashes() { + return &_impl_.function_hashes_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* +Package::mutable_function_hashes() { + // @@protoc_insertion_point(field_mutable_list:rsh.protocol.Package.function_hashes) + return _internal_mutable_function_hashes(); +} + +// optional .rsh.protocol.PackageSource source = 5; +inline bool Package::_internal_has_source() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.source_ != nullptr); + return value; +} +inline bool Package::has_source() const { + return _internal_has_source(); +} +inline void Package::clear_source() { + if (_impl_.source_ != nullptr) _impl_.source_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::rsh::protocol::PackageSource& Package::_internal_source() const { + const ::rsh::protocol::PackageSource* p = _impl_.source_; + return p != nullptr ? *p : reinterpret_cast( + ::rsh::protocol::_PackageSource_default_instance_); +} +inline const ::rsh::protocol::PackageSource& Package::source() const { + // @@protoc_insertion_point(field_get:rsh.protocol.Package.source) + return _internal_source(); +} +inline void Package::unsafe_arena_set_allocated_source( + ::rsh::protocol::PackageSource* source) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.source_); + } + _impl_.source_ = source; + if (source) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.protocol.Package.source) +} +inline ::rsh::protocol::PackageSource* Package::release_source() { + _impl_._has_bits_[0] &= ~0x00000001u; + ::rsh::protocol::PackageSource* temp = _impl_.source_; + _impl_.source_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::rsh::protocol::PackageSource* Package::unsafe_arena_release_source() { + // @@protoc_insertion_point(field_release:rsh.protocol.Package.source) + _impl_._has_bits_[0] &= ~0x00000001u; + ::rsh::protocol::PackageSource* temp = _impl_.source_; + _impl_.source_ = nullptr; + return temp; +} +inline ::rsh::protocol::PackageSource* Package::_internal_mutable_source() { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.source_ == nullptr) { + auto* p = CreateMaybeMessage<::rsh::protocol::PackageSource>(GetArenaForAllocation()); + _impl_.source_ = p; + } + return _impl_.source_; +} +inline ::rsh::protocol::PackageSource* Package::mutable_source() { + ::rsh::protocol::PackageSource* _msg = _internal_mutable_source(); + // @@protoc_insertion_point(field_mutable:rsh.protocol.Package.source) + return _msg; +} +inline void Package::set_allocated_source(::rsh::protocol::PackageSource* source) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.source_; + } + if (source) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(source); + if (message_arena != submessage_arena) { + source = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, source, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.source_ = source; + // @@protoc_insertion_point(field_set_allocated:rsh.protocol.Package.source) +} + +// ------------------------------------------------------------------- + +// PackageRequest + +// uint64 hash = 1; +inline void PackageRequest::clear_hash() { + _impl_.hash_ = uint64_t{0u}; +} +inline uint64_t PackageRequest::_internal_hash() const { + return _impl_.hash_; +} +inline uint64_t PackageRequest::hash() const { + // @@protoc_insertion_point(field_get:rsh.protocol.PackageRequest.hash) + return _internal_hash(); +} +inline void PackageRequest::_internal_set_hash(uint64_t value) { + + _impl_.hash_ = value; +} +inline void PackageRequest::set_hash(uint64_t value) { + _internal_set_hash(value); + // @@protoc_insertion_point(field_set:rsh.protocol.PackageRequest.hash) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace protocol +} // namespace rsh + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::rsh::protocol::Tier> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::rsh::protocol::Tier>() { + return ::rsh::protocol::Tier_descriptor(); +} +template <> struct is_proto_enum< ::rsh::protocol::TestLattice> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::rsh::protocol::TestLattice>() { + return ::rsh::protocol::TestLattice_descriptor(); +} +template <> struct is_proto_enum< ::rsh::protocol::Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::rsh::protocol::Type>() { + return ::rsh::protocol::Type_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_messages_2eproto diff --git a/client/rsh/src/protocol.pb.cc b/client/rsh/src/protocol.pb.cc deleted file mode 100644 index a61c66dc7..000000000 --- a/client/rsh/src/protocol.pb.cc +++ /dev/null @@ -1,1771 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -#include "protocol.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include - -PROTOBUF_PRAGMA_INIT_SEG - -namespace _pb = ::PROTOBUF_NAMESPACE_ID; -namespace _pbi = _pb::internal; - -namespace rsh { -namespace server { -namespace protocol { -PROTOBUF_CONSTEXPR Request::Request( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.payload_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{}} {} -struct RequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RequestDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~RequestDefaultTypeInternal() {} - union { - Request _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RequestDefaultTypeInternal _Request_default_instance_; -PROTOBUF_CONSTEXPR HandshakeRequest::HandshakeRequest( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.packages_)*/{} - , /*decltype(_impl_.rsh_version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.r_version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.platform_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_._cached_size_)*/{}} {} -struct HandshakeRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR HandshakeRequestDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~HandshakeRequestDefaultTypeInternal() {} - union { - HandshakeRequest _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HandshakeRequestDefaultTypeInternal _HandshakeRequest_default_instance_; -PROTOBUF_CONSTEXPR CompileRequest::CompileRequest( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.closure_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.bc_optimization_)*/0u - , /*decltype(_impl_.cc_optimization_)*/0u - , /*decltype(_impl_._cached_size_)*/{}} {} -struct CompileRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR CompileRequestDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~CompileRequestDefaultTypeInternal() {} - union { - CompileRequest _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompileRequestDefaultTypeInternal _CompileRequest_default_instance_; -PROTOBUF_CONSTEXPR CompiledFunction::CompiledFunction( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.native_code_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.constants_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_._cached_size_)*/{}} {} -struct CompiledFunctionDefaultTypeInternal { - PROTOBUF_CONSTEXPR CompiledFunctionDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~CompiledFunctionDefaultTypeInternal() {} - union { - CompiledFunction _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompiledFunctionDefaultTypeInternal _CompiledFunction_default_instance_; -PROTOBUF_CONSTEXPR CompileResponse::CompileResponse( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.data_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{}} {} -struct CompileResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR CompileResponseDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~CompileResponseDefaultTypeInternal() {} - union { - CompileResponse _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CompileResponseDefaultTypeInternal _CompileResponse_default_instance_; -} // namespace protocol -} // namespace server -} // namespace rsh -static ::_pb::Metadata file_level_metadata_protocol_2eproto[5]; -static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_protocol_2eproto = nullptr; -static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_protocol_2eproto = nullptr; - -const uint32_t TableStruct_protocol_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::Request, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::Request, _impl_._oneof_case_[0]), - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::Request, _impl_.payload_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::HandshakeRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::HandshakeRequest, _impl_.rsh_version_), - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::HandshakeRequest, _impl_.r_version_), - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::HandshakeRequest, _impl_.platform_), - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::HandshakeRequest, _impl_.packages_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompileRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompileRequest, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompileRequest, _impl_.closure_), - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompileRequest, _impl_.bc_optimization_), - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompileRequest, _impl_.cc_optimization_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompiledFunction, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompiledFunction, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompiledFunction, _impl_.native_code_), - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompiledFunction, _impl_.constants_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompileResponse, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompileResponse, _impl_._oneof_case_[0]), - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::rsh::server::protocol::CompileResponse, _impl_.data_), -}; -static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::rsh::server::protocol::Request)}, - { 9, -1, -1, sizeof(::rsh::server::protocol::HandshakeRequest)}, - { 19, -1, -1, sizeof(::rsh::server::protocol::CompileRequest)}, - { 29, -1, -1, sizeof(::rsh::server::protocol::CompiledFunction)}, - { 38, -1, -1, sizeof(::rsh::server::protocol::CompileResponse)}, -}; - -static const ::_pb::Message* const file_default_instances[] = { - &::rsh::server::protocol::_Request_default_instance_._instance, - &::rsh::server::protocol::_HandshakeRequest_default_instance_._instance, - &::rsh::server::protocol::_CompileRequest_default_instance_._instance, - &::rsh::server::protocol::_CompiledFunction_default_instance_._instance, - &::rsh::server::protocol::_CompileResponse_default_instance_._instance, -}; - -const char descriptor_table_protodef_protocol_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\016protocol.proto\022\023rsh.server.protocol\"\210\001" - "\n\007Request\022:\n\thandshake\030\001 \001(\0132%.rsh.serve" - "r.protocol.HandshakeRequestH\000\0226\n\007compile" - "\030\002 \001(\0132#.rsh.server.protocol.CompileRequ" - "estH\000B\t\n\007payload\"^\n\020HandshakeRequest\022\023\n\013" - "Rsh_version\030\001 \001(\t\022\021\n\tR_version\030\002 \001(\t\022\020\n\010" - "platform\030\003 \001(\t\022\020\n\010packages\030\004 \003(\t\"a\n\016Comp" - "ileRequest\022\014\n\004name\030\002 \001(\t\022\017\n\007closure\030\003 \001(" - "\014\022\027\n\017bc_optimization\030\004 \001(\r\022\027\n\017cc_optimiz" - "ation\030\005 \001(\r\"H\n\020CompiledFunction\022\014\n\004name\030" - "\002 \001(\t\022\023\n\013native_code\030\003 \001(\014\022\021\n\tconstants\030" - "\004 \001(\014\"e\n\017CompileResponse\022\021\n\007failure\030\002 \001(" - "\tH\000\0227\n\006result\030\003 \001(\0132%.rsh.server.protoco" - "l.CompiledFunctionH\000B\006\n\004dataB\036\n\032org.prlp" - "rg.server.protocolP\001b\006proto3" - ; -static ::_pbi::once_flag descriptor_table_protocol_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_protocol_2eproto = { - false, false, 588, descriptor_table_protodef_protocol_2eproto, - "protocol.proto", - &descriptor_table_protocol_2eproto_once, nullptr, 0, 5, - schemas, file_default_instances, TableStruct_protocol_2eproto::offsets, - file_level_metadata_protocol_2eproto, file_level_enum_descriptors_protocol_2eproto, - file_level_service_descriptors_protocol_2eproto, -}; -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_protocol_2eproto_getter() { - return &descriptor_table_protocol_2eproto; -} - -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_protocol_2eproto(&descriptor_table_protocol_2eproto); -namespace rsh { -namespace server { -namespace protocol { - -// =================================================================== - -class Request::_Internal { - public: - static const ::rsh::server::protocol::HandshakeRequest& handshake(const Request* msg); - static const ::rsh::server::protocol::CompileRequest& compile(const Request* msg); -}; - -const ::rsh::server::protocol::HandshakeRequest& -Request::_Internal::handshake(const Request* msg) { - return *msg->_impl_.payload_.handshake_; -} -const ::rsh::server::protocol::CompileRequest& -Request::_Internal::compile(const Request* msg) { - return *msg->_impl_.payload_.compile_; -} -void Request::set_allocated_handshake(::rsh::server::protocol::HandshakeRequest* handshake) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - clear_payload(); - if (handshake) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(handshake); - if (message_arena != submessage_arena) { - handshake = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, handshake, submessage_arena); - } - set_has_handshake(); - _impl_.payload_.handshake_ = handshake; - } - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.Request.handshake) -} -void Request::set_allocated_compile(::rsh::server::protocol::CompileRequest* compile) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - clear_payload(); - if (compile) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(compile); - if (message_arena != submessage_arena) { - compile = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, compile, submessage_arena); - } - set_has_compile(); - _impl_.payload_.compile_ = compile; - } - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.Request.compile) -} -Request::Request(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:rsh.server.protocol.Request) -} -Request::Request(const Request& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - Request* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.payload_){} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - clear_has_payload(); - switch (from.payload_case()) { - case kHandshake: { - _this->_internal_mutable_handshake()->::rsh::server::protocol::HandshakeRequest::MergeFrom( - from._internal_handshake()); - break; - } - case kCompile: { - _this->_internal_mutable_compile()->::rsh::server::protocol::CompileRequest::MergeFrom( - from._internal_compile()); - break; - } - case PAYLOAD_NOT_SET: { - break; - } - } - // @@protoc_insertion_point(copy_constructor:rsh.server.protocol.Request) -} - -inline void Request::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.payload_){} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{} - }; - clear_has_payload(); -} - -Request::~Request() { - // @@protoc_insertion_point(destructor:rsh.server.protocol.Request) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void Request::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (has_payload()) { - clear_payload(); - } -} - -void Request::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void Request::clear_payload() { -// @@protoc_insertion_point(one_of_clear_start:rsh.server.protocol.Request) - switch (payload_case()) { - case kHandshake: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.payload_.handshake_; - } - break; - } - case kCompile: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.payload_.compile_; - } - break; - } - case PAYLOAD_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = PAYLOAD_NOT_SET; -} - - -void Request::Clear() { -// @@protoc_insertion_point(message_clear_start:rsh.server.protocol.Request) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - clear_payload(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Request::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); - switch (tag >> 3) { - // .rsh.server.protocol.HandshakeRequest handshake = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_handshake(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // .rsh.server.protocol.CompileRequest compile = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_compile(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* Request::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:rsh.server.protocol.Request) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // .rsh.server.protocol.HandshakeRequest handshake = 1; - if (_internal_has_handshake()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::handshake(this), - _Internal::handshake(this).GetCachedSize(), target, stream); - } - - // .rsh.server.protocol.CompileRequest compile = 2; - if (_internal_has_compile()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::compile(this), - _Internal::compile(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:rsh.server.protocol.Request) - return target; -} - -size_t Request::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:rsh.server.protocol.Request) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - switch (payload_case()) { - // .rsh.server.protocol.HandshakeRequest handshake = 1; - case kHandshake: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.payload_.handshake_); - break; - } - // .rsh.server.protocol.CompileRequest compile = 2; - case kCompile: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.payload_.compile_); - break; - } - case PAYLOAD_NOT_SET: { - break; - } - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Request::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Request::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Request::GetClassData() const { return &_class_data_; } - - -void Request::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:rsh.server.protocol.Request) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - switch (from.payload_case()) { - case kHandshake: { - _this->_internal_mutable_handshake()->::rsh::server::protocol::HandshakeRequest::MergeFrom( - from._internal_handshake()); - break; - } - case kCompile: { - _this->_internal_mutable_compile()->::rsh::server::protocol::CompileRequest::MergeFrom( - from._internal_compile()); - break; - } - case PAYLOAD_NOT_SET: { - break; - } - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void Request::CopyFrom(const Request& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:rsh.server.protocol.Request) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Request::IsInitialized() const { - return true; -} - -void Request::InternalSwap(Request* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.payload_, other->_impl_.payload_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Request::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_protocol_2eproto_getter, &descriptor_table_protocol_2eproto_once, - file_level_metadata_protocol_2eproto[0]); -} - -// =================================================================== - -class HandshakeRequest::_Internal { - public: -}; - -HandshakeRequest::HandshakeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:rsh.server.protocol.HandshakeRequest) -} -HandshakeRequest::HandshakeRequest(const HandshakeRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - HandshakeRequest* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.packages_){from._impl_.packages_} - , decltype(_impl_.rsh_version_){} - , decltype(_impl_.r_version_){} - , decltype(_impl_.platform_){} - , /*decltype(_impl_._cached_size_)*/{}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.rsh_version_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rsh_version_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_rsh_version().empty()) { - _this->_impl_.rsh_version_.Set(from._internal_rsh_version(), - _this->GetArenaForAllocation()); - } - _impl_.r_version_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.r_version_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_r_version().empty()) { - _this->_impl_.r_version_.Set(from._internal_r_version(), - _this->GetArenaForAllocation()); - } - _impl_.platform_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.platform_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_platform().empty()) { - _this->_impl_.platform_.Set(from._internal_platform(), - _this->GetArenaForAllocation()); - } - // @@protoc_insertion_point(copy_constructor:rsh.server.protocol.HandshakeRequest) -} - -inline void HandshakeRequest::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.packages_){arena} - , decltype(_impl_.rsh_version_){} - , decltype(_impl_.r_version_){} - , decltype(_impl_.platform_){} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.rsh_version_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.rsh_version_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.r_version_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.r_version_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.platform_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.platform_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} - -HandshakeRequest::~HandshakeRequest() { - // @@protoc_insertion_point(destructor:rsh.server.protocol.HandshakeRequest) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void HandshakeRequest::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.packages_.~RepeatedPtrField(); - _impl_.rsh_version_.Destroy(); - _impl_.r_version_.Destroy(); - _impl_.platform_.Destroy(); -} - -void HandshakeRequest::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void HandshakeRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:rsh.server.protocol.HandshakeRequest) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.packages_.Clear(); - _impl_.rsh_version_.ClearToEmpty(); - _impl_.r_version_.ClearToEmpty(); - _impl_.platform_.ClearToEmpty(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* HandshakeRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); - switch (tag >> 3) { - // string Rsh_version = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - auto str = _internal_mutable_rsh_version(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "rsh.server.protocol.HandshakeRequest.Rsh_version")); - } else - goto handle_unusual; - continue; - // string R_version = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_r_version(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "rsh.server.protocol.HandshakeRequest.R_version")); - } else - goto handle_unusual; - continue; - // string platform = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_platform(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "rsh.server.protocol.HandshakeRequest.platform")); - } else - goto handle_unusual; - continue; - // repeated string packages = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_packages(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "rsh.server.protocol.HandshakeRequest.packages")); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* HandshakeRequest::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:rsh.server.protocol.HandshakeRequest) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // string Rsh_version = 1; - if (!this->_internal_rsh_version().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_rsh_version().data(), static_cast(this->_internal_rsh_version().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "rsh.server.protocol.HandshakeRequest.Rsh_version"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_rsh_version(), target); - } - - // string R_version = 2; - if (!this->_internal_r_version().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_r_version().data(), static_cast(this->_internal_r_version().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "rsh.server.protocol.HandshakeRequest.R_version"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_r_version(), target); - } - - // string platform = 3; - if (!this->_internal_platform().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_platform().data(), static_cast(this->_internal_platform().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "rsh.server.protocol.HandshakeRequest.platform"); - target = stream->WriteStringMaybeAliased( - 3, this->_internal_platform(), target); - } - - // repeated string packages = 4; - for (int i = 0, n = this->_internal_packages_size(); i < n; i++) { - const auto& s = this->_internal_packages(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "rsh.server.protocol.HandshakeRequest.packages"); - target = stream->WriteString(4, s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:rsh.server.protocol.HandshakeRequest) - return target; -} - -size_t HandshakeRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:rsh.server.protocol.HandshakeRequest) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string packages = 4; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.packages_.size()); - for (int i = 0, n = _impl_.packages_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - _impl_.packages_.Get(i)); - } - - // string Rsh_version = 1; - if (!this->_internal_rsh_version().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_rsh_version()); - } - - // string R_version = 2; - if (!this->_internal_r_version().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_r_version()); - } - - // string platform = 3; - if (!this->_internal_platform().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_platform()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData HandshakeRequest::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - HandshakeRequest::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*HandshakeRequest::GetClassData() const { return &_class_data_; } - - -void HandshakeRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:rsh.server.protocol.HandshakeRequest) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_impl_.packages_.MergeFrom(from._impl_.packages_); - if (!from._internal_rsh_version().empty()) { - _this->_internal_set_rsh_version(from._internal_rsh_version()); - } - if (!from._internal_r_version().empty()) { - _this->_internal_set_r_version(from._internal_r_version()); - } - if (!from._internal_platform().empty()) { - _this->_internal_set_platform(from._internal_platform()); - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void HandshakeRequest::CopyFrom(const HandshakeRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:rsh.server.protocol.HandshakeRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool HandshakeRequest::IsInitialized() const { - return true; -} - -void HandshakeRequest::InternalSwap(HandshakeRequest* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.packages_.InternalSwap(&other->_impl_.packages_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.rsh_version_, lhs_arena, - &other->_impl_.rsh_version_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.r_version_, lhs_arena, - &other->_impl_.r_version_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.platform_, lhs_arena, - &other->_impl_.platform_, rhs_arena - ); -} - -::PROTOBUF_NAMESPACE_ID::Metadata HandshakeRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_protocol_2eproto_getter, &descriptor_table_protocol_2eproto_once, - file_level_metadata_protocol_2eproto[1]); -} - -// =================================================================== - -class CompileRequest::_Internal { - public: -}; - -CompileRequest::CompileRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:rsh.server.protocol.CompileRequest) -} -CompileRequest::CompileRequest(const CompileRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - CompileRequest* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.name_){} - , decltype(_impl_.closure_){} - , decltype(_impl_.bc_optimization_){} - , decltype(_impl_.cc_optimization_){} - , /*decltype(_impl_._cached_size_)*/{}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_name().empty()) { - _this->_impl_.name_.Set(from._internal_name(), - _this->GetArenaForAllocation()); - } - _impl_.closure_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.closure_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_closure().empty()) { - _this->_impl_.closure_.Set(from._internal_closure(), - _this->GetArenaForAllocation()); - } - ::memcpy(&_impl_.bc_optimization_, &from._impl_.bc_optimization_, - static_cast(reinterpret_cast(&_impl_.cc_optimization_) - - reinterpret_cast(&_impl_.bc_optimization_)) + sizeof(_impl_.cc_optimization_)); - // @@protoc_insertion_point(copy_constructor:rsh.server.protocol.CompileRequest) -} - -inline void CompileRequest::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.name_){} - , decltype(_impl_.closure_){} - , decltype(_impl_.bc_optimization_){0u} - , decltype(_impl_.cc_optimization_){0u} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.closure_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.closure_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} - -CompileRequest::~CompileRequest() { - // @@protoc_insertion_point(destructor:rsh.server.protocol.CompileRequest) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void CompileRequest::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.name_.Destroy(); - _impl_.closure_.Destroy(); -} - -void CompileRequest::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void CompileRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:rsh.server.protocol.CompileRequest) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.name_.ClearToEmpty(); - _impl_.closure_.ClearToEmpty(); - ::memset(&_impl_.bc_optimization_, 0, static_cast( - reinterpret_cast(&_impl_.cc_optimization_) - - reinterpret_cast(&_impl_.bc_optimization_)) + sizeof(_impl_.cc_optimization_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* CompileRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); - switch (tag >> 3) { - // string name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_name(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "rsh.server.protocol.CompileRequest.name")); - } else - goto handle_unusual; - continue; - // bytes closure = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_closure(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // uint32 bc_optimization = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.bc_optimization_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // uint32 cc_optimization = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _impl_.cc_optimization_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* CompileRequest::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:rsh.server.protocol.CompileRequest) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // string name = 2; - if (!this->_internal_name().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "rsh.server.protocol.CompileRequest.name"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_name(), target); - } - - // bytes closure = 3; - if (!this->_internal_closure().empty()) { - target = stream->WriteBytesMaybeAliased( - 3, this->_internal_closure(), target); - } - - // uint32 bc_optimization = 4; - if (this->_internal_bc_optimization() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_bc_optimization(), target); - } - - // uint32 cc_optimization = 5; - if (this->_internal_cc_optimization() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_cc_optimization(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:rsh.server.protocol.CompileRequest) - return target; -} - -size_t CompileRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:rsh.server.protocol.CompileRequest) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string name = 2; - if (!this->_internal_name().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // bytes closure = 3; - if (!this->_internal_closure().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_closure()); - } - - // uint32 bc_optimization = 4; - if (this->_internal_bc_optimization() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_bc_optimization()); - } - - // uint32 cc_optimization = 5; - if (this->_internal_cc_optimization() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_cc_optimization()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CompileRequest::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - CompileRequest::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CompileRequest::GetClassData() const { return &_class_data_; } - - -void CompileRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:rsh.server.protocol.CompileRequest) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_name().empty()) { - _this->_internal_set_name(from._internal_name()); - } - if (!from._internal_closure().empty()) { - _this->_internal_set_closure(from._internal_closure()); - } - if (from._internal_bc_optimization() != 0) { - _this->_internal_set_bc_optimization(from._internal_bc_optimization()); - } - if (from._internal_cc_optimization() != 0) { - _this->_internal_set_cc_optimization(from._internal_cc_optimization()); - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void CompileRequest::CopyFrom(const CompileRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:rsh.server.protocol.CompileRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CompileRequest::IsInitialized() const { - return true; -} - -void CompileRequest::InternalSwap(CompileRequest* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.closure_, lhs_arena, - &other->_impl_.closure_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(CompileRequest, _impl_.cc_optimization_) - + sizeof(CompileRequest::_impl_.cc_optimization_) - - PROTOBUF_FIELD_OFFSET(CompileRequest, _impl_.bc_optimization_)>( - reinterpret_cast(&_impl_.bc_optimization_), - reinterpret_cast(&other->_impl_.bc_optimization_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CompileRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_protocol_2eproto_getter, &descriptor_table_protocol_2eproto_once, - file_level_metadata_protocol_2eproto[2]); -} - -// =================================================================== - -class CompiledFunction::_Internal { - public: -}; - -CompiledFunction::CompiledFunction(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:rsh.server.protocol.CompiledFunction) -} -CompiledFunction::CompiledFunction(const CompiledFunction& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - CompiledFunction* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.name_){} - , decltype(_impl_.native_code_){} - , decltype(_impl_.constants_){} - , /*decltype(_impl_._cached_size_)*/{}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_name().empty()) { - _this->_impl_.name_.Set(from._internal_name(), - _this->GetArenaForAllocation()); - } - _impl_.native_code_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.native_code_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_native_code().empty()) { - _this->_impl_.native_code_.Set(from._internal_native_code(), - _this->GetArenaForAllocation()); - } - _impl_.constants_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.constants_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (!from._internal_constants().empty()) { - _this->_impl_.constants_.Set(from._internal_constants(), - _this->GetArenaForAllocation()); - } - // @@protoc_insertion_point(copy_constructor:rsh.server.protocol.CompiledFunction) -} - -inline void CompiledFunction::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.name_){} - , decltype(_impl_.native_code_){} - , decltype(_impl_.constants_){} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.native_code_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.native_code_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.constants_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.constants_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING -} - -CompiledFunction::~CompiledFunction() { - // @@protoc_insertion_point(destructor:rsh.server.protocol.CompiledFunction) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void CompiledFunction::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.name_.Destroy(); - _impl_.native_code_.Destroy(); - _impl_.constants_.Destroy(); -} - -void CompiledFunction::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void CompiledFunction::Clear() { -// @@protoc_insertion_point(message_clear_start:rsh.server.protocol.CompiledFunction) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.name_.ClearToEmpty(); - _impl_.native_code_.ClearToEmpty(); - _impl_.constants_.ClearToEmpty(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* CompiledFunction::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); - switch (tag >> 3) { - // string name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_name(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "rsh.server.protocol.CompiledFunction.name")); - } else - goto handle_unusual; - continue; - // bytes native_code = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - auto str = _internal_mutable_native_code(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // bytes constants = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - auto str = _internal_mutable_constants(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* CompiledFunction::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:rsh.server.protocol.CompiledFunction) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // string name = 2; - if (!this->_internal_name().empty()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "rsh.server.protocol.CompiledFunction.name"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_name(), target); - } - - // bytes native_code = 3; - if (!this->_internal_native_code().empty()) { - target = stream->WriteBytesMaybeAliased( - 3, this->_internal_native_code(), target); - } - - // bytes constants = 4; - if (!this->_internal_constants().empty()) { - target = stream->WriteBytesMaybeAliased( - 4, this->_internal_constants(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:rsh.server.protocol.CompiledFunction) - return target; -} - -size_t CompiledFunction::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:rsh.server.protocol.CompiledFunction) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string name = 2; - if (!this->_internal_name().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // bytes native_code = 3; - if (!this->_internal_native_code().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_native_code()); - } - - // bytes constants = 4; - if (!this->_internal_constants().empty()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_constants()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CompiledFunction::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - CompiledFunction::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CompiledFunction::GetClassData() const { return &_class_data_; } - - -void CompiledFunction::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:rsh.server.protocol.CompiledFunction) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_name().empty()) { - _this->_internal_set_name(from._internal_name()); - } - if (!from._internal_native_code().empty()) { - _this->_internal_set_native_code(from._internal_native_code()); - } - if (!from._internal_constants().empty()) { - _this->_internal_set_constants(from._internal_constants()); - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void CompiledFunction::CopyFrom(const CompiledFunction& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:rsh.server.protocol.CompiledFunction) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CompiledFunction::IsInitialized() const { - return true; -} - -void CompiledFunction::InternalSwap(CompiledFunction* other) { - using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.native_code_, lhs_arena, - &other->_impl_.native_code_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.constants_, lhs_arena, - &other->_impl_.constants_, rhs_arena - ); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CompiledFunction::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_protocol_2eproto_getter, &descriptor_table_protocol_2eproto_once, - file_level_metadata_protocol_2eproto[3]); -} - -// =================================================================== - -class CompileResponse::_Internal { - public: - static const ::rsh::server::protocol::CompiledFunction& result(const CompileResponse* msg); -}; - -const ::rsh::server::protocol::CompiledFunction& -CompileResponse::_Internal::result(const CompileResponse* msg) { - return *msg->_impl_.data_.result_; -} -void CompileResponse::set_allocated_result(::rsh::server::protocol::CompiledFunction* result) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - clear_data(); - if (result) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(result); - if (message_arena != submessage_arena) { - result = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, result, submessage_arena); - } - set_has_result(); - _impl_.data_.result_ = result; - } - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.CompileResponse.result) -} -CompileResponse::CompileResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:rsh.server.protocol.CompileResponse) -} -CompileResponse::CompileResponse(const CompileResponse& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - CompileResponse* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.data_){} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - clear_has_data(); - switch (from.data_case()) { - case kFailure: { - _this->_internal_set_failure(from._internal_failure()); - break; - } - case kResult: { - _this->_internal_mutable_result()->::rsh::server::protocol::CompiledFunction::MergeFrom( - from._internal_result()); - break; - } - case DATA_NOT_SET: { - break; - } - } - // @@protoc_insertion_point(copy_constructor:rsh.server.protocol.CompileResponse) -} - -inline void CompileResponse::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.data_){} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{} - }; - clear_has_data(); -} - -CompileResponse::~CompileResponse() { - // @@protoc_insertion_point(destructor:rsh.server.protocol.CompileResponse) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } - SharedDtor(); -} - -inline void CompileResponse::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (has_data()) { - clear_data(); - } -} - -void CompileResponse::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); -} - -void CompileResponse::clear_data() { -// @@protoc_insertion_point(one_of_clear_start:rsh.server.protocol.CompileResponse) - switch (data_case()) { - case kFailure: { - _impl_.data_.failure_.Destroy(); - break; - } - case kResult: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.data_.result_; - } - break; - } - case DATA_NOT_SET: { - break; - } - } - _impl_._oneof_case_[0] = DATA_NOT_SET; -} - - -void CompileResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:rsh.server.protocol.CompileResponse) - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - clear_data(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* CompileResponse::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); - switch (tag >> 3) { - // string failure = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - auto str = _internal_mutable_failure(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "rsh.server.protocol.CompileResponse.failure")); - } else - goto handle_unusual; - continue; - // .rsh.server.protocol.CompiledFunction result = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_result(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - default: - goto handle_unusual; - } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - } // while -message_done: - return ptr; -failure: - ptr = nullptr; - goto message_done; -#undef CHK_ -} - -uint8_t* CompileResponse::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:rsh.server.protocol.CompileResponse) - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - // string failure = 2; - if (_internal_has_failure()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_failure().data(), static_cast(this->_internal_failure().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "rsh.server.protocol.CompileResponse.failure"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_failure(), target); - } - - // .rsh.server.protocol.CompiledFunction result = 3; - if (_internal_has_result()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::result(this), - _Internal::result(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:rsh.server.protocol.CompileResponse) - return target; -} - -size_t CompileResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:rsh.server.protocol.CompileResponse) - size_t total_size = 0; - - uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - switch (data_case()) { - // string failure = 2; - case kFailure: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_failure()); - break; - } - // .rsh.server.protocol.CompiledFunction result = 3; - case kResult: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.data_.result_); - break; - } - case DATA_NOT_SET: { - break; - } - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CompileResponse::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - CompileResponse::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CompileResponse::GetClassData() const { return &_class_data_; } - - -void CompileResponse::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:rsh.server.protocol.CompileResponse) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - switch (from.data_case()) { - case kFailure: { - _this->_internal_set_failure(from._internal_failure()); - break; - } - case kResult: { - _this->_internal_mutable_result()->::rsh::server::protocol::CompiledFunction::MergeFrom( - from._internal_result()); - break; - } - case DATA_NOT_SET: { - break; - } - } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); -} - -void CompileResponse::CopyFrom(const CompileResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:rsh.server.protocol.CompileResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CompileResponse::IsInitialized() const { - return true; -} - -void CompileResponse::InternalSwap(CompileResponse* other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.data_, other->_impl_.data_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CompileResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_protocol_2eproto_getter, &descriptor_table_protocol_2eproto_once, - file_level_metadata_protocol_2eproto[4]); -} - -// @@protoc_insertion_point(namespace_scope) -} // namespace protocol -} // namespace server -} // namespace rsh -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::rsh::server::protocol::Request* -Arena::CreateMaybeMessage< ::rsh::server::protocol::Request >(Arena* arena) { - return Arena::CreateMessageInternal< ::rsh::server::protocol::Request >(arena); -} -template<> PROTOBUF_NOINLINE ::rsh::server::protocol::HandshakeRequest* -Arena::CreateMaybeMessage< ::rsh::server::protocol::HandshakeRequest >(Arena* arena) { - return Arena::CreateMessageInternal< ::rsh::server::protocol::HandshakeRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::rsh::server::protocol::CompileRequest* -Arena::CreateMaybeMessage< ::rsh::server::protocol::CompileRequest >(Arena* arena) { - return Arena::CreateMessageInternal< ::rsh::server::protocol::CompileRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::rsh::server::protocol::CompiledFunction* -Arena::CreateMaybeMessage< ::rsh::server::protocol::CompiledFunction >(Arena* arena) { - return Arena::CreateMessageInternal< ::rsh::server::protocol::CompiledFunction >(arena); -} -template<> PROTOBUF_NOINLINE ::rsh::server::protocol::CompileResponse* -Arena::CreateMaybeMessage< ::rsh::server::protocol::CompileResponse >(Arena* arena) { - return Arena::CreateMessageInternal< ::rsh::server::protocol::CompileResponse >(arena); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/client/rsh/src/protocol.pb.h b/client/rsh/src/protocol.pb.h deleted file mode 100644 index 4c0c20f57..000000000 --- a/client/rsh/src/protocol.pb.h +++ /dev/null @@ -1,1938 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_protocol_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_protocol_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3021000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_protocol_2eproto -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct TableStruct_protocol_2eproto { - static const uint32_t offsets[]; -}; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_protocol_2eproto; -namespace rsh { -namespace server { -namespace protocol { -class CompileRequest; -struct CompileRequestDefaultTypeInternal; -extern CompileRequestDefaultTypeInternal _CompileRequest_default_instance_; -class CompileResponse; -struct CompileResponseDefaultTypeInternal; -extern CompileResponseDefaultTypeInternal _CompileResponse_default_instance_; -class CompiledFunction; -struct CompiledFunctionDefaultTypeInternal; -extern CompiledFunctionDefaultTypeInternal _CompiledFunction_default_instance_; -class HandshakeRequest; -struct HandshakeRequestDefaultTypeInternal; -extern HandshakeRequestDefaultTypeInternal _HandshakeRequest_default_instance_; -class Request; -struct RequestDefaultTypeInternal; -extern RequestDefaultTypeInternal _Request_default_instance_; -} // namespace protocol -} // namespace server -} // namespace rsh -PROTOBUF_NAMESPACE_OPEN -template<> ::rsh::server::protocol::CompileRequest* Arena::CreateMaybeMessage<::rsh::server::protocol::CompileRequest>(Arena*); -template<> ::rsh::server::protocol::CompileResponse* Arena::CreateMaybeMessage<::rsh::server::protocol::CompileResponse>(Arena*); -template<> ::rsh::server::protocol::CompiledFunction* Arena::CreateMaybeMessage<::rsh::server::protocol::CompiledFunction>(Arena*); -template<> ::rsh::server::protocol::HandshakeRequest* Arena::CreateMaybeMessage<::rsh::server::protocol::HandshakeRequest>(Arena*); -template<> ::rsh::server::protocol::Request* Arena::CreateMaybeMessage<::rsh::server::protocol::Request>(Arena*); -PROTOBUF_NAMESPACE_CLOSE -namespace rsh { -namespace server { -namespace protocol { - -// =================================================================== - -class Request final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.server.protocol.Request) */ { - public: - inline Request() : Request(nullptr) {} - ~Request() override; - explicit PROTOBUF_CONSTEXPR Request(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Request(const Request& from); - Request(Request&& from) noexcept - : Request() { - *this = ::std::move(from); - } - - inline Request& operator=(const Request& from) { - CopyFrom(from); - return *this; - } - inline Request& operator=(Request&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Request& default_instance() { - return *internal_default_instance(); - } - enum PayloadCase { - kHandshake = 1, - kCompile = 2, - PAYLOAD_NOT_SET = 0, - }; - - static inline const Request* internal_default_instance() { - return reinterpret_cast( - &_Request_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(Request& a, Request& b) { - a.Swap(&b); - } - inline void Swap(Request* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Request* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Request* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const Request& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Request& from) { - Request::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Request* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "rsh.server.protocol.Request"; - } - protected: - explicit Request(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kHandshakeFieldNumber = 1, - kCompileFieldNumber = 2, - }; - // .rsh.server.protocol.HandshakeRequest handshake = 1; - bool has_handshake() const; - private: - bool _internal_has_handshake() const; - public: - void clear_handshake(); - const ::rsh::server::protocol::HandshakeRequest& handshake() const; - PROTOBUF_NODISCARD ::rsh::server::protocol::HandshakeRequest* release_handshake(); - ::rsh::server::protocol::HandshakeRequest* mutable_handshake(); - void set_allocated_handshake(::rsh::server::protocol::HandshakeRequest* handshake); - private: - const ::rsh::server::protocol::HandshakeRequest& _internal_handshake() const; - ::rsh::server::protocol::HandshakeRequest* _internal_mutable_handshake(); - public: - void unsafe_arena_set_allocated_handshake( - ::rsh::server::protocol::HandshakeRequest* handshake); - ::rsh::server::protocol::HandshakeRequest* unsafe_arena_release_handshake(); - - // .rsh.server.protocol.CompileRequest compile = 2; - bool has_compile() const; - private: - bool _internal_has_compile() const; - public: - void clear_compile(); - const ::rsh::server::protocol::CompileRequest& compile() const; - PROTOBUF_NODISCARD ::rsh::server::protocol::CompileRequest* release_compile(); - ::rsh::server::protocol::CompileRequest* mutable_compile(); - void set_allocated_compile(::rsh::server::protocol::CompileRequest* compile); - private: - const ::rsh::server::protocol::CompileRequest& _internal_compile() const; - ::rsh::server::protocol::CompileRequest* _internal_mutable_compile(); - public: - void unsafe_arena_set_allocated_compile( - ::rsh::server::protocol::CompileRequest* compile); - ::rsh::server::protocol::CompileRequest* unsafe_arena_release_compile(); - - void clear_payload(); - PayloadCase payload_case() const; - // @@protoc_insertion_point(class_scope:rsh.server.protocol.Request) - private: - class _Internal; - void set_has_handshake(); - void set_has_compile(); - - inline bool has_payload() const; - inline void clear_has_payload(); - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - union PayloadUnion { - constexpr PayloadUnion() : _constinit_{} {} - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; - ::rsh::server::protocol::HandshakeRequest* handshake_; - ::rsh::server::protocol::CompileRequest* compile_; - } payload_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - uint32_t _oneof_case_[1]; - - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_protocol_2eproto; -}; -// ------------------------------------------------------------------- - -class HandshakeRequest final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.server.protocol.HandshakeRequest) */ { - public: - inline HandshakeRequest() : HandshakeRequest(nullptr) {} - ~HandshakeRequest() override; - explicit PROTOBUF_CONSTEXPR HandshakeRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - HandshakeRequest(const HandshakeRequest& from); - HandshakeRequest(HandshakeRequest&& from) noexcept - : HandshakeRequest() { - *this = ::std::move(from); - } - - inline HandshakeRequest& operator=(const HandshakeRequest& from) { - CopyFrom(from); - return *this; - } - inline HandshakeRequest& operator=(HandshakeRequest&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const HandshakeRequest& default_instance() { - return *internal_default_instance(); - } - static inline const HandshakeRequest* internal_default_instance() { - return reinterpret_cast( - &_HandshakeRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(HandshakeRequest& a, HandshakeRequest& b) { - a.Swap(&b); - } - inline void Swap(HandshakeRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(HandshakeRequest* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - HandshakeRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const HandshakeRequest& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const HandshakeRequest& from) { - HandshakeRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(HandshakeRequest* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "rsh.server.protocol.HandshakeRequest"; - } - protected: - explicit HandshakeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPackagesFieldNumber = 4, - kRshVersionFieldNumber = 1, - kRVersionFieldNumber = 2, - kPlatformFieldNumber = 3, - }; - // repeated string packages = 4; - int packages_size() const; - private: - int _internal_packages_size() const; - public: - void clear_packages(); - const std::string& packages(int index) const; - std::string* mutable_packages(int index); - void set_packages(int index, const std::string& value); - void set_packages(int index, std::string&& value); - void set_packages(int index, const char* value); - void set_packages(int index, const char* value, size_t size); - std::string* add_packages(); - void add_packages(const std::string& value); - void add_packages(std::string&& value); - void add_packages(const char* value); - void add_packages(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& packages() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_packages(); - private: - const std::string& _internal_packages(int index) const; - std::string* _internal_add_packages(); - public: - - // string Rsh_version = 1; - void clear_rsh_version(); - const std::string& rsh_version() const; - template - void set_rsh_version(ArgT0&& arg0, ArgT... args); - std::string* mutable_rsh_version(); - PROTOBUF_NODISCARD std::string* release_rsh_version(); - void set_allocated_rsh_version(std::string* rsh_version); - private: - const std::string& _internal_rsh_version() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_rsh_version(const std::string& value); - std::string* _internal_mutable_rsh_version(); - public: - - // string R_version = 2; - void clear_r_version(); - const std::string& r_version() const; - template - void set_r_version(ArgT0&& arg0, ArgT... args); - std::string* mutable_r_version(); - PROTOBUF_NODISCARD std::string* release_r_version(); - void set_allocated_r_version(std::string* r_version); - private: - const std::string& _internal_r_version() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_r_version(const std::string& value); - std::string* _internal_mutable_r_version(); - public: - - // string platform = 3; - void clear_platform(); - const std::string& platform() const; - template - void set_platform(ArgT0&& arg0, ArgT... args); - std::string* mutable_platform(); - PROTOBUF_NODISCARD std::string* release_platform(); - void set_allocated_platform(std::string* platform); - private: - const std::string& _internal_platform() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_platform(const std::string& value); - std::string* _internal_mutable_platform(); - public: - - // @@protoc_insertion_point(class_scope:rsh.server.protocol.HandshakeRequest) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField packages_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rsh_version_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr r_version_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr platform_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_protocol_2eproto; -}; -// ------------------------------------------------------------------- - -class CompileRequest final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.server.protocol.CompileRequest) */ { - public: - inline CompileRequest() : CompileRequest(nullptr) {} - ~CompileRequest() override; - explicit PROTOBUF_CONSTEXPR CompileRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - CompileRequest(const CompileRequest& from); - CompileRequest(CompileRequest&& from) noexcept - : CompileRequest() { - *this = ::std::move(from); - } - - inline CompileRequest& operator=(const CompileRequest& from) { - CopyFrom(from); - return *this; - } - inline CompileRequest& operator=(CompileRequest&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const CompileRequest& default_instance() { - return *internal_default_instance(); - } - static inline const CompileRequest* internal_default_instance() { - return reinterpret_cast( - &_CompileRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(CompileRequest& a, CompileRequest& b) { - a.Swap(&b); - } - inline void Swap(CompileRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(CompileRequest* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - CompileRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const CompileRequest& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const CompileRequest& from) { - CompileRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CompileRequest* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "rsh.server.protocol.CompileRequest"; - } - protected: - explicit CompileRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kNameFieldNumber = 2, - kClosureFieldNumber = 3, - kBcOptimizationFieldNumber = 4, - kCcOptimizationFieldNumber = 5, - }; - // string name = 2; - void clear_name(); - const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); - private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // bytes closure = 3; - void clear_closure(); - const std::string& closure() const; - template - void set_closure(ArgT0&& arg0, ArgT... args); - std::string* mutable_closure(); - PROTOBUF_NODISCARD std::string* release_closure(); - void set_allocated_closure(std::string* closure); - private: - const std::string& _internal_closure() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_closure(const std::string& value); - std::string* _internal_mutable_closure(); - public: - - // uint32 bc_optimization = 4; - void clear_bc_optimization(); - uint32_t bc_optimization() const; - void set_bc_optimization(uint32_t value); - private: - uint32_t _internal_bc_optimization() const; - void _internal_set_bc_optimization(uint32_t value); - public: - - // uint32 cc_optimization = 5; - void clear_cc_optimization(); - uint32_t cc_optimization() const; - void set_cc_optimization(uint32_t value); - private: - uint32_t _internal_cc_optimization() const; - void _internal_set_cc_optimization(uint32_t value); - public: - - // @@protoc_insertion_point(class_scope:rsh.server.protocol.CompileRequest) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr closure_; - uint32_t bc_optimization_; - uint32_t cc_optimization_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_protocol_2eproto; -}; -// ------------------------------------------------------------------- - -class CompiledFunction final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.server.protocol.CompiledFunction) */ { - public: - inline CompiledFunction() : CompiledFunction(nullptr) {} - ~CompiledFunction() override; - explicit PROTOBUF_CONSTEXPR CompiledFunction(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - CompiledFunction(const CompiledFunction& from); - CompiledFunction(CompiledFunction&& from) noexcept - : CompiledFunction() { - *this = ::std::move(from); - } - - inline CompiledFunction& operator=(const CompiledFunction& from) { - CopyFrom(from); - return *this; - } - inline CompiledFunction& operator=(CompiledFunction&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const CompiledFunction& default_instance() { - return *internal_default_instance(); - } - static inline const CompiledFunction* internal_default_instance() { - return reinterpret_cast( - &_CompiledFunction_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(CompiledFunction& a, CompiledFunction& b) { - a.Swap(&b); - } - inline void Swap(CompiledFunction* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(CompiledFunction* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - CompiledFunction* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const CompiledFunction& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const CompiledFunction& from) { - CompiledFunction::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CompiledFunction* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "rsh.server.protocol.CompiledFunction"; - } - protected: - explicit CompiledFunction(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kNameFieldNumber = 2, - kNativeCodeFieldNumber = 3, - kConstantsFieldNumber = 4, - }; - // string name = 2; - void clear_name(); - const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* name); - private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // bytes native_code = 3; - void clear_native_code(); - const std::string& native_code() const; - template - void set_native_code(ArgT0&& arg0, ArgT... args); - std::string* mutable_native_code(); - PROTOBUF_NODISCARD std::string* release_native_code(); - void set_allocated_native_code(std::string* native_code); - private: - const std::string& _internal_native_code() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_native_code(const std::string& value); - std::string* _internal_mutable_native_code(); - public: - - // bytes constants = 4; - void clear_constants(); - const std::string& constants() const; - template - void set_constants(ArgT0&& arg0, ArgT... args); - std::string* mutable_constants(); - PROTOBUF_NODISCARD std::string* release_constants(); - void set_allocated_constants(std::string* constants); - private: - const std::string& _internal_constants() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_constants(const std::string& value); - std::string* _internal_mutable_constants(); - public: - - // @@protoc_insertion_point(class_scope:rsh.server.protocol.CompiledFunction) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr native_code_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr constants_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_protocol_2eproto; -}; -// ------------------------------------------------------------------- - -class CompileResponse final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:rsh.server.protocol.CompileResponse) */ { - public: - inline CompileResponse() : CompileResponse(nullptr) {} - ~CompileResponse() override; - explicit PROTOBUF_CONSTEXPR CompileResponse(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - CompileResponse(const CompileResponse& from); - CompileResponse(CompileResponse&& from) noexcept - : CompileResponse() { - *this = ::std::move(from); - } - - inline CompileResponse& operator=(const CompileResponse& from) { - CopyFrom(from); - return *this; - } - inline CompileResponse& operator=(CompileResponse&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const CompileResponse& default_instance() { - return *internal_default_instance(); - } - enum DataCase { - kFailure = 2, - kResult = 3, - DATA_NOT_SET = 0, - }; - - static inline const CompileResponse* internal_default_instance() { - return reinterpret_cast( - &_CompileResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(CompileResponse& a, CompileResponse& b) { - a.Swap(&b); - } - inline void Swap(CompileResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(CompileResponse* other) { - if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - CompileResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const CompileResponse& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const CompileResponse& from) { - CompileResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } - - private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CompileResponse* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "rsh.server.protocol.CompileResponse"; - } - protected: - explicit CompileResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - public: - - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kFailureFieldNumber = 2, - kResultFieldNumber = 3, - }; - // string failure = 2; - bool has_failure() const; - private: - bool _internal_has_failure() const; - public: - void clear_failure(); - const std::string& failure() const; - template - void set_failure(ArgT0&& arg0, ArgT... args); - std::string* mutable_failure(); - PROTOBUF_NODISCARD std::string* release_failure(); - void set_allocated_failure(std::string* failure); - private: - const std::string& _internal_failure() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_failure(const std::string& value); - std::string* _internal_mutable_failure(); - public: - - // .rsh.server.protocol.CompiledFunction result = 3; - bool has_result() const; - private: - bool _internal_has_result() const; - public: - void clear_result(); - const ::rsh::server::protocol::CompiledFunction& result() const; - PROTOBUF_NODISCARD ::rsh::server::protocol::CompiledFunction* release_result(); - ::rsh::server::protocol::CompiledFunction* mutable_result(); - void set_allocated_result(::rsh::server::protocol::CompiledFunction* result); - private: - const ::rsh::server::protocol::CompiledFunction& _internal_result() const; - ::rsh::server::protocol::CompiledFunction* _internal_mutable_result(); - public: - void unsafe_arena_set_allocated_result( - ::rsh::server::protocol::CompiledFunction* result); - ::rsh::server::protocol::CompiledFunction* unsafe_arena_release_result(); - - void clear_data(); - DataCase data_case() const; - // @@protoc_insertion_point(class_scope:rsh.server.protocol.CompileResponse) - private: - class _Internal; - void set_has_failure(); - void set_has_result(); - - inline bool has_data() const; - inline void clear_has_data(); - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - struct Impl_ { - union DataUnion { - constexpr DataUnion() : _constinit_{} {} - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr failure_; - ::rsh::server::protocol::CompiledFunction* result_; - } data_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - uint32_t _oneof_case_[1]; - - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_protocol_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// Request - -// .rsh.server.protocol.HandshakeRequest handshake = 1; -inline bool Request::_internal_has_handshake() const { - return payload_case() == kHandshake; -} -inline bool Request::has_handshake() const { - return _internal_has_handshake(); -} -inline void Request::set_has_handshake() { - _impl_._oneof_case_[0] = kHandshake; -} -inline void Request::clear_handshake() { - if (_internal_has_handshake()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.payload_.handshake_; - } - clear_has_payload(); - } -} -inline ::rsh::server::protocol::HandshakeRequest* Request::release_handshake() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.Request.handshake) - if (_internal_has_handshake()) { - clear_has_payload(); - ::rsh::server::protocol::HandshakeRequest* temp = _impl_.payload_.handshake_; - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - _impl_.payload_.handshake_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::rsh::server::protocol::HandshakeRequest& Request::_internal_handshake() const { - return _internal_has_handshake() - ? *_impl_.payload_.handshake_ - : reinterpret_cast< ::rsh::server::protocol::HandshakeRequest&>(::rsh::server::protocol::_HandshakeRequest_default_instance_); -} -inline const ::rsh::server::protocol::HandshakeRequest& Request::handshake() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.Request.handshake) - return _internal_handshake(); -} -inline ::rsh::server::protocol::HandshakeRequest* Request::unsafe_arena_release_handshake() { - // @@protoc_insertion_point(field_unsafe_arena_release:rsh.server.protocol.Request.handshake) - if (_internal_has_handshake()) { - clear_has_payload(); - ::rsh::server::protocol::HandshakeRequest* temp = _impl_.payload_.handshake_; - _impl_.payload_.handshake_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Request::unsafe_arena_set_allocated_handshake(::rsh::server::protocol::HandshakeRequest* handshake) { - clear_payload(); - if (handshake) { - set_has_handshake(); - _impl_.payload_.handshake_ = handshake; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.server.protocol.Request.handshake) -} -inline ::rsh::server::protocol::HandshakeRequest* Request::_internal_mutable_handshake() { - if (!_internal_has_handshake()) { - clear_payload(); - set_has_handshake(); - _impl_.payload_.handshake_ = CreateMaybeMessage< ::rsh::server::protocol::HandshakeRequest >(GetArenaForAllocation()); - } - return _impl_.payload_.handshake_; -} -inline ::rsh::server::protocol::HandshakeRequest* Request::mutable_handshake() { - ::rsh::server::protocol::HandshakeRequest* _msg = _internal_mutable_handshake(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.Request.handshake) - return _msg; -} - -// .rsh.server.protocol.CompileRequest compile = 2; -inline bool Request::_internal_has_compile() const { - return payload_case() == kCompile; -} -inline bool Request::has_compile() const { - return _internal_has_compile(); -} -inline void Request::set_has_compile() { - _impl_._oneof_case_[0] = kCompile; -} -inline void Request::clear_compile() { - if (_internal_has_compile()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.payload_.compile_; - } - clear_has_payload(); - } -} -inline ::rsh::server::protocol::CompileRequest* Request::release_compile() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.Request.compile) - if (_internal_has_compile()) { - clear_has_payload(); - ::rsh::server::protocol::CompileRequest* temp = _impl_.payload_.compile_; - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - _impl_.payload_.compile_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::rsh::server::protocol::CompileRequest& Request::_internal_compile() const { - return _internal_has_compile() - ? *_impl_.payload_.compile_ - : reinterpret_cast< ::rsh::server::protocol::CompileRequest&>(::rsh::server::protocol::_CompileRequest_default_instance_); -} -inline const ::rsh::server::protocol::CompileRequest& Request::compile() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.Request.compile) - return _internal_compile(); -} -inline ::rsh::server::protocol::CompileRequest* Request::unsafe_arena_release_compile() { - // @@protoc_insertion_point(field_unsafe_arena_release:rsh.server.protocol.Request.compile) - if (_internal_has_compile()) { - clear_has_payload(); - ::rsh::server::protocol::CompileRequest* temp = _impl_.payload_.compile_; - _impl_.payload_.compile_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void Request::unsafe_arena_set_allocated_compile(::rsh::server::protocol::CompileRequest* compile) { - clear_payload(); - if (compile) { - set_has_compile(); - _impl_.payload_.compile_ = compile; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.server.protocol.Request.compile) -} -inline ::rsh::server::protocol::CompileRequest* Request::_internal_mutable_compile() { - if (!_internal_has_compile()) { - clear_payload(); - set_has_compile(); - _impl_.payload_.compile_ = CreateMaybeMessage< ::rsh::server::protocol::CompileRequest >(GetArenaForAllocation()); - } - return _impl_.payload_.compile_; -} -inline ::rsh::server::protocol::CompileRequest* Request::mutable_compile() { - ::rsh::server::protocol::CompileRequest* _msg = _internal_mutable_compile(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.Request.compile) - return _msg; -} - -inline bool Request::has_payload() const { - return payload_case() != PAYLOAD_NOT_SET; -} -inline void Request::clear_has_payload() { - _impl_._oneof_case_[0] = PAYLOAD_NOT_SET; -} -inline Request::PayloadCase Request::payload_case() const { - return Request::PayloadCase(_impl_._oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// HandshakeRequest - -// string Rsh_version = 1; -inline void HandshakeRequest::clear_rsh_version() { - _impl_.rsh_version_.ClearToEmpty(); -} -inline const std::string& HandshakeRequest::rsh_version() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.HandshakeRequest.Rsh_version) - return _internal_rsh_version(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void HandshakeRequest::set_rsh_version(ArgT0&& arg0, ArgT... args) { - - _impl_.rsh_version_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:rsh.server.protocol.HandshakeRequest.Rsh_version) -} -inline std::string* HandshakeRequest::mutable_rsh_version() { - std::string* _s = _internal_mutable_rsh_version(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.HandshakeRequest.Rsh_version) - return _s; -} -inline const std::string& HandshakeRequest::_internal_rsh_version() const { - return _impl_.rsh_version_.Get(); -} -inline void HandshakeRequest::_internal_set_rsh_version(const std::string& value) { - - _impl_.rsh_version_.Set(value, GetArenaForAllocation()); -} -inline std::string* HandshakeRequest::_internal_mutable_rsh_version() { - - return _impl_.rsh_version_.Mutable(GetArenaForAllocation()); -} -inline std::string* HandshakeRequest::release_rsh_version() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.HandshakeRequest.Rsh_version) - return _impl_.rsh_version_.Release(); -} -inline void HandshakeRequest::set_allocated_rsh_version(std::string* rsh_version) { - if (rsh_version != nullptr) { - - } else { - - } - _impl_.rsh_version_.SetAllocated(rsh_version, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.rsh_version_.IsDefault()) { - _impl_.rsh_version_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.HandshakeRequest.Rsh_version) -} - -// string R_version = 2; -inline void HandshakeRequest::clear_r_version() { - _impl_.r_version_.ClearToEmpty(); -} -inline const std::string& HandshakeRequest::r_version() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.HandshakeRequest.R_version) - return _internal_r_version(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void HandshakeRequest::set_r_version(ArgT0&& arg0, ArgT... args) { - - _impl_.r_version_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:rsh.server.protocol.HandshakeRequest.R_version) -} -inline std::string* HandshakeRequest::mutable_r_version() { - std::string* _s = _internal_mutable_r_version(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.HandshakeRequest.R_version) - return _s; -} -inline const std::string& HandshakeRequest::_internal_r_version() const { - return _impl_.r_version_.Get(); -} -inline void HandshakeRequest::_internal_set_r_version(const std::string& value) { - - _impl_.r_version_.Set(value, GetArenaForAllocation()); -} -inline std::string* HandshakeRequest::_internal_mutable_r_version() { - - return _impl_.r_version_.Mutable(GetArenaForAllocation()); -} -inline std::string* HandshakeRequest::release_r_version() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.HandshakeRequest.R_version) - return _impl_.r_version_.Release(); -} -inline void HandshakeRequest::set_allocated_r_version(std::string* r_version) { - if (r_version != nullptr) { - - } else { - - } - _impl_.r_version_.SetAllocated(r_version, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.r_version_.IsDefault()) { - _impl_.r_version_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.HandshakeRequest.R_version) -} - -// string platform = 3; -inline void HandshakeRequest::clear_platform() { - _impl_.platform_.ClearToEmpty(); -} -inline const std::string& HandshakeRequest::platform() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.HandshakeRequest.platform) - return _internal_platform(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void HandshakeRequest::set_platform(ArgT0&& arg0, ArgT... args) { - - _impl_.platform_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:rsh.server.protocol.HandshakeRequest.platform) -} -inline std::string* HandshakeRequest::mutable_platform() { - std::string* _s = _internal_mutable_platform(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.HandshakeRequest.platform) - return _s; -} -inline const std::string& HandshakeRequest::_internal_platform() const { - return _impl_.platform_.Get(); -} -inline void HandshakeRequest::_internal_set_platform(const std::string& value) { - - _impl_.platform_.Set(value, GetArenaForAllocation()); -} -inline std::string* HandshakeRequest::_internal_mutable_platform() { - - return _impl_.platform_.Mutable(GetArenaForAllocation()); -} -inline std::string* HandshakeRequest::release_platform() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.HandshakeRequest.platform) - return _impl_.platform_.Release(); -} -inline void HandshakeRequest::set_allocated_platform(std::string* platform) { - if (platform != nullptr) { - - } else { - - } - _impl_.platform_.SetAllocated(platform, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.platform_.IsDefault()) { - _impl_.platform_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.HandshakeRequest.platform) -} - -// repeated string packages = 4; -inline int HandshakeRequest::_internal_packages_size() const { - return _impl_.packages_.size(); -} -inline int HandshakeRequest::packages_size() const { - return _internal_packages_size(); -} -inline void HandshakeRequest::clear_packages() { - _impl_.packages_.Clear(); -} -inline std::string* HandshakeRequest::add_packages() { - std::string* _s = _internal_add_packages(); - // @@protoc_insertion_point(field_add_mutable:rsh.server.protocol.HandshakeRequest.packages) - return _s; -} -inline const std::string& HandshakeRequest::_internal_packages(int index) const { - return _impl_.packages_.Get(index); -} -inline const std::string& HandshakeRequest::packages(int index) const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.HandshakeRequest.packages) - return _internal_packages(index); -} -inline std::string* HandshakeRequest::mutable_packages(int index) { - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.HandshakeRequest.packages) - return _impl_.packages_.Mutable(index); -} -inline void HandshakeRequest::set_packages(int index, const std::string& value) { - _impl_.packages_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:rsh.server.protocol.HandshakeRequest.packages) -} -inline void HandshakeRequest::set_packages(int index, std::string&& value) { - _impl_.packages_.Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:rsh.server.protocol.HandshakeRequest.packages) -} -inline void HandshakeRequest::set_packages(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.packages_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:rsh.server.protocol.HandshakeRequest.packages) -} -inline void HandshakeRequest::set_packages(int index, const char* value, size_t size) { - _impl_.packages_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:rsh.server.protocol.HandshakeRequest.packages) -} -inline std::string* HandshakeRequest::_internal_add_packages() { - return _impl_.packages_.Add(); -} -inline void HandshakeRequest::add_packages(const std::string& value) { - _impl_.packages_.Add()->assign(value); - // @@protoc_insertion_point(field_add:rsh.server.protocol.HandshakeRequest.packages) -} -inline void HandshakeRequest::add_packages(std::string&& value) { - _impl_.packages_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:rsh.server.protocol.HandshakeRequest.packages) -} -inline void HandshakeRequest::add_packages(const char* value) { - GOOGLE_DCHECK(value != nullptr); - _impl_.packages_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:rsh.server.protocol.HandshakeRequest.packages) -} -inline void HandshakeRequest::add_packages(const char* value, size_t size) { - _impl_.packages_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:rsh.server.protocol.HandshakeRequest.packages) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -HandshakeRequest::packages() const { - // @@protoc_insertion_point(field_list:rsh.server.protocol.HandshakeRequest.packages) - return _impl_.packages_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -HandshakeRequest::mutable_packages() { - // @@protoc_insertion_point(field_mutable_list:rsh.server.protocol.HandshakeRequest.packages) - return &_impl_.packages_; -} - -// ------------------------------------------------------------------- - -// CompileRequest - -// string name = 2; -inline void CompileRequest::clear_name() { - _impl_.name_.ClearToEmpty(); -} -inline const std::string& CompileRequest::name() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.CompileRequest.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CompileRequest::set_name(ArgT0&& arg0, ArgT... args) { - - _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:rsh.server.protocol.CompileRequest.name) -} -inline std::string* CompileRequest::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.CompileRequest.name) - return _s; -} -inline const std::string& CompileRequest::_internal_name() const { - return _impl_.name_.Get(); -} -inline void CompileRequest::_internal_set_name(const std::string& value) { - - _impl_.name_.Set(value, GetArenaForAllocation()); -} -inline std::string* CompileRequest::_internal_mutable_name() { - - return _impl_.name_.Mutable(GetArenaForAllocation()); -} -inline std::string* CompileRequest::release_name() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.CompileRequest.name) - return _impl_.name_.Release(); -} -inline void CompileRequest::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.CompileRequest.name) -} - -// bytes closure = 3; -inline void CompileRequest::clear_closure() { - _impl_.closure_.ClearToEmpty(); -} -inline const std::string& CompileRequest::closure() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.CompileRequest.closure) - return _internal_closure(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CompileRequest::set_closure(ArgT0&& arg0, ArgT... args) { - - _impl_.closure_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:rsh.server.protocol.CompileRequest.closure) -} -inline std::string* CompileRequest::mutable_closure() { - std::string* _s = _internal_mutable_closure(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.CompileRequest.closure) - return _s; -} -inline const std::string& CompileRequest::_internal_closure() const { - return _impl_.closure_.Get(); -} -inline void CompileRequest::_internal_set_closure(const std::string& value) { - - _impl_.closure_.Set(value, GetArenaForAllocation()); -} -inline std::string* CompileRequest::_internal_mutable_closure() { - - return _impl_.closure_.Mutable(GetArenaForAllocation()); -} -inline std::string* CompileRequest::release_closure() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.CompileRequest.closure) - return _impl_.closure_.Release(); -} -inline void CompileRequest::set_allocated_closure(std::string* closure) { - if (closure != nullptr) { - - } else { - - } - _impl_.closure_.SetAllocated(closure, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.closure_.IsDefault()) { - _impl_.closure_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.CompileRequest.closure) -} - -// uint32 bc_optimization = 4; -inline void CompileRequest::clear_bc_optimization() { - _impl_.bc_optimization_ = 0u; -} -inline uint32_t CompileRequest::_internal_bc_optimization() const { - return _impl_.bc_optimization_; -} -inline uint32_t CompileRequest::bc_optimization() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.CompileRequest.bc_optimization) - return _internal_bc_optimization(); -} -inline void CompileRequest::_internal_set_bc_optimization(uint32_t value) { - - _impl_.bc_optimization_ = value; -} -inline void CompileRequest::set_bc_optimization(uint32_t value) { - _internal_set_bc_optimization(value); - // @@protoc_insertion_point(field_set:rsh.server.protocol.CompileRequest.bc_optimization) -} - -// uint32 cc_optimization = 5; -inline void CompileRequest::clear_cc_optimization() { - _impl_.cc_optimization_ = 0u; -} -inline uint32_t CompileRequest::_internal_cc_optimization() const { - return _impl_.cc_optimization_; -} -inline uint32_t CompileRequest::cc_optimization() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.CompileRequest.cc_optimization) - return _internal_cc_optimization(); -} -inline void CompileRequest::_internal_set_cc_optimization(uint32_t value) { - - _impl_.cc_optimization_ = value; -} -inline void CompileRequest::set_cc_optimization(uint32_t value) { - _internal_set_cc_optimization(value); - // @@protoc_insertion_point(field_set:rsh.server.protocol.CompileRequest.cc_optimization) -} - -// ------------------------------------------------------------------- - -// CompiledFunction - -// string name = 2; -inline void CompiledFunction::clear_name() { - _impl_.name_.ClearToEmpty(); -} -inline const std::string& CompiledFunction::name() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.CompiledFunction.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CompiledFunction::set_name(ArgT0&& arg0, ArgT... args) { - - _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:rsh.server.protocol.CompiledFunction.name) -} -inline std::string* CompiledFunction::mutable_name() { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.CompiledFunction.name) - return _s; -} -inline const std::string& CompiledFunction::_internal_name() const { - return _impl_.name_.Get(); -} -inline void CompiledFunction::_internal_set_name(const std::string& value) { - - _impl_.name_.Set(value, GetArenaForAllocation()); -} -inline std::string* CompiledFunction::_internal_mutable_name() { - - return _impl_.name_.Mutable(GetArenaForAllocation()); -} -inline std::string* CompiledFunction::release_name() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.CompiledFunction.name) - return _impl_.name_.Release(); -} -inline void CompiledFunction::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.CompiledFunction.name) -} - -// bytes native_code = 3; -inline void CompiledFunction::clear_native_code() { - _impl_.native_code_.ClearToEmpty(); -} -inline const std::string& CompiledFunction::native_code() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.CompiledFunction.native_code) - return _internal_native_code(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CompiledFunction::set_native_code(ArgT0&& arg0, ArgT... args) { - - _impl_.native_code_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:rsh.server.protocol.CompiledFunction.native_code) -} -inline std::string* CompiledFunction::mutable_native_code() { - std::string* _s = _internal_mutable_native_code(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.CompiledFunction.native_code) - return _s; -} -inline const std::string& CompiledFunction::_internal_native_code() const { - return _impl_.native_code_.Get(); -} -inline void CompiledFunction::_internal_set_native_code(const std::string& value) { - - _impl_.native_code_.Set(value, GetArenaForAllocation()); -} -inline std::string* CompiledFunction::_internal_mutable_native_code() { - - return _impl_.native_code_.Mutable(GetArenaForAllocation()); -} -inline std::string* CompiledFunction::release_native_code() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.CompiledFunction.native_code) - return _impl_.native_code_.Release(); -} -inline void CompiledFunction::set_allocated_native_code(std::string* native_code) { - if (native_code != nullptr) { - - } else { - - } - _impl_.native_code_.SetAllocated(native_code, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.native_code_.IsDefault()) { - _impl_.native_code_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.CompiledFunction.native_code) -} - -// bytes constants = 4; -inline void CompiledFunction::clear_constants() { - _impl_.constants_.ClearToEmpty(); -} -inline const std::string& CompiledFunction::constants() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.CompiledFunction.constants) - return _internal_constants(); -} -template -inline PROTOBUF_ALWAYS_INLINE -void CompiledFunction::set_constants(ArgT0&& arg0, ArgT... args) { - - _impl_.constants_.SetBytes(static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:rsh.server.protocol.CompiledFunction.constants) -} -inline std::string* CompiledFunction::mutable_constants() { - std::string* _s = _internal_mutable_constants(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.CompiledFunction.constants) - return _s; -} -inline const std::string& CompiledFunction::_internal_constants() const { - return _impl_.constants_.Get(); -} -inline void CompiledFunction::_internal_set_constants(const std::string& value) { - - _impl_.constants_.Set(value, GetArenaForAllocation()); -} -inline std::string* CompiledFunction::_internal_mutable_constants() { - - return _impl_.constants_.Mutable(GetArenaForAllocation()); -} -inline std::string* CompiledFunction::release_constants() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.CompiledFunction.constants) - return _impl_.constants_.Release(); -} -inline void CompiledFunction::set_allocated_constants(std::string* constants) { - if (constants != nullptr) { - - } else { - - } - _impl_.constants_.SetAllocated(constants, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.constants_.IsDefault()) { - _impl_.constants_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.CompiledFunction.constants) -} - -// ------------------------------------------------------------------- - -// CompileResponse - -// string failure = 2; -inline bool CompileResponse::_internal_has_failure() const { - return data_case() == kFailure; -} -inline bool CompileResponse::has_failure() const { - return _internal_has_failure(); -} -inline void CompileResponse::set_has_failure() { - _impl_._oneof_case_[0] = kFailure; -} -inline void CompileResponse::clear_failure() { - if (_internal_has_failure()) { - _impl_.data_.failure_.Destroy(); - clear_has_data(); - } -} -inline const std::string& CompileResponse::failure() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.CompileResponse.failure) - return _internal_failure(); -} -template -inline void CompileResponse::set_failure(ArgT0&& arg0, ArgT... args) { - if (!_internal_has_failure()) { - clear_data(); - set_has_failure(); - _impl_.data_.failure_.InitDefault(); - } - _impl_.data_.failure_.Set( static_cast(arg0), args..., GetArenaForAllocation()); - // @@protoc_insertion_point(field_set:rsh.server.protocol.CompileResponse.failure) -} -inline std::string* CompileResponse::mutable_failure() { - std::string* _s = _internal_mutable_failure(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.CompileResponse.failure) - return _s; -} -inline const std::string& CompileResponse::_internal_failure() const { - if (_internal_has_failure()) { - return _impl_.data_.failure_.Get(); - } - return ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); -} -inline void CompileResponse::_internal_set_failure(const std::string& value) { - if (!_internal_has_failure()) { - clear_data(); - set_has_failure(); - _impl_.data_.failure_.InitDefault(); - } - _impl_.data_.failure_.Set(value, GetArenaForAllocation()); -} -inline std::string* CompileResponse::_internal_mutable_failure() { - if (!_internal_has_failure()) { - clear_data(); - set_has_failure(); - _impl_.data_.failure_.InitDefault(); - } - return _impl_.data_.failure_.Mutable( GetArenaForAllocation()); -} -inline std::string* CompileResponse::release_failure() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.CompileResponse.failure) - if (_internal_has_failure()) { - clear_has_data(); - return _impl_.data_.failure_.Release(); - } else { - return nullptr; - } -} -inline void CompileResponse::set_allocated_failure(std::string* failure) { - if (has_data()) { - clear_data(); - } - if (failure != nullptr) { - set_has_failure(); - _impl_.data_.failure_.InitAllocated(failure, GetArenaForAllocation()); - } - // @@protoc_insertion_point(field_set_allocated:rsh.server.protocol.CompileResponse.failure) -} - -// .rsh.server.protocol.CompiledFunction result = 3; -inline bool CompileResponse::_internal_has_result() const { - return data_case() == kResult; -} -inline bool CompileResponse::has_result() const { - return _internal_has_result(); -} -inline void CompileResponse::set_has_result() { - _impl_._oneof_case_[0] = kResult; -} -inline void CompileResponse::clear_result() { - if (_internal_has_result()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.data_.result_; - } - clear_has_data(); - } -} -inline ::rsh::server::protocol::CompiledFunction* CompileResponse::release_result() { - // @@protoc_insertion_point(field_release:rsh.server.protocol.CompileResponse.result) - if (_internal_has_result()) { - clear_has_data(); - ::rsh::server::protocol::CompiledFunction* temp = _impl_.data_.result_; - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - _impl_.data_.result_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::rsh::server::protocol::CompiledFunction& CompileResponse::_internal_result() const { - return _internal_has_result() - ? *_impl_.data_.result_ - : reinterpret_cast< ::rsh::server::protocol::CompiledFunction&>(::rsh::server::protocol::_CompiledFunction_default_instance_); -} -inline const ::rsh::server::protocol::CompiledFunction& CompileResponse::result() const { - // @@protoc_insertion_point(field_get:rsh.server.protocol.CompileResponse.result) - return _internal_result(); -} -inline ::rsh::server::protocol::CompiledFunction* CompileResponse::unsafe_arena_release_result() { - // @@protoc_insertion_point(field_unsafe_arena_release:rsh.server.protocol.CompileResponse.result) - if (_internal_has_result()) { - clear_has_data(); - ::rsh::server::protocol::CompiledFunction* temp = _impl_.data_.result_; - _impl_.data_.result_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void CompileResponse::unsafe_arena_set_allocated_result(::rsh::server::protocol::CompiledFunction* result) { - clear_data(); - if (result) { - set_has_result(); - _impl_.data_.result_ = result; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:rsh.server.protocol.CompileResponse.result) -} -inline ::rsh::server::protocol::CompiledFunction* CompileResponse::_internal_mutable_result() { - if (!_internal_has_result()) { - clear_data(); - set_has_result(); - _impl_.data_.result_ = CreateMaybeMessage< ::rsh::server::protocol::CompiledFunction >(GetArenaForAllocation()); - } - return _impl_.data_.result_; -} -inline ::rsh::server::protocol::CompiledFunction* CompileResponse::mutable_result() { - ::rsh::server::protocol::CompiledFunction* _msg = _internal_mutable_result(); - // @@protoc_insertion_point(field_mutable:rsh.server.protocol.CompileResponse.result) - return _msg; -} - -inline bool CompileResponse::has_data() const { - return data_case() != DATA_NOT_SET; -} -inline void CompileResponse::clear_has_data() { - _impl_._oneof_case_[0] = DATA_NOT_SET; -} -inline CompileResponse::DataCase CompileResponse::data_case() const { - return CompileResponse::DataCase(_impl_._oneof_case_[0]); -} -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace protocol -} // namespace server -} // namespace rsh - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_protocol_2eproto diff --git a/client/rsh/src/routes.grpc.pb.cc b/client/rsh/src/routes.grpc.pb.cc new file mode 100644 index 000000000..4401319b1 --- /dev/null +++ b/client/rsh/src/routes.grpc.pb.cc @@ -0,0 +1,317 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: routes.proto + +#include "routes.pb.h" +#include "routes.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace rsh { +namespace protocol { + +static const char* CompileService_method_names[] = { + "/rsh.protocol.CompileService/Compile", + "/rsh.protocol.CompileService/Init", +}; + +std::unique_ptr< CompileService::Stub> CompileService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { + (void)options; + std::unique_ptr< CompileService::Stub> stub(new CompileService::Stub(channel, options)); + return stub; +} + +CompileService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) + : channel_(channel), rpcmethod_Compile_(CompileService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_Init_(CompileService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + {} + +::grpc::Status CompileService::Stub::Compile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::rsh::protocol::CompileResponse* response) { + return ::grpc::internal::BlockingUnaryCall< ::rsh::protocol::CompileRequest, ::rsh::protocol::CompileResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Compile_, context, request, response); +} + +void CompileService::Stub::async::Compile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest* request, ::rsh::protocol::CompileResponse* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::rsh::protocol::CompileRequest, ::rsh::protocol::CompileResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Compile_, context, request, response, std::move(f)); +} + +void CompileService::Stub::async::Compile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest* request, ::rsh::protocol::CompileResponse* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Compile_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::CompileResponse>* CompileService::Stub::PrepareAsyncCompileRaw(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::rsh::protocol::CompileResponse, ::rsh::protocol::CompileRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Compile_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::CompileResponse>* CompileService::Stub::AsyncCompileRaw(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncCompileRaw(context, request, cq); + result->StartCall(); + return result; +} + +::grpc::Status CompileService::Stub::Init(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::rsh::protocol::InitResponse* response) { + return ::grpc::internal::BlockingUnaryCall< ::rsh::protocol::InitRequest, ::rsh::protocol::InitResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Init_, context, request, response); +} + +void CompileService::Stub::async::Init(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest* request, ::rsh::protocol::InitResponse* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::rsh::protocol::InitRequest, ::rsh::protocol::InitResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Init_, context, request, response, std::move(f)); +} + +void CompileService::Stub::async::Init(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest* request, ::rsh::protocol::InitResponse* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Init_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::InitResponse>* CompileService::Stub::PrepareAsyncInitRaw(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::rsh::protocol::InitResponse, ::rsh::protocol::InitRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Init_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::InitResponse>* CompileService::Stub::AsyncInitRaw(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncInitRaw(context, request, cq); + result->StartCall(); + return result; +} + +CompileService::Service::Service() { + AddMethod(new ::grpc::internal::RpcServiceMethod( + CompileService_method_names[0], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< CompileService::Service, ::rsh::protocol::CompileRequest, ::rsh::protocol::CompileResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](CompileService::Service* service, + ::grpc::ServerContext* ctx, + const ::rsh::protocol::CompileRequest* req, + ::rsh::protocol::CompileResponse* resp) { + return service->Compile(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + CompileService_method_names[1], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< CompileService::Service, ::rsh::protocol::InitRequest, ::rsh::protocol::InitResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](CompileService::Service* service, + ::grpc::ServerContext* ctx, + const ::rsh::protocol::InitRequest* req, + ::rsh::protocol::InitResponse* resp) { + return service->Init(ctx, req, resp); + }, this))); +} + +CompileService::Service::~Service() { +} + +::grpc::Status CompileService::Service::Compile(::grpc::ServerContext* context, const ::rsh::protocol::CompileRequest* request, ::rsh::protocol::CompileResponse* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status CompileService::Service::Init(::grpc::ServerContext* context, const ::rsh::protocol::InitRequest* request, ::rsh::protocol::InitResponse* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + + +static const char* FactService_method_names[] = { + "/rsh.protocol.FactService/GetContext", + "/rsh.protocol.FactService/GetTypeFeedback", + "/rsh.protocol.FactService/GetValues", + "/rsh.protocol.FactService/GetFunction", +}; + +std::unique_ptr< FactService::Stub> FactService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { + (void)options; + std::unique_ptr< FactService::Stub> stub(new FactService::Stub(channel, options)); + return stub; +} + +FactService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) + : channel_(channel), rpcmethod_GetContext_(FactService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_GetTypeFeedback_(FactService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_GetValues_(FactService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_GetFunction_(FactService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + {} + +::grpc::Status FactService::Stub::GetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::rsh::protocol::Context* response) { + return ::grpc::internal::BlockingUnaryCall< ::rsh::protocol::ContextRequest, ::rsh::protocol::Context, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetContext_, context, request, response); +} + +void FactService::Stub::async::GetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest* request, ::rsh::protocol::Context* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::rsh::protocol::ContextRequest, ::rsh::protocol::Context, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetContext_, context, request, response, std::move(f)); +} + +void FactService::Stub::async::GetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest* request, ::rsh::protocol::Context* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetContext_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::Context>* FactService::Stub::PrepareAsyncGetContextRaw(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::rsh::protocol::Context, ::rsh::protocol::ContextRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetContext_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::Context>* FactService::Stub::AsyncGetContextRaw(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncGetContextRaw(context, request, cq); + result->StartCall(); + return result; +} + +::grpc::Status FactService::Stub::GetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::rsh::protocol::TypeFeedback* response) { + return ::grpc::internal::BlockingUnaryCall< ::rsh::protocol::FeedbackRequest, ::rsh::protocol::TypeFeedback, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetTypeFeedback_, context, request, response); +} + +void FactService::Stub::async::GetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest* request, ::rsh::protocol::TypeFeedback* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::rsh::protocol::FeedbackRequest, ::rsh::protocol::TypeFeedback, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetTypeFeedback_, context, request, response, std::move(f)); +} + +void FactService::Stub::async::GetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest* request, ::rsh::protocol::TypeFeedback* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetTypeFeedback_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::TypeFeedback>* FactService::Stub::PrepareAsyncGetTypeFeedbackRaw(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::rsh::protocol::TypeFeedback, ::rsh::protocol::FeedbackRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetTypeFeedback_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::TypeFeedback>* FactService::Stub::AsyncGetTypeFeedbackRaw(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncGetTypeFeedbackRaw(context, request, cq); + result->StartCall(); + return result; +} + +::grpc::Status FactService::Stub::GetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::rsh::protocol::Values* response) { + return ::grpc::internal::BlockingUnaryCall< ::rsh::protocol::ValueRequest, ::rsh::protocol::Values, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetValues_, context, request, response); +} + +void FactService::Stub::async::GetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest* request, ::rsh::protocol::Values* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::rsh::protocol::ValueRequest, ::rsh::protocol::Values, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetValues_, context, request, response, std::move(f)); +} + +void FactService::Stub::async::GetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest* request, ::rsh::protocol::Values* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetValues_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::Values>* FactService::Stub::PrepareAsyncGetValuesRaw(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::rsh::protocol::Values, ::rsh::protocol::ValueRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetValues_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::Values>* FactService::Stub::AsyncGetValuesRaw(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncGetValuesRaw(context, request, cq); + result->StartCall(); + return result; +} + +::grpc::Status FactService::Stub::GetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::rsh::protocol::Function* response) { + return ::grpc::internal::BlockingUnaryCall< ::rsh::protocol::FunctionRequest, ::rsh::protocol::Function, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetFunction_, context, request, response); +} + +void FactService::Stub::async::GetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest* request, ::rsh::protocol::Function* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::rsh::protocol::FunctionRequest, ::rsh::protocol::Function, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetFunction_, context, request, response, std::move(f)); +} + +void FactService::Stub::async::GetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest* request, ::rsh::protocol::Function* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetFunction_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::Function>* FactService::Stub::PrepareAsyncGetFunctionRaw(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::rsh::protocol::Function, ::rsh::protocol::FunctionRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetFunction_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::rsh::protocol::Function>* FactService::Stub::AsyncGetFunctionRaw(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncGetFunctionRaw(context, request, cq); + result->StartCall(); + return result; +} + +FactService::Service::Service() { + AddMethod(new ::grpc::internal::RpcServiceMethod( + FactService_method_names[0], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< FactService::Service, ::rsh::protocol::ContextRequest, ::rsh::protocol::Context, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](FactService::Service* service, + ::grpc::ServerContext* ctx, + const ::rsh::protocol::ContextRequest* req, + ::rsh::protocol::Context* resp) { + return service->GetContext(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + FactService_method_names[1], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< FactService::Service, ::rsh::protocol::FeedbackRequest, ::rsh::protocol::TypeFeedback, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](FactService::Service* service, + ::grpc::ServerContext* ctx, + const ::rsh::protocol::FeedbackRequest* req, + ::rsh::protocol::TypeFeedback* resp) { + return service->GetTypeFeedback(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + FactService_method_names[2], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< FactService::Service, ::rsh::protocol::ValueRequest, ::rsh::protocol::Values, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](FactService::Service* service, + ::grpc::ServerContext* ctx, + const ::rsh::protocol::ValueRequest* req, + ::rsh::protocol::Values* resp) { + return service->GetValues(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + FactService_method_names[3], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< FactService::Service, ::rsh::protocol::FunctionRequest, ::rsh::protocol::Function, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](FactService::Service* service, + ::grpc::ServerContext* ctx, + const ::rsh::protocol::FunctionRequest* req, + ::rsh::protocol::Function* resp) { + return service->GetFunction(ctx, req, resp); + }, this))); +} + +FactService::Service::~Service() { +} + +::grpc::Status FactService::Service::GetContext(::grpc::ServerContext* context, const ::rsh::protocol::ContextRequest* request, ::rsh::protocol::Context* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status FactService::Service::GetTypeFeedback(::grpc::ServerContext* context, const ::rsh::protocol::FeedbackRequest* request, ::rsh::protocol::TypeFeedback* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status FactService::Service::GetValues(::grpc::ServerContext* context, const ::rsh::protocol::ValueRequest* request, ::rsh::protocol::Values* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status FactService::Service::GetFunction(::grpc::ServerContext* context, const ::rsh::protocol::FunctionRequest* request, ::rsh::protocol::Function* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + + +} // namespace rsh +} // namespace protocol + diff --git a/client/rsh/src/routes.grpc.pb.h b/client/rsh/src/routes.grpc.pb.h new file mode 100644 index 000000000..38f98ea0a --- /dev/null +++ b/client/rsh/src/routes.grpc.pb.h @@ -0,0 +1,1080 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: routes.proto +#ifndef GRPC_routes_2eproto__INCLUDED +#define GRPC_routes_2eproto__INCLUDED + +#include "routes.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace rsh { +namespace protocol { + +// R sends requests to the compile server +class CompileService final { + public: + static constexpr char const* service_full_name() { + return "rsh.protocol.CompileService"; + } + class StubInterface { + public: + virtual ~StubInterface() {} + virtual ::grpc::Status Compile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::rsh::protocol::CompileResponse* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::CompileResponse>> AsyncCompile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::CompileResponse>>(AsyncCompileRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::CompileResponse>> PrepareAsyncCompile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::CompileResponse>>(PrepareAsyncCompileRaw(context, request, cq)); + } + virtual ::grpc::Status Init(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::rsh::protocol::InitResponse* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::InitResponse>> AsyncInit(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::InitResponse>>(AsyncInitRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::InitResponse>> PrepareAsyncInit(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::InitResponse>>(PrepareAsyncInitRaw(context, request, cq)); + } + class async_interface { + public: + virtual ~async_interface() {} + virtual void Compile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest* request, ::rsh::protocol::CompileResponse* response, std::function) = 0; + virtual void Compile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest* request, ::rsh::protocol::CompileResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; + virtual void Init(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest* request, ::rsh::protocol::InitResponse* response, std::function) = 0; + virtual void Init(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest* request, ::rsh::protocol::InitResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; + }; + typedef class async_interface experimental_async_interface; + virtual class async_interface* async() { return nullptr; } + class async_interface* experimental_async() { return async(); } + private: + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::CompileResponse>* AsyncCompileRaw(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::CompileResponse>* PrepareAsyncCompileRaw(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::InitResponse>* AsyncInitRaw(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::InitResponse>* PrepareAsyncInitRaw(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) = 0; + }; + class Stub final : public StubInterface { + public: + Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + ::grpc::Status Compile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::rsh::protocol::CompileResponse* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::CompileResponse>> AsyncCompile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::CompileResponse>>(AsyncCompileRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::CompileResponse>> PrepareAsyncCompile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::CompileResponse>>(PrepareAsyncCompileRaw(context, request, cq)); + } + ::grpc::Status Init(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::rsh::protocol::InitResponse* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::InitResponse>> AsyncInit(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::InitResponse>>(AsyncInitRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::InitResponse>> PrepareAsyncInit(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::InitResponse>>(PrepareAsyncInitRaw(context, request, cq)); + } + class async final : + public StubInterface::async_interface { + public: + void Compile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest* request, ::rsh::protocol::CompileResponse* response, std::function) override; + void Compile(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest* request, ::rsh::protocol::CompileResponse* response, ::grpc::ClientUnaryReactor* reactor) override; + void Init(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest* request, ::rsh::protocol::InitResponse* response, std::function) override; + void Init(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest* request, ::rsh::protocol::InitResponse* response, ::grpc::ClientUnaryReactor* reactor) override; + private: + friend class Stub; + explicit async(Stub* stub): stub_(stub) { } + Stub* stub() { return stub_; } + Stub* stub_; + }; + class async* async() override { return &async_stub_; } + + private: + std::shared_ptr< ::grpc::ChannelInterface> channel_; + class async async_stub_{this}; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::CompileResponse>* AsyncCompileRaw(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::CompileResponse>* PrepareAsyncCompileRaw(::grpc::ClientContext* context, const ::rsh::protocol::CompileRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::InitResponse>* AsyncInitRaw(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::InitResponse>* PrepareAsyncInitRaw(::grpc::ClientContext* context, const ::rsh::protocol::InitRequest& request, ::grpc::CompletionQueue* cq) override; + const ::grpc::internal::RpcMethod rpcmethod_Compile_; + const ::grpc::internal::RpcMethod rpcmethod_Init_; + }; + static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + + class Service : public ::grpc::Service { + public: + Service(); + virtual ~Service(); + virtual ::grpc::Status Compile(::grpc::ServerContext* context, const ::rsh::protocol::CompileRequest* request, ::rsh::protocol::CompileResponse* response); + virtual ::grpc::Status Init(::grpc::ServerContext* context, const ::rsh::protocol::InitRequest* request, ::rsh::protocol::InitResponse* response); + }; + template + class WithAsyncMethod_Compile : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_Compile() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_Compile() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Compile(::grpc::ServerContext* /*context*/, const ::rsh::protocol::CompileRequest* /*request*/, ::rsh::protocol::CompileResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestCompile(::grpc::ServerContext* context, ::rsh::protocol::CompileRequest* request, ::grpc::ServerAsyncResponseWriter< ::rsh::protocol::CompileResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_Init : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_Init() { + ::grpc::Service::MarkMethodAsync(1); + } + ~WithAsyncMethod_Init() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Init(::grpc::ServerContext* /*context*/, const ::rsh::protocol::InitRequest* /*request*/, ::rsh::protocol::InitResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestInit(::grpc::ServerContext* context, ::rsh::protocol::InitRequest* request, ::grpc::ServerAsyncResponseWriter< ::rsh::protocol::InitResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_Compile > AsyncService; + template + class WithCallbackMethod_Compile : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_Compile() { + ::grpc::Service::MarkMethodCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::CompileRequest, ::rsh::protocol::CompileResponse>( + [this]( + ::grpc::CallbackServerContext* context, const ::rsh::protocol::CompileRequest* request, ::rsh::protocol::CompileResponse* response) { return this->Compile(context, request, response); }));} + void SetMessageAllocatorFor_Compile( + ::grpc::MessageAllocator< ::rsh::protocol::CompileRequest, ::rsh::protocol::CompileResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); + static_cast<::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::CompileRequest, ::rsh::protocol::CompileResponse>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_Compile() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Compile(::grpc::ServerContext* /*context*/, const ::rsh::protocol::CompileRequest* /*request*/, ::rsh::protocol::CompileResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* Compile( + ::grpc::CallbackServerContext* /*context*/, const ::rsh::protocol::CompileRequest* /*request*/, ::rsh::protocol::CompileResponse* /*response*/) { return nullptr; } + }; + template + class WithCallbackMethod_Init : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_Init() { + ::grpc::Service::MarkMethodCallback(1, + new ::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::InitRequest, ::rsh::protocol::InitResponse>( + [this]( + ::grpc::CallbackServerContext* context, const ::rsh::protocol::InitRequest* request, ::rsh::protocol::InitResponse* response) { return this->Init(context, request, response); }));} + void SetMessageAllocatorFor_Init( + ::grpc::MessageAllocator< ::rsh::protocol::InitRequest, ::rsh::protocol::InitResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); + static_cast<::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::InitRequest, ::rsh::protocol::InitResponse>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_Init() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Init(::grpc::ServerContext* /*context*/, const ::rsh::protocol::InitRequest* /*request*/, ::rsh::protocol::InitResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* Init( + ::grpc::CallbackServerContext* /*context*/, const ::rsh::protocol::InitRequest* /*request*/, ::rsh::protocol::InitResponse* /*response*/) { return nullptr; } + }; + typedef WithCallbackMethod_Compile > CallbackService; + typedef CallbackService ExperimentalCallbackService; + template + class WithGenericMethod_Compile : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_Compile() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_Compile() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Compile(::grpc::ServerContext* /*context*/, const ::rsh::protocol::CompileRequest* /*request*/, ::rsh::protocol::CompileResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_Init : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_Init() { + ::grpc::Service::MarkMethodGeneric(1); + } + ~WithGenericMethod_Init() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Init(::grpc::ServerContext* /*context*/, const ::rsh::protocol::InitRequest* /*request*/, ::rsh::protocol::InitResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithRawMethod_Compile : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_Compile() { + ::grpc::Service::MarkMethodRaw(0); + } + ~WithRawMethod_Compile() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Compile(::grpc::ServerContext* /*context*/, const ::rsh::protocol::CompileRequest* /*request*/, ::rsh::protocol::CompileResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestCompile(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_Init : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_Init() { + ::grpc::Service::MarkMethodRaw(1); + } + ~WithRawMethod_Init() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Init(::grpc::ServerContext* /*context*/, const ::rsh::protocol::InitRequest* /*request*/, ::rsh::protocol::InitResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestInit(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawCallbackMethod_Compile : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_Compile() { + ::grpc::Service::MarkMethodRawCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Compile(context, request, response); })); + } + ~WithRawCallbackMethod_Compile() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Compile(::grpc::ServerContext* /*context*/, const ::rsh::protocol::CompileRequest* /*request*/, ::rsh::protocol::CompileResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* Compile( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithRawCallbackMethod_Init : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_Init() { + ::grpc::Service::MarkMethodRawCallback(1, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->Init(context, request, response); })); + } + ~WithRawCallbackMethod_Init() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Init(::grpc::ServerContext* /*context*/, const ::rsh::protocol::InitRequest* /*request*/, ::rsh::protocol::InitResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* Init( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithStreamedUnaryMethod_Compile : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_Compile() { + ::grpc::Service::MarkMethodStreamed(0, + new ::grpc::internal::StreamedUnaryHandler< + ::rsh::protocol::CompileRequest, ::rsh::protocol::CompileResponse>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::rsh::protocol::CompileRequest, ::rsh::protocol::CompileResponse>* streamer) { + return this->StreamedCompile(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_Compile() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status Compile(::grpc::ServerContext* /*context*/, const ::rsh::protocol::CompileRequest* /*request*/, ::rsh::protocol::CompileResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedCompile(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::rsh::protocol::CompileRequest,::rsh::protocol::CompileResponse>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_Init : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_Init() { + ::grpc::Service::MarkMethodStreamed(1, + new ::grpc::internal::StreamedUnaryHandler< + ::rsh::protocol::InitRequest, ::rsh::protocol::InitResponse>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::rsh::protocol::InitRequest, ::rsh::protocol::InitResponse>* streamer) { + return this->StreamedInit(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_Init() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status Init(::grpc::ServerContext* /*context*/, const ::rsh::protocol::InitRequest* /*request*/, ::rsh::protocol::InitResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedInit(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::rsh::protocol::InitRequest,::rsh::protocol::InitResponse>* server_unary_streamer) = 0; + }; + typedef WithStreamedUnaryMethod_Compile > StreamedUnaryService; + typedef Service SplitStreamedService; + typedef WithStreamedUnaryMethod_Compile > StreamedService; +}; + +// Used by the compile server to ask questions to R +// The server part there should be in the C++ code +class FactService final { + public: + static constexpr char const* service_full_name() { + return "rsh.protocol.FactService"; + } + class StubInterface { + public: + virtual ~StubInterface() {} + virtual ::grpc::Status GetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::rsh::protocol::Context* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Context>> AsyncGetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Context>>(AsyncGetContextRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Context>> PrepareAsyncGetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Context>>(PrepareAsyncGetContextRaw(context, request, cq)); + } + virtual ::grpc::Status GetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::rsh::protocol::TypeFeedback* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::TypeFeedback>> AsyncGetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::TypeFeedback>>(AsyncGetTypeFeedbackRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::TypeFeedback>> PrepareAsyncGetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::TypeFeedback>>(PrepareAsyncGetTypeFeedbackRaw(context, request, cq)); + } + virtual ::grpc::Status GetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::rsh::protocol::Values* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Values>> AsyncGetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Values>>(AsyncGetValuesRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Values>> PrepareAsyncGetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Values>>(PrepareAsyncGetValuesRaw(context, request, cq)); + } + virtual ::grpc::Status GetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::rsh::protocol::Function* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Function>> AsyncGetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Function>>(AsyncGetFunctionRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Function>> PrepareAsyncGetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Function>>(PrepareAsyncGetFunctionRaw(context, request, cq)); + } + class async_interface { + public: + virtual ~async_interface() {} + virtual void GetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest* request, ::rsh::protocol::Context* response, std::function) = 0; + virtual void GetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest* request, ::rsh::protocol::Context* response, ::grpc::ClientUnaryReactor* reactor) = 0; + virtual void GetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest* request, ::rsh::protocol::TypeFeedback* response, std::function) = 0; + virtual void GetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest* request, ::rsh::protocol::TypeFeedback* response, ::grpc::ClientUnaryReactor* reactor) = 0; + virtual void GetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest* request, ::rsh::protocol::Values* response, std::function) = 0; + virtual void GetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest* request, ::rsh::protocol::Values* response, ::grpc::ClientUnaryReactor* reactor) = 0; + virtual void GetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest* request, ::rsh::protocol::Function* response, std::function) = 0; + virtual void GetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest* request, ::rsh::protocol::Function* response, ::grpc::ClientUnaryReactor* reactor) = 0; + }; + typedef class async_interface experimental_async_interface; + virtual class async_interface* async() { return nullptr; } + class async_interface* experimental_async() { return async(); } + private: + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Context>* AsyncGetContextRaw(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Context>* PrepareAsyncGetContextRaw(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::TypeFeedback>* AsyncGetTypeFeedbackRaw(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::TypeFeedback>* PrepareAsyncGetTypeFeedbackRaw(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Values>* AsyncGetValuesRaw(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Values>* PrepareAsyncGetValuesRaw(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Function>* AsyncGetFunctionRaw(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::rsh::protocol::Function>* PrepareAsyncGetFunctionRaw(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) = 0; + }; + class Stub final : public StubInterface { + public: + Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + ::grpc::Status GetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::rsh::protocol::Context* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Context>> AsyncGetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Context>>(AsyncGetContextRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Context>> PrepareAsyncGetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Context>>(PrepareAsyncGetContextRaw(context, request, cq)); + } + ::grpc::Status GetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::rsh::protocol::TypeFeedback* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::TypeFeedback>> AsyncGetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::TypeFeedback>>(AsyncGetTypeFeedbackRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::TypeFeedback>> PrepareAsyncGetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::TypeFeedback>>(PrepareAsyncGetTypeFeedbackRaw(context, request, cq)); + } + ::grpc::Status GetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::rsh::protocol::Values* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Values>> AsyncGetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Values>>(AsyncGetValuesRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Values>> PrepareAsyncGetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Values>>(PrepareAsyncGetValuesRaw(context, request, cq)); + } + ::grpc::Status GetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::rsh::protocol::Function* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Function>> AsyncGetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Function>>(AsyncGetFunctionRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Function>> PrepareAsyncGetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Function>>(PrepareAsyncGetFunctionRaw(context, request, cq)); + } + class async final : + public StubInterface::async_interface { + public: + void GetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest* request, ::rsh::protocol::Context* response, std::function) override; + void GetContext(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest* request, ::rsh::protocol::Context* response, ::grpc::ClientUnaryReactor* reactor) override; + void GetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest* request, ::rsh::protocol::TypeFeedback* response, std::function) override; + void GetTypeFeedback(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest* request, ::rsh::protocol::TypeFeedback* response, ::grpc::ClientUnaryReactor* reactor) override; + void GetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest* request, ::rsh::protocol::Values* response, std::function) override; + void GetValues(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest* request, ::rsh::protocol::Values* response, ::grpc::ClientUnaryReactor* reactor) override; + void GetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest* request, ::rsh::protocol::Function* response, std::function) override; + void GetFunction(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest* request, ::rsh::protocol::Function* response, ::grpc::ClientUnaryReactor* reactor) override; + private: + friend class Stub; + explicit async(Stub* stub): stub_(stub) { } + Stub* stub() { return stub_; } + Stub* stub_; + }; + class async* async() override { return &async_stub_; } + + private: + std::shared_ptr< ::grpc::ChannelInterface> channel_; + class async async_stub_{this}; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Context>* AsyncGetContextRaw(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Context>* PrepareAsyncGetContextRaw(::grpc::ClientContext* context, const ::rsh::protocol::ContextRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::TypeFeedback>* AsyncGetTypeFeedbackRaw(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::TypeFeedback>* PrepareAsyncGetTypeFeedbackRaw(::grpc::ClientContext* context, const ::rsh::protocol::FeedbackRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Values>* AsyncGetValuesRaw(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Values>* PrepareAsyncGetValuesRaw(::grpc::ClientContext* context, const ::rsh::protocol::ValueRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Function>* AsyncGetFunctionRaw(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::rsh::protocol::Function>* PrepareAsyncGetFunctionRaw(::grpc::ClientContext* context, const ::rsh::protocol::FunctionRequest& request, ::grpc::CompletionQueue* cq) override; + const ::grpc::internal::RpcMethod rpcmethod_GetContext_; + const ::grpc::internal::RpcMethod rpcmethod_GetTypeFeedback_; + const ::grpc::internal::RpcMethod rpcmethod_GetValues_; + const ::grpc::internal::RpcMethod rpcmethod_GetFunction_; + }; + static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + + class Service : public ::grpc::Service { + public: + Service(); + virtual ~Service(); + virtual ::grpc::Status GetContext(::grpc::ServerContext* context, const ::rsh::protocol::ContextRequest* request, ::rsh::protocol::Context* response); + virtual ::grpc::Status GetTypeFeedback(::grpc::ServerContext* context, const ::rsh::protocol::FeedbackRequest* request, ::rsh::protocol::TypeFeedback* response); + virtual ::grpc::Status GetValues(::grpc::ServerContext* context, const ::rsh::protocol::ValueRequest* request, ::rsh::protocol::Values* response); + virtual ::grpc::Status GetFunction(::grpc::ServerContext* context, const ::rsh::protocol::FunctionRequest* request, ::rsh::protocol::Function* response); + }; + template + class WithAsyncMethod_GetContext : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_GetContext() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_GetContext() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetContext(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ContextRequest* /*request*/, ::rsh::protocol::Context* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetContext(::grpc::ServerContext* context, ::rsh::protocol::ContextRequest* request, ::grpc::ServerAsyncResponseWriter< ::rsh::protocol::Context>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_GetTypeFeedback : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_GetTypeFeedback() { + ::grpc::Service::MarkMethodAsync(1); + } + ~WithAsyncMethod_GetTypeFeedback() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTypeFeedback(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FeedbackRequest* /*request*/, ::rsh::protocol::TypeFeedback* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetTypeFeedback(::grpc::ServerContext* context, ::rsh::protocol::FeedbackRequest* request, ::grpc::ServerAsyncResponseWriter< ::rsh::protocol::TypeFeedback>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_GetValues : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_GetValues() { + ::grpc::Service::MarkMethodAsync(2); + } + ~WithAsyncMethod_GetValues() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetValues(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ValueRequest* /*request*/, ::rsh::protocol::Values* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetValues(::grpc::ServerContext* context, ::rsh::protocol::ValueRequest* request, ::grpc::ServerAsyncResponseWriter< ::rsh::protocol::Values>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_GetFunction : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_GetFunction() { + ::grpc::Service::MarkMethodAsync(3); + } + ~WithAsyncMethod_GetFunction() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetFunction(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FunctionRequest* /*request*/, ::rsh::protocol::Function* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetFunction(::grpc::ServerContext* context, ::rsh::protocol::FunctionRequest* request, ::grpc::ServerAsyncResponseWriter< ::rsh::protocol::Function>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_GetContext > > > AsyncService; + template + class WithCallbackMethod_GetContext : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_GetContext() { + ::grpc::Service::MarkMethodCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::ContextRequest, ::rsh::protocol::Context>( + [this]( + ::grpc::CallbackServerContext* context, const ::rsh::protocol::ContextRequest* request, ::rsh::protocol::Context* response) { return this->GetContext(context, request, response); }));} + void SetMessageAllocatorFor_GetContext( + ::grpc::MessageAllocator< ::rsh::protocol::ContextRequest, ::rsh::protocol::Context>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); + static_cast<::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::ContextRequest, ::rsh::protocol::Context>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_GetContext() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetContext(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ContextRequest* /*request*/, ::rsh::protocol::Context* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetContext( + ::grpc::CallbackServerContext* /*context*/, const ::rsh::protocol::ContextRequest* /*request*/, ::rsh::protocol::Context* /*response*/) { return nullptr; } + }; + template + class WithCallbackMethod_GetTypeFeedback : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_GetTypeFeedback() { + ::grpc::Service::MarkMethodCallback(1, + new ::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::FeedbackRequest, ::rsh::protocol::TypeFeedback>( + [this]( + ::grpc::CallbackServerContext* context, const ::rsh::protocol::FeedbackRequest* request, ::rsh::protocol::TypeFeedback* response) { return this->GetTypeFeedback(context, request, response); }));} + void SetMessageAllocatorFor_GetTypeFeedback( + ::grpc::MessageAllocator< ::rsh::protocol::FeedbackRequest, ::rsh::protocol::TypeFeedback>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); + static_cast<::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::FeedbackRequest, ::rsh::protocol::TypeFeedback>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_GetTypeFeedback() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTypeFeedback(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FeedbackRequest* /*request*/, ::rsh::protocol::TypeFeedback* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetTypeFeedback( + ::grpc::CallbackServerContext* /*context*/, const ::rsh::protocol::FeedbackRequest* /*request*/, ::rsh::protocol::TypeFeedback* /*response*/) { return nullptr; } + }; + template + class WithCallbackMethod_GetValues : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_GetValues() { + ::grpc::Service::MarkMethodCallback(2, + new ::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::ValueRequest, ::rsh::protocol::Values>( + [this]( + ::grpc::CallbackServerContext* context, const ::rsh::protocol::ValueRequest* request, ::rsh::protocol::Values* response) { return this->GetValues(context, request, response); }));} + void SetMessageAllocatorFor_GetValues( + ::grpc::MessageAllocator< ::rsh::protocol::ValueRequest, ::rsh::protocol::Values>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); + static_cast<::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::ValueRequest, ::rsh::protocol::Values>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_GetValues() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetValues(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ValueRequest* /*request*/, ::rsh::protocol::Values* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetValues( + ::grpc::CallbackServerContext* /*context*/, const ::rsh::protocol::ValueRequest* /*request*/, ::rsh::protocol::Values* /*response*/) { return nullptr; } + }; + template + class WithCallbackMethod_GetFunction : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_GetFunction() { + ::grpc::Service::MarkMethodCallback(3, + new ::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::FunctionRequest, ::rsh::protocol::Function>( + [this]( + ::grpc::CallbackServerContext* context, const ::rsh::protocol::FunctionRequest* request, ::rsh::protocol::Function* response) { return this->GetFunction(context, request, response); }));} + void SetMessageAllocatorFor_GetFunction( + ::grpc::MessageAllocator< ::rsh::protocol::FunctionRequest, ::rsh::protocol::Function>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); + static_cast<::grpc::internal::CallbackUnaryHandler< ::rsh::protocol::FunctionRequest, ::rsh::protocol::Function>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_GetFunction() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetFunction(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FunctionRequest* /*request*/, ::rsh::protocol::Function* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetFunction( + ::grpc::CallbackServerContext* /*context*/, const ::rsh::protocol::FunctionRequest* /*request*/, ::rsh::protocol::Function* /*response*/) { return nullptr; } + }; + typedef WithCallbackMethod_GetContext > > > CallbackService; + typedef CallbackService ExperimentalCallbackService; + template + class WithGenericMethod_GetContext : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_GetContext() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_GetContext() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetContext(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ContextRequest* /*request*/, ::rsh::protocol::Context* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_GetTypeFeedback : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_GetTypeFeedback() { + ::grpc::Service::MarkMethodGeneric(1); + } + ~WithGenericMethod_GetTypeFeedback() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTypeFeedback(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FeedbackRequest* /*request*/, ::rsh::protocol::TypeFeedback* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_GetValues : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_GetValues() { + ::grpc::Service::MarkMethodGeneric(2); + } + ~WithGenericMethod_GetValues() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetValues(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ValueRequest* /*request*/, ::rsh::protocol::Values* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_GetFunction : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_GetFunction() { + ::grpc::Service::MarkMethodGeneric(3); + } + ~WithGenericMethod_GetFunction() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetFunction(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FunctionRequest* /*request*/, ::rsh::protocol::Function* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithRawMethod_GetContext : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_GetContext() { + ::grpc::Service::MarkMethodRaw(0); + } + ~WithRawMethod_GetContext() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetContext(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ContextRequest* /*request*/, ::rsh::protocol::Context* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetContext(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_GetTypeFeedback : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_GetTypeFeedback() { + ::grpc::Service::MarkMethodRaw(1); + } + ~WithRawMethod_GetTypeFeedback() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTypeFeedback(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FeedbackRequest* /*request*/, ::rsh::protocol::TypeFeedback* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetTypeFeedback(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_GetValues : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_GetValues() { + ::grpc::Service::MarkMethodRaw(2); + } + ~WithRawMethod_GetValues() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetValues(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ValueRequest* /*request*/, ::rsh::protocol::Values* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetValues(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_GetFunction : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_GetFunction() { + ::grpc::Service::MarkMethodRaw(3); + } + ~WithRawMethod_GetFunction() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetFunction(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FunctionRequest* /*request*/, ::rsh::protocol::Function* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetFunction(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawCallbackMethod_GetContext : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_GetContext() { + ::grpc::Service::MarkMethodRawCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetContext(context, request, response); })); + } + ~WithRawCallbackMethod_GetContext() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetContext(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ContextRequest* /*request*/, ::rsh::protocol::Context* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetContext( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithRawCallbackMethod_GetTypeFeedback : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_GetTypeFeedback() { + ::grpc::Service::MarkMethodRawCallback(1, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetTypeFeedback(context, request, response); })); + } + ~WithRawCallbackMethod_GetTypeFeedback() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetTypeFeedback(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FeedbackRequest* /*request*/, ::rsh::protocol::TypeFeedback* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetTypeFeedback( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithRawCallbackMethod_GetValues : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_GetValues() { + ::grpc::Service::MarkMethodRawCallback(2, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetValues(context, request, response); })); + } + ~WithRawCallbackMethod_GetValues() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetValues(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ValueRequest* /*request*/, ::rsh::protocol::Values* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetValues( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithRawCallbackMethod_GetFunction : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_GetFunction() { + ::grpc::Service::MarkMethodRawCallback(3, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetFunction(context, request, response); })); + } + ~WithRawCallbackMethod_GetFunction() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetFunction(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FunctionRequest* /*request*/, ::rsh::protocol::Function* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* GetFunction( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } + }; + template + class WithStreamedUnaryMethod_GetContext : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_GetContext() { + ::grpc::Service::MarkMethodStreamed(0, + new ::grpc::internal::StreamedUnaryHandler< + ::rsh::protocol::ContextRequest, ::rsh::protocol::Context>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::rsh::protocol::ContextRequest, ::rsh::protocol::Context>* streamer) { + return this->StreamedGetContext(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_GetContext() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status GetContext(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ContextRequest* /*request*/, ::rsh::protocol::Context* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedGetContext(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::rsh::protocol::ContextRequest,::rsh::protocol::Context>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_GetTypeFeedback : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_GetTypeFeedback() { + ::grpc::Service::MarkMethodStreamed(1, + new ::grpc::internal::StreamedUnaryHandler< + ::rsh::protocol::FeedbackRequest, ::rsh::protocol::TypeFeedback>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::rsh::protocol::FeedbackRequest, ::rsh::protocol::TypeFeedback>* streamer) { + return this->StreamedGetTypeFeedback(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_GetTypeFeedback() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status GetTypeFeedback(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FeedbackRequest* /*request*/, ::rsh::protocol::TypeFeedback* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedGetTypeFeedback(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::rsh::protocol::FeedbackRequest,::rsh::protocol::TypeFeedback>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_GetValues : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_GetValues() { + ::grpc::Service::MarkMethodStreamed(2, + new ::grpc::internal::StreamedUnaryHandler< + ::rsh::protocol::ValueRequest, ::rsh::protocol::Values>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::rsh::protocol::ValueRequest, ::rsh::protocol::Values>* streamer) { + return this->StreamedGetValues(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_GetValues() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status GetValues(::grpc::ServerContext* /*context*/, const ::rsh::protocol::ValueRequest* /*request*/, ::rsh::protocol::Values* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedGetValues(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::rsh::protocol::ValueRequest,::rsh::protocol::Values>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_GetFunction : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_GetFunction() { + ::grpc::Service::MarkMethodStreamed(3, + new ::grpc::internal::StreamedUnaryHandler< + ::rsh::protocol::FunctionRequest, ::rsh::protocol::Function>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::rsh::protocol::FunctionRequest, ::rsh::protocol::Function>* streamer) { + return this->StreamedGetFunction(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_GetFunction() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status GetFunction(::grpc::ServerContext* /*context*/, const ::rsh::protocol::FunctionRequest* /*request*/, ::rsh::protocol::Function* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedGetFunction(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::rsh::protocol::FunctionRequest,::rsh::protocol::Function>* server_unary_streamer) = 0; + }; + typedef WithStreamedUnaryMethod_GetContext > > > StreamedUnaryService; + typedef Service SplitStreamedService; + typedef WithStreamedUnaryMethod_GetContext > > > StreamedService; +}; + +} // namespace protocol +} // namespace rsh + + +#endif // GRPC_routes_2eproto__INCLUDED diff --git a/client/rsh/src/routes.pb.cc b/client/rsh/src/routes.pb.cc new file mode 100644 index 000000000..0ecc6ef9d --- /dev/null +++ b/client/rsh/src/routes.pb.cc @@ -0,0 +1,77 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: routes.proto + +#include "routes.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace rsh { +namespace protocol { +} // namespace protocol +} // namespace rsh +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_routes_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_routes_2eproto = nullptr; +const uint32_t TableStruct_routes_2eproto::offsets[1] = {}; +static constexpr ::_pbi::MigrationSchema* schemas = nullptr; +static constexpr ::_pb::Message* const* file_default_instances = nullptr; + +const char descriptor_table_protodef_routes_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\014routes.proto\022\014rsh.protocol\032\016messages.p" + "roto2\233\001\n\016CompileService\022H\n\007Compile\022\034.rsh" + ".protocol.CompileRequest\032\035.rsh.protocol." + "CompileResponse\"\000\022\?\n\004Init\022\031.rsh.protocol" + ".InitRequest\032\032.rsh.protocol.InitResponse" + "\"\0002\253\002\n\013FactService\022C\n\nGetContext\022\034.rsh.p" + "rotocol.ContextRequest\032\025.rsh.protocol.Co" + "ntext\"\000\022N\n\017GetTypeFeedback\022\035.rsh.protoco" + "l.FeedbackRequest\032\032.rsh.protocol.TypeFee" + "dback\"\000\022\?\n\tGetValues\022\032.rsh.protocol.Valu" + "eRequest\032\024.rsh.protocol.Values\"\000\022F\n\013GetF" + "unction\022\035.rsh.protocol.FunctionRequest\032\026" + ".rsh.protocol.Function\"\000B\023\n\021org.prlprg.s" + "erverb\006proto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_routes_2eproto_deps[1] = { + &::descriptor_table_messages_2eproto, +}; +static ::_pbi::once_flag descriptor_table_routes_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_routes_2eproto = { + false, false, 533, descriptor_table_protodef_routes_2eproto, + "routes.proto", + &descriptor_table_routes_2eproto_once, descriptor_table_routes_2eproto_deps, 1, 0, + schemas, file_default_instances, TableStruct_routes_2eproto::offsets, + nullptr, file_level_enum_descriptors_routes_2eproto, + file_level_service_descriptors_routes_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_routes_2eproto_getter() { + return &descriptor_table_routes_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_routes_2eproto(&descriptor_table_routes_2eproto); +namespace rsh { +namespace protocol { + +// @@protoc_insertion_point(namespace_scope) +} // namespace protocol +} // namespace rsh +PROTOBUF_NAMESPACE_OPEN +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/client/rsh/src/routes.pb.h b/client/rsh/src/routes.pb.h new file mode 100644 index 000000000..c213b0242 --- /dev/null +++ b/client/rsh/src/routes.pb.h @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: routes.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_routes_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_routes_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include "messages.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_routes_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_routes_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_routes_2eproto; +PROTOBUF_NAMESPACE_OPEN +PROTOBUF_NAMESPACE_CLOSE +namespace rsh { +namespace protocol { + +// =================================================================== + + +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace protocol +} // namespace rsh + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_routes_2eproto diff --git a/client/rsh/test6.R b/client/rsh/test6.R new file mode 100644 index 000000000..ebdffd809 --- /dev/null +++ b/client/rsh/test6.R @@ -0,0 +1,44 @@ +rsh::rsh_jit_enable() +rsh::rsh_jit_disable() + + +cat("TEST 1\n") +f <- function(x) { + y <- x + 42 + y + x +} +print(f) +rsh::rsh_compile(f, list(tier = "bytecode", bc_opt = 3L)) +print(f) +print(f(5)) +stopifnot(f(5) == 52) + +cat("TEST 2\n") +# f should be in the compile cache now. +rsh::rsh_compile(f, list(tier = "bytecode", bc_opt = 3L)) +print(f) +.Internal(inspect(f)) +print(f(5)) +stopifnot(f(5) == 52) + +cat("TEST 3\n") +# another opt level so it should be recompiled +rsh::rsh_compile(f, list(tier = "bytecode", bc_opt = 2L)) +stopifnot(f(5) == 52) + + +cat("TEST 4\n") +f <- function(x) { + x + 3 +} + +# body changed so it should be recompiled +rsh::rsh_compile(f, list(tier = "bytecode", bc_opt = 2L)) +#str(compiler::disassemble(f)) +stopifnot(f(5) == 8) + +cat("TEST 5\n") +# Now native compilation +rsh::rsh_compile(f, list(tier = "native", bc_opt = 3L, cc_opt = 3L)) + +stopifnot(f(5) == 8) \ No newline at end of file diff --git a/proto/Makefile b/proto/Makefile new file mode 100644 index 000000000..d11ac4290 --- /dev/null +++ b/proto/Makefile @@ -0,0 +1,7 @@ +CPP_DEST := ../client/rsh/src +JAVA_DEST := ../server/src/main/proto + +all: + protoc --cpp_out=$(CPP_DEST) messages.proto routes.proto + protoc --grpc_out=$(CPP_DEST) --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` routes.proto + cp messages.proto routes.proto $(JAVA_DEST) diff --git a/proto/README.md b/proto/README.md new file mode 100644 index 000000000..314f9a854 --- /dev/null +++ b/proto/README.md @@ -0,0 +1,32 @@ +# Protocol + +The communication between the client and the server is done through gRPC. + +## Files + +- messages.proto: messages exchanged between the client and the server +- routes.proto: services exposed by the server with the remote functions. + +## Services + +- `CompileService` runs on the server side to compile the code and return the result. It also has + an `Init` route to initialize the server (version of R on the client...) +- `FactService` runs on the client side and is interrogated by the server to get information to compile functions, + for instance, a value in an environment. + + +## Generating the code + +Make sure you have `protoc` installed. + +## Java + +Run `make` to synchronize the proto to the java project. + +Then just compile the project through maven. The code will be generated in the `target/generated-sources/protobuf/grpc-java` and + `target/generated-sources/protobuf/java` folders. They are both part of the `server` package. + + +## C++ + +Run the `Makefile` at the root of the project as `make proto`. The code will be generated in the `client/rsh/src` folder. \ No newline at end of file diff --git a/proto/messages.proto b/proto/messages.proto new file mode 100644 index 000000000..181679b99 --- /dev/null +++ b/proto/messages.proto @@ -0,0 +1,176 @@ +syntax = "proto3"; + +option java_package = "org.prlprg.server"; + +package rsh.protocol; + +// Error handling +// grpc already has a way to handle errors +// Status message: https://grpc.github.io/grpc-java/javadoc/io/grpc/Status.html + +// Init +message Version { + int32 major = 1; + int32 minor = 2; + int32 patch = 3; +} + +message InitRequest { + Version Rsh_version = 1;// version of the compile server + Version R_version = 2; + string platform = 3;//amd64, etc TODO: use an enum for the allowed platforms? + repeated bytes package_hash = 4;//Packages which are initially part of the environment (in addition to base) +} + +message InitResponse {} + + +// Basic messages + +message CompileRequest { + Function function = 2;// Add package version + optional Tier tier = 4;//if not defined, let the compile server decide + optional int32 cc_opt = 5;// if not defined, the server decides + optional int32 bc_opt = 6;// for the bytecode. Native does bytecode first so this is also need when compiling to native + optional Context context = 7; + optional Environment environment = 8;//The values of all the bindings that statically appear in the function +} + +message CompileResponse { + uint64 hash = 1; + Tier tier = 2; + optional bytes code = 3; + optional bytes constants = 4; +} + + +message Function { + uint64 package_hash = 1; + string name = 2; //What if it is a closure passed to a HOF? + uint64 hash = 3; + optional bytes body = 4; + // what about the function parameters? +} + +message FunctionRequest { + uint64 hash = 1; +} + +message Environment { + map values = 1;//Name of the variable to a hash of the value +} + + +message ValueRequest { + repeated uint64 hash = 1;// We can batch and ask for several values +} + +message Value { + uint64 hash = 1; + bytes value = 2; +} +message Values { + repeated Value values = 1; +} + +message Empty {} + +enum Tier { + BASELINE = 0;// bytecode + OPTIMIZED = 1; // native code +} + +// Context + +message CallContext { + bool args_statically_matched = 1; + bool correct_number_of_args = 2; + bool correct_order_of_args = 3; + bool no_missing_args = 4; +} + +message ArgumentContext { + bool eager = 1; + bool reflection = 2; + bool object = 3; + optional Type type = 4; +} + +message Context { + CallContext call_context = 1; + repeated ArgumentContext argument_context = 2; +} + +message ContextRequest { + Function function = 1; +} + + +// Feedback + +enum TestLattice { + BOTH = 0; + ONLY_TRUE = 1; + ONLY_FALSE = 2; + NONE = 3; +} + +enum Type { + ANY = 0; + INTEGER = 1; + REAL = 2;// Add more types +} + +message TestFeedback { + TestLattice test_lattice = 1; +} + +message CallFeedback { + int64 n_calls = 1; + uint64 callee_hash = 2; +} + +message ValueFeedback { + bool scalar = 1; + bool object = 2; + bool accessed_attributes = 3; + bool vectorizable = 4; + bool is_promise = 5; +} + +message TypeFeedback { + message Feedback { + oneof feedback { + TestFeedback test_feedback = 1; + CallFeedback call_feedback = 2; + ValueFeedback value_feedback = 3; + } + } + map types = 2;//Offset in the bytecode to the feedback +} + +message FeedbackRequest { + Function function = 1; +} + +// Packages + + +message PackageSource { + oneof source { + string r_mirror = 2; + string github_url = 3; + } +} + +message Package { + string name = 1; + Version version = 2; + repeated uint64 function_hashes = 4; + // What about package data? Maybe just the sysdata? + optional PackageSource source = 5;//If none, it is a base package or a local package +} + +message PackageRequest { + uint64 hash = 1; +} \ No newline at end of file diff --git a/proto/routes.proto b/proto/routes.proto new file mode 100644 index 000000000..5a3208f7d --- /dev/null +++ b/proto/routes.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +option java_package = "org.prlprg.server"; + +import "messages.proto"; + +package rsh.protocol; + +// R sends requests to the compile server +service CompileService { + rpc Compile(CompileRequest) returns (CompileResponse) {} + rpc Init(InitRequest) returns (InitResponse) {} +} + +// Used by the compile server to ask questions to R +// The server part there should be in the C++ code +service FactService { + rpc GetContext(ContextRequest) returns (Context) {} + rpc GetTypeFeedback(FeedbackRequest) returns (TypeFeedback) {} + rpc GetValues(ValueRequest) returns (Values) {} + rpc GetFunction(FunctionRequest) returns (Function) {} +} \ No newline at end of file diff --git a/.tool-versions b/server/.tool-versions similarity index 100% rename from .tool-versions rename to server/.tool-versions diff --git a/server/pom.xml b/server/pom.xml index 846fe0483..b8683b66b 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -15,6 +15,8 @@ 22 ${maven.compiler.source} 7.2.0 + 3.25.3 + 1.64.0 @@ -37,11 +39,49 @@ jeromq 0.6.0 - + + + io.grpc + grpc-netty-shaded + ${grpc.version} + + + io.grpc + grpc-protobuf + ${grpc.version} + + + io.grpc + grpc-stub + ${grpc.version} + com.google.protobuf protobuf-java - 3.25.3 + ${protobuf.version} + + + io.grpc + grpc-services + ${grpc.version} + + + io.grpc + grpc-inprocess + ${grpc.version} + + + + com.asarkar.grpc + grpc-test + 1.2.2 + + + + org.apache.tomcat + annotations-api + 6.0.53 + provided @@ -93,9 +133,28 @@ + at their actual locations (bundled are overridden on recompile). --> - + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + com.google.protobuf:protoc:3.25.1:exe:${os.detected.classifier} + grpc-java + io.grpc:protoc-gen-grpc-java:1.64.0:exe:${os.detected.classifier} + + + + + compile + compile-custom + + + + + com.rudikershaw.gitbuildhook git-build-hook-maven-plugin @@ -345,5 +404,13 @@ + + + + kr.motd.maven + os-maven-plugin + 1.7.1 + + diff --git a/server/src/main/java/org/prlprg/AppConfig.java b/server/src/main/java/org/prlprg/AppConfig.java index c89a79f76..4ee3ef508 100644 --- a/server/src/main/java/org/prlprg/AppConfig.java +++ b/server/src/main/java/org/prlprg/AppConfig.java @@ -1,5 +1,9 @@ package org.prlprg; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import org.prlprg.ir.cfg.CFG; import org.prlprg.ir.closure.CodeObject; import org.prlprg.util.Strings; @@ -18,6 +22,22 @@ public final class AppConfig extends Config { */ public static final String R_BIN = get("R_BIN", "../external/R/bin/R"); + /** + * R library paths. There are the paths that the compile server will look libraries for in. We + * could call `.libPaths()` in R to get the paths R knows, but we also want to support custom + * paths? + */ + public static final ArrayList R_LIBS = new ArrayList<>(); + + static { + String defaultRlibs = "~/R/x86_64-pc-linux-gnu-library/4.3/:/usr/lib/R/library"; + defaultRlibs = defaultRlibs.replaceFirst("^~", System.getProperty("user.home")); + String r_libs = get("R_LIBS", defaultRlibs); + if (r_libs != null) { + R_LIBS.addAll(Arrays.stream(r_libs.split(":")).map(Path::of).toList()); + } + } + /** * Adds extra verification checks. * @@ -28,7 +48,7 @@ public final class AppConfig extends Config { /** * Whether to verify phi inputs' incoming basic block when they are added. * - *

They are always verified during {@linkplain org.prlprg.ir.cfg.CFG#verify()} verification + *

They are always verified during {@linkplain CFG#verify()} verification * *

Default:: true */ diff --git a/server/src/main/java/org/prlprg/RVersion.java b/server/src/main/java/org/prlprg/RVersion.java index c307ef3b8..82b96d918 100644 --- a/server/src/main/java/org/prlprg/RVersion.java +++ b/server/src/main/java/org/prlprg/RVersion.java @@ -46,7 +46,7 @@ public static RVersion parse(String textual) { return new RVersion(major, minor, patch, suffix); } - RVersion(int major, int minor, int patch) { + public RVersion(int major, int minor, int patch) { this(major, minor, patch, null); } diff --git a/server/src/main/java/org/prlprg/bc/BCCompiler.java b/server/src/main/java/org/prlprg/bc/BCCompiler.java index 33f35fe59..e67c791b6 100644 --- a/server/src/main/java/org/prlprg/bc/BCCompiler.java +++ b/server/src/main/java/org/prlprg/bc/BCCompiler.java @@ -16,7 +16,7 @@ import java.util.function.Supplier; import java.util.stream.IntStream; import javax.annotation.Nullable; -import org.prlprg.RSession; +import org.prlprg.bc.BcInstr.*; import org.prlprg.bc.BcInstr.Add; import org.prlprg.bc.BcInstr.And; import org.prlprg.bc.BcInstr.And1st; @@ -132,6 +132,8 @@ import org.prlprg.bc.BcInstr.VecSubset; import org.prlprg.bc.BcInstr.VecSubset2; import org.prlprg.bc.BcInstr.Visible; +import org.prlprg.session.RSession; +import org.prlprg.sexp.*; import org.prlprg.sexp.BCodeSXP; import org.prlprg.sexp.CloSXP; import org.prlprg.sexp.EnvSXP; diff --git a/server/src/main/java/org/prlprg/bc2c/BC2CCompiler.java b/server/src/main/java/org/prlprg/bc2c/BC2CCompiler.java index 8e505587e..aeb1addc7 100644 --- a/server/src/main/java/org/prlprg/bc2c/BC2CCompiler.java +++ b/server/src/main/java/org/prlprg/bc2c/BC2CCompiler.java @@ -74,6 +74,7 @@ record CompiledClosure(String name, VectorSXP constantPool) {} class CModule { private final List funs = new ArrayList<>(); + private int funId = 0; CFunction createFun(String returnType, String name, String args) { var fun = new CFunction(returnType, name, args); @@ -81,11 +82,8 @@ CFunction createFun(String returnType, String name, String args) { return fun; } - CompiledClosure compileClosure(Bc bc) { - var bcHash = Math.abs(bc.hashCode()); - var randomSuffix = UUID.randomUUID().toString().substring(0, 8); - var name = "f_" + bcHash + "_" + randomSuffix; - + CompiledClosure compileClosure(Bc bc, String baseName) { + var name = baseName + "_" + funId++; var compiler = new ClosureCompiler(this, name, bc); var constants = compiler.compile(); @@ -100,13 +98,18 @@ public Iterable funs() { public class BC2CCompiler { private final CModule module = new CModule(); private final Bc bc; + private final String name; // The name is chosen by the client - public BC2CCompiler(Bc bc) { + public BC2CCompiler(Bc bc, String name) { this.bc = bc; + // We can have other closures to compile in the same Bc + // We will need to generate a unique name for each + // This is the base name + this.name = name; } public CompiledModule finish() { - var compiledClosure = module.compileClosure(bc); + var compiledClosure = module.compileClosure(bc, name); var file = new CFile(); file.addInclude("runtime.h"); @@ -130,6 +133,7 @@ class ClosureCompiler { private final Set labels = new HashSet<>(); private final Set cells = new HashSet<>(); private int extraConstPoolIdx; + private final String name; protected CModule module; protected CFunction fun; @@ -137,6 +141,7 @@ class ClosureCompiler { public ClosureCompiler(CModule module, String name, Bc bc) { this.bc = bc; + this.name = name; this.module = module; this.fun = module.createFun("SEXP", name, "SEXP %s, SEXP %s".formatted(VAR_RHO, VAR_CCP)); this.body = fun.add(); @@ -370,7 +375,7 @@ private String compileMakeClosure(InstrBuilder builder, ConstPool.Idx id var cls = bc.consts().get(idx); if (cls.get(1) instanceof BCodeSXP closureBody) { - var compiledClosure = module.compileClosure(closureBody.bc()); + var compiledClosure = module.compileClosure(closureBody.bc(), name); var cpConst = createExtraConstant(compiledClosure.constantPool()); return builder .args(constantSXP(idx), "&" + compiledClosure.name(), constantSXP(cpConst)) diff --git a/server/src/main/java/org/prlprg/bc2ir/ClosureCompiler.java b/server/src/main/java/org/prlprg/bc2ir/ClosureCompiler.java index 5208e6279..2eec2c53b 100644 --- a/server/src/main/java/org/prlprg/bc2ir/ClosureCompiler.java +++ b/server/src/main/java/org/prlprg/bc2ir/ClosureCompiler.java @@ -4,7 +4,6 @@ import static org.prlprg.ir.analysis.PropertiesComputer.computeClosureVersionProperties; import static org.prlprg.ir.analysis.PropertiesComputer.computePromiseProperties; -import org.prlprg.RSession; import org.prlprg.bc.BCCompiler; import org.prlprg.ir.cfg.CFG; import org.prlprg.ir.cfg.IsEnv; @@ -13,6 +12,7 @@ import org.prlprg.ir.closure.Closure; import org.prlprg.ir.closure.ClosureVersion; import org.prlprg.ir.closure.Promise; +import org.prlprg.session.RSession; import org.prlprg.sexp.BCodeSXP; import org.prlprg.sexp.CloSXP; import org.prlprg.sexp.SEXP; diff --git a/server/src/main/java/org/prlprg/bc2ir/Module.java b/server/src/main/java/org/prlprg/bc2ir/Module.java index 7faf168ca..72d5e315a 100644 --- a/server/src/main/java/org/prlprg/bc2ir/Module.java +++ b/server/src/main/java/org/prlprg/bc2ir/Module.java @@ -5,12 +5,12 @@ import java.util.HashMap; import java.util.Map; import javax.annotation.Nullable; -import org.prlprg.RSession; import org.prlprg.bc.Bc; import org.prlprg.ir.cfg.CFG; import org.prlprg.ir.cfg.StaticEnv; import org.prlprg.ir.closure.Closure; import org.prlprg.ir.closure.ClosureVersion; +import org.prlprg.session.RSession; import org.prlprg.sexp.CloSXP; /** diff --git a/server/src/main/java/org/prlprg/rds/AltRep.java b/server/src/main/java/org/prlprg/rds/AltRep.java new file mode 100644 index 000000000..b0782d6e3 --- /dev/null +++ b/server/src/main/java/org/prlprg/rds/AltRep.java @@ -0,0 +1,68 @@ +package org.prlprg.rds; + +import java.util.HashMap; +import java.util.logging.Logger; +import org.prlprg.sexp.*; + +interface AltRep { + SEXPType getType(); + + String getClassName(); + + String getPackageName(); + + SEXP unserialize(SEXP state); +} + +class AltRepUnserializer { + private static Logger LOGGER = Logger.getLogger(AltRepUnserializer.class.getName()); + private final String className; + private final String packageName; + private final SEXPType type; + private final SEXP state; + + private static HashMap altReps = new HashMap(); + + static { + // Add here all the alt reps you want to support + addAltRep(new BaseAltrRep.CompactIntSeq()); + } + + public AltRepUnserializer(ListSXP info, SEXP state) { + className = ((RegSymSXP) info.get(0).value()).name(); + packageName = ((RegSymSXP) info.get(1).value()).name(); + type = SEXPType.valueOf(((IntSXP) info.get(2).value()).get(0)); + + // LOGGER.info( + // "Reading ALTREP with class " + // + className + // + " from package " + // + packageName + // + " with type " + // + type); + + this.state = state; + } + + public static void addAltRep(AltRep altRepClass) { + altReps.put( + altRepClass.getClassName() + altRepClass.getPackageName() + altRepClass.getType(), + altRepClass); + } + + public SEXP unserialize() { + var altRep = altReps.get(className + packageName + type); + if (altRep == null) { + throw new UnsupportedOperationException( + "AltRep " + + className + + " in package " + + packageName + + " for type " + + type + + " not implemented"); + } + + return altRep.unserialize(state); + } +} diff --git a/server/src/main/java/org/prlprg/rds/BaseAltrRep.java b/server/src/main/java/org/prlprg/rds/BaseAltrRep.java new file mode 100644 index 000000000..3811c4835 --- /dev/null +++ b/server/src/main/java/org/prlprg/rds/BaseAltrRep.java @@ -0,0 +1,45 @@ +package org.prlprg.rds; + +import java.util.stream.IntStream; +import org.prlprg.sexp.*; + +/** + * For all the altrep classes defined for base. See: ... + */ +public class BaseAltrRep { + public static class CompactIntSeq implements AltRep { + + @Override + public SEXPType getType() { + return SEXPType.INT; + } + + @Override + public String getClassName() { + return "compact_intseq"; + } + + @Override + public String getPackageName() { + return "base"; + } + + @Override + public SEXP unserialize(SEXP state) { + var l = (RealSXP) state; + var length = l.get(0).intValue(); // we might need a double there though + var start = l.get(1).intValue(); + var direction = l.get(2).intValue(); + + if (direction == 1) { + return SEXPs.integer(IntStream.rangeClosed(start, start + length).toArray()); + } else { + return SEXPs.integer( + IntStream.rangeClosed(start - length, start) + .map(i -> start - length + (start - 1 - i)) + .toArray()); + } + } + } +} diff --git a/server/src/main/java/org/prlprg/rds/RDSReader.java b/server/src/main/java/org/prlprg/rds/RDSReader.java index 301e4772e..56eb20ee8 100644 --- a/server/src/main/java/org/prlprg/rds/RDSReader.java +++ b/server/src/main/java/org/prlprg/rds/RDSReader.java @@ -3,6 +3,7 @@ import static java.util.Objects.requireNonNull; import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.Closeable; import java.io.File; @@ -11,13 +12,14 @@ import java.io.InputStream; import java.nio.charset.Charset; import java.util.*; +import java.util.logging.Logger; import javax.annotation.Nullable; -import org.prlprg.RSession; import org.prlprg.bc.Bc; import org.prlprg.primitive.BuiltinId; import org.prlprg.primitive.Complex; import org.prlprg.primitive.Constants; import org.prlprg.primitive.Logical; +import org.prlprg.session.RSession; import org.prlprg.sexp.*; import org.prlprg.util.IO; @@ -26,18 +28,31 @@ public class RDSReader implements Closeable { private final RSession rsession; private final RDSInputStream in; private final List refTable = new ArrayList<>(128); + private static Logger LOGGER = Logger.getLogger(RDSReader.class.getName()); + + // User-provided hook for PERSISTSXP + // Used for package databases for instance + public interface Hook { + SEXP hook(SEXP sexp) throws IOException; + } + + private Hook hook = null; // FIXME: this should include the logic from platform.c // or should we individually read the charset property of each SEXP? this will require // verifying which SEXPs we need to write the charset for--just CHARSXP, or also // builtin/special? - private final Charset nativeEncoding = Charset.defaultCharset(); + private Charset nativeEncoding = Charset.defaultCharset(); private RDSReader(RSession session, InputStream in) { this.rsession = session; this.in = new RDSInputStream(in); } + private void setHook(Hook hook) { + this.hook = hook; + } + /** * Reads a SEXP from the provided file. * @@ -64,10 +79,21 @@ public static SEXP readStream(RSession session, InputStream input) throws IOExce } } - private void readHeader() throws IOException { + public static SEXP readStream(RSession session, InputStream input, Hook hook) throws IOException { + try (var reader = new RDSReader(session, input)) { + reader.setHook(hook); + return reader.read(); + } + } + + public static SEXP readByteString(RSession session, ByteString byteString) throws IOException { + return RDSReader.readStream(session, byteString.newInput()); + } - if (in.readByte() != 'X') { - throw new RDSException("Unsupported type (possibly compressed)"); + private void readHeader() throws IOException { + var RDSkind = in.readByte(); + if (RDSkind != 'X') { + throw new RDSException("Unsupported type (possibly compressed): " + RDSkind); } if (in.readByte() != '\n') { throw new RDSException("Expected newline"); @@ -75,14 +101,22 @@ private void readHeader() throws IOException { // versions var formatVersion = in.readInt(); - if (formatVersion != 2) { - // we do not support RDS version 3 because it uses ALTREP - throw new RDSException("Unsupported RDS version: " + formatVersion); + if (formatVersion > 2) { + // we do not completely support RDS version 3 because it uses ALTREP + // LOGGER.warning("RDS version: " + formatVersion + "; some features are not supported."); } // writer version in.readInt(); // minimal reader version in.readInt(); + + if (formatVersion >= 3) { + int encodingLength = in.readInt(); + if (encodingLength > 0) { + var encoding = in.readString(encodingLength, nativeEncoding); + nativeEncoding = Charset.forName(encoding); + } + } } public SEXP read() throws IOException { @@ -135,7 +169,9 @@ private SEXP readItem() throws IOException { throw new RDSException("Unexpected bytecode reference here (not in bytecode)"); case ATTRLANGSXP, ATTRLISTSXP -> throw new RDSException("Unexpected attr here"); case UNBOUNDVALUE_SXP -> SEXPs.UNBOUND_VALUE; - case GENERICREFSXP, PACKAGESXP, PERSISTSXP, CLASSREFSXP, ALTREPSXP -> + case PERSISTSXP -> readPersist(flags); + case ALTREPSXP -> readAltRep(flags); + case GENERICREFSXP, PACKAGESXP, CLASSREFSXP -> throw new RDSException("Unsupported RDS special type: " + s); }; }; @@ -149,6 +185,28 @@ private SEXP readExternalPtr() throws IOException { return ptr; } + private SEXP readAltRep(Flags flags) throws IOException { + // Info: serialized class (looks like it is also the attribute of the altrep object!) + // Info is a 3 element list: class name, package name, type + var info = (ListSXP) readItem(); + var state = readItem(); + var attributes = readAttributes(); + + var sexp = new AltRepUnserializer(info, state).unserialize(); + return sexp.withAttributes(attributes); + } + + private SEXP readPersist(Flags flags) throws IOException { + var strs = readStringVec(); + // Call the persistent hook on that strsxp + if (hook == null) { + throw new RDSException("No hook provided for PERSISTSXP"); + } + var res = hook.hook(strs); + refTable.add(res); + return res; + } + private SEXP readComplex(Flags flags) throws IOException { var length = in.readInt(); var cplx = ImmutableList.builder(); @@ -590,7 +648,8 @@ private ListSXP readList(Flags flags) throws IOException { private CloSXP readClosure(Flags flags) throws IOException { var attributes = readAttributes(flags); - if (!(readItem() instanceof EnvSXP env)) { + var item = readItem(); + if (!(item instanceof EnvSXP env)) { throw new RDSException("Expected CLOENV to be environment"); } if (!(readItem() instanceof ListSXP formals)) { diff --git a/server/src/main/java/org/prlprg/rds/RDSWriter.java b/server/src/main/java/org/prlprg/rds/RDSWriter.java index 8aef8f576..054f823f8 100644 --- a/server/src/main/java/org/prlprg/rds/RDSWriter.java +++ b/server/src/main/java/org/prlprg/rds/RDSWriter.java @@ -1,5 +1,6 @@ package org.prlprg.rds; +import com.google.protobuf.ByteString; import java.io.*; import java.nio.charset.Charset; import java.util.*; @@ -34,6 +35,12 @@ public static void writeStream(OutputStream output, SEXP sexp) throws IOExceptio } } + public static ByteString writeByteString(SEXP sexp) throws IOException { + var output = ByteString.newOutput(); + RDSWriter.writeStream(output, sexp); + return output.toByteString(); + } + /** * Writes a SEXP to the provided file. * diff --git a/server/src/main/java/org/prlprg/server/CompileServer.java b/server/src/main/java/org/prlprg/server/CompileServer.java new file mode 100644 index 000000000..830ada6ef --- /dev/null +++ b/server/src/main/java/org/prlprg/server/CompileServer.java @@ -0,0 +1,71 @@ +package org.prlprg.server; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.health.v1.HealthCheckResponse; +import io.grpc.protobuf.services.HealthStatusManager; +import io.grpc.protobuf.services.ProtoReflectionService; +import java.util.concurrent.TimeUnit; +import java.util.logging.Logger; + +class CompileServer { + private static final Logger logger = Logger.getLogger(CompileServer.class.getName()); + + private final int port; + private final Server server; + private HealthStatusManager health; + + public CompileServer(int port) { + this.port = port; + this.health = new HealthStatusManager(); + this.server = + ServerBuilder.forPort(port) + .addService(new CompileService()) + .addService(health.getHealthService()) + .addService( + ProtoReflectionService + .newInstance()) // automatic discovery of all services and messages + .build(); + } + + public void start() throws Exception { + server.start(); + logger.info("Server started, listening on " + port); + Runtime.getRuntime() + .addShutdownHook( + new Thread() { + @Override + public void run() { + // Use stderr here since the logger may have been reset by its JVM shutdown hook. + System.err.println("*** shutting down gRPC server since JVM is shutting down"); + try { + CompileServer.this.stop(); + } catch (InterruptedException e) { + e.printStackTrace(System.err); + } + System.err.println("*** server shut down"); + } + }); + health.setStatus("", HealthCheckResponse.ServingStatus.SERVING); + } + + /** Stop serving requests and shutdown resources. */ + public void stop() throws InterruptedException { + if (server != null) { + server.shutdown().awaitTermination(30, TimeUnit.SECONDS); + } + } + + /** Await termination on the main thread since the grpc library uses daemon threads. */ + private void blockUntilShutdown() throws InterruptedException { + if (server != null) { + server.awaitTermination(); + } + } + + public static void main(String[] args) throws Exception { + CompileServer server = new CompileServer(8980); + server.start(); + server.blockUntilShutdown(); + } +} diff --git a/server/src/main/java/org/prlprg/server/CompileService.java b/server/src/main/java/org/prlprg/server/CompileService.java new file mode 100644 index 000000000..7709e12a7 --- /dev/null +++ b/server/src/main/java/org/prlprg/server/CompileService.java @@ -0,0 +1,284 @@ +package org.prlprg.server; + +import com.google.common.io.Files; +import com.google.protobuf.ByteString; +import io.grpc.Status; +import io.grpc.stub.ServerCallStreamObserver; +import io.grpc.stub.StreamObserver; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Optional; +import java.util.logging.Logger; +import javax.annotation.Nullable; +import org.prlprg.RVersion; +import org.prlprg.bc.BCCompiler; +import org.prlprg.bc.Bc; +import org.prlprg.bc2c.BC2CCompiler; +import org.prlprg.rds.RDSReader; +import org.prlprg.rds.RDSWriter; +import org.prlprg.service.NativeClosure; +import org.prlprg.service.RshCompiler; +import org.prlprg.session.GNURSession; +import org.prlprg.sexp.CloSXP; +import org.prlprg.sexp.SEXP; +import org.prlprg.sexp.SEXPs; +import org.prlprg.util.Pair; +import org.prlprg.util.Triple; + +class CompileService extends CompileServiceGrpc.CompileServiceImplBase { + private static final Logger logger = Logger.getLogger(CompileServer.class.getName()); + + private @Nullable GNURSession session = null; + // Cache for all values (including functions) + private HashMap cache = new HashMap<>(); + + // Cache for byte-code, only for functions. We keep the already serialized code in the cache + // not the Bc (or BcCodeSXP) + // Key is (hash, optimisationLevel) + private final HashMap, Pair> bcCache = new HashMap<>(); + // Cache for native code. + // Key is (hash, bcOpt, ccOpt) + private final HashMap, NativeClosure> nativeCache = + new HashMap<>(); + + private static String genSymbol(Messages.Function function) { + // the hash is uint64 (unsigned ) but java does not have unsigned numbers and store it as a long + // We first need to convert it to a string and interpret it as an unsigned number + // Java uses 2's complement + return "gen_" + Long.toUnsignedString(function.getHash()); + } + + // Testing externally: grpcurl -plaintext -d '{"function":{"name": "testFunc"}}' 0.0.0.0:8980 + // CompileService.Compile + @Override + public void compile( + Messages.CompileRequest request, + StreamObserver plainResponseObserver) { + + ServerCallStreamObserver responseObserver = + (ServerCallStreamObserver) plainResponseObserver; + responseObserver.setCompression( + "gzip"); // Or for all responses? In that case, we just need to add an interceptor. + + if (session == null) { + responseObserver.onError( + Status.INTERNAL.withDescription("Session not initialized.").asRuntimeException()); + } + + // Parse the request + Messages.Function function = request.getFunction(); + Messages.Tier tier = request.getTier(); // Default is optimized + if (tier == Messages.Tier.UNRECOGNIZED) { + tier = Messages.Tier.OPTIMIZED; + } + var bcOpt = request.hasBcOpt() ? request.getBcOpt() : 2; + var ccOpt = request.hasCcOpt() ? request.getCcOpt() : 2; + Messages.Context context = request.getContext(); // null if not provided + + logger.info( + "Received request to compile function " + + function.getName() + + " with hash " + + Long.toUnsignedString(function.getHash()) + + " at tier " + + tier + + " with bytecode level " + + (request.hasBcOpt() ? bcOpt : "default 2") + + " and native optimization level " + + (request.hasCcOpt() ? ccOpt : "default 2") + + " Serialized size = " + + request.getSerializedSize()); + + // Compile the code and build response + Messages.CompileResponse.Builder response = Messages.CompileResponse.newBuilder(); + response.setTier(tier); + response.setHash(function.getHash()); + + // Cache requests + NativeClosure ccCached = null; + var nativeKey = Triple.of(function.getHash(), bcOpt, ccOpt); + if (tier.equals(Messages.Tier.OPTIMIZED)) { + ccCached = nativeCache.get(nativeKey); + if (ccCached != null) { + logger.info("Found " + function.getName() + " in native cache. No recompilation."); + response.setCode(ccCached.code()); + response.setConstants(ccCached.constantPool()); + } + } + + Pair bcCached = null; + // We also have a look whether we have a cached bytecode for the native compilation + var bcKey = Pair.of(function.getHash(), bcOpt); + if (tier.equals((Messages.Tier.BASELINE)) || ccCached == null) { + bcCached = bcCache.get(bcKey); + if (bcCached != null) { + logger.info("Found " + function.getName() + " in bytecode cache. No recompilation."); + response.setCode(bcCached.second()); + } + } + + // We do not have the request version in cache + // Compile the body if we have it + if (!function.hasBody()) { + logger.info( + "No body sent with the request for function " + function.getName() + ". Cannot compile."); + responseObserver.onError( + Status.INVALID_ARGUMENT + .withDescription("No body sent with the request for function " + function.getName()) + .asRuntimeException()); + // TODO: send a request to the client to get the body + } else { + if ((tier.equals(Messages.Tier.BASELINE) && bcCached == null) + || (tier.equals(Messages.Tier.OPTIMIZED) && ccCached == null)) { + logger.info( + "Compile function " + + function.getName() + + " to bytecode with optimisation level " + + bcOpt + + ": not found in cache."); + try { + var bc = compileBcClosure(function.getBody(), bcOpt); + ByteString serializedBc = null; + if (bc.isEmpty()) { + logger.warning( + "Empty bytecode for function " + + function.getName() + + ". Not caching and returning the original body."); + // We will keep the code field empty + } else { + serializedBc = RDSWriter.writeByteString(SEXPs.bcode(bc.get())); + response.setCode(serializedBc); + bcCached = + Pair.of(bc.get(), serializedBc); // potentially used for the native compilation also + // Add it to the cache + bcCache.put(bcKey, bcCached); + } + } catch (Exception e) { + // See + // https://github.com/grpc/grpc-java/blob/master/examples/src/main/java/io/grpc/examples/errorhandling/DetailErrorSample.java + // We could have more details using that: + // https://github.com/grpc/grpc-java/blob/master/examples/src/main/java/io/grpc/examples/errordetails/ErrorDetailsExample.java + responseObserver.onError( + Status.INTERNAL + .withDescription( + "Cannot bytecode compile function " + + function.getName() + + " ; " + + e.getMessage()) + .asRuntimeException()); + } + } + if (tier.equals(Messages.Tier.OPTIMIZED) && ccCached == null) { // OPTIMIZED tier => native + logger.info( + "Compile function " + + function.getName() + + " with optimisation level " + + bcOpt + + " and native level " + + ccOpt + + ": not found in cache."); + // At this point, we have already the bytecode, whether we got it from the cache or we + // compiled it + try { + assert bcCached != null; + // Name should be fully decided by the client? + var name = genSymbol(function); + var bc2cCompiler = new BC2CCompiler(bcCached.first(), name); + var module = bc2cCompiler.finish(); + var input = File.createTempFile("cfile", ".c"); + var f = Files.newWriter(input, Charset.defaultCharset()); + module.file().writeTo(f); + var output = File.createTempFile("ofile", ".o"); + + RshCompiler.getInstance(ccOpt) + .createBuilder(input.getPath(), output.getPath()) + .flag("-c") + .compile(); + + var res = Files.asByteSource(output).read(); + var serializedConstantPool = RDSWriter.writeByteString(module.constantPool()); + + ccCached = + new NativeClosure( + ByteString.copyFrom(res), module.topLevelFunName(), serializedConstantPool); + nativeCache.put(nativeKey, ccCached); + response.setCode(ccCached.code()); + response.setConstants(ccCached.constantPool()); + } catch (Exception e) { + responseObserver.onError( + Status.INTERNAL + .withDescription( + "Cannot native compile function " + + function.getName() + + " ; " + + e.getMessage()) + .asRuntimeException()); + } + } + } + + // Send the response + var res = response.build(); + responseObserver.onNext(res); + logger.info("Response size : " + res.getSerializedSize()); + responseObserver.onCompleted(); + } + + @Override + public void init( + Messages.InitRequest request, StreamObserver responseObserver) { + + // Parse the request + Messages.Version rshVersion = request.getRshVersion(); + Messages.Version RVersion = request.getRVersion(); + String platform = request.getPlatform(); + + var packages = request.getPackageHashList(); + + logger.info( + "Received init request with R version " + + RVersion + + "and Rsh version " + + rshVersion + + " and platform " + + platform); + logger.info("Received package hashes: " + packages); + + // TODO: Lookup to see if we have this version of R installed or not. + // Hardcoded so far: + var r_dir = Path.of("/usr/lib/R/"); + var lib_dir = "~/R/x86_64-pc-linux-gnu-library/4.3/"; + lib_dir = lib_dir.replaceFirst("^~", System.getProperty("user.home")); + session = new GNURSession(convertVersion(RVersion), r_dir, Path.of(lib_dir)); + + // TODO: Look into our cache if we have the packages. + // Request the packages for those we do not have hashes for. + + responseObserver.onNext(Messages.InitResponse.newBuilder().build()); + responseObserver.onCompleted(); + } + + private RVersion convertVersion(Messages.Version version) { + return new RVersion(version.getMajor(), version.getMinor(), version.getPatch()); + } + + private Optional compileBcClosure(ByteString body, int optimizationLevel) { + SEXP closure = null; + try { + assert session != null; + closure = RDSReader.readByteString(session, body); + } catch (IOException e) { + throw new RuntimeException(e); + } + if (closure instanceof CloSXP c) { + BCCompiler compiler = new BCCompiler(c, session); + compiler.setOptimizationLevel(optimizationLevel); + return compiler.compile(); + } else { + throw new RuntimeException("Not a closure"); + } + } +} diff --git a/server/src/main/java/org/prlprg/server/protocol/CompileRequest.java b/server/src/main/java/org/prlprg/server/protocol/CompileRequest.java deleted file mode 100644 index 2363127f2..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/CompileRequest.java +++ /dev/null @@ -1,810 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -/** Protobuf type {@code rsh.server.protocol.CompileRequest} */ -public final class CompileRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:rsh.server.protocol.CompileRequest) - CompileRequestOrBuilder { - private static final long serialVersionUID = 0L; - - // Use CompileRequest.newBuilder() to construct. - private CompileRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CompileRequest() { - name_ = ""; - closure_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CompileRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.CompileRequest.class, - org.prlprg.server.protocol.CompileRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - - /** - * string name = 2; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - * string name = 2; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLOSURE_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString closure_ = com.google.protobuf.ByteString.EMPTY; - - /** - * - * - *

-   * the closure to be compiled as CLOSXP
-   * 
- * - * bytes closure = 3; - * - * @return The closure. - */ - @java.lang.Override - public com.google.protobuf.ByteString getClosure() { - return closure_; - } - - public static final int BC_OPTIMIZATION_FIELD_NUMBER = 4; - private int bcOptimization_ = 0; - - /** - * uint32 bc_optimization = 4; - * - * @return The bcOptimization. - */ - @java.lang.Override - public int getBcOptimization() { - return bcOptimization_; - } - - public static final int CC_OPTIMIZATION_FIELD_NUMBER = 5; - private int ccOptimization_ = 0; - - /** - * uint32 cc_optimization = 5; - * - * @return The ccOptimization. - */ - @java.lang.Override - public int getCcOptimization() { - return ccOptimization_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (!closure_.isEmpty()) { - output.writeBytes(3, closure_); - } - if (bcOptimization_ != 0) { - output.writeUInt32(4, bcOptimization_); - } - if (ccOptimization_ != 0) { - output.writeUInt32(5, ccOptimization_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (!closure_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, closure_); - } - if (bcOptimization_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeUInt32Size(4, bcOptimization_); - } - if (ccOptimization_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeUInt32Size(5, ccOptimization_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.prlprg.server.protocol.CompileRequest)) { - return super.equals(obj); - } - org.prlprg.server.protocol.CompileRequest other = - (org.prlprg.server.protocol.CompileRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!getClosure().equals(other.getClosure())) return false; - if (getBcOptimization() != other.getBcOptimization()) return false; - if (getCcOptimization() != other.getCcOptimization()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + CLOSURE_FIELD_NUMBER; - hash = (53 * hash) + getClosure().hashCode(); - hash = (37 * hash) + BC_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + getBcOptimization(); - hash = (37 * hash) + CC_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + getCcOptimization(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.CompileRequest parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.CompileRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(org.prlprg.server.protocol.CompileRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** Protobuf type {@code rsh.server.protocol.CompileRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:rsh.server.protocol.CompileRequest) - org.prlprg.server.protocol.CompileRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.CompileRequest.class, - org.prlprg.server.protocol.CompileRequest.Builder.class); - } - - // Construct using org.prlprg.server.protocol.CompileRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - closure_ = com.google.protobuf.ByteString.EMPTY; - bcOptimization_ = 0; - ccOptimization_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileRequest_descriptor; - } - - @java.lang.Override - public org.prlprg.server.protocol.CompileRequest getDefaultInstanceForType() { - return org.prlprg.server.protocol.CompileRequest.getDefaultInstance(); - } - - @java.lang.Override - public org.prlprg.server.protocol.CompileRequest build() { - org.prlprg.server.protocol.CompileRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.prlprg.server.protocol.CompileRequest buildPartial() { - org.prlprg.server.protocol.CompileRequest result = - new org.prlprg.server.protocol.CompileRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(org.prlprg.server.protocol.CompileRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.closure_ = closure_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.bcOptimization_ = bcOptimization_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.ccOptimization_ = ccOptimization_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.prlprg.server.protocol.CompileRequest) { - return mergeFrom((org.prlprg.server.protocol.CompileRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.prlprg.server.protocol.CompileRequest other) { - if (other == org.prlprg.server.protocol.CompileRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getClosure() != com.google.protobuf.ByteString.EMPTY) { - setClosure(other.getClosure()); - } - if (other.getBcOptimization() != 0) { - setBcOptimization(other.getBcOptimization()); - } - if (other.getCcOptimization() != 0) { - setCcOptimization(other.getCcOptimization()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 18 - case 26: - { - closure_ = input.readBytes(); - bitField0_ |= 0x00000002; - break; - } // case 26 - case 32: - { - bcOptimization_ = input.readUInt32(); - bitField0_ |= 0x00000004; - break; - } // case 32 - case 40: - { - ccOptimization_ = input.readUInt32(); - bitField0_ |= 0x00000008; - break; - } // case 40 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - - /** - * string name = 2; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string name = 2; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string name = 2; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * string name = 2; - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - /** - * string name = 2; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString closure_ = com.google.protobuf.ByteString.EMPTY; - - /** - * - * - *
-     * the closure to be compiled as CLOSXP
-     * 
- * - * bytes closure = 3; - * - * @return The closure. - */ - @java.lang.Override - public com.google.protobuf.ByteString getClosure() { - return closure_; - } - - /** - * - * - *
-     * the closure to be compiled as CLOSXP
-     * 
- * - * bytes closure = 3; - * - * @param value The closure to set. - * @return This builder for chaining. - */ - public Builder setClosure(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - closure_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * - * - *
-     * the closure to be compiled as CLOSXP
-     * 
- * - * bytes closure = 3; - * - * @return This builder for chaining. - */ - public Builder clearClosure() { - bitField0_ = (bitField0_ & ~0x00000002); - closure_ = getDefaultInstance().getClosure(); - onChanged(); - return this; - } - - private int bcOptimization_; - - /** - * uint32 bc_optimization = 4; - * - * @return The bcOptimization. - */ - @java.lang.Override - public int getBcOptimization() { - return bcOptimization_; - } - - /** - * uint32 bc_optimization = 4; - * - * @param value The bcOptimization to set. - * @return This builder for chaining. - */ - public Builder setBcOptimization(int value) { - - bcOptimization_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * uint32 bc_optimization = 4; - * - * @return This builder for chaining. - */ - public Builder clearBcOptimization() { - bitField0_ = (bitField0_ & ~0x00000004); - bcOptimization_ = 0; - onChanged(); - return this; - } - - private int ccOptimization_; - - /** - * uint32 cc_optimization = 5; - * - * @return The ccOptimization. - */ - @java.lang.Override - public int getCcOptimization() { - return ccOptimization_; - } - - /** - * uint32 cc_optimization = 5; - * - * @param value The ccOptimization to set. - * @return This builder for chaining. - */ - public Builder setCcOptimization(int value) { - - ccOptimization_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - /** - * uint32 cc_optimization = 5; - * - * @return This builder for chaining. - */ - public Builder clearCcOptimization() { - bitField0_ = (bitField0_ & ~0x00000008); - ccOptimization_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:rsh.server.protocol.CompileRequest) - } - - // @@protoc_insertion_point(class_scope:rsh.server.protocol.CompileRequest) - private static final org.prlprg.server.protocol.CompileRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new org.prlprg.server.protocol.CompileRequest(); - } - - public static org.prlprg.server.protocol.CompileRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CompileRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.prlprg.server.protocol.CompileRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/server/src/main/java/org/prlprg/server/protocol/CompileRequestOrBuilder.java b/server/src/main/java/org/prlprg/server/protocol/CompileRequestOrBuilder.java deleted file mode 100644 index 104c2c7ee..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/CompileRequestOrBuilder.java +++ /dev/null @@ -1,51 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -public interface CompileRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:rsh.server.protocol.CompileRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 2; - * - * @return The name. - */ - java.lang.String getName(); - - /** - * string name = 2; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * the closure to be compiled as CLOSXP
-   * 
- * - * bytes closure = 3; - * - * @return The closure. - */ - com.google.protobuf.ByteString getClosure(); - - /** - * uint32 bc_optimization = 4; - * - * @return The bcOptimization. - */ - int getBcOptimization(); - - /** - * uint32 cc_optimization = 5; - * - * @return The ccOptimization. - */ - int getCcOptimization(); -} diff --git a/server/src/main/java/org/prlprg/server/protocol/CompileResponse.java b/server/src/main/java/org/prlprg/server/protocol/CompileResponse.java deleted file mode 100644 index ec4cebbcd..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/CompileResponse.java +++ /dev/null @@ -1,901 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -/** Protobuf type {@code rsh.server.protocol.CompileResponse} */ -public final class CompileResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:rsh.server.protocol.CompileResponse) - CompileResponseOrBuilder { - private static final long serialVersionUID = 0L; - - // Use CompileResponse.newBuilder() to construct. - private CompileResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CompileResponse() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CompileResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.CompileResponse.class, - org.prlprg.server.protocol.CompileResponse.Builder.class); - } - - private int dataCase_ = 0; - private java.lang.Object data_; - - public enum DataCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - FAILURE(2), - RESULT(3), - DATA_NOT_SET(0); - private final int value; - - private DataCase(int value) { - this.value = value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static DataCase valueOf(int value) { - return forNumber(value); - } - - public static DataCase forNumber(int value) { - switch (value) { - case 2: - return FAILURE; - case 3: - return RESULT; - case 0: - return DATA_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public DataCase getDataCase() { - return DataCase.forNumber(dataCase_); - } - - public static final int FAILURE_FIELD_NUMBER = 2; - - /** - * string failure = 2; - * - * @return Whether the failure field is set. - */ - public boolean hasFailure() { - return dataCase_ == 2; - } - - /** - * string failure = 2; - * - * @return The failure. - */ - public java.lang.String getFailure() { - java.lang.Object ref = ""; - if (dataCase_ == 2) { - ref = data_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (dataCase_ == 2) { - data_ = s; - } - return s; - } - } - - /** - * string failure = 2; - * - * @return The bytes for failure. - */ - public com.google.protobuf.ByteString getFailureBytes() { - java.lang.Object ref = ""; - if (dataCase_ == 2) { - ref = data_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (dataCase_ == 2) { - data_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESULT_FIELD_NUMBER = 3; - - /** - * .rsh.server.protocol.CompiledFunction result = 3; - * - * @return Whether the result field is set. - */ - @java.lang.Override - public boolean hasResult() { - return dataCase_ == 3; - } - - /** - * .rsh.server.protocol.CompiledFunction result = 3; - * - * @return The result. - */ - @java.lang.Override - public org.prlprg.server.protocol.CompiledFunction getResult() { - if (dataCase_ == 3) { - return (org.prlprg.server.protocol.CompiledFunction) data_; - } - return org.prlprg.server.protocol.CompiledFunction.getDefaultInstance(); - } - - /** .rsh.server.protocol.CompiledFunction result = 3; */ - @java.lang.Override - public org.prlprg.server.protocol.CompiledFunctionOrBuilder getResultOrBuilder() { - if (dataCase_ == 3) { - return (org.prlprg.server.protocol.CompiledFunction) data_; - } - return org.prlprg.server.protocol.CompiledFunction.getDefaultInstance(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (dataCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, data_); - } - if (dataCase_ == 3) { - output.writeMessage(3, (org.prlprg.server.protocol.CompiledFunction) data_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dataCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, data_); - } - if (dataCase_ == 3) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 3, (org.prlprg.server.protocol.CompiledFunction) data_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.prlprg.server.protocol.CompileResponse)) { - return super.equals(obj); - } - org.prlprg.server.protocol.CompileResponse other = - (org.prlprg.server.protocol.CompileResponse) obj; - - if (!getDataCase().equals(other.getDataCase())) return false; - switch (dataCase_) { - case 2: - if (!getFailure().equals(other.getFailure())) return false; - break; - case 3: - if (!getResult().equals(other.getResult())) return false; - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (dataCase_) { - case 2: - hash = (37 * hash) + FAILURE_FIELD_NUMBER; - hash = (53 * hash) + getFailure().hashCode(); - break; - case 3: - hash = (37 * hash) + RESULT_FIELD_NUMBER; - hash = (53 * hash) + getResult().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.CompileResponse parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.CompileResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(org.prlprg.server.protocol.CompileResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** Protobuf type {@code rsh.server.protocol.CompileResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:rsh.server.protocol.CompileResponse) - org.prlprg.server.protocol.CompileResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.CompileResponse.class, - org.prlprg.server.protocol.CompileResponse.Builder.class); - } - - // Construct using org.prlprg.server.protocol.CompileResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (resultBuilder_ != null) { - resultBuilder_.clear(); - } - dataCase_ = 0; - data_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompileResponse_descriptor; - } - - @java.lang.Override - public org.prlprg.server.protocol.CompileResponse getDefaultInstanceForType() { - return org.prlprg.server.protocol.CompileResponse.getDefaultInstance(); - } - - @java.lang.Override - public org.prlprg.server.protocol.CompileResponse build() { - org.prlprg.server.protocol.CompileResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.prlprg.server.protocol.CompileResponse buildPartial() { - org.prlprg.server.protocol.CompileResponse result = - new org.prlprg.server.protocol.CompileResponse(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartial0(org.prlprg.server.protocol.CompileResponse result) { - int from_bitField0_ = bitField0_; - } - - private void buildPartialOneofs(org.prlprg.server.protocol.CompileResponse result) { - result.dataCase_ = dataCase_; - result.data_ = this.data_; - if (dataCase_ == 3 && resultBuilder_ != null) { - result.data_ = resultBuilder_.build(); - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.prlprg.server.protocol.CompileResponse) { - return mergeFrom((org.prlprg.server.protocol.CompileResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.prlprg.server.protocol.CompileResponse other) { - if (other == org.prlprg.server.protocol.CompileResponse.getDefaultInstance()) return this; - switch (other.getDataCase()) { - case FAILURE: - { - dataCase_ = 2; - data_ = other.data_; - onChanged(); - break; - } - case RESULT: - { - mergeResult(other.getResult()); - break; - } - case DATA_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - dataCase_ = 2; - data_ = s; - break; - } // case 18 - case 26: - { - input.readMessage(getResultFieldBuilder().getBuilder(), extensionRegistry); - dataCase_ = 3; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int dataCase_ = 0; - private java.lang.Object data_; - - public DataCase getDataCase() { - return DataCase.forNumber(dataCase_); - } - - public Builder clearData() { - dataCase_ = 0; - data_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - /** - * string failure = 2; - * - * @return Whether the failure field is set. - */ - @java.lang.Override - public boolean hasFailure() { - return dataCase_ == 2; - } - - /** - * string failure = 2; - * - * @return The failure. - */ - @java.lang.Override - public java.lang.String getFailure() { - java.lang.Object ref = ""; - if (dataCase_ == 2) { - ref = data_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (dataCase_ == 2) { - data_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string failure = 2; - * - * @return The bytes for failure. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFailureBytes() { - java.lang.Object ref = ""; - if (dataCase_ == 2) { - ref = data_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (dataCase_ == 2) { - data_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string failure = 2; - * - * @param value The failure to set. - * @return This builder for chaining. - */ - public Builder setFailure(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - dataCase_ = 2; - data_ = value; - onChanged(); - return this; - } - - /** - * string failure = 2; - * - * @return This builder for chaining. - */ - public Builder clearFailure() { - if (dataCase_ == 2) { - dataCase_ = 0; - data_ = null; - onChanged(); - } - return this; - } - - /** - * string failure = 2; - * - * @param value The bytes for failure to set. - * @return This builder for chaining. - */ - public Builder setFailureBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - dataCase_ = 2; - data_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.prlprg.server.protocol.CompiledFunction, - org.prlprg.server.protocol.CompiledFunction.Builder, - org.prlprg.server.protocol.CompiledFunctionOrBuilder> - resultBuilder_; - - /** - * .rsh.server.protocol.CompiledFunction result = 3; - * - * @return Whether the result field is set. - */ - @java.lang.Override - public boolean hasResult() { - return dataCase_ == 3; - } - - /** - * .rsh.server.protocol.CompiledFunction result = 3; - * - * @return The result. - */ - @java.lang.Override - public org.prlprg.server.protocol.CompiledFunction getResult() { - if (resultBuilder_ == null) { - if (dataCase_ == 3) { - return (org.prlprg.server.protocol.CompiledFunction) data_; - } - return org.prlprg.server.protocol.CompiledFunction.getDefaultInstance(); - } else { - if (dataCase_ == 3) { - return resultBuilder_.getMessage(); - } - return org.prlprg.server.protocol.CompiledFunction.getDefaultInstance(); - } - } - - /** .rsh.server.protocol.CompiledFunction result = 3; */ - public Builder setResult(org.prlprg.server.protocol.CompiledFunction value) { - if (resultBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - data_ = value; - onChanged(); - } else { - resultBuilder_.setMessage(value); - } - dataCase_ = 3; - return this; - } - - /** .rsh.server.protocol.CompiledFunction result = 3; */ - public Builder setResult(org.prlprg.server.protocol.CompiledFunction.Builder builderForValue) { - if (resultBuilder_ == null) { - data_ = builderForValue.build(); - onChanged(); - } else { - resultBuilder_.setMessage(builderForValue.build()); - } - dataCase_ = 3; - return this; - } - - /** .rsh.server.protocol.CompiledFunction result = 3; */ - public Builder mergeResult(org.prlprg.server.protocol.CompiledFunction value) { - if (resultBuilder_ == null) { - if (dataCase_ == 3 - && data_ != org.prlprg.server.protocol.CompiledFunction.getDefaultInstance()) { - data_ = - org.prlprg.server.protocol.CompiledFunction.newBuilder( - (org.prlprg.server.protocol.CompiledFunction) data_) - .mergeFrom(value) - .buildPartial(); - } else { - data_ = value; - } - onChanged(); - } else { - if (dataCase_ == 3) { - resultBuilder_.mergeFrom(value); - } else { - resultBuilder_.setMessage(value); - } - } - dataCase_ = 3; - return this; - } - - /** .rsh.server.protocol.CompiledFunction result = 3; */ - public Builder clearResult() { - if (resultBuilder_ == null) { - if (dataCase_ == 3) { - dataCase_ = 0; - data_ = null; - onChanged(); - } - } else { - if (dataCase_ == 3) { - dataCase_ = 0; - data_ = null; - } - resultBuilder_.clear(); - } - return this; - } - - /** .rsh.server.protocol.CompiledFunction result = 3; */ - public org.prlprg.server.protocol.CompiledFunction.Builder getResultBuilder() { - return getResultFieldBuilder().getBuilder(); - } - - /** .rsh.server.protocol.CompiledFunction result = 3; */ - @java.lang.Override - public org.prlprg.server.protocol.CompiledFunctionOrBuilder getResultOrBuilder() { - if ((dataCase_ == 3) && (resultBuilder_ != null)) { - return resultBuilder_.getMessageOrBuilder(); - } else { - if (dataCase_ == 3) { - return (org.prlprg.server.protocol.CompiledFunction) data_; - } - return org.prlprg.server.protocol.CompiledFunction.getDefaultInstance(); - } - } - - /** .rsh.server.protocol.CompiledFunction result = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< - org.prlprg.server.protocol.CompiledFunction, - org.prlprg.server.protocol.CompiledFunction.Builder, - org.prlprg.server.protocol.CompiledFunctionOrBuilder> - getResultFieldBuilder() { - if (resultBuilder_ == null) { - if (!(dataCase_ == 3)) { - data_ = org.prlprg.server.protocol.CompiledFunction.getDefaultInstance(); - } - resultBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - org.prlprg.server.protocol.CompiledFunction, - org.prlprg.server.protocol.CompiledFunction.Builder, - org.prlprg.server.protocol.CompiledFunctionOrBuilder>( - (org.prlprg.server.protocol.CompiledFunction) data_, - getParentForChildren(), - isClean()); - data_ = null; - } - dataCase_ = 3; - onChanged(); - return resultBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:rsh.server.protocol.CompileResponse) - } - - // @@protoc_insertion_point(class_scope:rsh.server.protocol.CompileResponse) - private static final org.prlprg.server.protocol.CompileResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new org.prlprg.server.protocol.CompileResponse(); - } - - public static org.prlprg.server.protocol.CompileResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CompileResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.prlprg.server.protocol.CompileResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/server/src/main/java/org/prlprg/server/protocol/CompileResponseOrBuilder.java b/server/src/main/java/org/prlprg/server/protocol/CompileResponseOrBuilder.java deleted file mode 100644 index 8625c7bc6..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/CompileResponseOrBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -public interface CompileResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:rsh.server.protocol.CompileResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * string failure = 2; - * - * @return Whether the failure field is set. - */ - boolean hasFailure(); - - /** - * string failure = 2; - * - * @return The failure. - */ - java.lang.String getFailure(); - - /** - * string failure = 2; - * - * @return The bytes for failure. - */ - com.google.protobuf.ByteString getFailureBytes(); - - /** - * .rsh.server.protocol.CompiledFunction result = 3; - * - * @return Whether the result field is set. - */ - boolean hasResult(); - - /** - * .rsh.server.protocol.CompiledFunction result = 3; - * - * @return The result. - */ - org.prlprg.server.protocol.CompiledFunction getResult(); - - /** .rsh.server.protocol.CompiledFunction result = 3; */ - org.prlprg.server.protocol.CompiledFunctionOrBuilder getResultOrBuilder(); - - public org.prlprg.server.protocol.CompileResponse.DataCase getDataCase(); -} diff --git a/server/src/main/java/org/prlprg/server/protocol/CompiledFunction.java b/server/src/main/java/org/prlprg/server/protocol/CompiledFunction.java deleted file mode 100644 index 9b639b52c..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/CompiledFunction.java +++ /dev/null @@ -1,764 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -/** Protobuf type {@code rsh.server.protocol.CompiledFunction} */ -public final class CompiledFunction extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:rsh.server.protocol.CompiledFunction) - CompiledFunctionOrBuilder { - private static final long serialVersionUID = 0L; - - // Use CompiledFunction.newBuilder() to construct. - private CompiledFunction(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CompiledFunction() { - name_ = ""; - nativeCode_ = com.google.protobuf.ByteString.EMPTY; - constants_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CompiledFunction(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompiledFunction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompiledFunction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.CompiledFunction.class, - org.prlprg.server.protocol.CompiledFunction.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - - /** - * string name = 2; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - * string name = 2; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NATIVE_CODE_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString nativeCode_ = com.google.protobuf.ByteString.EMPTY; - - /** - * - * - *
-   * content of the object file as spilled by the compiler
-   * 
- * - * bytes native_code = 3; - * - * @return The nativeCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNativeCode() { - return nativeCode_; - } - - public static final int CONSTANTS_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString constants_ = com.google.protobuf.ByteString.EMPTY; - - /** - * - * - *
-   * the constants used by the native code as VECSXP
-   * 
- * - * bytes constants = 4; - * - * @return The constants. - */ - @java.lang.Override - public com.google.protobuf.ByteString getConstants() { - return constants_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (!nativeCode_.isEmpty()) { - output.writeBytes(3, nativeCode_); - } - if (!constants_.isEmpty()) { - output.writeBytes(4, constants_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (!nativeCode_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, nativeCode_); - } - if (!constants_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, constants_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.prlprg.server.protocol.CompiledFunction)) { - return super.equals(obj); - } - org.prlprg.server.protocol.CompiledFunction other = - (org.prlprg.server.protocol.CompiledFunction) obj; - - if (!getName().equals(other.getName())) return false; - if (!getNativeCode().equals(other.getNativeCode())) return false; - if (!getConstants().equals(other.getConstants())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + NATIVE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getNativeCode().hashCode(); - hash = (37 * hash) + CONSTANTS_FIELD_NUMBER; - hash = (53 * hash) + getConstants().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompiledFunction parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.CompiledFunction parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.CompiledFunction parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(org.prlprg.server.protocol.CompiledFunction prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** Protobuf type {@code rsh.server.protocol.CompiledFunction} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:rsh.server.protocol.CompiledFunction) - org.prlprg.server.protocol.CompiledFunctionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompiledFunction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompiledFunction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.CompiledFunction.class, - org.prlprg.server.protocol.CompiledFunction.Builder.class); - } - - // Construct using org.prlprg.server.protocol.CompiledFunction.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - nativeCode_ = com.google.protobuf.ByteString.EMPTY; - constants_ = com.google.protobuf.ByteString.EMPTY; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_CompiledFunction_descriptor; - } - - @java.lang.Override - public org.prlprg.server.protocol.CompiledFunction getDefaultInstanceForType() { - return org.prlprg.server.protocol.CompiledFunction.getDefaultInstance(); - } - - @java.lang.Override - public org.prlprg.server.protocol.CompiledFunction build() { - org.prlprg.server.protocol.CompiledFunction result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.prlprg.server.protocol.CompiledFunction buildPartial() { - org.prlprg.server.protocol.CompiledFunction result = - new org.prlprg.server.protocol.CompiledFunction(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(org.prlprg.server.protocol.CompiledFunction result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nativeCode_ = nativeCode_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.constants_ = constants_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.prlprg.server.protocol.CompiledFunction) { - return mergeFrom((org.prlprg.server.protocol.CompiledFunction) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.prlprg.server.protocol.CompiledFunction other) { - if (other == org.prlprg.server.protocol.CompiledFunction.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getNativeCode() != com.google.protobuf.ByteString.EMPTY) { - setNativeCode(other.getNativeCode()); - } - if (other.getConstants() != com.google.protobuf.ByteString.EMPTY) { - setConstants(other.getConstants()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 18 - case 26: - { - nativeCode_ = input.readBytes(); - bitField0_ |= 0x00000002; - break; - } // case 26 - case 34: - { - constants_ = input.readBytes(); - bitField0_ |= 0x00000004; - break; - } // case 34 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - - /** - * string name = 2; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string name = 2; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string name = 2; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * string name = 2; - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - /** - * string name = 2; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString nativeCode_ = com.google.protobuf.ByteString.EMPTY; - - /** - * - * - *
-     * content of the object file as spilled by the compiler
-     * 
- * - * bytes native_code = 3; - * - * @return The nativeCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNativeCode() { - return nativeCode_; - } - - /** - * - * - *
-     * content of the object file as spilled by the compiler
-     * 
- * - * bytes native_code = 3; - * - * @param value The nativeCode to set. - * @return This builder for chaining. - */ - public Builder setNativeCode(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - nativeCode_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * - * - *
-     * content of the object file as spilled by the compiler
-     * 
- * - * bytes native_code = 3; - * - * @return This builder for chaining. - */ - public Builder clearNativeCode() { - bitField0_ = (bitField0_ & ~0x00000002); - nativeCode_ = getDefaultInstance().getNativeCode(); - onChanged(); - return this; - } - - private com.google.protobuf.ByteString constants_ = com.google.protobuf.ByteString.EMPTY; - - /** - * - * - *
-     * the constants used by the native code as VECSXP
-     * 
- * - * bytes constants = 4; - * - * @return The constants. - */ - @java.lang.Override - public com.google.protobuf.ByteString getConstants() { - return constants_; - } - - /** - * - * - *
-     * the constants used by the native code as VECSXP
-     * 
- * - * bytes constants = 4; - * - * @param value The constants to set. - * @return This builder for chaining. - */ - public Builder setConstants(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - constants_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * - * - *
-     * the constants used by the native code as VECSXP
-     * 
- * - * bytes constants = 4; - * - * @return This builder for chaining. - */ - public Builder clearConstants() { - bitField0_ = (bitField0_ & ~0x00000004); - constants_ = getDefaultInstance().getConstants(); - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:rsh.server.protocol.CompiledFunction) - } - - // @@protoc_insertion_point(class_scope:rsh.server.protocol.CompiledFunction) - private static final org.prlprg.server.protocol.CompiledFunction DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new org.prlprg.server.protocol.CompiledFunction(); - } - - public static org.prlprg.server.protocol.CompiledFunction getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CompiledFunction parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.prlprg.server.protocol.CompiledFunction getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/server/src/main/java/org/prlprg/server/protocol/CompiledFunctionOrBuilder.java b/server/src/main/java/org/prlprg/server/protocol/CompiledFunctionOrBuilder.java deleted file mode 100644 index 4ce0d6794..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/CompiledFunctionOrBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -public interface CompiledFunctionOrBuilder - extends - // @@protoc_insertion_point(interface_extends:rsh.server.protocol.CompiledFunction) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 2; - * - * @return The name. - */ - java.lang.String getName(); - - /** - * string name = 2; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * content of the object file as spilled by the compiler
-   * 
- * - * bytes native_code = 3; - * - * @return The nativeCode. - */ - com.google.protobuf.ByteString getNativeCode(); - - /** - * - * - *
-   * the constants used by the native code as VECSXP
-   * 
- * - * bytes constants = 4; - * - * @return The constants. - */ - com.google.protobuf.ByteString getConstants(); -} diff --git a/server/src/main/java/org/prlprg/server/protocol/HandshakeRequest.java b/server/src/main/java/org/prlprg/server/protocol/HandshakeRequest.java deleted file mode 100644 index 8917ea708..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/HandshakeRequest.java +++ /dev/null @@ -1,1069 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -/** Protobuf type {@code rsh.server.protocol.HandshakeRequest} */ -public final class HandshakeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:rsh.server.protocol.HandshakeRequest) - HandshakeRequestOrBuilder { - private static final long serialVersionUID = 0L; - - // Use HandshakeRequest.newBuilder() to construct. - private HandshakeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private HandshakeRequest() { - rshVersion_ = ""; - rVersion_ = ""; - platform_ = ""; - packages_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new HandshakeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_HandshakeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_HandshakeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.HandshakeRequest.class, - org.prlprg.server.protocol.HandshakeRequest.Builder.class); - } - - public static final int RSH_VERSION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object rshVersion_ = ""; - - /** - * string Rsh_version = 1; - * - * @return The rshVersion. - */ - @java.lang.Override - public java.lang.String getRshVersion() { - java.lang.Object ref = rshVersion_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rshVersion_ = s; - return s; - } - } - - /** - * string Rsh_version = 1; - * - * @return The bytes for rshVersion. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRshVersionBytes() { - java.lang.Object ref = rshVersion_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rshVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int R_VERSION_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object rVersion_ = ""; - - /** - * string R_version = 2; - * - * @return The rVersion. - */ - @java.lang.Override - public java.lang.String getRVersion() { - java.lang.Object ref = rVersion_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rVersion_ = s; - return s; - } - } - - /** - * string R_version = 2; - * - * @return The bytes for rVersion. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRVersionBytes() { - java.lang.Object ref = rVersion_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PLATFORM_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object platform_ = ""; - - /** - * string platform = 3; - * - * @return The platform. - */ - @java.lang.Override - public java.lang.String getPlatform() { - java.lang.Object ref = platform_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - platform_ = s; - return s; - } - } - - /** - * string platform = 3; - * - * @return The bytes for platform. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPlatformBytes() { - java.lang.Object ref = platform_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - platform_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PACKAGES_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringList packages_; - - /** - * repeated string packages = 4; - * - * @return A list containing the packages. - */ - public com.google.protobuf.ProtocolStringList getPackagesList() { - return packages_; - } - - /** - * repeated string packages = 4; - * - * @return The count of packages. - */ - public int getPackagesCount() { - return packages_.size(); - } - - /** - * repeated string packages = 4; - * - * @param index The index of the element to return. - * @return The packages at the given index. - */ - public java.lang.String getPackages(int index) { - return packages_.get(index); - } - - /** - * repeated string packages = 4; - * - * @param index The index of the value to return. - * @return The bytes of the packages at the given index. - */ - public com.google.protobuf.ByteString getPackagesBytes(int index) { - return packages_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rshVersion_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, rshVersion_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rVersion_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, rVersion_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(platform_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, platform_); - } - for (int i = 0; i < packages_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, packages_.getRaw(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rshVersion_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, rshVersion_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rVersion_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, rVersion_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(platform_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, platform_); - } - { - int dataSize = 0; - for (int i = 0; i < packages_.size(); i++) { - dataSize += computeStringSizeNoTag(packages_.getRaw(i)); - } - size += dataSize; - size += 1 * getPackagesList().size(); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.prlprg.server.protocol.HandshakeRequest)) { - return super.equals(obj); - } - org.prlprg.server.protocol.HandshakeRequest other = - (org.prlprg.server.protocol.HandshakeRequest) obj; - - if (!getRshVersion().equals(other.getRshVersion())) return false; - if (!getRVersion().equals(other.getRVersion())) return false; - if (!getPlatform().equals(other.getPlatform())) return false; - if (!getPackagesList().equals(other.getPackagesList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + RSH_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getRshVersion().hashCode(); - hash = (37 * hash) + R_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getRVersion().hashCode(); - hash = (37 * hash) + PLATFORM_FIELD_NUMBER; - hash = (53 * hash) + getPlatform().hashCode(); - if (getPackagesCount() > 0) { - hash = (37 * hash) + PACKAGES_FIELD_NUMBER; - hash = (53 * hash) + getPackagesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.HandshakeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(org.prlprg.server.protocol.HandshakeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** Protobuf type {@code rsh.server.protocol.HandshakeRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:rsh.server.protocol.HandshakeRequest) - org.prlprg.server.protocol.HandshakeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_HandshakeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_HandshakeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.HandshakeRequest.class, - org.prlprg.server.protocol.HandshakeRequest.Builder.class); - } - - // Construct using org.prlprg.server.protocol.HandshakeRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - rshVersion_ = ""; - rVersion_ = ""; - platform_ = ""; - packages_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_HandshakeRequest_descriptor; - } - - @java.lang.Override - public org.prlprg.server.protocol.HandshakeRequest getDefaultInstanceForType() { - return org.prlprg.server.protocol.HandshakeRequest.getDefaultInstance(); - } - - @java.lang.Override - public org.prlprg.server.protocol.HandshakeRequest build() { - org.prlprg.server.protocol.HandshakeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.prlprg.server.protocol.HandshakeRequest buildPartial() { - org.prlprg.server.protocol.HandshakeRequest result = - new org.prlprg.server.protocol.HandshakeRequest(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(org.prlprg.server.protocol.HandshakeRequest result) { - if (((bitField0_ & 0x00000008) != 0)) { - packages_ = packages_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.packages_ = packages_; - } - - private void buildPartial0(org.prlprg.server.protocol.HandshakeRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.rshVersion_ = rshVersion_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.rVersion_ = rVersion_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.platform_ = platform_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.prlprg.server.protocol.HandshakeRequest) { - return mergeFrom((org.prlprg.server.protocol.HandshakeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.prlprg.server.protocol.HandshakeRequest other) { - if (other == org.prlprg.server.protocol.HandshakeRequest.getDefaultInstance()) return this; - if (!other.getRshVersion().isEmpty()) { - rshVersion_ = other.rshVersion_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getRVersion().isEmpty()) { - rVersion_ = other.rVersion_; - bitField0_ |= 0x00000002; - onChanged(); - } - if (!other.getPlatform().isEmpty()) { - platform_ = other.platform_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (!other.packages_.isEmpty()) { - if (packages_.isEmpty()) { - packages_ = other.packages_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensurePackagesIsMutable(); - packages_.addAll(other.packages_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - rshVersion_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - rVersion_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - platform_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - ensurePackagesIsMutable(); - packages_.add(s); - break; - } // case 34 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object rshVersion_ = ""; - - /** - * string Rsh_version = 1; - * - * @return The rshVersion. - */ - public java.lang.String getRshVersion() { - java.lang.Object ref = rshVersion_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rshVersion_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string Rsh_version = 1; - * - * @return The bytes for rshVersion. - */ - public com.google.protobuf.ByteString getRshVersionBytes() { - java.lang.Object ref = rshVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rshVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string Rsh_version = 1; - * - * @param value The rshVersion to set. - * @return This builder for chaining. - */ - public Builder setRshVersion(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - rshVersion_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * string Rsh_version = 1; - * - * @return This builder for chaining. - */ - public Builder clearRshVersion() { - rshVersion_ = getDefaultInstance().getRshVersion(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - /** - * string Rsh_version = 1; - * - * @param value The bytes for rshVersion to set. - * @return This builder for chaining. - */ - public Builder setRshVersionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - rshVersion_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object rVersion_ = ""; - - /** - * string R_version = 2; - * - * @return The rVersion. - */ - public java.lang.String getRVersion() { - java.lang.Object ref = rVersion_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rVersion_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string R_version = 2; - * - * @return The bytes for rVersion. - */ - public com.google.protobuf.ByteString getRVersionBytes() { - java.lang.Object ref = rVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - rVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string R_version = 2; - * - * @param value The rVersion to set. - * @return This builder for chaining. - */ - public Builder setRVersion(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - rVersion_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * string R_version = 2; - * - * @return This builder for chaining. - */ - public Builder clearRVersion() { - rVersion_ = getDefaultInstance().getRVersion(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - /** - * string R_version = 2; - * - * @param value The bytes for rVersion to set. - * @return This builder for chaining. - */ - public Builder setRVersionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - rVersion_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private java.lang.Object platform_ = ""; - - /** - * string platform = 3; - * - * @return The platform. - */ - public java.lang.String getPlatform() { - java.lang.Object ref = platform_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - platform_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string platform = 3; - * - * @return The bytes for platform. - */ - public com.google.protobuf.ByteString getPlatformBytes() { - java.lang.Object ref = platform_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - platform_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string platform = 3; - * - * @param value The platform to set. - * @return This builder for chaining. - */ - public Builder setPlatform(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - platform_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * string platform = 3; - * - * @return This builder for chaining. - */ - public Builder clearPlatform() { - platform_ = getDefaultInstance().getPlatform(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - /** - * string platform = 3; - * - * @param value The bytes for platform to set. - * @return This builder for chaining. - */ - public Builder setPlatformBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - platform_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList packages_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensurePackagesIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - packages_ = new com.google.protobuf.LazyStringArrayList(packages_); - bitField0_ |= 0x00000008; - } - } - - /** - * repeated string packages = 4; - * - * @return A list containing the packages. - */ - public com.google.protobuf.ProtocolStringList getPackagesList() { - return packages_.getUnmodifiableView(); - } - - /** - * repeated string packages = 4; - * - * @return The count of packages. - */ - public int getPackagesCount() { - return packages_.size(); - } - - /** - * repeated string packages = 4; - * - * @param index The index of the element to return. - * @return The packages at the given index. - */ - public java.lang.String getPackages(int index) { - return packages_.get(index); - } - - /** - * repeated string packages = 4; - * - * @param index The index of the value to return. - * @return The bytes of the packages at the given index. - */ - public com.google.protobuf.ByteString getPackagesBytes(int index) { - return packages_.getByteString(index); - } - - /** - * repeated string packages = 4; - * - * @param index The index to set the value at. - * @param value The packages to set. - * @return This builder for chaining. - */ - public Builder setPackages(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePackagesIsMutable(); - packages_.set(index, value); - onChanged(); - return this; - } - - /** - * repeated string packages = 4; - * - * @param value The packages to add. - * @return This builder for chaining. - */ - public Builder addPackages(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePackagesIsMutable(); - packages_.add(value); - onChanged(); - return this; - } - - /** - * repeated string packages = 4; - * - * @param values The packages to add. - * @return This builder for chaining. - */ - public Builder addAllPackages(java.lang.Iterable values) { - ensurePackagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, packages_); - onChanged(); - return this; - } - - /** - * repeated string packages = 4; - * - * @return This builder for chaining. - */ - public Builder clearPackages() { - packages_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - - /** - * repeated string packages = 4; - * - * @param value The bytes of the packages to add. - * @return This builder for chaining. - */ - public Builder addPackagesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensurePackagesIsMutable(); - packages_.add(value); - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:rsh.server.protocol.HandshakeRequest) - } - - // @@protoc_insertion_point(class_scope:rsh.server.protocol.HandshakeRequest) - private static final org.prlprg.server.protocol.HandshakeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new org.prlprg.server.protocol.HandshakeRequest(); - } - - public static org.prlprg.server.protocol.HandshakeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public HandshakeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.prlprg.server.protocol.HandshakeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/server/src/main/java/org/prlprg/server/protocol/HandshakeRequestOrBuilder.java b/server/src/main/java/org/prlprg/server/protocol/HandshakeRequestOrBuilder.java deleted file mode 100644 index f0a824044..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/HandshakeRequestOrBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -public interface HandshakeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:rsh.server.protocol.HandshakeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * string Rsh_version = 1; - * - * @return The rshVersion. - */ - java.lang.String getRshVersion(); - - /** - * string Rsh_version = 1; - * - * @return The bytes for rshVersion. - */ - com.google.protobuf.ByteString getRshVersionBytes(); - - /** - * string R_version = 2; - * - * @return The rVersion. - */ - java.lang.String getRVersion(); - - /** - * string R_version = 2; - * - * @return The bytes for rVersion. - */ - com.google.protobuf.ByteString getRVersionBytes(); - - /** - * string platform = 3; - * - * @return The platform. - */ - java.lang.String getPlatform(); - - /** - * string platform = 3; - * - * @return The bytes for platform. - */ - com.google.protobuf.ByteString getPlatformBytes(); - - /** - * repeated string packages = 4; - * - * @return A list containing the packages. - */ - java.util.List getPackagesList(); - - /** - * repeated string packages = 4; - * - * @return The count of packages. - */ - int getPackagesCount(); - - /** - * repeated string packages = 4; - * - * @param index The index of the element to return. - * @return The packages at the given index. - */ - java.lang.String getPackages(int index); - - /** - * repeated string packages = 4; - * - * @param index The index of the value to return. - * @return The bytes of the packages at the given index. - */ - com.google.protobuf.ByteString getPackagesBytes(int index); -} diff --git a/server/src/main/java/org/prlprg/server/protocol/Protocol.java b/server/src/main/java/org/prlprg/server/protocol/Protocol.java deleted file mode 100644 index fb4980439..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/Protocol.java +++ /dev/null @@ -1,106 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -public final class Protocol { - private Protocol() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor - internal_static_rsh_server_protocol_Request_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_rsh_server_protocol_Request_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_rsh_server_protocol_HandshakeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_rsh_server_protocol_HandshakeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_rsh_server_protocol_CompileRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_rsh_server_protocol_CompileRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_rsh_server_protocol_CompiledFunction_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_rsh_server_protocol_CompiledFunction_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_rsh_server_protocol_CompileResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_rsh_server_protocol_CompileResponse_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n\016protocol.proto\022\023rsh.server.protocol\"\210\001" - + "\n\007Request\022:\n\thandshake\030\001 \001(\0132%.rsh.serve" - + "r.protocol.HandshakeRequestH\000\0226\n\007compile" - + "\030\002 \001(\0132#.rsh.server.protocol.CompileRequ" - + "estH\000B\t\n\007payload\"^\n\020HandshakeRequest\022\023\n\013" - + "Rsh_version\030\001 \001(\t\022\021\n\tR_version\030\002 \001(\t\022\020\n\010" - + "platform\030\003 \001(\t\022\020\n\010packages\030\004 \003(\t\"a\n\016Comp" - + "ileRequest\022\014\n\004name\030\002 \001(\t\022\017\n\007closure\030\003 \001(" - + "\014\022\027\n\017bc_optimization\030\004 \001(\r\022\027\n\017cc_optimiz" - + "ation\030\005 \001(\r\"H\n\020CompiledFunction\022\014\n\004name\030" - + "\002 \001(\t\022\023\n\013native_code\030\003 \001(\014\022\021\n\tconstants\030" - + "\004 \001(\014\"e\n\017CompileResponse\022\021\n\007failure\030\002 \001(" - + "\tH\000\0227\n\006result\030\003 \001(\0132%.rsh.server.protoco" - + "l.CompiledFunctionH\000B\006\n\004dataB\036\n\032org.prlp" - + "rg.server.protocolP\001b\006proto3" - }; - descriptor = - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_rsh_server_protocol_Request_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_rsh_server_protocol_Request_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_rsh_server_protocol_Request_descriptor, - new java.lang.String[] { - "Handshake", "Compile", "Payload", - }); - internal_static_rsh_server_protocol_HandshakeRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_rsh_server_protocol_HandshakeRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_rsh_server_protocol_HandshakeRequest_descriptor, - new java.lang.String[] { - "RshVersion", "RVersion", "Platform", "Packages", - }); - internal_static_rsh_server_protocol_CompileRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_rsh_server_protocol_CompileRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_rsh_server_protocol_CompileRequest_descriptor, - new java.lang.String[] { - "Name", "Closure", "BcOptimization", "CcOptimization", - }); - internal_static_rsh_server_protocol_CompiledFunction_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_rsh_server_protocol_CompiledFunction_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_rsh_server_protocol_CompiledFunction_descriptor, - new java.lang.String[] { - "Name", "NativeCode", "Constants", - }); - internal_static_rsh_server_protocol_CompileResponse_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_rsh_server_protocol_CompileResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_rsh_server_protocol_CompileResponse_descriptor, - new java.lang.String[] { - "Failure", "Result", "Data", - }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/server/src/main/java/org/prlprg/server/protocol/Request.java b/server/src/main/java/org/prlprg/server/protocol/Request.java deleted file mode 100644 index b64408328..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/Request.java +++ /dev/null @@ -1,929 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -/** Protobuf type {@code rsh.server.protocol.Request} */ -public final class Request extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:rsh.server.protocol.Request) - RequestOrBuilder { - private static final long serialVersionUID = 0L; - - // Use Request.newBuilder() to construct. - private Request(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Request() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Request(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_Request_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_Request_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.Request.class, - org.prlprg.server.protocol.Request.Builder.class); - } - - private int payloadCase_ = 0; - private java.lang.Object payload_; - - public enum PayloadCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - HANDSHAKE(1), - COMPILE(2), - PAYLOAD_NOT_SET(0); - private final int value; - - private PayloadCase(int value) { - this.value = value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static PayloadCase valueOf(int value) { - return forNumber(value); - } - - public static PayloadCase forNumber(int value) { - switch (value) { - case 1: - return HANDSHAKE; - case 2: - return COMPILE; - case 0: - return PAYLOAD_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public PayloadCase getPayloadCase() { - return PayloadCase.forNumber(payloadCase_); - } - - public static final int HANDSHAKE_FIELD_NUMBER = 1; - - /** - * .rsh.server.protocol.HandshakeRequest handshake = 1; - * - * @return Whether the handshake field is set. - */ - @java.lang.Override - public boolean hasHandshake() { - return payloadCase_ == 1; - } - - /** - * .rsh.server.protocol.HandshakeRequest handshake = 1; - * - * @return The handshake. - */ - @java.lang.Override - public org.prlprg.server.protocol.HandshakeRequest getHandshake() { - if (payloadCase_ == 1) { - return (org.prlprg.server.protocol.HandshakeRequest) payload_; - } - return org.prlprg.server.protocol.HandshakeRequest.getDefaultInstance(); - } - - /** .rsh.server.protocol.HandshakeRequest handshake = 1; */ - @java.lang.Override - public org.prlprg.server.protocol.HandshakeRequestOrBuilder getHandshakeOrBuilder() { - if (payloadCase_ == 1) { - return (org.prlprg.server.protocol.HandshakeRequest) payload_; - } - return org.prlprg.server.protocol.HandshakeRequest.getDefaultInstance(); - } - - public static final int COMPILE_FIELD_NUMBER = 2; - - /** - * .rsh.server.protocol.CompileRequest compile = 2; - * - * @return Whether the compile field is set. - */ - @java.lang.Override - public boolean hasCompile() { - return payloadCase_ == 2; - } - - /** - * .rsh.server.protocol.CompileRequest compile = 2; - * - * @return The compile. - */ - @java.lang.Override - public org.prlprg.server.protocol.CompileRequest getCompile() { - if (payloadCase_ == 2) { - return (org.prlprg.server.protocol.CompileRequest) payload_; - } - return org.prlprg.server.protocol.CompileRequest.getDefaultInstance(); - } - - /** .rsh.server.protocol.CompileRequest compile = 2; */ - @java.lang.Override - public org.prlprg.server.protocol.CompileRequestOrBuilder getCompileOrBuilder() { - if (payloadCase_ == 2) { - return (org.prlprg.server.protocol.CompileRequest) payload_; - } - return org.prlprg.server.protocol.CompileRequest.getDefaultInstance(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (payloadCase_ == 1) { - output.writeMessage(1, (org.prlprg.server.protocol.HandshakeRequest) payload_); - } - if (payloadCase_ == 2) { - output.writeMessage(2, (org.prlprg.server.protocol.CompileRequest) payload_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (payloadCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 1, (org.prlprg.server.protocol.HandshakeRequest) payload_); - } - if (payloadCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, (org.prlprg.server.protocol.CompileRequest) payload_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.prlprg.server.protocol.Request)) { - return super.equals(obj); - } - org.prlprg.server.protocol.Request other = (org.prlprg.server.protocol.Request) obj; - - if (!getPayloadCase().equals(other.getPayloadCase())) return false; - switch (payloadCase_) { - case 1: - if (!getHandshake().equals(other.getHandshake())) return false; - break; - case 2: - if (!getCompile().equals(other.getCompile())) return false; - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (payloadCase_) { - case 1: - hash = (37 * hash) + HANDSHAKE_FIELD_NUMBER; - hash = (53 * hash) + getHandshake().hashCode(); - break; - case 2: - hash = (37 * hash) + COMPILE_FIELD_NUMBER; - hash = (53 * hash) + getCompile().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.prlprg.server.protocol.Request parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.Request parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.Request parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.Request parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.Request parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.prlprg.server.protocol.Request parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.prlprg.server.protocol.Request parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.Request parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.Request parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.Request parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static org.prlprg.server.protocol.Request parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static org.prlprg.server.protocol.Request parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(org.prlprg.server.protocol.Request prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** Protobuf type {@code rsh.server.protocol.Request} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:rsh.server.protocol.Request) - org.prlprg.server.protocol.RequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_Request_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_Request_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.prlprg.server.protocol.Request.class, - org.prlprg.server.protocol.Request.Builder.class); - } - - // Construct using org.prlprg.server.protocol.Request.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (handshakeBuilder_ != null) { - handshakeBuilder_.clear(); - } - if (compileBuilder_ != null) { - compileBuilder_.clear(); - } - payloadCase_ = 0; - payload_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.prlprg.server.protocol.Protocol - .internal_static_rsh_server_protocol_Request_descriptor; - } - - @java.lang.Override - public org.prlprg.server.protocol.Request getDefaultInstanceForType() { - return org.prlprg.server.protocol.Request.getDefaultInstance(); - } - - @java.lang.Override - public org.prlprg.server.protocol.Request build() { - org.prlprg.server.protocol.Request result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.prlprg.server.protocol.Request buildPartial() { - org.prlprg.server.protocol.Request result = new org.prlprg.server.protocol.Request(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartial0(org.prlprg.server.protocol.Request result) { - int from_bitField0_ = bitField0_; - } - - private void buildPartialOneofs(org.prlprg.server.protocol.Request result) { - result.payloadCase_ = payloadCase_; - result.payload_ = this.payload_; - if (payloadCase_ == 1 && handshakeBuilder_ != null) { - result.payload_ = handshakeBuilder_.build(); - } - if (payloadCase_ == 2 && compileBuilder_ != null) { - result.payload_ = compileBuilder_.build(); - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.prlprg.server.protocol.Request) { - return mergeFrom((org.prlprg.server.protocol.Request) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.prlprg.server.protocol.Request other) { - if (other == org.prlprg.server.protocol.Request.getDefaultInstance()) return this; - switch (other.getPayloadCase()) { - case HANDSHAKE: - { - mergeHandshake(other.getHandshake()); - break; - } - case COMPILE: - { - mergeCompile(other.getCompile()); - break; - } - case PAYLOAD_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getHandshakeFieldBuilder().getBuilder(), extensionRegistry); - payloadCase_ = 1; - break; - } // case 10 - case 18: - { - input.readMessage(getCompileFieldBuilder().getBuilder(), extensionRegistry); - payloadCase_ = 2; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int payloadCase_ = 0; - private java.lang.Object payload_; - - public PayloadCase getPayloadCase() { - return PayloadCase.forNumber(payloadCase_); - } - - public Builder clearPayload() { - payloadCase_ = 0; - payload_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - private com.google.protobuf.SingleFieldBuilderV3< - org.prlprg.server.protocol.HandshakeRequest, - org.prlprg.server.protocol.HandshakeRequest.Builder, - org.prlprg.server.protocol.HandshakeRequestOrBuilder> - handshakeBuilder_; - - /** - * .rsh.server.protocol.HandshakeRequest handshake = 1; - * - * @return Whether the handshake field is set. - */ - @java.lang.Override - public boolean hasHandshake() { - return payloadCase_ == 1; - } - - /** - * .rsh.server.protocol.HandshakeRequest handshake = 1; - * - * @return The handshake. - */ - @java.lang.Override - public org.prlprg.server.protocol.HandshakeRequest getHandshake() { - if (handshakeBuilder_ == null) { - if (payloadCase_ == 1) { - return (org.prlprg.server.protocol.HandshakeRequest) payload_; - } - return org.prlprg.server.protocol.HandshakeRequest.getDefaultInstance(); - } else { - if (payloadCase_ == 1) { - return handshakeBuilder_.getMessage(); - } - return org.prlprg.server.protocol.HandshakeRequest.getDefaultInstance(); - } - } - - /** .rsh.server.protocol.HandshakeRequest handshake = 1; */ - public Builder setHandshake(org.prlprg.server.protocol.HandshakeRequest value) { - if (handshakeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - payload_ = value; - onChanged(); - } else { - handshakeBuilder_.setMessage(value); - } - payloadCase_ = 1; - return this; - } - - /** .rsh.server.protocol.HandshakeRequest handshake = 1; */ - public Builder setHandshake( - org.prlprg.server.protocol.HandshakeRequest.Builder builderForValue) { - if (handshakeBuilder_ == null) { - payload_ = builderForValue.build(); - onChanged(); - } else { - handshakeBuilder_.setMessage(builderForValue.build()); - } - payloadCase_ = 1; - return this; - } - - /** .rsh.server.protocol.HandshakeRequest handshake = 1; */ - public Builder mergeHandshake(org.prlprg.server.protocol.HandshakeRequest value) { - if (handshakeBuilder_ == null) { - if (payloadCase_ == 1 - && payload_ != org.prlprg.server.protocol.HandshakeRequest.getDefaultInstance()) { - payload_ = - org.prlprg.server.protocol.HandshakeRequest.newBuilder( - (org.prlprg.server.protocol.HandshakeRequest) payload_) - .mergeFrom(value) - .buildPartial(); - } else { - payload_ = value; - } - onChanged(); - } else { - if (payloadCase_ == 1) { - handshakeBuilder_.mergeFrom(value); - } else { - handshakeBuilder_.setMessage(value); - } - } - payloadCase_ = 1; - return this; - } - - /** .rsh.server.protocol.HandshakeRequest handshake = 1; */ - public Builder clearHandshake() { - if (handshakeBuilder_ == null) { - if (payloadCase_ == 1) { - payloadCase_ = 0; - payload_ = null; - onChanged(); - } - } else { - if (payloadCase_ == 1) { - payloadCase_ = 0; - payload_ = null; - } - handshakeBuilder_.clear(); - } - return this; - } - - /** .rsh.server.protocol.HandshakeRequest handshake = 1; */ - public org.prlprg.server.protocol.HandshakeRequest.Builder getHandshakeBuilder() { - return getHandshakeFieldBuilder().getBuilder(); - } - - /** .rsh.server.protocol.HandshakeRequest handshake = 1; */ - @java.lang.Override - public org.prlprg.server.protocol.HandshakeRequestOrBuilder getHandshakeOrBuilder() { - if ((payloadCase_ == 1) && (handshakeBuilder_ != null)) { - return handshakeBuilder_.getMessageOrBuilder(); - } else { - if (payloadCase_ == 1) { - return (org.prlprg.server.protocol.HandshakeRequest) payload_; - } - return org.prlprg.server.protocol.HandshakeRequest.getDefaultInstance(); - } - } - - /** .rsh.server.protocol.HandshakeRequest handshake = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< - org.prlprg.server.protocol.HandshakeRequest, - org.prlprg.server.protocol.HandshakeRequest.Builder, - org.prlprg.server.protocol.HandshakeRequestOrBuilder> - getHandshakeFieldBuilder() { - if (handshakeBuilder_ == null) { - if (!(payloadCase_ == 1)) { - payload_ = org.prlprg.server.protocol.HandshakeRequest.getDefaultInstance(); - } - handshakeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - org.prlprg.server.protocol.HandshakeRequest, - org.prlprg.server.protocol.HandshakeRequest.Builder, - org.prlprg.server.protocol.HandshakeRequestOrBuilder>( - (org.prlprg.server.protocol.HandshakeRequest) payload_, - getParentForChildren(), - isClean()); - payload_ = null; - } - payloadCase_ = 1; - onChanged(); - return handshakeBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.prlprg.server.protocol.CompileRequest, - org.prlprg.server.protocol.CompileRequest.Builder, - org.prlprg.server.protocol.CompileRequestOrBuilder> - compileBuilder_; - - /** - * .rsh.server.protocol.CompileRequest compile = 2; - * - * @return Whether the compile field is set. - */ - @java.lang.Override - public boolean hasCompile() { - return payloadCase_ == 2; - } - - /** - * .rsh.server.protocol.CompileRequest compile = 2; - * - * @return The compile. - */ - @java.lang.Override - public org.prlprg.server.protocol.CompileRequest getCompile() { - if (compileBuilder_ == null) { - if (payloadCase_ == 2) { - return (org.prlprg.server.protocol.CompileRequest) payload_; - } - return org.prlprg.server.protocol.CompileRequest.getDefaultInstance(); - } else { - if (payloadCase_ == 2) { - return compileBuilder_.getMessage(); - } - return org.prlprg.server.protocol.CompileRequest.getDefaultInstance(); - } - } - - /** .rsh.server.protocol.CompileRequest compile = 2; */ - public Builder setCompile(org.prlprg.server.protocol.CompileRequest value) { - if (compileBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - payload_ = value; - onChanged(); - } else { - compileBuilder_.setMessage(value); - } - payloadCase_ = 2; - return this; - } - - /** .rsh.server.protocol.CompileRequest compile = 2; */ - public Builder setCompile(org.prlprg.server.protocol.CompileRequest.Builder builderForValue) { - if (compileBuilder_ == null) { - payload_ = builderForValue.build(); - onChanged(); - } else { - compileBuilder_.setMessage(builderForValue.build()); - } - payloadCase_ = 2; - return this; - } - - /** .rsh.server.protocol.CompileRequest compile = 2; */ - public Builder mergeCompile(org.prlprg.server.protocol.CompileRequest value) { - if (compileBuilder_ == null) { - if (payloadCase_ == 2 - && payload_ != org.prlprg.server.protocol.CompileRequest.getDefaultInstance()) { - payload_ = - org.prlprg.server.protocol.CompileRequest.newBuilder( - (org.prlprg.server.protocol.CompileRequest) payload_) - .mergeFrom(value) - .buildPartial(); - } else { - payload_ = value; - } - onChanged(); - } else { - if (payloadCase_ == 2) { - compileBuilder_.mergeFrom(value); - } else { - compileBuilder_.setMessage(value); - } - } - payloadCase_ = 2; - return this; - } - - /** .rsh.server.protocol.CompileRequest compile = 2; */ - public Builder clearCompile() { - if (compileBuilder_ == null) { - if (payloadCase_ == 2) { - payloadCase_ = 0; - payload_ = null; - onChanged(); - } - } else { - if (payloadCase_ == 2) { - payloadCase_ = 0; - payload_ = null; - } - compileBuilder_.clear(); - } - return this; - } - - /** .rsh.server.protocol.CompileRequest compile = 2; */ - public org.prlprg.server.protocol.CompileRequest.Builder getCompileBuilder() { - return getCompileFieldBuilder().getBuilder(); - } - - /** .rsh.server.protocol.CompileRequest compile = 2; */ - @java.lang.Override - public org.prlprg.server.protocol.CompileRequestOrBuilder getCompileOrBuilder() { - if ((payloadCase_ == 2) && (compileBuilder_ != null)) { - return compileBuilder_.getMessageOrBuilder(); - } else { - if (payloadCase_ == 2) { - return (org.prlprg.server.protocol.CompileRequest) payload_; - } - return org.prlprg.server.protocol.CompileRequest.getDefaultInstance(); - } - } - - /** .rsh.server.protocol.CompileRequest compile = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< - org.prlprg.server.protocol.CompileRequest, - org.prlprg.server.protocol.CompileRequest.Builder, - org.prlprg.server.protocol.CompileRequestOrBuilder> - getCompileFieldBuilder() { - if (compileBuilder_ == null) { - if (!(payloadCase_ == 2)) { - payload_ = org.prlprg.server.protocol.CompileRequest.getDefaultInstance(); - } - compileBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - org.prlprg.server.protocol.CompileRequest, - org.prlprg.server.protocol.CompileRequest.Builder, - org.prlprg.server.protocol.CompileRequestOrBuilder>( - (org.prlprg.server.protocol.CompileRequest) payload_, - getParentForChildren(), - isClean()); - payload_ = null; - } - payloadCase_ = 2; - onChanged(); - return compileBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:rsh.server.protocol.Request) - } - - // @@protoc_insertion_point(class_scope:rsh.server.protocol.Request) - private static final org.prlprg.server.protocol.Request DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new org.prlprg.server.protocol.Request(); - } - - public static org.prlprg.server.protocol.Request getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Request parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.prlprg.server.protocol.Request getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/server/src/main/java/org/prlprg/server/protocol/RequestOrBuilder.java b/server/src/main/java/org/prlprg/server/protocol/RequestOrBuilder.java deleted file mode 100644 index 37de07f66..000000000 --- a/server/src/main/java/org/prlprg/server/protocol/RequestOrBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: protocol.proto - -package org.prlprg.server.protocol; - -public interface RequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:rsh.server.protocol.Request) - com.google.protobuf.MessageOrBuilder { - - /** - * .rsh.server.protocol.HandshakeRequest handshake = 1; - * - * @return Whether the handshake field is set. - */ - boolean hasHandshake(); - - /** - * .rsh.server.protocol.HandshakeRequest handshake = 1; - * - * @return The handshake. - */ - org.prlprg.server.protocol.HandshakeRequest getHandshake(); - - /** .rsh.server.protocol.HandshakeRequest handshake = 1; */ - org.prlprg.server.protocol.HandshakeRequestOrBuilder getHandshakeOrBuilder(); - - /** - * .rsh.server.protocol.CompileRequest compile = 2; - * - * @return Whether the compile field is set. - */ - boolean hasCompile(); - - /** - * .rsh.server.protocol.CompileRequest compile = 2; - * - * @return The compile. - */ - org.prlprg.server.protocol.CompileRequest getCompile(); - - /** .rsh.server.protocol.CompileRequest compile = 2; */ - org.prlprg.server.protocol.CompileRequestOrBuilder getCompileOrBuilder(); - - public org.prlprg.server.protocol.Request.PayloadCase getPayloadCase(); -} diff --git a/server/src/main/java/org/prlprg/service/JITService.java b/server/src/main/java/org/prlprg/service/JITService.java deleted file mode 100644 index 7ac4e62dd..000000000 --- a/server/src/main/java/org/prlprg/service/JITService.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.prlprg.service; - -import com.google.common.io.Files; -import java.io.File; -import java.nio.charset.Charset; -import java.util.logging.Logger; -import org.prlprg.RSession; -import org.prlprg.bc.BCCompiler; -import org.prlprg.bc2c.BC2CCompiler; -import org.prlprg.sexp.CloSXP; - -public class JITService { - private final RSession rsession; - - private static final Logger logger = Logger.getLogger(JITService.class.getName()); - - public JITService(RSession rsession) { - this.rsession = rsession; - } - - public NativeClosure execute(String name, CloSXP closure, int bcOptimization, int ccOptimization) - throws Exception { - logger.fine( - "Compiling closure: " - + name - + "\n" - + closure - + "(bcOpt=" - + bcOptimization - + ", ccOpt=" - + ccOptimization - + ")\n"); - - var bcCompiler = new BCCompiler(closure, rsession); - bcCompiler.setOptimizationLevel(bcOptimization); - var bc = bcCompiler.compile().get(); - var bc2cCompiler = new BC2CCompiler(bc); - var module = bc2cCompiler.finish(); - // var input = new File("/tmp/jit.c"); - var input = File.createTempFile("cfile", ".c"); - var f = Files.newWriter(input, Charset.defaultCharset()); - module.file().writeTo(f); - // var output = new File("/tmp/jit.o"); - var output = File.createTempFile("ofile", ".o"); - - RshCompiler.getInstance(ccOptimization) - .createBuilder(input.getPath(), output.getPath()) - .flag("-c") - .compile(); - - var res = Files.asByteSource(output).read(); - - // if (!input.delete()) { - // throw new IOException("Unable to delete file" + input); - // } - - // if (!output.delete()) { - // throw new IOException("Unable to delete file" + input); - // } - - return new NativeClosure(res, module.topLevelFunName(), module.constantPool()); - } -} diff --git a/server/src/main/java/org/prlprg/service/NativeClosure.java b/server/src/main/java/org/prlprg/service/NativeClosure.java index 82248fb7e..15d3b8a35 100644 --- a/server/src/main/java/org/prlprg/service/NativeClosure.java +++ b/server/src/main/java/org/prlprg/service/NativeClosure.java @@ -1,6 +1,5 @@ package org.prlprg.service; -import org.prlprg.sexp.SEXP; -import org.prlprg.sexp.VectorSXP; +import com.google.protobuf.ByteString; -public record NativeClosure(byte[] code, String name, VectorSXP constantPool) {} +public record NativeClosure(ByteString code, String name, ByteString constantPool) {} diff --git a/server/src/main/java/org/prlprg/service/RshCompiler.java b/server/src/main/java/org/prlprg/service/RshCompiler.java index f11180ffe..fe69027ce 100644 --- a/server/src/main/java/org/prlprg/service/RshCompiler.java +++ b/server/src/main/java/org/prlprg/service/RshCompiler.java @@ -4,17 +4,29 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; +import java.util.logging.Logger; import org.prlprg.util.cc.CCCompilationBuilder; public class RshCompiler { + private static final Logger logger = Logger.getLogger(RshCompiler.class.getName()); + + // Make it work whether we run it from the server directory or from the root of the project + private static Path baseDirectory = Paths.get("").toAbsolutePath(); + + static { + if (baseDirectory.endsWith("server")) { + baseDirectory = baseDirectory.getParent(); + } + } + // TODO: this is just temporary // what we need is to keep this in the resources, versioned by R version // and upon server instantiation, copy it to some temp directory // and precompile the header file (if needed) private static final Path RSH_INCLUDE_PATH = - Paths.get("../client/rsh/src/bc2c").normalize().toAbsolutePath(); + baseDirectory.resolve("client/rsh/src/bc2c").normalize().toAbsolutePath(); private static final Path R_INCLUDE_PATH = - Paths.get("../external/R/include").normalize().toAbsolutePath(); + baseDirectory.resolve("external/R/include").normalize().toAbsolutePath(); // TODO: which ones are needed? private static final List COMMON_COMPILER_FLAGS = @@ -55,7 +67,6 @@ public static RshCompiler getInstance(int optimizationLevel) { } flags.add("-O" + optimizationLevel); - // TODO: cache return new RshCompiler(flags); } diff --git a/server/src/main/java/org/prlprg/session/DESCRIPTION.java b/server/src/main/java/org/prlprg/session/DESCRIPTION.java new file mode 100644 index 000000000..5bf1336ae --- /dev/null +++ b/server/src/main/java/org/prlprg/session/DESCRIPTION.java @@ -0,0 +1,97 @@ +package org.prlprg.session; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** DESCRIPTION file parser. */ +public class DESCRIPTION { + private String version; + private final HashMap suggests; + private final HashMap imports; + + private static final Pattern versionPattern = Pattern.compile("^Version:\\s*(.*)$"); + private static final Pattern suggestsPattern = Pattern.compile("^Suggests:\\s*(.*)$"); + private static final Pattern importsPattern = Pattern.compile("^Imports:\\s*(.*)$"); + private static final Pattern versionRequirementPattern = + Pattern.compile("([a-zA-Z0-9]+)\\s*\\((>=|=|>|<=|<)\\s*([0-9\\.]+)\\)"); + + public DESCRIPTION(Path descriptionFile) throws IOException { + this.suggests = new HashMap<>(); + this.imports = new HashMap<>(); + parseDescriptionFile(descriptionFile); + } + + /** + * Parses the DESCRIPTION file. + * + * @param descriptionFile the path to the DESCRIPTION file + * @throws IOException if an I/O error occurs + */ + private void parseDescriptionFile(Path descriptionFile) throws IOException { + List lines = Files.readAllLines(descriptionFile); + + for (String line : lines) { + Matcher versionMatcher = versionPattern.matcher(line); + Matcher suggestsMatcher = suggestsPattern.matcher(line); + Matcher importsMatcher = importsPattern.matcher(line); + + if (versionMatcher.find()) { + this.version = versionMatcher.group(1).trim(); + } else if (suggestsMatcher.find()) { + parsePackages(suggestsMatcher.group(1).trim(), this.suggests); + } else if (importsMatcher.find()) { + parsePackages(importsMatcher.group(1).trim(), this.imports); + } + } + } + + /** + * Parses a comma-separated list of packages with version requirements. + * + * @param packages the comma-separated list of packages + * @param map the map to add the packages and their version requirements to + */ + private void parsePackages(String packages, HashMap map) { + String[] packageArray = packages.split(","); + for (String pkg : packageArray) { + Matcher matcher = versionRequirementPattern.matcher(pkg.trim()); + if (matcher.find()) { + map.put(matcher.group(1).trim(), matcher.group(2).trim() + " " + matcher.group(3).trim()); + } else { + map.put(pkg.trim(), ""); + } + } + } + + /** + * Returns the version of the package. + * + * @return the version of the package + */ + public String getVersion() { + return version; + } + + /** + * Returns the list of suggested packages. + * + * @return the list of suggested packages + */ + public HashMap getSuggests() { + return suggests; + } + + /** + * Returns the list of imported packages. + * + * @return the list of imported packages + */ + public HashMap getImports() { + return imports; + } +} diff --git a/server/src/main/java/org/prlprg/session/GNURSession.java b/server/src/main/java/org/prlprg/session/GNURSession.java new file mode 100644 index 000000000..4989e80da --- /dev/null +++ b/server/src/main/java/org/prlprg/session/GNURSession.java @@ -0,0 +1,329 @@ +package org.prlprg.session; + +import com.google.common.collect.ImmutableList; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Path; +import java.util.*; +import java.util.logging.Logger; +import javax.annotation.Nullable; +import org.prlprg.RVersion; +import org.prlprg.rds.RDSReader; +import org.prlprg.server.Messages; +import org.prlprg.sexp.*; +import org.prlprg.util.Files; + +/** + * Dummy session used to bootstrap base. Indeed, the RDS reader that reads base package database + * requires a session. + */ +class DummySession implements RSession { + private final Logger logger = Logger.getLogger(DummySession.class.getName()); + private final GlobalEnvSXP globalEnv = new GlobalEnvSXP(SEXPs.EMPTY_ENV); + private final NamespaceEnvSXP namespaceEnv = + new NamespaceEnvSXP("base", "4.3.2", globalEnv, new HashMap<>()); + private final BaseEnvSXP baseEnv = new BaseEnvSXP(new HashMap<>()); + + @Override + public NamespaceEnvSXP baseNamespace() { + return namespaceEnv; + } + + @Override + public BaseEnvSXP baseEnv() { + return baseEnv; + } + + @Override + public GlobalEnvSXP globalEnv() { + return globalEnv; + } + + @Override + public boolean isBuiltin(String name) { + return false; + } + + @Override + public boolean isSpecial(String name) { + return false; + } + + @Override + public boolean isBuiltinInternal(String name) { + return false; + } + + @Override + public NamespaceEnvSXP getNamespace(String name, String version) { + return null; + } + + @Override + public ImmutableList RFunTab() { + return null; + } +} + +public class GNURSession implements RSession { + private URI cranMirror; + private org.prlprg.RVersion RVersion; + private final Path RDir; + private final List RLibraries; + + private @Nullable BaseEnvSXP baseEnv = null; + private @Nullable NamespaceEnvSXP baseNamespace = null; + private @Nullable GlobalEnvSXP globalEnv = null; + private @Nullable Set builtins = null; + private @Nullable Set specials = null; + private @Nullable Set builtinsInternal = null; + private final HashMap namespaces = new HashMap<>(); + private @Nullable ImmutableList rFunTab = null; + private static final String R_FUN_TAB_FILE = "R_FunTab.txt"; + + // TODO: need the path to R *and* the path to the installed packages + public GNURSession(RVersion version, Path r_dir, Path r_libraries) { + cranMirror = URI.create("https://cran.r-project.org"); + RVersion = version; + RDir = r_dir; + RLibraries = Arrays.asList(RDir.resolve("library"), r_libraries); + } + + public GNURSession(RVersion version, Path r_dir, Path r_libraries, URI cranMirror) { + this(version, r_dir, r_libraries); + this.cranMirror = cranMirror; + } + + public void setCranMirror(URI uri) {} + + private @Nullable Path resolvePaths(String name) { + for (var p : RLibraries) { + var pkgPath = p.resolve(name); + var pkgDir = pkgPath.toFile(); + if (pkgDir.exists() && pkgDir.isDirectory()) { + return pkgPath; + } + } + return null; + } + + // We should also handle installation of a package from a GitHub repo? + public void loadPackage(String name, String version) { + @Nullable var pkgDir = resolvePaths(name); + if (pkgDir == null) { + installPackage(name); + pkgDir = resolvePaths(name); + } + + DESCRIPTION description = getDescription(name); + + String installedVersion = description.getVersion(); + + // TODO: Handle that better that throwing an error. + if (!version.equals(installedVersion)) { + throw new RuntimeException( + "Version mismatch: expected " + version + " but found " + installedVersion); + } + + // Use suggests and imports as needed + var suggests = description.getSuggests(); + var imports = description.getImports(); + + // Make sure base is loaded + if (baseNamespace == null) { + loadBase(); + } + + // Bootstrap the namespace + prepareNamespace(name, version); + + // Load the package + try { + // getParent() because we add the name of the package to the path in readPackageDatabase + var bindings = readPackageDatabase(this, pkgDir.getParent(), name); + var ns = namespaces.get(name + version); + ns.setBindings(bindings); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private void installPackage(String name) { + var pkgDir = resolvePaths(name); + + var RScript = RDir.resolve("bin/Rscript"); + try { + ProcessBuilder processBuilder = + new ProcessBuilder( + RScript.toString(), + "-e", + "install.packages('" + name + "', repos='" + cranMirror + "')"); + processBuilder.inheritIO(); + Process process = processBuilder.start(); + int exitCode = process.waitFor(); + if (exitCode != 0) { + throw new RuntimeException("Failed to install package " + name); + } + } catch (IOException | InterruptedException e) { + throw new RuntimeException("Failed to install package " + name, e); + } + } + + private DESCRIPTION getDescription(String name) { + try { + var pkgDir = resolvePaths(name); + + Path descriptionFile = pkgDir.toAbsolutePath().resolve("DESCRIPTION"); + DESCRIPTION description; + description = new DESCRIPTION(descriptionFile); + return description; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private static HashMap readPackageDatabase( + RSession session, Path libPath, String packageName) throws IOException { + var db = new PackageDatabase(session, libPath, packageName); + return db.getBindings(); + } + + /** + * Objects in a package database refer to their own namespace so we need to create it before + * reading. + * + * @param name + * @param version + */ + private void prepareNamespace(String name, String version) { + var ns = namespaces.get(name + version); + if (globalEnv == null) { + loadBase(); + } + if (ns == null) { + ns = new NamespaceEnvSXP(name, version, globalEnv, new HashMap<>()); + namespaces.put(name + version, ns); + } + } + + /** + * Makes it possible to load a package by providing its functions directly. + * + *

Note that it does not support loading the package's data, documentation, etc. + * + * @param name + * @param version + * @param functions in the package + * @return the populated environment + */ + public EnvSXP loadPackage(String name, String version, List functions) { + if (name.equals("base")) { + throw new RuntimeException("Cannot load base namespace this way"); + } + // Should the parent rather be the package namespace? + if (baseNamespace == null) { + throw new RuntimeException("Base namespace not loaded yet"); + } + + var bindings = new HashMap(functions.size()); + functions.forEach( + function -> { + try { + bindings.put( + function.getName(), (CloSXP) RDSReader.readByteString(this, function.getBody())); + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + return new NamespaceEnvSXP(name, version, baseNamespace, bindings); + } + + /** + * Load the base environment and namespace. + * + *

It requires a special treatment as the reader refers to base functions, and so we need to + * carefully load symbols and then bind them. + */ + public void loadBase(List functions) { + // TODO + // Bootstrap the reader with an ad-hoc session? + } + + /** Load base from the given installed R version */ + public void loadBase() { + var session = new DummySession(); + var baseLibPath = RDir.resolve("library"); + try { + var objs = GNURSession.readPackageDatabase(session, baseLibPath, "base"); + baseEnv = new BaseEnvSXP(objs); + globalEnv = new GlobalEnvSXP(baseEnv); + baseNamespace = new NamespaceEnvSXP("base", RVersion.toString(), globalEnv, objs); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public NamespaceEnvSXP baseNamespace() { + if (baseNamespace == null) { + loadBase(); + } + return baseNamespace; + } + + @Override + public BaseEnvSXP baseEnv() { + if (baseEnv == null) { + loadBase(); + } + return baseEnv; + } + + @Override + public GlobalEnvSXP globalEnv() { + if (globalEnv == null) { + loadBase(); + } + return globalEnv; + } + + @Override + public boolean isBuiltin(String name) { + return false; + } + + @Override + public boolean isSpecial(String name) { + return false; + } + + @Override + public boolean isBuiltinInternal(String name) { + return false; + } + + @Override + public NamespaceEnvSXP getNamespace(String name, String version) { + var ns = namespaces.get(name + version); + if (ns == null) { + loadPackage(name, version); + // Retrieve the namespace again after loading the package + ns = namespaces.get(name + version); + } + return ns; + } + + @Override + public ImmutableList RFunTab() { + if (rFunTab == null) { + rFunTab = + ImmutableList.builder() + .addAll( + Files.readLines( + Objects.requireNonNull( + GNURSession.class.getResourceAsStream(R_FUN_TAB_FILE)))) + .build(); + } + return rFunTab; + } +} diff --git a/server/src/main/java/org/prlprg/session/PackageDatabase.java b/server/src/main/java/org/prlprg/session/PackageDatabase.java new file mode 100644 index 000000000..ac1571d0c --- /dev/null +++ b/server/src/main/java/org/prlprg/session/PackageDatabase.java @@ -0,0 +1,309 @@ +package org.prlprg.session; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.file.Path; +import java.util.*; +import java.util.logging.Logger; +import java.util.zip.InflaterInputStream; +import org.prlprg.rds.RDSException; +import org.prlprg.rds.RDSReader; +import org.prlprg.sexp.*; + +/** + * Read a package database. As described in the Lazy Loading + * section of the R internals manual, the package database is located in the R subdirectory of the + * installed package and consists of two files: a compressed index file with the extension .rdx and + * a serialized object file with the extension .rdb. + * + *

This class can load object in the package on demand, and not all of them at once. + */ +public class PackageDatabase { + private static Logger LOGGER = Logger.getLogger(PackageDatabase.class.getName()); + private final RandomAccessFile objectFile; + private final HashMap index = new HashMap<>(); + private final HashMap tmpEnvs = new HashMap<>(); + private final HashMap objects = new HashMap<>(); + private final RSession session; + private final EnvHook envHook = new EnvHook(); + private final Set seenTmpEnvs = new HashSet<>(); + + private class EnvHook implements RDSReader.Hook { + @Override + public SEXP hook(SEXP sexp) throws IOException { + if (sexp instanceof StrSXP s) { + var name = s.get(0); + var position = tmpEnvs.get(name); + if (position == null) { + return sexp; + } + // There is a cycle in the Env! + if (seenTmpEnvs.contains(name)) { + // create a placeholder environment, which we will replace later + // by the actual environment + return new NamespaceEnvSXP( + // add a binding which would be the parent SEXP? + name, "__placeholder__", session.baseNamespace(), new HashMap<>()); + } + + seenTmpEnvs.add(name); + // env::4, env::10, env::9 are not environments but VecSXP! + // We should convert them to environments. + // They are created when the function was defined using `local` + // But more generally, any non special env (i.e, not global, namespace, base etc) + // is serialized to a VecSXP in the rdb file. + var tmpEnv = readObject(name, tmpEnvs); + if (tmpEnv instanceof VecSXP v) { + var realEnv = vecToEnv(v); + realEnv = (UserEnvSXP) replacePlaceHolder(realEnv, realEnv, name); + return realEnv; + } + + return tmpEnv; + } + + return sexp; + } + } + + /** + * Find occurrences of all placeholder environments, that we added when reading back environments + * with cycles and put back the cycle. Placeholder envs are NamespaceEnv with "__placeholder__" as + * version and the original env::n as name. We have to do this 2-step dance here because we first + * need to build the environment before putting a reference to it inside itself! + * + * @param selfRefEnv the environment that we want to make refer to itself + * @param v the sexp on which we currently recurse + * @param name the name of the environment used in the placeholder + * @return the sexp with the placeholder replaced by the actual environment + */ + private static SEXP replacePlaceHolder(UserEnvSXP selfRefEnv, SEXP v, String name) { + // FIXME: there could also be environments in attributes + return switch (v) { + case NamespaceEnvSXP n -> { + if (n.version().equals("__placeholder__") && n.name().equals(name)) { + yield selfRefEnv; + } else { + yield n; + } + } + case EnvSXP env -> { + for (var e : env.bindings()) { + var res = replacePlaceHolder(selfRefEnv, e.getValue(), name); + if (res != e.getValue()) { + env.set(e.getKey(), res); + } + } + yield env; + } + case VecSXP vec -> { + SEXP[] res = new SEXP[vec.size()]; + boolean change = false; + for (int i = 0; i < vec.size(); i++) { + res[i] = replacePlaceHolder(selfRefEnv, vec.get(i), name); + if (res[i] != vec.get(i)) { + change = true; + } + } + if (change) { + yield SEXPs.vec(res, vec.attributes()); + } else { + yield vec; + } + } + case CloSXP clo -> { + var res = replacePlaceHolder(selfRefEnv, clo.env(), name); + if (res != clo.env()) { + yield SEXPs.closure(clo.parameters(), clo.body(), (EnvSXP) res, clo.attributes()); + } else { + yield clo; + } + } + default -> v; + }; + } + + /** + * Envs that are not special environments are serialized as VecSXP, with a specific shape. Here, + * we transform them back into EnvSXP + * + *

See makebasedb.R or makelazyload.R + * + *

- makebasedb + * - makelazyload + * + * @param v + * @return + */ + private static UserEnvSXP vecToEnv(VecSXP v) { + /* + env is a list with 2 elements with names: + - `bindings`: all the symbols in the environment (names + value) + - `enclos`: the parent environment + */ + // Check if the names are correct + var names = (StrSXP) v.attributes().get("names"); + assert Objects.requireNonNull(names).get(0).equals("bindings"); + assert names.get(1).equals("enclos"); + + // Enclos + var enclos = (EnvSXP) v.get(1); + + // Bindings + var symbols = (VecSXP) v.get(0); + names = (StrSXP) symbols.attributes().get("names"); + assert names != null; + var bindings = new HashMap(); + for (int i = 0; i < symbols.size(); i++) { + var name = names.get(i); + assert name != null; + var value = symbols.get(i); + bindings.put(name, value); + } + + return new UserEnvSXP(enclos, bindings); + } + + /** + * Create a new package database. + * + * @param pkgDir The path to the library where the package is installed. + * @param packageName The name of the package. + */ + public PackageDatabase(RSession session, Path pkgDir, String packageName) throws IOException { + this.session = session; + // .libPaths and installed_packages() in R can help to see + // where packages are installed + var basePath = pkgDir.resolve(packageName + "/R"); + // Read the index file .rdx + // we get a list with 3 elements, variables, references and compressed + // See LazyLoading in https://cran.r-project.org/doc/manuals/r-devel/R-ints.html + var indexFile = RDSReader.readFile(session, basePath.resolve(packageName + ".rdx").toFile()); + + // Load objects .rdb + objectFile = new RandomAccessFile(String.valueOf(basePath.resolve(packageName + ".rdb")), "r"); + + // Read the index + if (indexFile instanceof VecSXP l) { + var variables = (VecSXP) l.get(0); + var references = (VecSXP) l.get(1); + var compressed = l.get(2); + if (compressed instanceof IntSXP i) { + var algo = + switch (i.get(0)) { + case 2 -> "bzip2"; + case 3 -> "xz"; + default -> "unknown"; + }; + // For the other ones, there would be one more byte in addition to the length + // that would contain the compression method again or 0 if the compressed size + // had exceeded the uncompressed one. + throw new RuntimeException(algo + " compression detected; only zlib is supported"); + } + + populateIndex(variables, index); + populateIndex(references, tmpEnvs); + } else { + throw new IllegalArgumentException("Invalid index file"); + } + } + + private static void populateIndex(VecSXP offsets, HashMap offsetMap) { + var names = offsets.names(); + for (int i = 0; i < offsets.size(); i++) { + var posInRdb = (IntSXP) offsets.get(i); + offsetMap.put(names.get(i), posInRdb); + } + } + + /** + * Get the names of the symbols in the package database. It corresponds to the `variables` field + * in the index file (.rdb) + * + * @return + */ + public Set getSymbolNames() { + return index.keySet(); + } + + /** + * Get the object with the given name. This will look at the cache or read the rdb file and use + * the offset and length information from the index file to read the object. + * + * @param name + * @return + */ + public SEXP getObject(String name) throws IOException { + return readObject(name, index); + } + + private SEXP readObject(String name, HashMap offsets) throws IOException { + var obj = objects.get(name); + if (obj != null) { + return obj; + } + + var posInRdb = offsets.get(name); + objectFile.seek(posInRdb.get(0)); + byte[] raw = new byte[posInRdb.get(1)]; + objectFile.readFully(raw); + // The first 4 bytes are the uncompressed size for the chunk we read + // It is a big endian int + int length = (raw[0] << 24) | (raw[1] << 16) | (raw[2] << 8) | raw[3]; + // assert length >= raw.length - 4; + + var input = new ByteArrayInputStream(raw); + input.skipNBytes(4); + obj = RDSReader.readStream(session, new InflaterInputStream(input), envHook); + + objects.put(name, obj); + return obj; + } + + /** + * Get all the objects in the package database. + * + * @return + */ + public HashMap getBindings() throws IOException { + if (objects.size() == index.size() + tmpEnvs.size()) { + return objects; + } + if (index.containsKey(".__NAMESPACE__.")) { + readObject(".__NAMESPACE__.", index); + } + + // Problems: + // - .doSortWrap : cycle in with env:4 + // - globalCallingHandlers : same as .doSortWrap + // - conflictRules : same + // - .doWrap : same (but it seems it depends on the order of the symbol reading + // - .dynLibs: cycle with env:4 + // - .libPaths: same + for (var name : index.keySet()) { + // LOGGER.info("Loading " + name); + + try { + readObject(name, index); + } catch (RDSException e) { + LOGGER.warning("Error loading " + name + ": " + e.getMessage()); + } + } + + var notClos = + objects.entrySet().stream() + .filter(e -> !(e.getValue() instanceof CloSXP)) + .map(e -> e.getKey() + ":" + e.getValue().type()) + .toList(); + LOGGER.info("Not Closures: " + notClos); + + // Remove the persist environments + objects.keySet().removeAll(tmpEnvs.keySet()); + + return objects; + } +} diff --git a/server/src/main/java/org/prlprg/RSession.java b/server/src/main/java/org/prlprg/session/RSession.java similarity index 95% rename from server/src/main/java/org/prlprg/RSession.java rename to server/src/main/java/org/prlprg/session/RSession.java index 96ec744b7..8225cee66 100644 --- a/server/src/main/java/org/prlprg/RSession.java +++ b/server/src/main/java/org/prlprg/session/RSession.java @@ -1,4 +1,4 @@ -package org.prlprg; +package org.prlprg.session; import com.google.common.collect.ImmutableList; import org.prlprg.sexp.BaseEnvSXP; diff --git a/server/src/main/java/org/prlprg/session/package-info.java b/server/src/main/java/org/prlprg/session/package-info.java new file mode 100644 index 000000000..6ff4de529 --- /dev/null +++ b/server/src/main/java/org/prlprg/session/package-info.java @@ -0,0 +1,11 @@ +/** + * Socket setup and communication with clients (which are running an instance of R), and protocols. + */ +@ParametersAreNonnullByDefault +@FieldsAreNonNullByDefault +@ReturnTypesAreNonNullByDefault +package org.prlprg.session; + +import javax.annotation.ParametersAreNonnullByDefault; +import org.prlprg.util.FieldsAreNonNullByDefault; +import org.prlprg.util.ReturnTypesAreNonNullByDefault; diff --git a/server/src/main/java/org/prlprg/sexp/AbstractEnvSXP.java b/server/src/main/java/org/prlprg/sexp/AbstractEnvSXP.java index 4821a1d8d..b22cb444d 100644 --- a/server/src/main/java/org/prlprg/sexp/AbstractEnvSXP.java +++ b/server/src/main/java/org/prlprg/sexp/AbstractEnvSXP.java @@ -51,6 +51,11 @@ public void set(String name, SEXP value) { bindings.put(name, value); } + public void setBindings(Map bindings) { + this.bindings.clear(); + this.bindings.putAll(bindings); + } + @Override public String toString() { return Printer.toString(this); diff --git a/server/src/main/java/org/prlprg/sexp/EnvSXP.java b/server/src/main/java/org/prlprg/sexp/EnvSXP.java index 84bfdfb75..681e9f607 100644 --- a/server/src/main/java/org/prlprg/sexp/EnvSXP.java +++ b/server/src/main/java/org/prlprg/sexp/EnvSXP.java @@ -56,6 +56,10 @@ public sealed interface EnvSXP extends SEXP permits StaticEnvSXP, UserEnvSXP { */ int size(); + default boolean isEmpty() { + return size() == 0; + } + @Override default SEXPType type() { return SEXPType.ENV; diff --git a/server/src/main/java/org/prlprg/sexp/SEXP.java b/server/src/main/java/org/prlprg/sexp/SEXP.java index 9cb5b749c..661f1cabe 100644 --- a/server/src/main/java/org/prlprg/sexp/SEXP.java +++ b/server/src/main/java/org/prlprg/sexp/SEXP.java @@ -155,6 +155,10 @@ default Optional as(Class clazz) { return clazz.isInstance(this) ? Optional.of(clazz.cast(this)) : Optional.empty(); } + default boolean isObject() { + return attributes() != null && Objects.requireNonNull(attributes()).containsKey("class"); + } + // region serialization and deserialization @ParseMethod private static SEXP parse(Parser p, HasSEXPParseContext h) { @@ -179,8 +183,4 @@ private void print(Printer p) { // `toString` is overridden in every subclass to call `Printer.toString(this)`. // endregion serialization and deserialization - - default boolean isObject() { - return attributes() != null && Objects.requireNonNull(attributes()).containsKey("class"); - } } diff --git a/server/src/main/java/org/prlprg/sexp/UserEnvSXP.java b/server/src/main/java/org/prlprg/sexp/UserEnvSXP.java index 243ed4571..2763f288b 100644 --- a/server/src/main/java/org/prlprg/sexp/UserEnvSXP.java +++ b/server/src/main/java/org/prlprg/sexp/UserEnvSXP.java @@ -35,14 +35,6 @@ public Iterator iterator() { bindings.entrySet().iterator(), e -> new TaggedElem(e.getKey(), e.getValue())); } - public ListSXP frame() { - return new ListSXPImpl( - bindings.entrySet().stream() - .map(e -> new TaggedElem(e.getKey(), e.getValue())) - .collect(ImmutableList.toImmutableList()), - Attributes.NONE); - } - @Override public EnvType envType() { return EnvType.USER; @@ -62,4 +54,16 @@ public UserEnvSXP withAttributes(Attributes attributes) { public void setAttributes(Attributes attributes) { this.attributes = attributes; } + + public ListSXP frame() { + return SEXPs.list( + bindings.entrySet().stream() + .map(e -> new TaggedElem(e.getKey(), e.getValue())) + .collect(ImmutableList.toImmutableList())); + } + + @Override + public String toString() { + return ""; + } } diff --git a/server/src/main/proto/messages.proto b/server/src/main/proto/messages.proto new file mode 100644 index 000000000..181679b99 --- /dev/null +++ b/server/src/main/proto/messages.proto @@ -0,0 +1,176 @@ +syntax = "proto3"; + +option java_package = "org.prlprg.server"; + +package rsh.protocol; + +// Error handling +// grpc already has a way to handle errors +// Status message: https://grpc.github.io/grpc-java/javadoc/io/grpc/Status.html + +// Init +message Version { + int32 major = 1; + int32 minor = 2; + int32 patch = 3; +} + +message InitRequest { + Version Rsh_version = 1;// version of the compile server + Version R_version = 2; + string platform = 3;//amd64, etc TODO: use an enum for the allowed platforms? + repeated bytes package_hash = 4;//Packages which are initially part of the environment (in addition to base) +} + +message InitResponse {} + + +// Basic messages + +message CompileRequest { + Function function = 2;// Add package version + optional Tier tier = 4;//if not defined, let the compile server decide + optional int32 cc_opt = 5;// if not defined, the server decides + optional int32 bc_opt = 6;// for the bytecode. Native does bytecode first so this is also need when compiling to native + optional Context context = 7; + optional Environment environment = 8;//The values of all the bindings that statically appear in the function +} + +message CompileResponse { + uint64 hash = 1; + Tier tier = 2; + optional bytes code = 3; + optional bytes constants = 4; +} + + +message Function { + uint64 package_hash = 1; + string name = 2; //What if it is a closure passed to a HOF? + uint64 hash = 3; + optional bytes body = 4; + // what about the function parameters? +} + +message FunctionRequest { + uint64 hash = 1; +} + +message Environment { + map values = 1;//Name of the variable to a hash of the value +} + + +message ValueRequest { + repeated uint64 hash = 1;// We can batch and ask for several values +} + +message Value { + uint64 hash = 1; + bytes value = 2; +} +message Values { + repeated Value values = 1; +} + +message Empty {} + +enum Tier { + BASELINE = 0;// bytecode + OPTIMIZED = 1; // native code +} + +// Context + +message CallContext { + bool args_statically_matched = 1; + bool correct_number_of_args = 2; + bool correct_order_of_args = 3; + bool no_missing_args = 4; +} + +message ArgumentContext { + bool eager = 1; + bool reflection = 2; + bool object = 3; + optional Type type = 4; +} + +message Context { + CallContext call_context = 1; + repeated ArgumentContext argument_context = 2; +} + +message ContextRequest { + Function function = 1; +} + + +// Feedback + +enum TestLattice { + BOTH = 0; + ONLY_TRUE = 1; + ONLY_FALSE = 2; + NONE = 3; +} + +enum Type { + ANY = 0; + INTEGER = 1; + REAL = 2;// Add more types +} + +message TestFeedback { + TestLattice test_lattice = 1; +} + +message CallFeedback { + int64 n_calls = 1; + uint64 callee_hash = 2; +} + +message ValueFeedback { + bool scalar = 1; + bool object = 2; + bool accessed_attributes = 3; + bool vectorizable = 4; + bool is_promise = 5; +} + +message TypeFeedback { + message Feedback { + oneof feedback { + TestFeedback test_feedback = 1; + CallFeedback call_feedback = 2; + ValueFeedback value_feedback = 3; + } + } + map types = 2;//Offset in the bytecode to the feedback +} + +message FeedbackRequest { + Function function = 1; +} + +// Packages + + +message PackageSource { + oneof source { + string r_mirror = 2; + string github_url = 3; + } +} + +message Package { + string name = 1; + Version version = 2; + repeated uint64 function_hashes = 4; + // What about package data? Maybe just the sysdata? + optional PackageSource source = 5;//If none, it is a base package or a local package +} + +message PackageRequest { + uint64 hash = 1; +} \ No newline at end of file diff --git a/server/src/main/proto/routes.proto b/server/src/main/proto/routes.proto new file mode 100644 index 000000000..5a3208f7d --- /dev/null +++ b/server/src/main/proto/routes.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +option java_package = "org.prlprg.server"; + +import "messages.proto"; + +package rsh.protocol; + +// R sends requests to the compile server +service CompileService { + rpc Compile(CompileRequest) returns (CompileResponse) {} + rpc Init(InitRequest) returns (InitResponse) {} +} + +// Used by the compile server to ask questions to R +// The server part there should be in the C++ code +service FactService { + rpc GetContext(ContextRequest) returns (Context) {} + rpc GetTypeFeedback(FeedbackRequest) returns (TypeFeedback) {} + rpc GetValues(ValueRequest) returns (Values) {} + rpc GetFunction(FunctionRequest) returns (Function) {} +} \ No newline at end of file diff --git a/server/src/main/resources/org/prlprg/session/R_FunTab.txt b/server/src/main/resources/org/prlprg/session/R_FunTab.txt new file mode 100644 index 000000000..fa3b4d8db --- /dev/null +++ b/server/src/main/resources/org/prlprg/session/R_FunTab.txt @@ -0,0 +1,754 @@ +if +while +for +repeat +break +next +return +function +<- += +<<- +{ +( +.subset +.subset2 +[ +[[ +$ +@ +[<- +[[<- +$<- +switch +browser +.primTrace +.primUntrace +.Internal +.Primitive +call +quote +substitute +missing +nargs +on.exit +forceAndCall +declare +stop +warning +gettext +ngettext +bindtextdomain +.addCondHands +.addGlobHands +.resetCondHands +.signalCondition +.dfltStop +.dfltWarn +.addRestart +.getRestart +.invokeRestart +.addTryHandlers +geterrmessage +seterrmessage +printDeferredWarnings +interruptsSuspended +as.function.default +debug +undebug +isdebugged +debugonce +Recall +delayedAssign +makeLazy +identical +C_tryCatchHelper +getNamespaceValue ++ +- +* +/ +^ +%% +%/% +%*% +== +!= +< +<= +>= +> +& +| +! +&& +|| +: +~ +:: +::: +all +any +...elt +...length +...names +length +length<- +c +oldClass +oldClass<- +class +.cache_class +.class2 +class<- +unclass +names +names<- +dimnames +dimnames<- +dim +dim<- +attributes +attributes<- +attr +attr<- +@<- +levels<- +vector +complex +matrix +array +diag +backsolve +max.col +row +col +unlist +cbind +rbind +drop +all.names +comment +comment<- +get +get0 +mget +exists +assign +list2env +remove +duplicated +unique +anyDuplicated +anyNA +which +which.min +pmin +pmax +which.max +match +pmatch +charmatch +match.call +crossprod +tcrossprod +lengths +sequence +vhash +attach +detach +search +setFileTime +round +signif +log +log10 +log2 +abs +floor +ceiling +sqrt +sign +trunc +exp +expm1 +log1p +cos +sin +tan +acos +asin +atan +cosh +sinh +tanh +acosh +asinh +atanh +lgamma +gamma +digamma +trigamma +cospi +sinpi +tanpi +atan2 +lbeta +beta +lchoose +choose +dchisq +pchisq +qchisq +dexp +pexp +qexp +dgeom +pgeom +qgeom +dpois +ppois +qpois +dt +pt +qt +dsignrank +psignrank +qsignrank +besselJ +besselY +psigamma +Re +Im +Mod +Arg +Conj +dbeta +pbeta +qbeta +dbinom +pbinom +qbinom +dcauchy +pcauchy +qcauchy +df +pf +qf +dgamma +pgamma +qgamma +dlnorm +plnorm +qlnorm +dlogis +plogis +qlogis +dnbinom +pnbinom +qnbinom +dnorm +pnorm +qnorm +dunif +punif +qunif +dweibull +pweibull +qweibull +dnchisq +pnchisq +qnchisq +dnt +pnt +qnt +dwilcox +pwilcox +qwilcox +besselI +besselK +dnbinom_mu +pnbinom_mu +qnbinom_mu +dhyper +phyper +qhyper +dnbeta +pnbeta +qnbeta +dnf +pnf +qnf +dtukey +ptukey +qtukey +rchisq +rexp +rgeom +rpois +rt +rsignrank +rbeta +rbinom +rcauchy +rf +rgamma +rlnorm +rlogis +rnbinom +rnbinom_mu +rnchisq +rnorm +runif +rweibull +rwilcox +rhyper +sample +sample2 +RNGkind +set.seed +sum +min +max +prod +mean +range +cumsum +cumprod +cummax +cummin +as.character +as.integer +as.double +as.numeric +as.complex +as.logical +as.raw +as.call +as.environment +storage.mode<- +asCharacterFactor +as.vector +paste +paste0 +file.path +format +format.info +cat +do.call +str2lang +str2expression +nchar +nzchar +substr +startsWith +endsWith +substr<- +strsplit +abbreviate +make.names +pcre_config +grep +grepl +grepRaw +sub +gsub +regexpr +gregexpr +regexec +agrep +agrepl +adist +aregexec +tolower +toupper +chartr +sprintf +make.unique +charToRaw +rawToChar +rawShift +intToBits +numToBits +numToInts +rawToBits +packBits +utf8ToInt +intToUtf8 +validUTF8 +validEnc +encodeString +iconv +strtrim +strtoi +strrep +is.null +is.logical +is.integer +is.double +is.complex +is.character +is.symbol +is.name +is.environment +is.list +is.pairlist +is.expression +is.raw +is.object +isS4 +is.numeric +is.matrix +is.array +is.atomic +is.recursive +is.call +is.language +is.function +is.single +is.na +is.nan +is.finite +is.infinite +is.vector +proc.time +gc.time +withVisible +expression +interactive +invisible +rep +rep.int +rep_len +seq.int +seq_len +seq_along +list +xtfrm +enc2native +enc2utf8 +emptyenv +baseenv +globalenv +environment<- +pos.to.env +.C +.Fortran +.External +.External2 +.Call +.External.graphics +.Call.graphics +eapply +lapply +vapply +mapply +Version +machine +commandArgs +internalsID +system +parse +save +saveToConn +load +loadFromConn2 +loadInfoFromConn2 +serializeToConn +unserializeFromConn +serializeInfoFromConn +deparse +dput +dump +quit +readline +print.default +prmatrix +gc +gcinfo +gctorture +gctorture2 +memory.profile +mem.maxVSize +mem.maxNSize +split +is.loaded +recordGraphics +dyn.load +dyn.unload +ls +typeof +eval +Exec +Tailcall +returnValue +sys.parent +sys.call +sys.frame +sys.nframe +sys.calls +sys.frames +sys.on.exit +sys.parents +sys.function +traceback +browserText +browserCondition +browserSetDebug +parent.frame +sort +is.unsorted +sorted_fpass +psort +qsort +radixsort +order +rank +scan +t.default +aperm +builtins +args +formals +body +bodyCode +environment +environmentName +env2list +reg.finalizer +options +getOption +sink +sink.number +rapply +islistfactor +colSums +colMeans +rowSums +rowMeans +tracemem +retracemem +untracemem +inspect +address +named +refcnt +merge +capabilities +capabilitiesX11 +new.env +parent.env +parent.env<- +topenv +l10n_info +Cstack_info +mmap_file +munmap_file +wrap_meta +tryWrap +altrep_class +file.show +file.create +file.remove +file.rename +file.append +file.symlink +file.link +file.copy +list.files +list.dirs +file.exists +file.choose +file.info +file.access +dir.exists +dir.create +tempfile +tempdir +R.home +date +Sys.getenv +Sys.setenv +Sys.unsetenv +getwd +setwd +basename +dirname +Sys.chmod +Sys.umask +Sys.readlink +Sys.info +Sys.sleep +Sys.getlocale +Sys.setlocale +Sys.localeconv +path.expand +Sys.getpid +normalizePath +Sys.glob +unlink +polyroot +inherits +UseMethod +NextMethod +standardGeneric +Sys.time +as.POSIXct +as.POSIXlt +format.POSIXlt +strptime +Date2POSIXlt +POSIXlt2Date +balancePOSIXlt +unCfillPOSIXlt +compareNumericVersion +mkCode +bcClose +is.builtin.internal +disassemble +bcVersion +load.from.file +save.to.file +growconst +putconst +getconst +enableJIT +compilePKGS +setNumMathThreads +setMaxNumMathThreads +stdin +stdout +stderr +isatty +readLines +writeLines +readBin +writeBin +readChar +writeChar +open +isOpen +isIncomplete +isSeekable +close +flush +file +url +pipe +fifo +gzfile +bzfile +xzfile +unz +seek +truncate +pushBack +clearPushBack +pushBackLength +rawConnection +rawConnectionValue +textConnection +textConnectionValue +socketConnection +socketAccept +sockSelect +serverSocket +socketTimeout +getConnection +getAllConnections +summary.connection +gzcon +memCompress +memDecompress +readDCF +lockEnvironment +environmentIsLocked +lockBinding +unlockBinding +bindingIsLocked +makeActiveBinding +bindingIsActive +activeBindingFunction +mkUnbound +isNamespaceEnv +registerNamespace +unregisterNamespace +getRegisteredNamespace +isRegisteredNamespace +getNamespaceRegistry +importIntoEnv +env.profile +Encoding +setEncoding +setTimeLimit +setSessionTimeLimit +icuSetCollate +icuGetCollate +readRenviron +shortRowNames +copyDFattr +getRegisteredRoutines +getLoadedDLLs +getSymbolInfo +.isMethodsDispatchOn +lazyLoadDBfetch +lazyLoadDBflush +getVarsFromFrame +lazyLoadDBinsertValue +bincode +tabulate +findInterval +pretty +formatC +crc64 +bitwiseAnd +bitwiseNot +bitwiseOr +bitwiseXor +bitwiseShiftL +bitwiseShiftR +serialize +serializeb +unserialize +rowsum_matrix +rowsum_df +setS4Object +traceOnOff +debugOnOff +La_qr_cmplx +La_rs +La_rs_cmplx +La_rg +La_rg_cmplx +La_rs +La_rs_cmplx +La_dlange +La_dgecon +La_dtrcon +La_dtrcon3 +La_zlange +La_zgecon +La_ztrcon +La_ztrcon3 +La_solve_cmplx +La_solve +La_qr +La_chol +La_chol2inv +qr_coef_real +qr_qy_real +det_ge_real +qr_coef_cmplx +qr_qy_cmplx +La_svd +La_svd_cmplx +La_version +La_library +bcprofcounts +bcprofstart +bcprofstop +eSoftVersion +curlVersion +curlGetHeaders +curlDownload +compilerVersion diff --git a/server/src/test/java/org/prlprg/AbstractGNURBasedTest.java b/server/src/test/java/org/prlprg/AbstractGNURBasedTest.java new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/server/src/test/java/org/prlprg/AbstractGNURBasedTest.java @@ -0,0 +1 @@ + diff --git a/server/src/test/java/org/prlprg/TestConfig.java b/server/src/test/java/org/prlprg/TestConfig.java index 8c14eb637..575c99472 100644 --- a/server/src/test/java/org/prlprg/TestConfig.java +++ b/server/src/test/java/org/prlprg/TestConfig.java @@ -26,7 +26,7 @@ public class TestConfig extends Config { * *

This is unset by default. */ - public static final boolean FAST_TESTS = get("FAST_TESTS", false); + public static final boolean FAST_TESTS = get("FAST_TESTS", true); /** * Whether to enable additional logging. diff --git a/server/src/test/java/org/prlprg/bc/BCSnapshotTestExtension.java b/server/src/test/java/org/prlprg/bc/BCSnapshotTestExtension.java index e99ea370d..a499b41cf 100644 --- a/server/src/test/java/org/prlprg/bc/BCSnapshotTestExtension.java +++ b/server/src/test/java/org/prlprg/bc/BCSnapshotTestExtension.java @@ -4,8 +4,8 @@ import static org.junit.jupiter.api.Assertions.fail; import java.lang.reflect.Method; -import org.prlprg.RSession; import org.prlprg.rsession.TestRSession; +import org.prlprg.session.RSession; import org.prlprg.sexp.*; import org.prlprg.util.Files; import org.prlprg.util.ThrowingSupplier; diff --git a/server/src/test/java/org/prlprg/bc/ContextTest.java b/server/src/test/java/org/prlprg/bc/ContextTest.java index e29adf4d4..73419301c 100644 --- a/server/src/test/java/org/prlprg/bc/ContextTest.java +++ b/server/src/test/java/org/prlprg/bc/ContextTest.java @@ -144,6 +144,7 @@ > f(42) public void testFrameTypes() { var fun = (CloSXP) R.eval("utils::unzip"); var ctx = Context.functionContext(fun); + var identical = ctx.resolve("identical").orElseThrow(); assertTrue(identical.first() instanceof NamespaceEnvSXP ns && ns.name().equals("base")); } diff --git a/server/src/test/java/org/prlprg/bc2c/BC2CCompilerTest.java b/server/src/test/java/org/prlprg/bc2c/BC2CCompilerTest.java index d263ee139..e4eed3269 100644 --- a/server/src/test/java/org/prlprg/bc2c/BC2CCompilerTest.java +++ b/server/src/test/java/org/prlprg/bc2c/BC2CCompilerTest.java @@ -274,6 +274,7 @@ public void testSubassignN(BC2CSnapshot snapshot) { @Test public void testSubassign2N(BC2CSnapshot snapshot) { snapshot.verify("a <- array(1:8, dim=c(2,2,2)); a[[1,2,1]] <- 42L; a", fastSubassign()); + snapshot.verify( "a <- structure(array(1:8, dim=c(2,2,2)), class='a'); a[[1,2,1]] <- 42; a", slowSubassign()); @@ -427,14 +428,14 @@ public void testNestedFor(BC2CSnapshot snapshot) { // this for loop will not use ISQ as it will be constant folded snapshot.verify( """ - s <- 0L - for (i in 1:10) { - for (j in 1:10) { - s <- s + j + i - } - } - s - """, + s <- 0L + for (i in 1:10) { + for (j in 1:10) { + s <- s + j + i + } + } + s + """, returns(1100)); } @@ -442,10 +443,10 @@ public void testNestedFor(BC2CSnapshot snapshot) { public void testColon(BC2CSnapshot snapshot) { snapshot.verify( """ - x <- 1 - y <- 10 - x:y - """, + x <- 1 + y <- 10 + x:y + """, x -> assertEquals(x.pc().isq(), 1)); } @@ -524,14 +525,14 @@ public void testIf(BC2CSnapshot snapshot) { """); snapshot.verify( """ - function(x) { - if (x > 0) { - } - 1 - } - - 1 - """); + function(x) { + if (x > 0) { + } + 1 + } + + 1 + """); } @Test diff --git a/server/src/test/java/org/prlprg/bc2c/BC2CSnapshotTestExtension.java b/server/src/test/java/org/prlprg/bc2c/BC2CSnapshotTestExtension.java index 847752b2c..ff54a7b90 100644 --- a/server/src/test/java/org/prlprg/bc2c/BC2CSnapshotTestExtension.java +++ b/server/src/test/java/org/prlprg/bc2c/BC2CSnapshotTestExtension.java @@ -8,11 +8,11 @@ import java.util.Objects; import java.util.function.Consumer; import java.util.logging.Logger; -import org.prlprg.RSession; import org.prlprg.bc.BCCompiler; import org.prlprg.rds.RDSWriter; import org.prlprg.rsession.TestRSession; import org.prlprg.service.RshCompiler; +import org.prlprg.session.RSession; import org.prlprg.sexp.CloSXP; import org.prlprg.sexp.SEXP; import org.prlprg.sexp.SEXPs; @@ -177,7 +177,8 @@ TestArtifact compileAndCall(String code) { .orElseThrow(() -> new RuntimeException("Compilation did not produce byte code")); try { - var bc2c = new BC2CCompiler(bc); + var name = "f_" + (bc.hashCode() < 0 ? "n" + -bc.hashCode() : bc.hashCode()); + var bc2c = new BC2CCompiler(bc, name); var module = bc2c.finish(); RDSWriter.writeFile(cpFile, module.constantPool()); diff --git a/server/src/test/java/org/prlprg/rds/RDSWriterTest.java b/server/src/test/java/org/prlprg/rds/RDSWriterTest.java index 6c4f808eb..39023e3a0 100644 --- a/server/src/test/java/org/prlprg/rds/RDSWriterTest.java +++ b/server/src/test/java/org/prlprg/rds/RDSWriterTest.java @@ -49,6 +49,20 @@ public void testInts() throws Exception { } } + @Test + public void testInts_withR() { + var ints = integer(5, 4, 3, 2, 1); + var output = + R.eval("typeof(input) == 'integer' && identical(input, c(5L, 4L, 3L, 2L, 1L))", ints); + + if (output instanceof LglSXP readLgls) { + assertEquals(1, readLgls.size()); + assertEquals(Logical.TRUE, readLgls.get(0)); + } else { + fail("Expected LglSXP"); + } + } + @Test public void testComplex() throws Exception { var complexes = complex(new Complex(0, 0), new Complex(1, 2), new Complex(-2, -1)); @@ -67,6 +81,20 @@ public void testComplex() throws Exception { } } + @Test + public void testComplex_withR() { + var complexes = complex(new Complex(0, 0), new Complex(1, 2), new Complex(-2, -1)); + var output = + R.eval("typeof(input) == 'complex' && identical(input, c(0+0i, 1+2i, -2-1i))", complexes); + + if (output instanceof LglSXP read_lgls) { + assertEquals(1, read_lgls.size()); + assertEquals(Logical.TRUE, read_lgls.get(0)); + } else { + fail("Expected LglSXP"); + } + } + @Test public void testLang() throws Exception { var lang = @@ -275,6 +303,46 @@ public void testEnv() throws Exception { } } + @Test + public void testEnv_withR() { + var env = new UserEnvSXP(); + env.set("a", integer(1)); + env.set("b", logical(Logical.TRUE)); + env.set("c", real(3.14, 2.71)); + env.set("d", string("foo", "bar")); + + var output = R.eval("typeof(input) == 'environment'", env); + + if (output instanceof LglSXP read_lgls) { + assertEquals(1, read_lgls.size()); + assertEquals(Logical.TRUE, read_lgls.get(0)); + } else { + fail("Expected LglSXP"); + } + } + + @Test + public void testClosureEval() { + // function(x, y=1) length(x) + x + y + // test by loading the closure into R and evaluating + var clo = + closure( + list(List.of(new TaggedElem("x", MISSING_ARG), new TaggedElem("y", real(3)))), + lang( + symbol("+"), + list( + lang( + symbol("+"), + list(lang(symbol("length"), list(symbol("x"))), symbol("x"))), + symbol("y"))), + new BaseEnvSXP(new HashMap<>())) + .withAttributes(new Attributes.Builder().put("a", integer(1)).build()); + + var output = R.eval("input(x=c(1, 2))", clo); + + assertEquals(output, real(6, 7)); + } + @Test public void testClosureWithBC() throws Exception { // Same closure as `testClosure`, just compiled to bytecode @@ -299,4 +367,25 @@ public void testClosureWithBC() throws Exception { assertEquals(sexp, bcode(bc)); } + + @Test + public void testClosureWithBCEval() { + // Same closure as `testClosure`, just compiled to bytecode + // Test by loading into R and evaluating + var clo = + closure( + list(List.of(new TaggedElem("x", MISSING_ARG), new TaggedElem("y", real(3)))), + lang( + symbol("+"), + list( + lang(symbol("+"), list(lang(symbol("length"), list(symbol("x"))), symbol("x"))), + symbol("y"))), + new BaseEnvSXP(new HashMap<>())); + var bc = new BCCompiler(clo, R.getSession()).compile().orElseThrow(); + var compiled_clo = closure(clo.parameters(), bcode(bc), clo.env()); + + var output = R.eval("input(x=c(1, 2))", compiled_clo); + + assertEquals(output, real(6, 7)); + } } diff --git a/server/src/test/java/org/prlprg/rsession/DESCRIPTIONTest.java b/server/src/test/java/org/prlprg/rsession/DESCRIPTIONTest.java new file mode 100644 index 000000000..4dbe7a214 --- /dev/null +++ b/server/src/test/java/org/prlprg/rsession/DESCRIPTIONTest.java @@ -0,0 +1,81 @@ +package org.prlprg.rsession; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.prlprg.session.DESCRIPTION; + +public class DESCRIPTIONTest { + + @TempDir Path tempDir; + + @Test + public void testDescriptionParsing() throws IOException { + // Create a temporary DESCRIPTION file + Path descriptionFile = tempDir.resolve("DESCRIPTION"); + Files.writeString( + descriptionFile, + "Package: testpkg\nVersion: 1.2.3\nSuggests: pkgA (>= 1.0.0), pkgB\nImports: pkgC, pkgD (>= 2.0.0)\n"); + + // Parse the DESCRIPTION file + DESCRIPTION description = new DESCRIPTION(descriptionFile); + + // Assert the parsed values + Assertions.assertEquals("1.2.3", description.getVersion()); + Assertions.assertEquals(Map.of("pkgA", ">= 1.0.0", "pkgB", ""), description.getSuggests()); + Assertions.assertEquals(Map.of("pkgC", "", "pkgD", ">= 2.0.0"), description.getImports()); + } + + @Test + public void testEmptySuggestsAndImports() throws IOException { + // Create a temporary DESCRIPTION file + Path descriptionFile = tempDir.resolve("DESCRIPTION"); + Files.writeString(descriptionFile, "Package: testpkg\nVersion: 1.2.3\n"); + + // Parse the DESCRIPTION file + DESCRIPTION description = new DESCRIPTION(descriptionFile); + + // Assert the parsed values + Assertions.assertEquals("1.2.3", description.getVersion()); + Assertions.assertTrue(description.getSuggests().isEmpty()); + Assertions.assertTrue(description.getImports().isEmpty()); + } + + @Test + public void testNoVersion() throws IOException { + // Create a temporary DESCRIPTION file + Path descriptionFile = tempDir.resolve("DESCRIPTION"); + Files.writeString( + descriptionFile, + "Package: testpkg\nSuggests: pkgA (>= 1.0.0), pkgB\nImports: pkgC, pkgD (>= 2.0.0)\n"); + + // Parse the DESCRIPTION file + DESCRIPTION description = new DESCRIPTION(descriptionFile); + + // Assert the parsed values + Assertions.assertNull(description.getVersion()); + Assertions.assertEquals(Map.of("pkgA", ">= 1.0.0", "pkgB", ""), description.getSuggests()); + Assertions.assertEquals(Map.of("pkgC", "", "pkgD", ">= 2.0.0"), description.getImports()); + } + + @Test + public void testMalformedDescription() throws IOException { + // Create a temporary DESCRIPTION file + Path descriptionFile = tempDir.resolve("DESCRIPTION"); + Files.writeString( + descriptionFile, + "Package: testpkg\nVersion: 1.2.3\nSuggests pkgA (>= 1.0.0), pkgB\nImports: pkgC, pkgD (>= 2.0.0)\n"); + + // Parse the DESCRIPTION file + DESCRIPTION description = new DESCRIPTION(descriptionFile); + + // Assert the parsed values + Assertions.assertEquals("1.2.3", description.getVersion()); + Assertions.assertTrue(description.getSuggests().isEmpty()); + Assertions.assertEquals(Map.of("pkgC", "", "pkgD", ">= 2.0.0"), description.getImports()); + } +} diff --git a/server/src/test/java/org/prlprg/rsession/GNURSessionTest.java b/server/src/test/java/org/prlprg/rsession/GNURSessionTest.java new file mode 100644 index 000000000..f89ea4ffd --- /dev/null +++ b/server/src/test/java/org/prlprg/rsession/GNURSessionTest.java @@ -0,0 +1,85 @@ +package org.prlprg.rsession; + +import java.io.IOException; +import java.nio.file.Path; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.prlprg.RVersion; +import org.prlprg.session.GNURSession; + +public class GNURSessionTest { + private static final Path RDir = Path.of("../external/R/"); + // TODO: rather create a temporary library directory for the tests? + private static final Path libDir = Path.of("../external/R/library/"); + @TempDir Path tempDir; + + static { + System.out.println(new java.io.File("").getAbsolutePath()); + } + + @Test + public void testReadPackageDatabase() throws IOException { + var session = new GNURSession(RVersion.LATEST_AWARE, RDir, libDir); + + session.loadPackage("yaml", "2.3.10"); + + var ns = session.getNamespace("yaml", "2.3.10"); + + Assertions.assertFalse(ns.bindings().isEmpty()); + } + + @Test + public void testLoadBase() throws IOException { + var session = new GNURSession(RVersion.LATEST_AWARE, RDir, null); + session.loadBase(); + + Assertions.assertFalse(session.baseNamespace().isEmpty()); + } + + @Test + public void testVersionMismatch() { + var session = new GNURSession(RVersion.LATEST_AWARE, RDir, libDir); + + Assertions.assertThrows( + RuntimeException.class, + () -> { + session.loadPackage("yaml", "1.0.0"); + }); + } + + @Test + public void testLoadNonInstalledPackage() throws IOException, InterruptedException { + var session = new GNURSession(RVersion.LATEST_AWARE, RDir, libDir); + + // Assuming "nonexistentpkg" is not installed + Assertions.assertThrows( + RuntimeException.class, + () -> { + session.loadPackage("nonexistentpkg", "1.0.0"); + }); + } + + @Test + public void testRetrieveNamespaceAfterLoadingPackage() throws IOException { + var session = new GNURSession(RVersion.LATEST_AWARE, RDir, libDir); + + session.loadPackage("yaml", "2.3.10"); + + var ns = session.getNamespace("yaml", "2.3.10"); + + Assertions.assertNotNull(ns); + } + + @Test + public void testMissingDescriptionFile() { + var session = new GNURSession(RVersion.LATEST_AWARE, RDir, libDir); + + // Assuming "pkgwithnomissingdesc" has no DESCRIPTION file + Assertions.assertThrows( + RuntimeException.class, + () -> { + session.loadPackage("pkgwithnomissingdesc", "1.0.0"); + }); + } +} diff --git a/server/src/test/java/org/prlprg/rsession/TestRSession.java b/server/src/test/java/org/prlprg/rsession/TestRSession.java index 8d9a3c573..97a08a982 100644 --- a/server/src/test/java/org/prlprg/rsession/TestRSession.java +++ b/server/src/test/java/org/prlprg/rsession/TestRSession.java @@ -8,8 +8,9 @@ import java.util.Objects; import java.util.Set; import javax.annotation.Nullable; -import org.prlprg.RSession; import org.prlprg.rds.RDSReader; +import org.prlprg.session.RSession; +import org.prlprg.sexp.*; import org.prlprg.sexp.BaseEnvSXP; import org.prlprg.sexp.EnvSXP; import org.prlprg.sexp.GlobalEnvSXP; @@ -53,7 +54,7 @@ private void bootstrapBase() { var bindings = new HashMap(names.size()); names.forEach(x -> bindings.put(x, SEXPs.UNBOUND_VALUE)); - // 3. Create a temporary baseenv and temporart base namespace + // 3. Create a temporary baseenv and temporary base namespace baseEnv = new BaseEnvSXP(bindings); // the 4.3.2 should correspond to the R version that written the RDS files used in this class baseNamespace = new NamespaceEnvSXP("base", "4.3.2", baseEnv, bindings); diff --git a/server/src/test/java/org/prlprg/server/Main.java b/server/src/test/java/org/prlprg/server/Main.java deleted file mode 100644 index ae04ed5c9..000000000 --- a/server/src/test/java/org/prlprg/server/Main.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.prlprg.server; - -import com.google.protobuf.ByteString; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.logging.ConsoleHandler; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.prlprg.RSession; -import org.prlprg.rds.RDSReader; -import org.prlprg.rds.RDSWriter; -import org.prlprg.rsession.TestRSession; -import org.prlprg.server.protocol.CompileRequest; -import org.prlprg.server.protocol.CompileResponse; -import org.prlprg.server.protocol.CompiledFunction; -import org.prlprg.server.protocol.Request; -import org.prlprg.service.JITService; -import org.prlprg.sexp.CloSXP; -import org.prlprg.sexp.SEXP; -import org.zeromq.SocketType; -import org.zeromq.ZContext; -import org.zeromq.ZMQ; - -public class Main { - - static { - var logger = Logger.getLogger("org.prlprg"); - logger.setLevel(Level.ALL); - var consoleHandler = new ConsoleHandler(); - consoleHandler.setLevel(Level.ALL); - logger.addHandler(consoleHandler); - } - - private static final Logger logger = Logger.getLogger(Main.class.getName()); - private final RSession rsession; - private final JITService jit; - - public Main() { - rsession = new TestRSession(); - jit = new JITService(rsession); - } - - void run() { - try (ZContext context = new ZContext()) { - ZMQ.Socket socket = context.createSocket(SocketType.REP); - socket.bind("tcp://*:5555"); - logger.info("Listening on " + socket.getLastEndpoint()); - - while (!Thread.currentThread().isInterrupted()) { - Request request = Request.parseFrom(socket.recv(0)); - logger.info("Got a request: " + request); - - switch (request.getPayloadCase()) { - case COMPILE -> { - var response = compile(request.getCompile()); - socket.send(response.toByteArray()); - } - default -> { - logger.severe("Unknown request type: " + request); - } - } - } - } catch (Exception e) { - e.printStackTrace(System.err); - System.exit(1); - } - } - - private CompileResponse compile(CompileRequest compile) { - try { - var name = compile.getName(); - var closure = deserialize(new ByteArrayInputStream(compile.getClosure().toByteArray())); - var nativeClosure = - jit.execute(name, closure, compile.getBcOptimization(), compile.getCcOptimization()); - - var result = - CompiledFunction.newBuilder() - .setName(nativeClosure.name()) - .setNativeCode(ByteString.copyFrom(nativeClosure.code())) - .setConstants(ByteString.copyFrom(serialize(nativeClosure.constantPool()))); - - var response = CompileResponse.newBuilder().setResult(result); - - return response.build(); - } catch (Exception e) { - logger.severe("Unable to process request: " + e.getMessage()); - var response = CompileResponse.newBuilder().setFailure(e.getMessage()); - return response.build(); - } - } - - private CloSXP deserialize(InputStream input) throws IOException { - return (CloSXP) RDSReader.readStream(rsession, input); - } - - private byte[] serialize(SEXP data) throws IOException { - var output = new ByteArrayOutputStream(); - RDSWriter.writeStream(output, data); - return output.toByteArray(); - } - - public static void main(String[] args) { - new Main().run(); - } -} diff --git a/server/src/test/java/org/prlprg/server/ServerTests.java b/server/src/test/java/org/prlprg/server/ServerTests.java new file mode 100644 index 000000000..a608d0f7b --- /dev/null +++ b/server/src/test/java/org/prlprg/server/ServerTests.java @@ -0,0 +1,114 @@ +package org.prlprg.server; + +import static org.junit.jupiter.api.Assertions.*; + +import com.asarkar.grpc.test.GrpcCleanupExtension; +import com.asarkar.grpc.test.Resources; +import io.grpc.ManagedChannel; +import io.grpc.Server; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import java.io.IOException; +import java.time.Duration; +import javax.annotation.Nullable; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.prlprg.rds.RDSWriter; +import org.prlprg.sexp.SEXPs; +import org.prlprg.sexp.TaggedElem; + +@ExtendWith(GrpcCleanupExtension.class) +public class ServerTests { + + private @Nullable Server server; + private @Nullable ManagedChannel channel; + private @Nullable CompileServiceGrpc.CompileServiceBlockingStub blockingStub; + + @BeforeEach + public void setupServer() throws IOException { + String serverName = InProcessServerBuilder.generateName(); + server = + InProcessServerBuilder.forName(serverName) + .directExecutor() + .addService(new CompileService()) + .build() + .start(); + + channel = InProcessChannelBuilder.forName(serverName).directExecutor().build(); + blockingStub = CompileServiceGrpc.newBlockingStub(channel); + } + + @AfterEach + public void tearDown() { + assert server != null; + server.shutdown(); + } + + @Test + void testCompile(Resources resources) throws IOException { + assert server != null; + resources.register(server, Duration.ofSeconds(3)); + assert channel != null; + resources.register(channel, Duration.ofSeconds(3)); + + // Init compile server + var initRequest = + Messages.InitRequest.newBuilder() + .setRVersion(Messages.Version.newBuilder().setMajor(4).setMinor(3).setPatch(2).build()) + .setRshVersion(Messages.Version.newBuilder().build()) + .setPlatform("amd64") + .build(); + assert blockingStub != null; + assertDoesNotThrow( + () -> { + Messages.InitResponse initResponse = blockingStub.init(initRequest); + }); + + // Compile identify function + var function = + SEXPs.closure( + SEXPs.list(new TaggedElem("x", SEXPs.symbol("x"))), SEXPs.symbol("x"), SEXPs.EMPTY_ENV); + var f = + Messages.Function.newBuilder() + .setName("testFunc") + .setBody(RDSWriter.writeByteString(function)) + .build(); + var compileRequest = + Messages.CompileRequest.newBuilder() + .setFunction(f) + .setTier(Messages.Tier.BASELINE) + .setBcOpt(0) + .setContext(Messages.Context.newBuilder().build()) + .build(); + + final Messages.CompileResponse[] response = new Messages.CompileResponse[1]; + assertDoesNotThrow( + () -> { + assert blockingStub != null; + response[0] = blockingStub.compile(compileRequest); + }); + assertNotNull(response[0].getCode()); + } + + @Test + void testInit(Resources resources) throws Exception { + assert server != null; + resources.register(server, Duration.ofSeconds(3)); + assert channel != null; + resources.register(channel, Duration.ofSeconds(3)); + + var initRequest = + Messages.InitRequest.newBuilder() + .setRVersion(Messages.Version.newBuilder().setMajor(4).setMinor(3).setPatch(2).build()) + .setRshVersion(Messages.Version.newBuilder().build()) + .setPlatform("amd64") + .build(); + assertDoesNotThrow( + () -> { + assert blockingStub != null; + Messages.InitResponse response = blockingStub.init(initRequest); + }); + } +} diff --git a/server/src/test/java/org/prlprg/util/GNUR.java b/server/src/test/java/org/prlprg/util/GNUR.java new file mode 100644 index 000000000..b9d68283f --- /dev/null +++ b/server/src/test/java/org/prlprg/util/GNUR.java @@ -0,0 +1,16 @@ +package org.prlprg.util; + +import org.prlprg.sexp.SEXP; + +public interface GNUR extends AutoCloseable { + boolean isAlive(); + + SEXP eval(String source); + + Pair capturingEval(String source); + + SEXP eval(String source, SEXP input); + + @Override + void close() throws Exception; +} diff --git a/server/src/test/java/org/prlprg/util/gnur/GNUR.java b/server/src/test/java/org/prlprg/util/gnur/GNUR.java index e7a0fb2ee..8cdf97ef2 100644 --- a/server/src/test/java/org/prlprg/util/gnur/GNUR.java +++ b/server/src/test/java/org/prlprg/util/gnur/GNUR.java @@ -1,6 +1,6 @@ package org.prlprg.util.gnur; -import org.prlprg.RSession; +import org.prlprg.session.RSession; import org.prlprg.sexp.SEXP; import org.prlprg.util.Pair; @@ -11,6 +11,8 @@ public interface GNUR extends AutoCloseable { Pair capturingEval(String source); + SEXP eval(String source, SEXP input); + @Override void close() throws Exception; diff --git a/server/src/test/java/org/prlprg/util/gnur/GNURFactory.java b/server/src/test/java/org/prlprg/util/gnur/GNURFactory.java index eec6ed9f5..0421d1c2f 100644 --- a/server/src/test/java/org/prlprg/util/gnur/GNURFactory.java +++ b/server/src/test/java/org/prlprg/util/gnur/GNURFactory.java @@ -11,8 +11,9 @@ import java.util.logging.Logger; import javax.annotation.Nullable; import javax.annotation.concurrent.NotThreadSafe; -import org.prlprg.RSession; import org.prlprg.rds.RDSReader; +import org.prlprg.rds.RDSWriter; +import org.prlprg.session.RSession; import org.prlprg.sexp.SEXP; import org.prlprg.util.Pair; @@ -101,6 +102,13 @@ public SEXP eval(String source) { return R.eval(source); } + @Override + public SEXP eval(String source, SEXP input) { + check(); + assert R != null; + return R.eval(source, input); + } + @Override public Pair capturingEval(String source) { check(); @@ -187,6 +195,26 @@ public SEXP eval(String source) { return capturingEval(source).first(); } + /** + * Evaluate R source with input SEXP. The SEXP is passed from Java to the R world using RDS. + * + * @param source + * @param input + * @return + */ + @Override + public SEXP eval(String source, SEXP input) { + try { + var inputFile = File.createTempFile("RCS-input", ".rds"); + RDSWriter.writeFile(inputFile, input); + String full_source = "input <- readRDS('" + inputFile.getAbsolutePath() + "')\n" + source; + + return eval(full_source); + } catch (Exception e) { + throw new RuntimeException("Unable to eval R source", e); + } + } + private String waitForCommand(String requestId) { var output = new StringBuilder(); try { diff --git a/server/src/test/java/org/prlprg/util/snapshot/RDSFileSnapshotStoreFactory.java b/server/src/test/java/org/prlprg/util/snapshot/RDSFileSnapshotStoreFactory.java index 020ab8c0f..ba47e14f9 100644 --- a/server/src/test/java/org/prlprg/util/snapshot/RDSFileSnapshotStoreFactory.java +++ b/server/src/test/java/org/prlprg/util/snapshot/RDSFileSnapshotStoreFactory.java @@ -2,7 +2,7 @@ import java.nio.file.Path; import java.util.function.Function; -import org.prlprg.RSession; +import org.prlprg.session.RSession; import org.prlprg.sexp.SEXP; public class RDSFileSnapshotStoreFactory extends FileSnapshotStoreFactory { diff --git a/server/src/test/java/org/prlprg/util/snapshot/RDSSnapshotStore.java b/server/src/test/java/org/prlprg/util/snapshot/RDSSnapshotStore.java index 6247e532a..8637f7493 100644 --- a/server/src/test/java/org/prlprg/util/snapshot/RDSSnapshotStore.java +++ b/server/src/test/java/org/prlprg/util/snapshot/RDSSnapshotStore.java @@ -6,9 +6,9 @@ import java.util.Optional; import java.util.zip.GZIPOutputStream; import javax.annotation.Nullable; -import org.prlprg.RSession; import org.prlprg.rds.RDSReader; import org.prlprg.rds.RDSWriter; +import org.prlprg.session.RSession; import org.prlprg.sexp.EnvSXP; import org.prlprg.sexp.SEXP; import org.prlprg.sexp.UserEnvSXP; diff --git a/tools/Makefile b/tools/Makefile new file mode 100644 index 000000000..4b42fcc92 --- /dev/null +++ b/tools/Makefile @@ -0,0 +1,16 @@ +# Saner makefile +MAKEFLAGS += --no-builtin-rules + +LLVM_LIB := $(shell llvm-config-17 --libfiles) +BEAR := $(shell command -v bear 2> /dev/null) + +BASE_DIR = $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/..) +RSH_HOME = $(BASE_DIR)/client/rsh +R_HOME ?= $(BASE_DIR)/external/R +R := $(R_HOME)/bin/R --slave --no-restore +LLVM_R := LD_PRELOAD=$(LLVM_LIB) $(R) + + +.PHONY: package +package: + $(LLVM_R) Rscript compile-package.R tidyr diff --git a/tools/compile-package.R b/tools/compile-package.R new file mode 100644 index 000000000..d5fe8e4b9 --- /dev/null +++ b/tools/compile-package.R @@ -0,0 +1,67 @@ +#! /usr/bin/env Rscript + +# Compile all the functions in a package +# Report the ones that do not compile + +# For yaml +# LD_PRELOAD=/usr/lib/llvm-17/lib/libLLVM-17.so ../external/R/bin/Rscript compile-package.R yaml + + + +compile_package <- function(package, tier = "bytecode") { + cat( + "Compiling package ", package, " at version ", + as.character(packageVersion(package)), "\n" + ) + + library(package, character.only = TRUE) + + ns <- getNamespace(package) + + nb_comps <- 0 + not_compiled <- character(0) + + # Only compile closures + for (v in ls(ns)) { + f <- ns[[v]] + if (typeof(f) == "closure") { + nb_comps <- nb_comps + 1 + cat("Compiling ", v, "\n") + tryCatch( + { + rsh::rsh_compile(f, list(tier = tier, bc_opt = 3L)) + }, + error = function(e) { + cat("Error compiling ", v, ": ", e$message, "\n") + not_compiled <<- c(not_compiled, v) + } + ) + } else { + cat("Skipping ", v, " (not a closure) but", typeof(f), "\n") + } + } + + cat("Compiled ", nb_comps, " functions out of ", nb_comps + length(not_compiled), "\n") + if (length(not_compiled) > 0) { + cat("The following functions were not compiled: ", paste(not_compiled, collapse = ", "), "\n") + } + + list(sizes = rsh:::rsh_total_size(), nb_comps = nb_comps, nb_fails = length(not_compiled)) # return message sizes +} + + +if (sys.nframe() == 0L) { # Check if we are called from RScript or not + args <- commandArgs(trailingOnly = TRUE) + + + package <- if (length(args) == 0) { + stop("At least one argument must be provided") + } else { + args[[1]] + } + + message_sizes <- compile_package(package) + print(message_sizes) + cat("Cumulated size of requests: ", message_sizes$sizes[[1]], "bytes \n") + cat("Cumulated size of responses: ", message_sizes$sizes[[2]], "bytes \n") +} diff --git a/tools/message-sizes.R b/tools/message-sizes.R new file mode 100644 index 000000000..ab5dda85a --- /dev/null +++ b/tools/message-sizes.R @@ -0,0 +1,29 @@ +#! /usr/bin/env Rscript + +# LD_PRELOAD=/usr/lib/llvm-17/lib/libLLVM-17.so ../external/R/bin/Rscript messages-sizes.R + + +source("compile-package.R") + +packages <- c("yaml", "magrittr", "R6", "glue", "jsonlite", "curl") + +results <- list() + +rsh::init_client() + +for(p in packages) { + results[[p]] <- compile_package(p) +} + +# output a csv file +write.csv( + data.frame( + package = names(results), + request_sizes = sapply(results, function(x) x$sizes[["request"]]), + response_sizes = sapply(results, function(x) x$sizes[["response"]]), + nb_comps = sapply(results, function(x) x$nb_comps), + nb_fails = sapply(results, function(x) x$nb_fails) + ), + file = "message-sizes.csv", + row.names = FALSE +) \ No newline at end of file