Bifrost: src/UnitigIterator.hpp Source File

Bifrost

UnitigIterator.hpp
Go to the documentation of this file.
1 #ifndef UNITIG_ITERATOR_HPP
2 #define UNITIG_ITERATOR_HPP
3
4 #include "UnitigMap.hpp"
5 #include "KmerHashTable.hpp"
6 #include "CompressedCoverage.hpp"
7
13 template<typename U, typename G> class CompactedDBG;
14
35 template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
36 class unitigIterator : public std::iterator<std::input_iterator_tag, UnitigMap<Unitig_data_t, Graph_data_t, is_const>, int> {
37
38 typedef Unitig_data_t U;
39 typedef Graph_data_t G;
40
41 public:
42
43 typedef typename std::conditional<is_const, const CompactedDBG<U, G>*, CompactedDBG<U, G>*>::type CompactedDBG_ptr_t;
44
48 unitigIterator();
49
55 unitigIterator(CompactedDBG_ptr_t cdbg_);
56
60 unitigIterator(const unitigIterator& o);
61
65 unitigIterator& operator++();
66
70 unitigIterator operator++(int);
71
76 bool operator==(const unitigIterator& o) const;
77
82 bool operator!=(const unitigIterator& o) const;
83
87 const UnitigMap<U, G, is_const>& operator*() const;
88
92 const UnitigMap<U, G, is_const>* operator->() const;
93
94 private:
95
96 size_t i;
97
98 size_t v_unitigs_sz;
99 size_t v_kmers_sz;
100 size_t h_kmers_ccov_sz;
101 size_t sz;
102
103 bool invalid;
104
105 typename KmerHashTable<CompressedCoverage_t<U>>::const_iterator it_h_kmers_ccov;
106
107 UnitigMap<U, G, is_const> um;
108
109 CompactedDBG_ptr_t cdbg;
110 };
111
112 #include "UnitigIterator.tcc"
113
114 #endif
unitigIterator
Iterator for the unitigs of a Compacted de Bruijn graph.
Definition: UnitigIterator.hpp:36
unitigIterator::operator++
unitigIterator & operator++()
Prefix increment, iterate over the next unitig.
CompactedDBG
Represent a Compacted de Bruijn graph.
Definition: CompactedDBG.hpp:297
UnitigMap.hpp
UnitigMap type interface.
unitigIterator::operator->
const UnitigMap< U, G, is_const > * operator->() const
Dereference operator.
unitigIterator::operator!=
bool operator!=(const unitigIterator &o) const
Inequality operator: check if two unitigIterator are different.
UnitigMap< U, G, is_const >
unitigIterator::unitigIterator
unitigIterator()
Constructor.
unitigIterator::operator*
const UnitigMap< U, G, is_const > & operator*() const
Indirection operator.
unitigIterator::operator==
bool operator==(const unitigIterator &o) const
Equality operator: check if two unitigIterator are the same.