| Home | Libraries | People | FAQ | More

## Class template constant_buffer_iterator

boost::compute::constant_buffer_iterator — An iterator for a buffer in the `constant` memory space.

## Synopsis

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

    template<typename T>
    class constant_buffer_iterator {
    public:
      // types
      typedef unspecified                 super_type;
      typedef super_type::reference       reference;
      typedef super_type::difference_type difference_type;

      // public member functions
      constant_buffer_iterator();
      constant_buffer_iterator(const buffer &, size_t);
      constant_buffer_iterator(const constant_buffer_iterator< T > &);
      constant_buffer_iterator< T > &
      operator=(const constant_buffer_iterator< T > &);
      ~constant_buffer_iterator();
      const buffer & get_buffer() const;
      size_t get_index() const;
      T read(command_queue &) const;
      void write(const T &, command_queue &);
      template<typename Expr> unspecified operator[](const Expr &) const;

      // private member functions
      reference dereference() const;
      bool equal(const constant_buffer_iterator< T > &) const;
      void increment();
      void decrement();
      void advance(difference_type);
      difference_type distance_to(const constant_buffer_iterator< T > &) const;
    };

## Description

The constant_buffer_iterator class provides an iterator for values in a buffer in the `constant` memory space.

For iterating over values in the `global` memory space (the most common case), use the buffer_iterator class.

See Also: buffer_iterator

### `constant_buffer_iterator` public member functions

1.     constant_buffer_iterator();

2.     constant_buffer_iterator(const buffer & buffer, size_t index);

3.     constant_buffer_iterator(const constant_buffer_iterator< T > & other);

4.     constant_buffer_iterator< T > &
       operator=(const constant_buffer_iterator< T > & other);

5.     ~constant_buffer_iterator();

6.     const buffer & get_buffer() const;

7.     size_t get_index() const;

8.     T read(command_queue & queue) const;

9.     void write(const T & value, command_queue & queue);

10.     template<typename Expr> unspecified operator[](const Expr & expr) const;

### `constant_buffer_iterator` private member functions

1.     reference dereference() const;

2.     bool equal(const constant_buffer_iterator< T > & other) const;

3.     void increment();

4.     void decrement();

5.     void advance(difference_type n);

6.     difference_type distance_to(const constant_buffer_iterator< T > & other) const;