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

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

#include <synced_variant_iterator.h>

Public Member Functions

 SyncedVariantIterator ()
 creates an empty iterator (used for the end() method) More...
 
 SyncedVariantIterator (const std::shared_ptr< bcf_srs_t > &synced_readers)
 initializes a new iterator based on a structure of synced vcf/bcf file readers More...
 
 SyncedVariantIterator (SyncedVariantIterator &&other)=default
 a SyncedVariantIterator should never be copied, but it can be moved around More...
 
SyncedVariantIteratoroperator= (SyncedVariantIterator &&other)=default
 
 SyncedVariantIterator (const SyncedVariantIterator &)=delete
 a SyncedVariantIterator cannot be copied safely, as it is iterating over streams. More...
 
SyncedVariantIteratoroperator= (const SyncedVariantIterator &)=delete
 
bool operator!= (const SyncedVariantIterator &rhs)
 pseudo-inequality operator (needed by for-each loop) More...
 
std::vector< Variant > & operator* ()
 dereference operator (needed by for-each loop) More...
 
std::vector< Variant > & operator++ ()
 pre-fetches the next vector and tests for end of file More...
 

Detailed Description

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

Constructor & Destructor Documentation

gamgee::SyncedVariantIterator::SyncedVariantIterator ( )

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

gamgee::SyncedVariantIterator::SyncedVariantIterator ( const std::shared_ptr< bcf_srs_t > &  synced_readers)

initializes a new iterator based on a structure of synced vcf/bcf file readers

Parameters
synced_readersan htslib structure of synced vcf/bcf file readers created using the bcf_sr_init() function
gamgee::SyncedVariantIterator::SyncedVariantIterator ( SyncedVariantIterator &&  other)
default

a SyncedVariantIterator should never be copied, but it can be moved around

gamgee::SyncedVariantIterator::SyncedVariantIterator ( const SyncedVariantIterator )
delete

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

Member Function Documentation

bool gamgee::SyncedVariantIterator::operator!= ( const SyncedVariantIterator 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 SyncedVariantIterator to compare to
Returns
whether both iterators have entered their end states
std::vector< Variant > & gamgee::SyncedVariantIterator::operator* ( )

dereference operator (needed by for-each loop)

Returns
a persistent Variant vector independent from the iterator (a copy of the iterator's vector)
std::vector< Variant > & gamgee::SyncedVariantIterator::operator++ ( )

pre-fetches the next vector and tests for end of file

Returns
a reference to the vector
SyncedVariantIterator& gamgee::SyncedVariantIterator::operator= ( SyncedVariantIterator &&  other)
default
SyncedVariantIterator& gamgee::SyncedVariantIterator::operator= ( const SyncedVariantIterator )
delete

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