VPTissue Reference Manual
|
Implementation of iterator for SegmentedVector. More...
#include <SVIterator.h>
Public Types | |
using | self_type = SVIterator< T, N, P, R, is_const_iterator > |
Public Member Functions | |
SVIterator () | |
Default constructor. | |
SVIterator (const self_type &other) | |
Copy constructor. | |
bool | operator!= (const self_type &other) const |
Iterator inequality. | |
R | operator* () const |
Element access. | |
self_type | operator+ (std::ptrdiff_t n) |
Return iterator pointing to n-th next element. | |
self_type & | operator++ () |
Pre-increment (returns position after increment) | |
self_type | operator++ (int) |
Post-increment (returns position prior to increment) | |
self_type & | operator+= (std::ptrdiff_t n) |
Set iterator to n-th next element. | |
self_type | operator- (std::ptrdiff_t) |
Return iterator pointing to n-th previous element. | |
long int | operator- (const self_type &other) const |
Return distance between iterators. | |
self_type & | operator-- () |
Pre-decrement (returns position after decrement) | |
self_type | operator-- (int) |
Pre-increment (returns position after decrement) | |
self_type & | operator-= (std::ptrdiff_t n) |
Set iterator to n-th previous element. | |
P | operator-> () const |
Member of element access. | |
bool | operator< (const self_type &other) const |
Returns whether iterator is before other. | |
bool | operator<= (const self_type &other) const |
Returns whether iterator is not after other. | |
bool | operator== (const self_type &other) const |
Iterator equality. | |
bool | operator> (const self_type &other) const |
Returns whether iterator is after other. | |
bool | operator>= (const self_type &other) const |
Returns whether iterator is not after other. | |
R | operator[] (std::size_t n) const |
Direct access to n-th element. | |
Friends | |
class | SegmentedVector< T, N > |
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 == m_end. 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_end. 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 62 of file SVIterator.h.