A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FastaInputIterator Class Reference

#include <genesis/sequence/formats/fasta_input_iterator.hpp>

Detailed Description

Iterate an input stream and parse it as fasta sequences.

This class allows to iterate over an input stream, iterpreting it as fasta sequences, and yielding one such sequence per iteration step. This is useful for processing large files without having to keep them fully in memory.

Example:

auto it = FastaInputIterator( some_istream );
while( it ) {
    std::cout << it->length() << "\n";
    ++it;
}

See FastaReader for a description of the expected format. In order to change the reading behaviour, use the reader() function to access the internal FastaReaser and change its properties.

Definition at line 66 of file fasta_input_iterator.hpp.

Public Member Functions

 FastaInputIterator ()
 
 FastaInputIterator (utils::InputStream &in)
 
 FastaInputIterator (utils::InputStream &in, FastaReader const &reader)
 
 FastaInputIterator (self_type const &)=delete
 
 FastaInputIterator (self_type &&)=default
 
 ~FastaInputIterator ()=default
 
Sequence const & dereference () const
 
void increment ()
 
 operator bool () const
 Return true iff dereferencing is valid, i.e., iff there is a Sequence available. More...
 
bool operator!= (self_type const &other) const
 
Sequence const & operator* () const
 
self_typeoperator++ ()
 
Sequence const * operator-> () const
 
self_typeoperator= (self_type const &)=delete
 
self_typeoperator= (self_type &&)=default
 
bool operator== (self_type const &other) const
 
FastaReaderreader ()
 Return the FastaReader used for this iterator. More...
 

Public Types

using iterator_category = std::input_iterator_tag
 
using self_type = FastaInputIterator
 

Constructor & Destructor Documentation

FastaInputIterator ( )
inline

Definition at line 81 of file fasta_input_iterator.hpp.

Definition at line 87 of file fasta_input_iterator.hpp.

FastaInputIterator ( utils::InputStream in,
FastaReader const &  reader 
)
inline

Definition at line 96 of file fasta_input_iterator.hpp.

~FastaInputIterator ( )
default
FastaInputIterator ( self_type const &  )
delete
FastaInputIterator ( self_type &&  )
default

Member Function Documentation

Sequence const& dereference ( ) const
inline

Definition at line 149 of file fasta_input_iterator.hpp.

void increment ( )
inline

Definition at line 174 of file fasta_input_iterator.hpp.

operator bool ( ) const
inlineexplicit

Return true iff dereferencing is valid, i.e., iff there is a Sequence available.

Definition at line 130 of file fasta_input_iterator.hpp.

bool operator!= ( self_type const &  other) const
inline

Definition at line 122 of file fasta_input_iterator.hpp.

Sequence const& operator* ( ) const
inline

Definition at line 139 of file fasta_input_iterator.hpp.

self_type& operator++ ( )
inline

Definition at line 168 of file fasta_input_iterator.hpp.

Sequence const* operator-> ( ) const
inline

Definition at line 144 of file fasta_input_iterator.hpp.

self_type& operator= ( self_type const &  )
delete
self_type& operator= ( self_type &&  )
default
bool operator== ( self_type const &  other) const
inline

Definition at line 117 of file fasta_input_iterator.hpp.

FastaReader& reader ( )
inline

Return the FastaReader used for this iterator.

Use this to change the reading behaviour of the iterator. See FastaReader for details.

Definition at line 159 of file fasta_input_iterator.hpp.

Member Typedef Documentation

using iterator_category = std::input_iterator_tag

Definition at line 75 of file fasta_input_iterator.hpp.

Definition at line 74 of file fasta_input_iterator.hpp.


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