13 template<
typename T>
class BufferRangeIterator;
37 : start_(
buffer + start_elem_index * elem_stride), size_(
size), elem_stride_(elem_stride)
43 return a.start_ ==
b.start_ &&
a.size_ ==
b.size_ &&
a.elem_stride_ ==
b.elem_stride_;
53 return start_ + index * elem_stride_;
66 return begin_iterator<Iterator>();
71 return end_iterator<Iterator>();
76 return begin_iterator<ConstIterator>();
81 return end_iterator<ConstIterator>();
85 template<
typename TIterator> constexpr TIterator begin_iterator()
const
87 if (elem_stride_ == 0) {
89 return TIterator(start_, 1);
92 return TIterator(start_, elem_stride_);
95 template<
typename TIterator> constexpr TIterator end_iterator()
const
97 if (elem_stride_ == 0) {
99 return TIterator(start_ + 1, 1);
102 return TIterator(start_ + size_ * elem_stride_, elem_stride_);
122 : current_(current), elem_stride_(elem_stride)
128 current_ += elem_stride_;
136 return copied_iterator;
141 return a.current_ !=
b.current_;
146 return a.current_ ==
b.current_;
std::input_iterator_tag iterator_category
constexpr BufferRangeIterator(T *current, int elem_stride=1)
constexpr BufferRangeIterator()=default
constexpr friend bool operator==(const BufferRangeIterator &a, const BufferRangeIterator &b)
constexpr friend bool operator!=(const BufferRangeIterator &a, const BufferRangeIterator &b)
std::ptrdiff_t difference_type
constexpr BufferRangeIterator operator++(int) const
constexpr T * operator*() const
constexpr BufferRangeIterator & operator++()
constexpr ConstIterator begin() const
constexpr T * operator[](int64_t index) const
constexpr BufferRange()=default
constexpr Iterator begin()
constexpr BufferRange(T *buffer, int64_t start_elem_index, int64_t size, int elem_stride=1)
constexpr int64_t size() const
constexpr friend bool operator==(const BufferRange &a, const BufferRange &b)
constexpr ConstIterator end() const
ccl_global float * buffer
static const pxr::TfToken b("b", pxr::TfToken::Immortal)