37 uint32_t payload_length = key.
length - (((
const uint8_t *)key.
row)-key.
serial.
ptr) + 1;
51 size_t n = std::min((
size_t)(payload_length-1),
m_buffer.
fill());
55 const uint8_t *incoming = (
const uint8_t *)key.
row;
56 const uint8_t *incoming_end = incoming + (payload_length-1);
60 if (*ptr != *incoming)
bool empty() const
Returns true if the buffer is empty.
DynamicBuffer m_compressed_key
uint8_t * ptr
Pointer to the end of the used part of the buffer.
int encoded_length_vi32(uint32_t val)
Length of a variable length encoded 32-bit integer (up to 5 bytes)
uint8_t * add(const void *data, size_t len)
Adds more data WITH boundary checks; if required the buffer is resized and existing data is preserved...
Compatibility Macros for C/C++.
void render_uncompressed()
Functions to serialize/deserialize primitives to/from a memory buffer.
const uint8_t * ptr
The pointer to the serialized data.
DynamicBuffer m_uncompressed_key
void encode_vi32(uint8_t **bufp, uint32_t val)
Encode a integer (up to 32-bit) in variable length encoding.
virtual size_t length_uncompressed()
void clear()
Clears the buffer.
virtual void write(uint8_t *buf)
Provides access to internal components of opaque key.
uint8_t * base
Pointer to the allocated memory buffer.
size_t fill() const
Returns the size of the used portion.
virtual void write_uncompressed(uint8_t *buf)
virtual void add(const Key &key)
void ensure(size_t len)
Ensure space for additional data Will grow the space to 1.5 of the needed space with existing data un...
uint8_t * add_unchecked(const void *data, size_t len)
Adds additional data without boundary checks.
void reserve(size_t len, bool nocopy=false)
Reserve space for additional data Will grow the space to exactly what's needed.