Ignore:
Timestamp:
Mar 15, 2014, 9:15:51 AM (8 years ago)
Author:
Peter
Message:

new class BamPair?. refs #784

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamPairIterator.h

    r3174 r3175  
    2525#include <iostream>
    2626
     27#include "BamPair.h"
    2728#include "BamRead.h"
    2829
     
    5960  class BamPairIterator
    6061    : public boost::iterator_facade<
    61     BamPairIterator<Base>, const std::pair<BamRead, BamRead>,
    62     std::input_iterator_tag
     62    BamPairIterator<Base>, const BamPair, std::input_iterator_tag
    6363    >
    6464  {
     
    8181    Base iter_;
    8282    Base end_;
    83     std::pair<BamRead, BamRead> x_;
     83    BamPair x_;
    8484    boost::shared_ptr<std::map<std::string, BamRead> > siam_reads_;
    8585    typedef std::pair<int32_t, int32_t> Position;
     
    8787    friend class boost::iterator_core_access;
    8888
    89     const std::pair<BamRead, BamRead>& dereference(void) const;
     89    const BamPair& dereference(void) const;
    9090    bool equal(const BamPairIterator& other) const;
    9191    void increment(void);
     
    143143
    144144  template<typename Base>
    145   const std::pair<BamRead, BamRead>&
     145  const BamPair&
    146146  BamPairIterator<Base>::dereference(void) const
    147147  {
     
    189189        for (; lower!=reads_->end() && lower->first == position; ++lower)
    190190          if (same_query_name(lower->second, *iter_)) {
    191             x_.first = lower->second;
    192             x_.second = *iter_;
     191            x_.first() = lower->second;
     192            x_.second() = *iter_;
    193193            return;
    194194          }
     
    199199          mate = siam_reads_->lower_bound(iter_->name());
    200200        if (mate!=siam_reads_->end() && same_query_name(mate->second, *iter_)) {
    201           x_.first = mate->second;
    202           x_.second = *iter_;
     201          x_.first() = mate->second;
     202          x_.second() = *iter_;
    203203          return;
    204204        }
Note: See TracChangeset for help on using the changeset viewer.