Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | List of all members
gamgee::MultipleVariantIterator Class Reference

Utility class to enable for-each style iteration in the MultipleVariantReader class. More...

#include <multiple_variant_iterator.h>

Inheritance diagram for gamgee::MultipleVariantIterator:
gamgee::ReferenceBlockSplittingVariantIterator

Public Member Functions

 MultipleVariantIterator ()=default
 creates an empty iterator (used for the end() method) More...
 
 MultipleVariantIterator (const std::vector< std::shared_ptr< htsFile >> &variant_files, const std::vector< std::shared_ptr< bcf_hdr_t >> &variant_headers)
 initializes a new iterator based on a vector of input files (vcf or bcf) More...
 
 MultipleVariantIterator (MultipleVariantIterator &&)=default
 a MultipleVariantIterator move constructor guarantees all objects will have the same state. More...
 
MultipleVariantIteratoroperator= (MultipleVariantIterator &&other)=default
 
 MultipleVariantIterator (const MultipleVariantIterator &)=delete
 a MultipleVariantIterator cannot be copied safely, as it is iterating over streams. More...
 
MultipleVariantIteratoroperator= (const MultipleVariantIterator &other)=delete
 
bool operator!= (const MultipleVariantIterator &rhs)
 pseudo-inequality operator (needed by for-each loop) More...
 
std::vector< VariantIndexPair > & operator* ()
 dereference operator (needed by for-each loop) More...
 
std::vector< VariantIndexPair > & operator++ ()
 advances the iterator, fetching the next vector More...
 

Detailed Description

Utility class to enable for-each style iteration in the MultipleVariantReader class.

Constructor & Destructor Documentation

gamgee::MultipleVariantIterator::MultipleVariantIterator ( )
default

creates an empty iterator (used for the end() method)

gamgee::MultipleVariantIterator::MultipleVariantIterator ( const std::vector< std::shared_ptr< htsFile >> &  variant_files,
const std::vector< std::shared_ptr< bcf_hdr_t >> &  variant_headers 
)

initializes a new iterator based on a vector of input files (vcf or bcf)

Parameters
variant_filesvector of vcf/bcf files opened via the bcf_open() macro from htslib
variant_headersvector of headers corresponding to the files
gamgee::MultipleVariantIterator::MultipleVariantIterator ( MultipleVariantIterator &&  )
default

a MultipleVariantIterator move constructor guarantees all objects will have the same state.

gamgee::MultipleVariantIterator::MultipleVariantIterator ( const MultipleVariantIterator )
delete

a MultipleVariantIterator cannot be copied safely, as it is iterating over streams.

Member Function Documentation

bool gamgee::MultipleVariantIterator::operator!= ( const MultipleVariantIterator rhs)

pseudo-inequality operator (needed by for-each loop)

Warning
this method does the minimal work necessary to determine that we have reached the end of iteration. it is NOT a valid general-purpose inequality method.
Parameters
rhsthe other MultipleVariantIterator to compare to
Returns
whether both iterators have entered their end states
std::vector< VariantIndexPair > & gamgee::MultipleVariantIterator::operator* ( )

dereference operator (needed by for-each loop)

Returns
a reference to the iterator's Variant vector
std::vector< VariantIndexPair > & gamgee::MultipleVariantIterator::operator++ ( )

advances the iterator, fetching the next vector

Returns
a reference to the iterator's Variant vector
MultipleVariantIterator& gamgee::MultipleVariantIterator::operator= ( MultipleVariantIterator &&  other)
default
MultipleVariantIterator& gamgee::MultipleVariantIterator::operator= ( const MultipleVariantIterator other)
delete

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