69 return (int64_t)(bits >> 1) ^ -((int64_t)(bits & 0x1));
86 uint64_t
static get_uint64_t(
const uint8_t *&stream)
92 if (((got = *stream++) & 0x80) == 0)
100 if (((next = *stream++) & 0x80) == 0)
101 return got | next << shift;
102 got |= (next & 0x7F) << shift;
117 inline static uint64_t get_int64_t(
const uint8_t *&stream)
131 inline static uint32_t get_uint32_t(
const uint8_t *&stream)
133 return static_cast<uint32_t
>(
un_zigzag(get_uint64_t(stream)));
145 inline static int32_t get_int32_t(
const uint8_t *&stream)
147 return static_cast<int32_t
>(
un_zigzag(get_uint64_t(stream)));
161 inline static slice get_blob(
const uint8_t *&stream)
163 size_t length = get_uint64_t(stream);
164 const uint8_t *at = &stream[0];
167 return slice(const_cast<uint8_t *>(at), length);
182 inline static uint64_t get_64_t(
const uint8_t *&stream)
186 answer =
static_cast<uint64_t
>(*stream++) << 0;
187 answer |=
static_cast<uint64_t
>(*stream++) << 8;
188 answer |=
static_cast<uint64_t
>(*stream++) << 16;
189 answer |=
static_cast<uint64_t
>(*stream++) << 24;
190 answer |=
static_cast<uint64_t
>(*stream++) << 32;
191 answer |=
static_cast<uint64_t
>(*stream++) << 40;
192 answer |=
static_cast<uint64_t
>(*stream++) << 48;
193 answer |=
static_cast<uint64_t
>(*stream++) << 56;
210 inline static uint32_t get_32_t(
const uint8_t *&stream)
214 answer =
static_cast<uint32_t
>(*stream++) << 0;
215 answer |=
static_cast<uint32_t
>(*stream++) << 8;
216 answer |=
static_cast<uint32_t
>(*stream++) << 16;
217 answer |=
static_cast<uint32_t
>(*stream++) << 24;
234 inline static double get_double(
const uint8_t *&stream)
238 uint64_t byte_sequence;
242 answer.byte_sequence = get_64_t(stream);
243 return answer.number;
261 uint8_t encoding = *stream++;
263 type =
static_cast<wire_type>(encoding & 0x07);
265 return encoding >> 3;
Little endian 32-bit number, integer or floating point types.
Definition: protobuf.h:49
C++ slices (string-descriptors)
Definition: slice.h:27
Depricated in protobuf 3.
Definition: protobuf.h:48
static int64_t un_zigzag(uint64_t bits)
Turn unsigned ZigZaged integer into a signed integer.
Definition: protobuf.h:67
Variable byte encoded integer of up-to 64 bits, signed or unsigned.
Definition: protobuf.h:44
Functions to read a protobuf buffer.
Definition: protobuf.h:31
Little endian 64-bit number, integer or floating point types.
Definition: protobuf.h:45
Slices (also known as string-descriptors) for C++.
Depricated in protobuf 3.
Definition: protobuf.h:47
Definition: compress_integer_elias_delta_simd.c:23
static uint8_t get_type_and_field(wire_type &type, const uint8_t *&stream)
Extract the field number and its type from the stream.
Definition: protobuf.h:259
wire_type
The known protobuf types for protobuf 3.
Definition: protobuf.h:42
Blob or string. length VARINT then data.
Definition: protobuf.h:46