byteme
C++ wrappers for buffered inputs
|
Perform parallelized byte-by-byte extraction from a Reader
source.
More...
#include <PerByte.hpp>
Public Member Functions | |
PerByteParallel (Pointer_ reader) | |
bool | valid () const |
bool | advance () |
Type_ | get () const |
size_t | position () const |
std::pair< size_t, bool > | extract (size_t number, Type_ *output) |
Perform parallelized byte-by-byte extraction from a Reader
source.
Type_ | Character type to return, usually char for text or unsigned char for binary. |
Pointer_ | A (possibly smart) non-const pointer to a Reader . |
This is much like PerByte
except that the Reader
's loading operation is called in a separate thread, thus allowing the caller to parse the bytes of the current chunk in parallel.
|
inline |
reader | A (possibly smart) pointer to a Reader object. |
|
inline |
|
inline |
Extract up to number
bytes from the Reader
source and store them in the output
. This is equivalent to (but more efficient than) calling get()
and then advance()
up to number
times, only iterating while the return value of advance()
is still true. The number of successful iterations is returned in the output as the first pair element, while the return value of the final advance()
is returned as the second pair element.
number | Number of bytes to extract. | |
[out] | output | Pointer to an output buffer of length number . This is filled with up to number bytes from the source. |
|
inline |
This should only be called if valid()
is true
.
|
inline |
|
inline |