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

eagine::deserializer_data_source Struct Referenceabstract

Abstract base class for deserialization data sources. More...

#include <eagine/serialize/data_source.hpp>

Public Member Functions

virtual auto top (span_size_t size) -> memory::const_block=0
 Returns a block covering the specified amount of data of the top. More...
 
virtual void pop (span_size_t size)=0
 Returns the specified amount of data of the top of the source. More...
 
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.
 

Detailed Description

Abstract base class for deserialization data sources.

See also
data_sink
deserializer_backend

Member Function Documentation

◆ pop()

virtual void eagine::deserializer_data_source::pop ( span_size_t  size)
pure virtual

Returns the specified amount of data of the top of the source.

See also
top

Implemented in eagine::block_data_source, and eagine::istream_data_source.

◆ scan_for()

auto eagine::deserializer_data_source::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>
inline

Returns the position of the first occurrence of the specified byte.

See also
scan_until
Parameters
whatthe searched value.
maxthe maximum number of bytes from the top to scan.
stephow much data should be fetched per scan iteration.

◆ scan_until()

template<typename Function >
auto eagine::deserializer_data_source::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>
inline

Returns the position of the first byte where predicate is true.

See also
scan_for
Parameters
predicatethe function indicating where to stop the scan.
maxthe maximum number of bytes from the top to scan.
stephow much data should be fetched per scan iteration.

◆ top()

virtual auto eagine::deserializer_data_source::top ( span_size_t  size) -> memory::const_block
pure virtual

Returns a block covering the specified amount of data of the top.

See also
pop
scan_until
scan_for

Implemented in eagine::block_data_source, and eagine::istream_data_source.


The documentation for this struct 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).