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

closes #784. New class BamPairProxy? to finalize implementation of BamPairIterator?.

File:
1 edited

Legend:

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

    r3175 r3176  
    7272  };
    7373
     74
     75  /**
     76     A proxy class that behaves like a const BamPair&.
     77
     78     The class is used in BamPairIterator. The class allows to create
     79     an object that looks like a const reference of BamPair from two
     80     BamRead pointers without copying the BamRead objects. As the
     81     class is aimed at looking like a const BamPair&, implicit
     82     conversion to BamPair is allowed to mimic: BamPair = const BamPair&.
     83   */
     84  class BamPairProxy
     85  {
     86  public:
     87    /**
     88       \brief Default constructor
     89    */
     90    BamPairProxy(void);
     91
     92    /**
     93       Create a proxy from \a first and \a second.
     94
     95       \note if the objects pointed to by \a first and \a second goes
     96       out of scope, this class becomes invalid and behaviour is
     97       undefined.
     98     */
     99    BamPairProxy(const BamRead* first, const BamRead* second);
     100
     101    /**
     102       \return const reference to first BamRead
     103     */
     104    const BamRead& first(void) const;
     105
     106    /**
     107       \return const reference to second BamRead
     108    */
     109    const BamRead& second(void) const;
     110
     111    /**
     112       Implicit conversion from BamPairProxy to BamPair.
     113     */
     114    operator BamPair() const;
     115  private:
     116    const BamRead* first_;
     117    const BamRead* second_;
     118  };
     119
    74120}}}
    75121#endif
Note: See TracChangeset for help on using the changeset viewer.