78 void write(
const unsigned char* data, std::size_t size) {
100 void put(
unsigned char data) {
114 template <
typename... T>
128 template <std::
size_t N>
145 template <std::
size_t N>
158 std::array<unsigned char, buffer_size>
buffer_{};
Class to implement internal implementation of serialization_buffer class using buffers.
details::mutable_static_binary_view< N > prepare_buffer()
Prepare a buffer.
void set_buffer_written() noexcept
Set the buffer returned by prepare_buffer function to be written.
static constexpr std::size_t buffer_size
Size of the internal buffer.
void write_in_big_endian(T... values)
Write values in big endian.
buffered_serialization_buffer_impl(output_stream &stream)
Constructor.
void write(const unsigned char *data, std::size_t size)
Write data.
std::array< unsigned char, buffer_size > buffer_
Internal buffer.
~buffered_serialization_buffer_impl() noexcept
Destructor.
std::size_t current_position_in_buffer_
Current position in the internal buffer.
output_stream & stream_
Stream to write output to.
void put(unsigned char data)
Write a byte of data.
void flush()
Flush the internal buffer in this instance.
Class of views of mutable buffers with static sizes.
Interface of streams to write data.
Definition of mutable_static_binary_view class.
Namespace of internal implementations.
constexpr std::size_t static_memory_buffer_size
Size of buffers on memory defined using static arrays.
void pack_in_big_endian(mutable_static_binary_view< total_size_of< T, Remaining... > > buffer, T value, Remaining... remaining_values) noexcept
Pack some values in big endian.
constexpr std::size_t total_size_of
Get the total size of types in template arguments.
Definition of output_stream class.
Definition of pack_in_big_endian function.
Definition of static_memory_buffer_size constant.
Definition of total_size_of variable.