Gobelijn API documentation
- generated for commit a0cbea7
|
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. 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... | |
self_type | operator++ (int) |
Post-increment (returns position prior to increment) More... | |
self_type & | operator-- () |
Pre-decrement (returns position after decrement) More... | |
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) |
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 > *, SegmentedVector< T, N > * >::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... | |
bool | IsDefaultContructed () |
See class description. More... | |
bool | IsPastTheEnd () |
See class description. More... | |
bool | IsDereferencable () |
See class description. More... | |
Private Attributes | |
std::size_t | m_p |
Current iterator position in the container. More... | |
container_pointer_type | m_c |
Static Private Attributes | |
static constexpr std::size_t | m_end = std::numeric_limits<size_t>::max() |
One past the last element iterator position. More... | |
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 55 of file SVIterator.h.
using UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::self_type = SVIterator<T, N, P, R, is_const_iterator> |
Definition at line 63 of file SVIterator.h.
|
private |
Type of pointer-to-container (i.e. its const qualification).
Definition at line 207 of file SVIterator.h.
|
inline |
Default constructor.
Definition at line 69 of file SVIterator.h.
|
inline |
Copy constructor.
Definition at line 72 of file SVIterator.h.
|
inlineprivate |
Private constructor, currently only container itself can create iterators.
Definition at line 214 of file SVIterator.h.
|
inline |
Element access.
Definition at line 79 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Member of element access.
Definition at line 88 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Pre-increment (returns position after increment)
Definition at line 97 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_end, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
Referenced by UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator++().
|
inline |
Post-increment (returns position prior to increment)
Definition at line 109 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator++().
|
inline |
Pre-decrement (returns position after decrement)
Definition at line 117 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_end, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
Referenced by UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator--().
|
inline |
Pre-increment (returns position after decrement)
Definition at line 129 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator--().
|
inline |
Iterator equality.
Definition at line 137 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Iterator inequality.
Definition at line 140 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Direct access to n-th element.
Definition at line 147 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_end, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Set iterator to n-th next element.
Definition at line 156 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_end, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Set iterator to n-th previous element.
Definition at line 165 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_end, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Return iterator pointing to n-th next element.
Definition at line 174 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
self_type UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator- | ( | std::ptrdiff_t | ) |
Return iterator pointing to n-th previous element.
|
inline |
Return distance between iterators.
Definition at line 180 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Returns whether iterator is before other.
Definition at line 183 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Returns whether iterator is not after other.
Definition at line 186 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Returns whether iterator is after other.
Definition at line 189 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inline |
Returns whether iterator is not after other.
Definition at line 192 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inlineprivate |
See class description.
Definition at line 217 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_end, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inlineprivate |
See class description.
Definition at line 220 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_end, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
inlineprivate |
See class description.
Definition at line 223 of file SVIterator.h.
References UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_c, and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::m_p.
|
friend |
Definition at line 195 of file SVIterator.h.
|
private |
Current iterator position in the container.
Definition at line 199 of file SVIterator.h.
Referenced by UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::IsDefaultContructed(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::IsDereferencable(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::IsPastTheEnd(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator!=(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator*(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator+(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator++(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator+=(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator-(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator--(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator-=(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator->(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator<(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator<=(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator==(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator>(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator>=(), and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator[]().
|
staticprivate |
One past the last element iterator position.
Definition at line 202 of file SVIterator.h.
Referenced by UA_CoMP::Container::SegmentedVector< T, N >::cend(), UA_CoMP::Container::SegmentedVector< T, N >::end(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::IsDefaultContructed(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::IsPastTheEnd(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator++(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator+=(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator--(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator-=(), and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator[]().
|
private |
Definition at line 210 of file SVIterator.h.
Referenced by UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::IsDefaultContructed(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::IsDereferencable(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::IsPastTheEnd(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator!=(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator*(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator+(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator++(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator+=(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator--(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator->(), UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator==(), and UA_CoMP::Container::SVIterator< T, N, P, R, is_const_iterator >::operator[]().