Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
synced_variant_iterator.h
Go to the documentation of this file.
1 #ifndef gamgee__synced_variant_iterator__guard
2 #define gamgee__synced_variant_iterator__guard
3 
4 #include "htslib/vcf.h"
6 
7 #include "variant.h"
8 
9 #include <memory>
10 
11 namespace gamgee {
12 
17  public:
18 
23 
29  SyncedVariantIterator(const std::shared_ptr<bcf_srs_t>& synced_readers);
30 
36 
42 
53  bool operator!=(const SyncedVariantIterator& rhs);
54 
60  std::vector<Variant>& operator*();
61 
67  std::vector<Variant>& operator++();
68 
69  private:
70  std::shared_ptr<bcf_srs_t> m_synced_readers;
71  std::vector<Variant> m_variant_vector;
72  std::vector<std::shared_ptr<bcf_hdr_t>> m_headers_vector;
73 
74  void init_headers_vector();
75  void fetch_next_record();
76 };
77 
78 } // end namespace gamgee
79 
80 #endif /* gamgee__synced_variant_iterator__guard */
SyncedVariantIterator()
creates an empty iterator (used for the end() method)
Definition: synced_variant_iterator.cpp:11
Utility class to enable for-each style iteration in the SyncedVariantReader class.
Definition: synced_variant_iterator.h:16
std::vector< Variant > & operator*()
dereference operator (needed by for-each loop)
Definition: synced_variant_iterator.cpp:24
SyncedVariantIterator & operator=(SyncedVariantIterator &&other)=default
std::vector< Variant > & operator++()
pre-fetches the next vector and tests for end of file
Definition: synced_variant_iterator.cpp:28
Definition: exceptions.h:9
bool operator!=(const SyncedVariantIterator &rhs)
pseudo-inequality operator (needed by for-each loop)
Definition: synced_variant_iterator.cpp:35