|
byteme
C++ wrappers for buffered inputs
|
Parallelized buffering to wrap a Reader.
More...
#include <BufferedReader.hpp>


Public Member Functions | |
| ParallelBufferedReader (Pointer_ reader, std::size_t buffer_size) | |
Public Member Functions inherited from byteme::BufferedReader< Type_ > | |
| bool | advance () |
| Type_ | get () const |
| unsigned long long | position () const |
| bool | valid () const |
| std::pair< std::size_t, bool > | extract (std::size_t number, Type_ *output) |
Parallelized buffering to wrap a Reader.
| Type_ | Type of the output bytes, usually char for text or unsigned char for binary. |
| Pointer_ | Pointer to a class that serves as a source of input bytes. The pointed-to class should satisfy the Reader interface; it may also be a concrete Reader subclass to enable devirtualization. Either a smart or raw pointer may be supplied depending on how the caller wants to manage the lifetime of the pointed-to object. |
This is a subclass of BufferedReader that calls Reader::read() on a worker thread. The user can iterate over the currently-filled buffer in parallel with the reading of the next buffer's worth of bytes.
|
inline |
| reader | Pointer to a source of input bytes. |
| buffer_size | Size of the internal buffer in which to store bytes that have been read from reader but not yet used. Larger values reduce the number of read calls at the cost of greater memory usage. Should be positive. |