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

#include <genesis/tree/formats/newick/input_iterator.hpp>

Detailed Description

Iterate an input stream and parse it as Newick trees.

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

Example:

auto it = NewickInputIterator( some_istream );
while( it ) {
    Tree const& t = *it;
    std::cout << t.node_count() << "\n";
    ++it;
}

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

Definition at line 67 of file input_iterator.hpp.

Public Member Functions

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

Public Types

using iterator_category = std::input_iterator_tag
 
using self_type = NewickInputIterator
 

Constructor & Destructor Documentation

NewickInputIterator ( )
inline

Definition at line 82 of file input_iterator.hpp.

Definition at line 88 of file input_iterator.hpp.

NewickInputIterator ( utils::InputStream in,
NewickReader const &  reader 
)
inline

Definition at line 100 of file input_iterator.hpp.

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

Member Function Documentation

Tree const& dereference ( ) const
inline

Definition at line 156 of file input_iterator.hpp.

void increment ( )
inline

Definition at line 181 of file input_iterator.hpp.

operator bool ( ) const
inlineexplicit

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

Definition at line 137 of file input_iterator.hpp.

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

Definition at line 129 of file input_iterator.hpp.

Tree const& operator* ( ) const
inline

Definition at line 146 of file input_iterator.hpp.

self_type& operator++ ( )
inline

Definition at line 175 of file input_iterator.hpp.

Tree const* operator-> ( ) const
inline

Definition at line 151 of file 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 124 of file input_iterator.hpp.

NewickReader& reader ( )
inline

Return the NewickReader used for this iterator.

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

Definition at line 166 of file input_iterator.hpp.

Member Typedef Documentation

using iterator_category = std::input_iterator_tag

Definition at line 76 of file input_iterator.hpp.

Definition at line 75 of file input_iterator.hpp.


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