Ignore:
Timestamp:
Sep 27, 2008, 6:27:55 AM (13 years ago)
Author:
Peter
Message:

refs #368 - added several tests. Left now is to add specializations for trait classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/WeightedIterator.h

    r1537 r1538  
    4141    : public boost::iterator_facade<
    4242    WeightedIterator<DataIterator, WeightIterator>,
    43     DataWeight,
     43    DataWeightProxy<DataIterator, WeightIterator>,
    4444    typename std::iterator_traits<DataIterator>::iterator_category,
    4545    DataWeightProxy<DataIterator, WeightIterator> >
     
    4747  {
    4848  public:
     49    /**
     50       \brief DataIterator
     51     */
     52    typedef DataIterator data_iterator_type;
     53
     54    /**
     55       \brief DataIterator
     56     */
     57    typedef WeightIterator weight_iterator_type;
     58
    4959    /**
    5060       \brief Constructor
     
    5464    {}
    5565   
     66    /**
     67       \return const reference to underlying data iterator
     68     */
     69    const DataIterator& data_base(void) const { return d_iter_; }
     70
     71    /**
     72       \return const reference to underlying weight iterator
     73     */
     74    const WeightIterator& weight_base(void) const { return w_iter_; }
    5675
    5776    /**
     
    7392       to const_iterator.
    7493     */
    75     /*
    7694    template<typename D2, typename W2>
    7795    WeightedIterator(WeightedIterator<D2, W2> other,
    7896            typename boost::enable_if_convertible<D2,DataIterator>::type* = 0,
    7997            typename boost::enable_if_convertible<W2,WeightIterator>::type* = 0)
    80     {}
    81     */
     98      : d_iter_(other.data_base()), w_iter_(other.weight_base()) {}
     99
    82100
    83101  private:
     
    98116    utility::DataWeightProxy<DataIterator, WeightIterator>
    99117    dereference(void) const
    100     {
    101       return DataWeightProxy<DataIterator, WeightIterator>(d_iter_,
     118    { return DataWeightProxy<DataIterator, WeightIterator>(d_iter_,
    102119                                                           w_iter_);
    103120    }
Note: See TracChangeset for help on using the changeset viewer.