A library for working with phylogenetic and population genetic data.
v0.32.0
StreamInputSource Class Referencefinal

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

Inherits BaseInputSource.

Detailed Description

Input source for reading byte data from an istream.

The input stream is provided via the constructor. It is not owned by this class, thus the owner must keep it alive as long as reading from it is required, and is responsbile for destroying it. This class merely keeps a reference to it.

Definition at line 56 of file stream_input_source.hpp.

Public Member Functions

 StreamInputSource (std::istream &in)
 Construct the input source from an std::istream. More...
 
 StreamInputSource (StreamInputSource &&)=default
 
 StreamInputSource (StreamInputSource const &)=default
 
 ~StreamInputSource () override
 
StreamInputSourceoperator= (StreamInputSource &&)=default
 
StreamInputSourceoperator= (StreamInputSource const &)=default
 
- Public Member Functions inherited from BaseInputSource
 BaseInputSource ()=default
 
 BaseInputSource (BaseInputSource &&)=default
 
 BaseInputSource (BaseInputSource const &)=default
 
virtual ~BaseInputSource ()
 
bool is_trivial () const
 Return whether reading from this source is trivial, such as reading from a file, or involves more complex operations, such as reading from a compressed input that needs to be decompressed first. More...
 
BaseInputSourceoperator= (BaseInputSource &&)=default
 
BaseInputSourceoperator= (BaseInputSource const &)=default
 
size_t read (char *buffer, size_t size)
 Read size many bytes into the char buffer. More...
 
std::string source_name () const
 Get a name of the input source. This is intended for user output. More...
 
std::string source_string () const
 Get a string representing the input source. This is intended for the reader classes, which for example might want to examine the input file name. More...
 

Constructor & Destructor Documentation

◆ StreamInputSource() [1/3]

StreamInputSource ( std::istream &  in)
inlineexplicit

Construct the input source from an std::istream.

Definition at line 67 of file stream_input_source.hpp.

◆ StreamInputSource() [2/3]

StreamInputSource ( StreamInputSource const &  )
default

◆ StreamInputSource() [3/3]

◆ ~StreamInputSource()

~StreamInputSource ( )
inlineoverride

Definition at line 77 of file stream_input_source.hpp.

Member Function Documentation

◆ operator=() [1/2]

StreamInputSource& operator= ( StreamInputSource &&  )
default

◆ operator=() [2/2]

StreamInputSource& operator= ( StreamInputSource const &  )
default

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