Packing serialization data sink backed by a pre-allocated memory block. More...
#include <eagine/serialize/packed_block_sink.hpp>
Public Member Functions | |
packed_block_data_sink () noexcept=default | |
Default constructor. | |
packed_block_data_sink (data_compressor compressor, memory::block dst) noexcept | |
Constructor setting the backing block and data compressor. | |
auto | finalize () -> serialization_errors final |
Does additional finalization, like compression after serialization operation. | |
![]() | |
constexpr | block_data_sink () noexcept=default |
Default constructor. More... | |
block_data_sink (memory::block dst) noexcept | |
Constructor setting the backing block. | |
void | reset (memory::block dst) |
Resets the backing block. More... | |
auto | done () const noexcept -> memory::block |
Returns the part of the backing block already written to. More... | |
auto | free () const noexcept -> memory::block |
Returns the free part of the backing block. More... | |
auto | remaining_size () -> span_size_t final |
Returns the size of the free part of the backing block. More... | |
auto | write (memory::const_block blk) -> serialization_errors final |
Writes a block of data into this sink. | |
auto | replace_with (memory::const_block blk) -> serialization_errors |
Replaces the content of the backing block with the content of the argument. More... | |
auto | begin_work () -> transaction_handle final |
Begins a write transaction on this data sink. More... | |
void | commit (transaction_handle th) final |
Commits writes done as a part of transaction identified by argument. More... | |
void | rollback (transaction_handle th) final |
Rolls-back writes done as a part of transaction identified by argument. More... | |
virtual auto | write (memory::const_block data) -> result=0 |
Writes a block of data into this sink. | |
auto | write (char chr) -> result |
Writes a single string character into this sink. | |
auto | write (string_view str) -> result |
Writes a string view into this sink. | |
![]() | |
auto | write (char chr) -> result |
Writes a single string character into this sink. | |
auto | write (string_view str) -> result |
Writes a string view into this sink. | |
auto | write_some (memory::const_split_block data) -> serialization_result< memory::const_split_block > |
Writes as much as possible from a split data block. | |
Additional Inherited Members | |
![]() | |
using | result = serialization_errors |
Alias for the operation result type. | |
using | transaction_handle = std::uintptr_t |
Alias for type indentifying sink transaction that can be rolled back. | |
![]() | |
constexpr | abstract () noexcept=default |
Default constructible by derived. | |
constexpr | abstract (abstract &&) noexcept=default |
Move constructible by derived. | |
constexpr | abstract (const abstract &) noexcept=default |
Copy constructible by derived. | |
auto | operator= (abstract &&) noexcept -> abstract &=default |
Move assignable by derived. | |
auto | operator= (const abstract &) noexcept -> abstract &=default |
Copy assignable by derived. | |
Packing serialization data sink backed by a pre-allocated memory block.