Changeset 3176 for trunk/yat/omic/BamPairIterator.h
- Timestamp:
- Mar 15, 2014, 10:10:37 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/omic/BamPairIterator.h
r3175 r3176 60 60 class BamPairIterator 61 61 : public boost::iterator_facade< 62 BamPairIterator<Base>, const BamPair, std::input_iterator_tag 62 BamPairIterator<Base>, const BamPair, std::input_iterator_tag, 63 const BamPairProxy 63 64 > 64 65 { … … 81 82 Base iter_; 82 83 Base end_; 83 BamPair x_;84 const BamRead* mate_; 84 85 boost::shared_ptr<std::map<std::string, BamRead> > siam_reads_; 85 86 typedef std::pair<int32_t, int32_t> Position; … … 87 88 friend class boost::iterator_core_access; 88 89 89 const BamPair &dereference(void) const;90 const BamPairProxy dereference(void) const; 90 91 bool equal(const BamPairIterator& other) const; 91 92 void increment(void); … … 143 144 144 145 template<typename Base> 145 const BamPair &146 const BamPairProxy 146 147 BamPairIterator<Base>::dereference(void) const 147 148 { 148 return x_;149 return BamPairProxy(mate_, &*iter_); 149 150 } 150 151 … … 189 190 for (; lower!=reads_->end() && lower->first == position; ++lower) 190 191 if (same_query_name(lower->second, *iter_)) { 191 x_.first() = lower->second; 192 x_.second() = *iter_; 192 mate_ = &lower->second; 193 193 return; 194 194 } … … 199 199 mate = siam_reads_->lower_bound(iter_->name()); 200 200 if (mate!=siam_reads_->end() && same_query_name(mate->second, *iter_)) { 201 x_.first() = mate->second; 202 x_.second() = *iter_; 201 mate_ = &mate->second; 203 202 return; 204 203 }
Note: See TracChangeset
for help on using the changeset viewer.