Abstract base class for serialization data sinks. More...
#include <eagine/serialize/data_sink.hpp>
Public Types | |
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. | |
Public Member Functions | |
virtual auto | remaining_size () -> span_size_t=0 |
Returns the remaining available size for data in this sink. | |
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_some (memory::const_split_block data) -> serialization_result< memory::const_split_block > |
Writes as much as possible from a split data block. | |
virtual auto | begin_work () -> transaction_handle=0 |
Begins a write transaction on this data sink. More... | |
virtual void | commit (transaction_handle)=0 |
Commits writes done as a part of transaction identified by argument. More... | |
virtual void | rollback (transaction_handle)=0 |
Rolls-back writes done as a part of transaction identified by argument. More... | |
virtual auto | finalize () -> result=0 |
Does additional finalization, like compression after serialization operation. | |
Additional Inherited Members | |
![]() | |
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. | |
Abstract base class for serialization data sinks.
|
pure virtual |
Begins a write transaction on this data sink.
Implemented in eagine::block_data_sink, and eagine::ostream_data_sink.
|
pure virtual |
Commits writes done as a part of transaction identified by argument.
Implemented in eagine::block_data_sink, and eagine::ostream_data_sink.
|
pure virtual |
Rolls-back writes done as a part of transaction identified by argument.
Implemented in eagine::block_data_sink, and eagine::ostream_data_sink.