File binned_iterator.hpp

template<typename T>
class BinnedConstIterator
#include <binned_iterator.hpp>

An iterator that provides read-only access to the values of elements that are grouped into bins.

Template Parameters:

T – The type of the values

Public Types

typedef int difference_type

The type that is used to represent the difference between two iterators.

typedef const T value_type

The type of the elements, the iterator provides access to.

typedef const T *pointer

The type of a pointer to an element, the iterator provides access to.

typedef const T &reference

The type of a reference to an element, the iterator provides access to.

typedef std::random_access_iterator_tag iterator_category

The tag that specifies the capabilities of the iterator.

Public Functions

inline BinnedConstIterator(View<uint32>::const_iterator binIndexIterator, typename View<T>::const_iterator valueIterator)
Parameters:
  • binIndexIterator – An iterator to the bin indices of individual elements

  • valueIterator – An iterator to the values of individual bins

inline reference operator[](uint32 index) const

Returns the element at a specific index.

Parameters:

index – The index of the element to be returned

Returns:

The element at the given index

inline reference operator*() const

Returns the element, the iterator currently refers to.

Returns:

The element, the iterator currently refers to

inline BinnedConstIterator &operator++()

Returns an iterator to the next element.

Returns:

A reference to an iterator to the next element

inline BinnedConstIterator &operator++(int n)

Returns an iterator to the next element.

Returns:

A reference to an iterator to the next element

inline BinnedConstIterator &operator--()

Returns an iterator to the previous element.

Returns:

A reference to an iterator to the previous element

inline BinnedConstIterator &operator--(int n)

Returns an iterator to the previous element.

Returns:

A reference to an iterator to the previous element

inline bool operator!=(const BinnedConstIterator &rhs) const

Returns whether this iterator and another one refer to the same element.

Parameters:

rhs – A reference to another iterator

Returns:

True, if the iterators do not refer to the same element, false otherwise

inline bool operator==(const BinnedConstIterator &rhs) const

Returns whether this iterator and another one refer to the same element.

Parameters:

rhs – A reference to another iterator

Returns:

True, if the iterators refer to the same element, false otherwise

inline difference_type operator-(const BinnedConstIterator &rhs) const

Returns the difference between this iterator and another one.

Parameters:

rhs – A reference to another iterator

Returns:

The difference between the iterators

Private Members

View<uint32>::const_iterator binIndexIterator_
View<T>::const_iterator valueIterator_