Changeset 2886


Ignore:
Timestamp:
Dec 5, 2012, 4:43:35 AM (9 years ago)
Author:
Peter
Message:

fast swap for BamRead?

Location:
trunk/yat/omic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamRead.cc

    r2883 r2886  
    199199
    200200
     201  void BamRead::swap(BamRead& other)
     202  {
     203    std::swap(bam_, other.bam_);
     204  }
     205
     206
     207  void swap(BamRead& lhs, BamRead& rhs)
     208  {
     209    lhs.swap(rhs);
     210  }
     211
    201212  bool same_query_name(const BamRead& lhs, const BamRead& rhs)
    202213  {
  • trunk/yat/omic/BamRead.h

    r2884 r2886  
    217217     */
    218218    uint16_t flag(void) const;
     219
     220    /**
     221       Exchanging this read with \a other.
     222     */
     223    void swap(BamRead& other);
     224
    219225  private:
    220226    bam1_t* bam_;
     
    226232
    227233  /**
     234     Swap specialization for BamRead that is faster than generic
     235     std::swap as just swap a pointers.
     236
     237     \since New in yat 0.10
     238   */
     239  void swap(BamRead& lhs, BamRead& rhs);
     240
     241  /**
    228242     \return \c true if read is soft clipped, either left_soft_clipped
    229243     or right_soft_clipped.
Note: See TracChangeset for help on using the changeset viewer.