Bolt  1.3
C++ template library with support for OpenCL
Classes | Public Types | Public Member Functions | Public Attributes | Friends | List of all members
bolt::cl::device_vector< T >::iterator_base< Container > Class Template Reference

Base class provided to encapsulate all the common functionality for constant and non-constant iterators. More...

#include <device_vector.h>

Inheritance diagram for bolt::cl::device_vector< T >::iterator_base< Container >:

Classes

struct  Payload
 

Public Types

typedef boost::iterator_facade
< iterator_base< Container >
, value_type,
device_vector_tag, typename
device_vector::reference, int >
::difference_type 
difference_type
 

Public Member Functions

 iterator_base (Container &rhs, difference_type index)
 
template<typename OtherContainer >
 iterator_base (const iterator_base< OtherContainer > &rhs)
 
 iterator_base (value_type *ptr)
 
iterator_base< Container > & operator= (const iterator_base< Container > &rhs)
 
iterator_base< Container > & base ()
 
const iterator_base< Container > & base () const
 
iterator_base< Container > & operator+= (const difference_type &n)
 
iterator_base< Container > & operator= (const difference_type &n)
 
const iterator_base< Container > operator+ (const difference_type &n) const
 
Container & getContainer () const
 
int setKernelBuffers (int arg_num,::cl::Kernel &kernel) const
 
const Payload gpuPayload () const
 
const difference_type gpuPayloadSize () const
 
difference_type distance_to (const iterator_base< Container > &rhs) const
 

Public Attributes

difference_type m_Index
 

Friends

class boost::iterator_core_access
 
class device_vector< value_type >
 
template<typename >
class iterator_base
 

Detailed Description

template<typename T>
template<typename Container>
class bolt::cl::device_vector< T >::iterator_base< Container >

Base class provided to encapsulate all the common functionality for constant and non-constant iterators.

See Also
http://www.sgi.com/tech/stl/Iterators.html
http://www.sgi.com/tech/stl/RandomAccessIterator.html
Bug:
operator[] with device_vector iterators result in a compile-time error when accessed for reading. Writing with operator[] appears to be OK. Workarounds: either use the operator[] on the device_vector container, or use iterator arithmetic instead, such as *(iter + 5) for reading from the iterator.
Note
The difference_type for this iterator has been explicitely set to a 32-bit int, because m_Index is used in clSetKernelArg(), which does not accept size_t parameters

The documentation for this class was generated from the following file: