Monado OpenXR Runtime
|
Class template for iterator for HistoryBuffer. More...
Public Types | |
using | Self = HistoryBufIterator< T, MaxSize > |
using | container_type = HistoryBuffer< T, MaxSize > |
using | value_type = T |
using | pointer = T * |
using | reference = T & |
![]() | |
using | iterator_category = std::random_access_iterator_tag |
using | difference_type = std::ptrdiff_t |
using | const_iterator_base = std::conditional_t< std::is_const< const RingBufferHelper >::value, RandomAccessIteratorBase, RandomAccessIteratorBase< std::add_const_t< const RingBufferHelper > > > |
Public Member Functions | |
HistoryBufIterator ()=default | |
Default-construct an (invalid) iterator. More... | |
HistoryBufIterator (HistoryBufIterator const &)=default | |
HistoryBufIterator (HistoryBufIterator &&) noexcept=default | |
HistoryBufIterator & | operator= (HistoryBufIterator const &)=default |
HistoryBufIterator & | operator= (HistoryBufIterator &&) noexcept=default |
bool | valid () const noexcept |
Is this iterator valid? More... | |
operator bool () const noexcept | |
Is this iterator valid? More... | |
container_type * | container () const noexcept |
Get the associated container: for internal use. More... | |
reference | operator* () const |
Dereference operator: throws std::out_of_range if invalid. More... | |
pointer | operator-> () const noexcept |
Smart pointer operator: returns nullptr if invalid. More... | |
Self & | operator++ () |
Pre-increment: Advance, then return self. More... | |
Self | operator++ (int) |
Post-increment: return a copy of initial state after incrementing self. More... | |
Self & | operator-- () |
Pre-decrement: Subtract, then return self. More... | |
Self | operator-- (int) |
Post-decrement: return a copy of initial state after decrementing self. More... | |
Self & | operator+= (std::ptrdiff_t n) noexcept |
Increment by an arbitrary amount. More... | |
Self & | operator-= (std::ptrdiff_t n) noexcept |
Decrement by an arbitrary amount. More... | |
Self | operator+ (std::ptrdiff_t n) const noexcept |
Increment a copy of the iterator by an arbitrary amount. More... | |
Self | operator- (std::ptrdiff_t n) const noexcept |
Decrement a copy of the iterator by an arbitrary amount. More... | |
![]() | |
bool | valid () const noexcept |
Is this iterator valid? More... | |
operator bool () const noexcept | |
Is this iterator valid? More... | |
size_t | index () const noexcept |
What is the index stored by this iterator? More... | |
bool | is_past_the_end () const noexcept |
Is this iterator pointing "past the end" of the container? More... | |
bool | is_cleared () const noexcept |
True if this iterator is "irrecoverably" invalid (that is, cleared or default constructed). More... | |
std::ptrdiff_t | operator- (const RandomAccessIteratorBase< const RingBufferHelper > &other) const |
Compute the difference between two iterators. More... | |
RandomAccessIteratorBase | operator- (std::ptrdiff_t n) const |
Subtract some arbitrary amount from a copy of this iterator. More... | |
RandomAccessIteratorBase & | operator+= (std::ptrdiff_t n) |
Increment by an arbitrary value. More... | |
RandomAccessIteratorBase & | operator-= (std::ptrdiff_t n) |
Decrement by an arbitrary value. More... | |
RandomAccessIteratorBase | operator+ (std::ptrdiff_t n) const |
Add some arbitrary amount to a copy of this iterator. More... | |
RandomAccessIteratorBase ()=default | |
Default constructor - initializes to "cleared" (that is, irrecoverably invalid - because we have no reference to a container) More... | |
RandomAccessIteratorBase (const RingBufferHelper &container, size_t index) | |
Constructor from a helper/container and index. More... | |
const_iterator_base | as_const () const |
Get a const iterator base pointing to the same element as this element. More... | |
Friends | |
class | HistoryBuffer< T, MaxSize > |
Additional Inherited Members | |
![]() | |
static RandomAccessIteratorBase | begin (const RingBufferHelper &container) |
Factory function: construct the "begin" iterator. More... | |
static RandomAccessIteratorBase | end (const RingBufferHelper &container) |
Factory function: construct the "past the end" iterator that can be decremented safely. More... | |
![]() | |
RandomAccessIteratorBase (const RingBufferHelper *container, size_t index) | |
for internal use More... | |
void | increment_n (std::size_t n) |
Increment an arbitrary amount. More... | |
void | decrement_n (std::size_t n) |
Decrement an arbitrary amount. More... | |
const RingBufferHelper * | container () const noexcept |
Get the associated container or helper. More... | |
![]() | |
static bool | operator== (RandomAccessIteratorBase< const RingBufferHelper > const &lhs, RandomAccessIteratorBase< const RingBufferHelper > const &rhs) noexcept |
Equality comparison operator for RandomAccessIteratorBase. More... | |
static bool | operator!= (RandomAccessIteratorBase< const RingBufferHelper > const &lhs, RandomAccessIteratorBase< const RingBufferHelper > const &rhs) noexcept |
Inequality comparison operator for RandomAccessIteratorBase. More... | |
Class template for iterator for HistoryBuffer.
T | Container element type - must match HistoryBuffer |
MaxSize | Maximum number of elements - must match HistoryBuffer |
|
default |
Default-construct an (invalid) iterator.
|
inlinenoexcept |
Get the associated container: for internal use.
|
inlineexplicitnoexcept |
Is this iterator valid?
References xrt::auxiliary::util::detail::HistoryBufIterator< T, MaxSize >::valid().
|
inline |
Dereference operator: throws std::out_of_range if invalid.
|
inlinenoexcept |
Increment a copy of the iterator by an arbitrary amount.
|
inline |
Pre-increment: Advance, then return self.
|
inline |
Post-increment: return a copy of initial state after incrementing self.
References xrt::auxiliary::util::RandomAccessIteratorBase< const RingBufferHelper >::increment_n().
|
inlinenoexcept |
Increment by an arbitrary amount.
|
inlinenoexcept |
Decrement a copy of the iterator by an arbitrary amount.
|
inline |
Pre-decrement: Subtract, then return self.
|
inline |
Post-decrement: return a copy of initial state after decrementing self.
References xrt::auxiliary::util::RandomAccessIteratorBase< const RingBufferHelper >::decrement_n().
|
inlinenoexcept |
Decrement by an arbitrary amount.
|
inlinenoexcept |
Smart pointer operator: returns nullptr if invalid.
|
inlinenoexcept |
Is this iterator valid?
References xrt::auxiliary::util::RandomAccessIteratorBase< const RingBufferHelper >::valid().
Referenced by xrt::auxiliary::util::detail::HistoryBufIterator< T, MaxSize >::operator bool().