Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
sam_iterator.h
Go to the documentation of this file.
1 #ifndef __gamgee__sam_iterator__
2 #define __gamgee__sam_iterator__
3 
4 #include "sam.h"
5 
6 #include "htslib/sam.h"
7 
8 #include <memory>
9 
10 namespace gamgee {
11 
15 class SamIterator {
16  public:
17 
21  SamIterator();
22 
29  SamIterator(samFile* sam_file_ptr, const std::shared_ptr<bam_hdr_t>& sam_header_ptr);
30 
35 
44  bool operator!=(const SamIterator& rhs);
45 
51  Sam& operator*();
52 
59  Sam& operator++();
60 
61  private:
62  samFile * m_sam_file_ptr;
63  std::shared_ptr<bam_hdr_t> m_sam_header_ptr;
64  std::shared_ptr<bam1_t> m_sam_record_ptr;
65  Sam m_sam_record;
66 
67  Sam fetch_next_record();
68 };
69 
70 } // end namespace gamgee
71 
72 #endif
SamIterator()
creates an empty iterator (used for the end() method)
Definition: sam_iterator.cpp:9
Utility class to enable for-each style iteration in the SamReader class.
Definition: sam_iterator.h:15
Sam & operator*()
dereference operator (needed by for-each loop)
Definition: sam_iterator.cpp:29
Utility class to manipulate a Sam record.
Definition: sam.h:19
Sam & operator++()
pre-fetches the next record and tests for end of file
Definition: sam_iterator.cpp:33
bool operator!=(const SamIterator &rhs)
inequality operator (needed by for-each loop)
Definition: sam_iterator.cpp:38