1 #ifndef theplu_yat_utility_cigar_iterator
2 #define theplu_yat_utility_cigar_iterator
27 #include <boost/concept_check.hpp>
28 #include <boost/cstdint.hpp>
29 #include <boost/iterator/iterator_facade.hpp>
30 #include <boost/iterator/iterator_categories.hpp>
31 #include <boost/iterator/iterator_concepts.hpp>
59 template<
typename BASE>
61 :
public boost::iterator_facade<
62 CigarIterator<BASE>, uint8_t
63 , boost::bidirectional_traversal_tag, const uint8_t>
81 BASE
base(
void)
const;
83 friend class boost::iterator_core_access;
89 uint8_t dereference(
void)
const;
101 template<
typename BASE>
104 BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIterator<BASE>));
105 BOOST_CONCEPT_ASSERT((boost_concepts::BidirectionalTraversal<BASE>));
109 template<
typename BASE>
111 : base_(b), index_(x)
113 BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIterator<BASE>));
114 BOOST_CONCEPT_ASSERT((boost_concepts::BidirectionalTraversal<BASE>));
118 template<
typename BASE>
125 template<
typename BASE>
132 index_ = bam_cigar_oplen(*base_)-1;
137 template<
typename BASE>
138 uint8_t CigarIterator<BASE>::dereference(
void)
const
140 return bam_cigar_op(*base_);
144 template<
typename BASE>
145 bool CigarIterator<BASE>::equal(
const CigarIterator& other)
const
147 return base_==other.base_ && index_==other.index_;
151 template<
typename BASE>
152 void CigarIterator<BASE>::increment(
void)
154 if (++index_ == bam_cigar_oplen(*base_)) {
Iterator over a CIGAR.
Definition: CigarIterator.h:60
BASE base(void) const
Definition: CigarIterator.h:119
CigarIterator(void)
Default constructor.
Definition: CigarIterator.h:102