A toolkit for working with phylogenetic data.
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 ( )

◆ AsynchronousReader() [2/3]

AsynchronousReader ( AsynchronousReader const &  )

◆ AsynchronousReader() [3/3]

◆ ~AsynchronousReader()

~AsynchronousReader ( )

Definition at line 172 of file input_reader.hpp.

Member Function Documentation

◆ class_name()

std::string class_name ( ) const

Definition at line 258 of file input_reader.hpp.

◆ finish_reading()

long finish_reading ( )

Definition at line 277 of file input_reader.hpp.

◆ init()

void init ( std::shared_ptr< BaseInputSource input_source)

Definition at line 192 of file input_reader.hpp.

◆ input_source()

BaseInputSource const* input_source ( ) const

Definition at line 253 of file input_reader.hpp.

◆ operator=() [1/2]

AsynchronousReader& operator= ( AsynchronousReader const &  )

◆ operator=() [2/2]

AsynchronousReader& operator= ( AsynchronousReader &&  )

◆ start_reading()

void start_reading ( char *  target_buffer,
long  target_size 

Definition at line 267 of file input_reader.hpp.

◆ valid()

bool valid ( ) const

Definition at line 248 of file input_reader.hpp.

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