OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::packed_block_data_sink Class Reference

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.
 
- Public Member Functions inherited from eagine::block_data_sink
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.
 
- Public Member Functions inherited from eagine::serializer_data_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

- Public Types inherited from eagine::serializer_data_sink
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.
 
- Protected Member Functions inherited from eagine::abstract< serializer_data_sink >
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.
 

Detailed Description

Packing serialization data sink backed by a pre-allocated memory block.

See also
packed_block_data_source
data_compressor

The documentation for this class was generated from the following file:

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).