#include <genesis/utils/io/input_reader.hpp>
Read bytes from an InputSource into a char buffer
.
The reading is done asynchronously, that is, a second thread is started. This is usually faster than synchronous reading (see SynchronousReader), particularly for large data blocks. It is thus the preferred reader, if available.
This class is only available if threading is available, that is, if the GENESIS_PTHREADS
macro definition is set. If this is the case, the InputReader typedef is an alias of this class. Otherwise, only the SynchronousReader is available and InputReader aliases this one instead.
Implementation details inspired by fast-cpp-csv-parser by Ben Strasser, see also Acknowledgements.
Definition at line 114 of file input_reader.hpp.
Public Member Functions | |
AsynchronousReader ()=default | |
AsynchronousReader (AsynchronousReader &&)=delete | |
AsynchronousReader (AsynchronousReader const &)=delete | |
~AsynchronousReader () | |
std::string | class_name () const |
long | finish_reading () |
void | init (std::shared_ptr< BaseInputSource > input_source) |
BaseInputSource const * | input_source () const |
AsynchronousReader & | operator= (AsynchronousReader &&)=delete |
AsynchronousReader & | operator= (AsynchronousReader const &)=delete |
void | start_reading (char *target_buffer, long target_size) |
bool | valid () const |
|
default |
|
delete |
|
delete |
|
inline |
Definition at line 172 of file input_reader.hpp.
|
inline |
Definition at line 258 of file input_reader.hpp.
|
inline |
Definition at line 277 of file input_reader.hpp.
|
inline |
Definition at line 192 of file input_reader.hpp.
|
inline |
Definition at line 253 of file input_reader.hpp.
|
delete |
|
delete |
|
inline |
Definition at line 267 of file input_reader.hpp.
|
inline |
Definition at line 248 of file input_reader.hpp.