Deserialization data source backed by a pre-allocated memory block. More...
#include <eagine/serialize/block_source.hpp>
Public Member Functions | |
| block_data_source () noexcept=default | |
| Default constructor. | |
| block_data_source (memory::const_block src) noexcept | |
| Constructor setting the backing block. | |
| void | reset (memory::const_block src) |
| Resets the backing block. More... | |
| auto | top (span_size_t req_size) -> memory::const_block final |
| Returns a block covering the specified amount of data of the top. More... | |
| void | pop (span_size_t del_size) final |
| Returns the specified amount of data of the top of the source. More... | |
Public Member Functions inherited from eagine::deserializer_data_source | |
| template<typename Function > | |
| auto | scan_until (Function predicate, const valid_if_positive< span_size_t > &max, const valid_if_positive< span_size_t > &step={256}) -> valid_if_nonnegative< span_size_t > |
| Returns the position of the first byte where predicate is true. More... | |
| auto | scan_for (byte what, const valid_if_positive< span_size_t > &max, const valid_if_positive< span_size_t > &step={256}) -> valid_if_nonnegative< span_size_t > |
| Returns the position of the first occurrence of the specified byte. More... | |
| void | fetch_all (memory::buffer &dst, valid_if_positive< span_size_t > step={256}) |
| Fetches all the remaining data into a buffer. | |
Public Member Functions inherited from eagine::interface< deserializer_data_source > | |
| constexpr | interface (const interface &)=delete |
| Not copyable. | |
| auto | operator= (interface &&)=delete |
| Not move assignable. | |
| auto | operator= (const interface &)=delete |
| Not copy assignable. | |
Additional Inherited Members | |
Protected Member Functions inherited from eagine::interface< deserializer_data_source > | |
| constexpr | interface () noexcept=default |
| Default constructible by derived. | |
| constexpr | interface (interface &&) noexcept=default |
| Move constructible by derived. | |
Deserialization data source backed by a pre-allocated memory block.
|
inlinefinalvirtual |
Returns the specified amount of data of the top of the source.
Implements eagine::deserializer_data_source.
|
inline |
Resets the backing block.
|
inlinefinalvirtual |
Returns a block covering the specified amount of data of the top.
Implements eagine::deserializer_data_source.