Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fastq_iterator.h
Go to the documentation of this file.
1 #ifndef gamgee__fastq_iterator__guard
2 #define gamgee__fastq_iterator__guard
3 
4 #include "fastq.h"
5 
6 #include <memory>
7 #include <istream>
8 
9 namespace gamgee {
10 
15  public:
16 
20  FastqIterator();
21 
27  explicit FastqIterator(std::shared_ptr<std::istream>& in);
28 
33  FastqIterator(const FastqIterator&) = delete;
34  FastqIterator& operator=(const FastqIterator&) = delete;
35 
39  FastqIterator(FastqIterator&&) = default;
41 
50  bool operator==(const FastqIterator& rhs) const;
51 
60  bool operator!=(const FastqIterator& rhs) const;
61 
67  Fastq& operator*();
68 
74  Fastq& operator++();
75 
76  private:
77  std::shared_ptr<std::istream> m_input_stream;
78  Fastq m_element;
79  bool m_is_fastq;
80  char m_eos_delim;
81  char m_bor_delim;
82 
83  Fastq fetch_next_element();
84  std::string parse_comment();
85  std::string parse_seq();
86  std::string parse_quals(uint32_t seq_length);
87  const std::string parse_multiline();
88  void skip_new_lines();
89 };
90 
91 } // end namespace gamgee
92 
93 #endif // gamgee__fastq_iterator__guard
FastqIterator()
creates an empty iterator (used for the end() method)
Definition: fastq_iterator.cpp:11
bool operator!=(const FastqIterator &rhs) const
inequality operator (needed by for-each loop)
Definition: fastq_iterator.cpp:44
Utility class to hold one FastA or FastQ record.
Definition: fastq.h:13
FastqIterator & operator=(const FastqIterator &)=delete
Utility class to enable for-each style iteration in the FastqReader class.
Definition: fastq_iterator.h:14
Fastq & operator*()
dereference operator (needed by for-each loop)
Definition: fastq_iterator.cpp:31
Definition: exceptions.h:9
Fastq & operator++()
increment operator (needed by for-each loop)
Definition: fastq_iterator.cpp:35
bool operator==(const FastqIterator &rhs) const
equality operator
Definition: fastq_iterator.cpp:40