Go to the documentation of this file.
9 #ifndef EAGINE_SERIALIZE_BLOCK_SOURCE_HPP
10 #define EAGINE_SERIALIZE_BLOCK_SOURCE_HPP
12 #include "../memory/block.hpp"
13 #include "../memory/span_algo.hpp"
40 return head(
skip(_src, _done), req_size);
47 auto remaining() const noexcept -> memory::
const_block {
48 return skip(_src, _done);
58 #endif // EAGINE_SERIALIZE_BLOCK_SOURCE_HPP
block_data_source(memory::const_block src) noexcept
Constructor setting the backing block.
Definition: block_source.hpp:29
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
auto top(span_size_t req_size) -> memory::const_block final
Returns a block covering the specified amount of data of the top.
Definition: block_source.hpp:39
Common code is placed in this namespace.
Definition: eagine.hpp:21
basic_block< true > const_block
Alias for const byte memory span.
Definition: block.hpp:32
Deserialization data source backed by a pre-allocated memory block.
Definition: block_source.hpp:23
static constexpr auto head(basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S >
Returns the first l elements from the front of a span.
Definition: span_algo.hpp:99
void pop(span_size_t del_size) final
Returns the specified amount of data of the top of the source.
Definition: block_source.hpp:43
block_data_source() noexcept=default
Default constructor.
Non-owning view of a contiguous range of memory with ValueType elements.
Definition: flatten_fwd.hpp:16
static constexpr auto skip(basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S >
Skips a specified count of elements from the front of a span.
Definition: span_algo.hpp:60
Abstract base class for deserialization data sources.
Definition: data_source.hpp:25
void reset(memory::const_block src)
Resets the backing block.
Definition: block_source.hpp:34