Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
reference_block_splitting_variant_iterator.h
Go to the documentation of this file.
1 #ifndef __gamgee__reference_block_splitting_variant_iterator__
2 #define __gamgee__reference_block_splitting_variant_iterator__
3 
4 #include "variant.h"
6 
7 #include <list>
8 
9 namespace gamgee {
10 
17  public:
18 
23 
30  ReferenceBlockSplittingVariantIterator(const std::vector<std::shared_ptr<htsFile>>& variant_files, const std::vector<std::shared_ptr<bcf_hdr_t>>& variant_headers);
31 
37 
43 
55 
61  std::vector<VariantIndexPair>& operator*();
62 
68  std::vector<VariantIndexPair>& operator++();
69 
70  private:
71  // fetches the next reference-block-split Variant vector
72  // calls populate_pending() and populate_split_variants() as needed
73  void fetch_next_split_vector();
74 
75  // populates the list of pending variants from the incoming vector of pre-split reference-block variants
76  inline void populate_pending();
77 
78  // populates the vector of split variants from the list of pending variants, modifying the pending list as well
79  inline void populate_split_variants();
80 
81  // holds the incoming reference-block variants before and during split operations
82  std::vector<VariantIndexPair> m_pending_variants;
83 
84  // caches next reference-block-split Variant vector
85  std::vector<VariantIndexPair> m_split_variants;
86 
87  unsigned int m_pending_chrom = UINT_MAX;
88  unsigned int m_pending_start = UINT_MAX;
89  unsigned int m_pending_min_end = UINT_MAX;
90 };
91 
92 } // end namespace gamgee
93 
94 #endif // __gamgee__reference_block_splitting_variant_iterator__
ReferenceBlockSplittingVariantIterator()=default
creates an empty iterator (used for the end() method)
Utility class to enable for-each style iteration in the MultipleVariantReader class.
Definition: multiple_variant_iterator.h:20
bool operator!=(const ReferenceBlockSplittingVariantIterator &rhs)
pseudo-inequality operator (needed by for-each loop)
Definition: reference_block_splitting_variant_iterator.cpp:34
std::vector< VariantIndexPair > & operator++()
advances the iterator, fetching the next vector
Definition: reference_block_splitting_variant_iterator.cpp:27
Definition: exceptions.h:9
ReferenceBlockSplittingVariantIterator & operator=(ReferenceBlockSplittingVariantIterator &&)=default
Utility class to handle reference blocks while iterating over multiple variant files.
Definition: reference_block_splitting_variant_iterator.h:16
std::vector< VariantIndexPair > & operator*()
dereference operator (needed by for-each loop)
Definition: reference_block_splitting_variant_iterator.cpp:23