Ignore:
Timestamp:
Jul 16, 2008, 9:32:20 PM (13 years ago)
Author:
Peter
Message:

add WeightIterator? - fixes #369

File:
1 copied

Legend:

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

    r1375 r1376  
    1 #ifndef _theplu_yat_utility_data_iterator_
    2 #define _theplu_yat_utility_data_iterator_
     1#ifndef _theplu_yat_utility_weight_iterator_
     2#define _theplu_yat_utility_weight_iterator_
    33
    44// $Id$
     
    3636  */
    3737  template<typename Base>
    38   class DataIterator
     38  class WeightIterator
    3939    : public boost::iterator_adaptor<
    40     DataIterator<Base>               // Derived
     40    WeightIterator<Base>               // Derived
    4141    , Base                          // Base
    42     , boost::remove_reference<typename iterator_traits<Base>::data_reference>
     42    , boost::remove_reference<typename iterator_traits<Base>::weight_reference>
    4343    , boost::forward_traversal_tag    // CategoryOrTraversal
    44     , typename iterator_traits<Base>::data_reference // Reference
     44    , typename iterator_traits<Base>::weight_reference // Reference
    4545    >
    4646
     
    5050       \brief Constructor from \a Base iterator
    5151     */
    52     explicit DataIterator(Base b)
    53       : DataIterator::iterator_adaptor_(b) {}
     52    explicit WeightIterator(Base b)
     53      : WeightIterator::iterator_adaptor_(b) {}
    5454
    5555    /**
     
    5858       \return data
    5959     */
    60     typename iterator_traits<Base>::data_reference operator*(void) const
    61     { return iterator_traits<Base>().data(this->base()); }
     60    typename iterator_traits<Base>::weight_reference operator*(void) const
     61    { return iterator_traits<Base>().weight(this->base()); }
    6262
    6363  private:
     
    7070   */
    7171  template<typename Base>
    72   DataIterator<Base> make_data_iterator(Base base)
     72  WeightIterator<Base> make_weight_iterator(Base base)
    7373  {
    74     return DataIterator<Base>(base);
     74    return WeightIterator<Base>(base);
    7575  }
    7676 
Note: See TracChangeset for help on using the changeset viewer.