A toolkit for working with phylogenetic data.
v0.24.0
AsynchronousReader Class Reference

#include <genesis/utils/io/input_reader.hpp>

Detailed Description

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 const &)=delete
 
 AsynchronousReader (AsynchronousReader &&)=delete
 
 ~AsynchronousReader ()
 
std::string class_name () const
 
long finish_reading ()
 
void init (std::shared_ptr< BaseInputSource > input_source)
 
BaseInputSource const * input_source () const
 
AsynchronousReaderoperator= (AsynchronousReader const &)=delete
 
AsynchronousReaderoperator= (AsynchronousReader &&)=delete
 
void start_reading (char *target_buffer, long target_size)
 
bool valid () const
 

Constructor & Destructor Documentation

◆ AsynchronousReader() [1/3]

AsynchronousReader ( )
default

◆ AsynchronousReader() [2/3]

AsynchronousReader ( AsynchronousReader const &  )
delete

◆ AsynchronousReader() [3/3]

◆ ~AsynchronousReader()

~AsynchronousReader ( )
inline

Definition at line 172 of file input_reader.hpp.

Member Function Documentation

◆ class_name()

std::string class_name ( ) const
inline

Definition at line 258 of file input_reader.hpp.

◆ finish_reading()

long finish_reading ( )
inline

Definition at line 277 of file input_reader.hpp.

◆ init()

void init ( std::shared_ptr< BaseInputSource input_source)
inline

Definition at line 192 of file input_reader.hpp.

◆ input_source()

BaseInputSource const* input_source ( ) const
inline

Definition at line 253 of file input_reader.hpp.

◆ operator=() [1/2]

AsynchronousReader& operator= ( AsynchronousReader const &  )
delete

◆ operator=() [2/2]

AsynchronousReader& operator= ( AsynchronousReader &&  )
delete

◆ start_reading()

void start_reading ( char *  target_buffer,
long  target_size 
)
inline

Definition at line 267 of file input_reader.hpp.

◆ valid()

bool valid ( ) const
inline

Definition at line 248 of file input_reader.hpp.


The documentation for this class was generated from the following file: