Stride Reference Manual
- generated for commit 9643b11
|
Implementation of iterator for SegmentedVector. More...
#include <SVIterator.h>
Public Types | |
using | iterator_category = std::random_access_iterator_tag |
using | value_type = T |
using | difference_type = std::ptrdiff_t |
using | pointer = P |
using | reference = R |
using | self_type = SVIterator< T, N, Safe, P, R, is_const_iterator > |
Public Member Functions | |
SVIterator () | |
Default constructor. More... | |
SVIterator (const self_type &other) | |
Copy constructor. More... | |
R | operator* () const |
Element access. More... | |
P | operator-> () const |
Member of element access. More... | |
self_type & | operator++ () |
Pre-increment (returns position after increment) More... | |
const self_type | operator++ (int) |
Post-increment (returns position prior to increment) More... | |
self_type & | operator-- () |
Pre-decrement (returns position after decrement) More... | |
const self_type | operator-- (int) |
Pre-increment (returns position after decrement) More... | |
bool | operator== (const self_type &other) const |
Iterator equality. More... | |
bool | operator!= (const self_type &other) const |
Iterator inequality. More... | |
R | operator[] (std::size_t n) const |
Direct access to n-th element. More... | |
self_type & | operator+= (std::ptrdiff_t n) |
Set iterator to n-th next element. More... | |
self_type & | operator-= (std::ptrdiff_t n) |
Set iterator to n-th previous element. More... | |
self_type | operator+ (std::ptrdiff_t n) |
Return iterator pointing to n-th next element. More... | |
self_type | operator- (std::ptrdiff_t n) |
Return iterator pointing to n-th previous element. More... | |
long int | operator- (const self_type &other) const |
Return distance between iterators. More... | |
bool | operator< (const self_type &other) const |
Returns whether iterator is before other. More... | |
bool | operator<= (const self_type &other) const |
Returns whether iterator is not after other. More... | |
bool | operator> (const self_type &other) const |
Returns whether iterator is after other. More... | |
bool | operator>= (const self_type &other) const |
Returns whether iterator is not after other. More... | |
Private Types | |
using | container_pointer_type = typename std::conditional< is_const_iterator, const SegmentedVector< T, N, Safe > *, SegmentedVector< T, N, Safe > * >::type |
Type of pointer-to-container (i.e. its const qualification). More... | |
Private Member Functions | |
SVIterator (std::size_t p, container_pointer_type c) | |
Private constructor, currently only container itself can create iterators. More... | |
Private Attributes | |
std::size_t | m_p |
Current iterator position in the container. More... | |
container_pointer_type | m_c |
Container that the iterator points into. More... | |
Friends | |
class | SegmentedVector< T, N, Safe > |
Implementation of iterator for SegmentedVector.
It will provide both const and non-const iterators.
Possible states for the iterator are: (a) Default constructed: m_c == nullptr && m_p == 0. This is the singular state in which the iterator can be assigned, but not incremented or compared. (b) Past-the-end: m_c != nullptr && m_p == m_c->size(). The iterator cannot be dereferenced. (c) Dereferencable: m_c != nullptr && m_p < mc->size(). Notice that m_p is of type size_t and hence always non-negative. Thus the above reuires !m_c->empty().
Template parameters: T value type of iterator and of its container. N block size of its container P pointer-to-T type (can be const qualified). R reference-to-T type (can be const qualified). is_const_iterator to make it a const_iterator
Definition at line 57 of file SVIterator.h.
using stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::iterator_category = std::random_access_iterator_tag |
Definition at line 61 of file SVIterator.h.
using stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::value_type = T |
Definition at line 62 of file SVIterator.h.
using stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::difference_type = std::ptrdiff_t |
Definition at line 63 of file SVIterator.h.
using stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::pointer = P |
Definition at line 64 of file SVIterator.h.
using stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::reference = R |
Definition at line 65 of file SVIterator.h.
using stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::self_type = SVIterator<T, N, Safe, P, R, is_const_iterator> |
Definition at line 73 of file SVIterator.h.
|
private |
Type of pointer-to-container (i.e. its const qualification).
Definition at line 237 of file SVIterator.h.
|
inline |
Default constructor.
Definition at line 79 of file SVIterator.h.
|
inline |
Copy constructor.
Definition at line 82 of file SVIterator.h.
|
inlineprivate |
Private constructor, currently only container itself can create iterators.
Definition at line 241 of file SVIterator.h.
|
inline |
Element access.
Definition at line 89 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Member of element access.
Definition at line 97 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Pre-increment (returns position after increment)
Definition at line 104 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
Referenced by stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator++().
|
inline |
Post-increment (returns position prior to increment)
Definition at line 114 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator++().
|
inline |
Pre-decrement (returns position after decrement)
Definition at line 122 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
Referenced by stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator--().
|
inline |
Pre-increment (returns position after decrement)
Definition at line 132 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator--().
|
inline |
Iterator equality.
Definition at line 140 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Iterator inequality.
Definition at line 143 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Direct access to n-th element.
Definition at line 150 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Set iterator to n-th next element.
Definition at line 157 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Set iterator to n-th previous element.
Definition at line 166 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Return iterator pointing to n-th next element.
Definition at line 176 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Return iterator pointing to n-th previous element.
Definition at line 184 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Return distance between iterators.
Definition at line 192 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Returns whether iterator is before other.
Definition at line 200 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Returns whether iterator is not after other.
Definition at line 208 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Returns whether iterator is after other.
Definition at line 216 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
inline |
Returns whether iterator is not after other.
Definition at line 224 of file SVIterator.h.
References stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_c, and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::m_p.
|
friend |
Definition at line 232 of file SVIterator.h.
|
private |
Current iterator position in the container.
Definition at line 244 of file SVIterator.h.
Referenced by stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator!=(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator*(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator+(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator++(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator+=(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator-(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator--(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator-=(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator->(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator<(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator<=(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator==(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator>(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator>=(), and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator[]().
|
private |
Container that the iterator points into.
Definition at line 245 of file SVIterator.h.
Referenced by stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator!=(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator*(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator+(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator++(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator+=(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator-(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator--(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator-=(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator->(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator<(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator<=(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator==(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator>(), stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator>=(), and stride::util::SVIterator< T, N, Safe, P, R, is_const_iterator >::operator[]().