Changeset 1565 for trunk


Ignore:
Timestamp:
Oct 10, 2008, 11:49:07 PM (13 years ago)
Author:
Peter
Message:

removed Policy from Container2DIterator - refs #398

Location:
trunk/yat
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/KernelLookup.h

    r1552 r1565  
    8484    /// 'Read Only' iterator
    8585    typedef utility::StrideIterator<
    86     utility::Container2DIterator<const KernelLookup, double, void,const double> >
     86    utility::Container2DIterator<const KernelLookup, value_type,
     87                                 const_reference> >
    8788    const_iterator;
    8889
  • trunk/yat/classifier/MatrixLookup.h

    r1549 r1565  
    8787
    8888    /// 'Read Only' iterator
    89     typedef utility::Container2DIterator<const MatrixLookup, double,
    90                                          void, const double>
     89    typedef utility::Container2DIterator<const MatrixLookup, value_type,
     90                                         const_reference>
    9191    const_iterator;
    9292
  • trunk/yat/classifier/MatrixLookupWeighted.h

    r1552 r1565  
    8989    typedef utility::StrideIterator<
    9090    utility::Container2DIterator<const MatrixLookupWeighted,
    91                                  value_type, void, 
    92                                  const_reference,
    93              utility::IteratorPolicyWeighted<const MatrixLookupWeighted,
    94                                              const double,
    95                                              const double> > >
     91                                 value_type, const_reference> >
    9692    const_iterator;
    9793
  • trunk/yat/utility/Container2DIterator.h

    r1564 r1565  
    2424*/
    2525
    26 #include "IteratorPolicy.h"
     26#include "deprecate.h"
     27#include "iterator_traits.h"
    2728#include "yat_assert.h"
    2829
     
    4142     @brief Iterator
    4243  */
    43   template<typename Container, typename value,
    44            typename pointer = value*, typename reference = value&,
    45            class Policy = IteratorPolicy<Container, reference, value> >
     44  template<typename Container, typename value, typename reference = value&>
    4645  class Container2DIterator
    4746    : public boost::iterator_facade<
    48     Container2DIterator<Container, value, pointer, reference, Policy>
     47    Container2DIterator<Container, value, reference>
    4948    , value
    5049    , std::random_access_iterator_tag
    5150    , reference>
    5251  {
    53   public:
    54     /**
    55        Tells whether iterator is weighted or not.
    56 
    57        \see weighted_iterator_tag and unweighted_iterator_tag
    58      */
    59     typedef typename Policy::weighted_iterator_type weighted_iterator_type;
    60 
    6152  private:
    62     typedef Container2DIterator<Container, value, pointer,reference,Policy> self;
     53    typedef Container2DIterator<Container, value, reference> self;
    6354
    6455  public:
     
    7869      : container_(&container), index_(row*container.columns()+column) {}
    7970
    80     /**
    81        \return data
    82     */
    83     typename Policy::data_type data(void) const
    84     { yat_assert<std::out_of_range>(index_<this->size(),
    85                                     "Container2DIterator::data");
    86       return ip_.data(*container_, row(index_), column(index_));
    87     }
    88 
    89     /**
    90        \return weight
    91     */
    92     typename Policy::weight_type weight(void) const
    93     { yat_assert<std::out_of_range>(index_<this->size(),
    94                                     "Container2DIterator::weight");
    95       return ip_.weight(*container_, row(index_), column(index_));
    96     }
    97 
    9871  private:
    9972    friend class boost::iterator_core_access;
     
    10174    Container* container_;
    10275    size_t index_;
    103     Policy ip_;
    10476
    10577    void advance(int n) { index_+=n; }
  • trunk/yat/utility/iterator_traits.h

    r1563 r1565  
    298298     that have an underlying iterator (e.g. StrideIterator), this
    299299     class should be specialized, so the class also works when the
    300      underlying is an iterator that is not overed by this class
     300     underlying is an iterator that is not covered by this class
    301301     e.g. WeightedIterator.
    302302   */
Note: See TracChangeset for help on using the changeset viewer.