24#ifndef MYSQL_SERIALIZATION_WRITE_ARCHIVE_BINARY_H
25#define MYSQL_SERIALIZATION_WRITE_ARCHIVE_BINARY_H
49 template <
typename Field_type>
53 template <
typename Field_type>
55 static constexpr auto value_size = Field_type::value_size;
58 value_size>(arg.get());
62 template <
typename T, Field_size S>
74 void set_stream(
unsigned char *stream, std::size_t stream_size) {
Interface for archives (file archive, byte vector archive, string archive etc.), available only to in...
Definition: archive.h:50
Binary, write only archive implementation based on vector of bytes.
Definition: write_archive_binary.h:44
Field_id_type peek_type_field_id()
This method decodes field id, without moving stream positions.
Internal_type m_stream
Internal data stream.
Definition: write_archive_binary.h:94
Write_archive_binary & operator<<(Field_type &&arg)
Ingests argument into this archive.
Definition: write_archive_binary_impl.hpp:30
static std::size_t get_size(Field_type &&arg)
Function returns size of serialized argument.
Definition: write_archive_binary.h:54
std::size_t m_write_pos
Write position.
Definition: write_archive_binary.h:96
unsigned char * Internal_type
Definition: write_archive_binary.h:46
std::size_t get_size_written() const
Returns archive size - size of data written to the archive.
Definition: write_archive_binary.cpp:39
static constexpr std::size_t get_max_size()
Function returns maximum size of the Type.
Definition: write_archive_binary.h:63
void set_stream(unsigned char *stream, std::size_t stream_size)
Set up internal stream, this implementation of Archive does not own memory, it just reads it.
Definition: write_archive_binary.h:74
Internal_type & get_raw_data()
Function for the API user to access data in the archive.
Definition: write_archive_binary.cpp:30
std::size_t m_stream_size
Internal data stream size.
Definition: write_archive_binary.h:95
bool can_write(size_t bytes) const
Internal function used to check whether writing is possible.
Definition: write_archive_binary.cpp:34
uint16_t value_type
Definition: vt100.h:184
uint64_t Field_id_type
Type for field_id assigned to each field in the.
Definition: serialization_types.h:42
Definition: sql_resultset.h:36
static constexpr std::size_t get_max_size()
Calculates maximum encoded size of the fixed-length integer and floating point fields.
Definition: archive_binary_field_max_size_calculator.h:48
This class is to provide functionality to encode/decode the primitive types into/out of defined strea...
Definition: primitive_type_codec.h:113