Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class template strided_iterator

boost::compute::strided_iterator — An iterator adaptor with adjustable iteration step.

Synopsis

// In header: <boost/compute/iterator/strided_iterator.hpp>

template<typename Iterator> 
class strided_iterator {
public:
  // types
  typedef unspecified                 super_type;     
  typedef super_type::value_type      value_type;     
  typedef super_type::reference       reference;      
  typedef super_type::base_type       base_type;      
  typedef super_type::difference_type difference_type;

  // construct/copy/destruct
  strided_iterator(Iterator, difference_type);
  strided_iterator(const strided_iterator< Iterator > &);
  strided_iterator< Iterator > & 
  operator=(const strided_iterator< Iterator > &);
  ~strided_iterator();

  // public member functions
  size_t get_index() const;
  const buffer & get_buffer() const;
  template<typename IndexExpression> 
    unspecified operator[](const IndexExpression &) const;

  // private member functions
  reference dereference() const;
  bool equal(const strided_iterator< Iterator > &) const;
  void increment();
  void decrement();
  void advance(typename super_type::difference_type);
  difference_type distance_to(const strided_iterator< Iterator > &) const;
};

Description

The strided iterator adaptor skips over multiple elements each time it is incremented or decremented.

See Also:

buffer_iterator, make_strided_iterator(), make_strided_iterator_end()

strided_iterator public construct/copy/destruct

  1. strided_iterator(Iterator iterator, difference_type stride);
  2. strided_iterator(const strided_iterator< Iterator > & other);
  3. strided_iterator< Iterator > & 
    operator=(const strided_iterator< Iterator > & other);
  4. ~strided_iterator();

strided_iterator public member functions

  1. size_t get_index() const;
  2. const buffer & get_buffer() const;
  3. template<typename IndexExpression> 
      unspecified operator[](const IndexExpression & expr) const;

strided_iterator private member functions

  1. reference dereference() const;
  2. bool equal(const strided_iterator< Iterator > & other) const;
  3. void increment();
  4. void decrement();
  5. void advance(typename super_type::difference_type n);
  6. difference_type distance_to(const strided_iterator< Iterator > & other) const;

PrevUpHomeNext