Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
variant_iterator.h
Go to the documentation of this file.
1 #ifndef __gamgee__variant_iterator__
2 #define __gamgee__variant_iterator__
3 
4 #include "variant.h"
5 
6 #include "htslib/vcf.h"
7 
8 #include <memory>
9 
10 namespace gamgee {
11 
16  public:
17 
22 
29  VariantIterator(vcfFile* variant_file_ptr, const std::shared_ptr<bcf_hdr_t>& variant_header_ptr);
30 
35 
44  bool operator!=(const VariantIterator& rhs);
45 
51  Variant& operator*();
52 
60 
61  private:
62  vcfFile * m_variant_file_ptr;
63  std::shared_ptr<bcf_hdr_t> m_variant_header_ptr;
64  std::shared_ptr<bcf1_t> m_variant_record_ptr;
65  Variant m_variant_record;
66 
67  Variant fetch_next_record();
68 };
69 
70 } // end namespace gamgee
71 
72 #endif
bool operator!=(const VariantIterator &rhs)
inequality operator (needed by for-each loop)
Definition: variant_iterator.cpp:38
VariantIterator()
creates an empty iterator (used for the end() method)
Definition: variant_iterator.cpp:9
Variant & operator++()
pre-fetches the next record and tests for end of file
Definition: variant_iterator.cpp:33
Variant & operator*()
dereference operator (needed by for-each loop)
Definition: variant_iterator.cpp:29
Utility class to enable for-each style iteration in the VariantReader class.
Definition: variant_iterator.h:15
Utility class to manipulate a Variant record.
Definition: variant.h:16