Lunchbox
1.17.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
|
Counter-based, as opposed to pointer-based, iterator for any container. More...
#include <indexIterator.h>
Public Member Functions | |
IndexIterator (C *container, const size_t i) | |
Construct an iterator for a given container and position. More... | |
IndexIterator (const S &from) | |
Copy-construct an iterator. More... | |
template<class U , class V , class W > | |
IndexIterator (const IndexIterator< U, V, W > &from) | |
Copy-construct an iterator. More... | |
S & | operator= (const IndexIterator &rhs) |
Assign the container and position from another iterator. More... | |
template<class U , class W > | |
S & | operator= (const IndexIterator< S, U, W > &rhs) |
Assign the container and position from another iterator. More... | |
S & | operator++ () |
Increment the iterator position. More... | |
S & | operator-- () |
Decrement the iterator position. More... | |
S | operator++ (int) |
Increment the iterator position. More... | |
S | operator-- (int) |
Decrement the iterator position. More... | |
S | operator+ (const size_t &n) const |
Increment the iterator position by a given amount. More... | |
S & | operator+= (const size_t &n) |
Increment the iterator position by a given amount. More... | |
S | operator- (const size_t &n) const |
Decrement the iterator position by a given amount. More... | |
S & | operator-= (const size_t &n) |
Decrement the iterator position by a given amount. More... | |
ssize_t | operator- (const S &n) const |
Compute the distance between this and another iterator. More... | |
bool | operator== (const S &rhs) const |
bool | operator!= (const S &rhs) const |
bool | operator< (const S &rhs) const |
bool | operator> (const S &rhs) const |
bool | operator<= (const S &rhs) const |
bool | operator>= (const S &rhs) const |
size_t | getPosition () const |
Protected Attributes | |
C * | container_ |
size_t | i_ |
Friends | |
template<class , class , class > | |
class | IndexIterator |
Counter-based, as opposed to pointer-based, iterator for any container.
Uses curiously recurring template pattern to return proper type from assignment and other operators. Access methods are to be implemented by a subclass using container_ and i_. Furthermore subclasses need to implement the necessary constructors (see LFVectorIterator for example).
S | CRTP Subclass type |
C | The container type |
T | The element type |
Definition at line 38 of file indexIterator.h.
|
inline |
Construct an iterator for a given container and position.
Definition at line 42 of file indexIterator.h.
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
Definition at line 126 of file indexIterator.h.
|
inline |
Increment the iterator position by a given amount.
Definition at line 100 of file indexIterator.h.
|
inline |
|
inline |
|
inline |
Increment the iterator position by a given amount.
Definition at line 102 of file indexIterator.h.
|
inline |
Decrement the iterator position by a given amount.
Definition at line 109 of file indexIterator.h.
|
inline |
Compute the distance between this and another iterator.
Definition at line 118 of file indexIterator.h.
|
inline |
|
inline |
|
inline |
Decrement the iterator position by a given amount.
Definition at line 111 of file indexIterator.h.
|
inline |
Definition at line 132 of file indexIterator.h.
|
inline |
Definition at line 147 of file indexIterator.h.
|
inline |
Assign the container and position from another iterator.
Definition at line 65 of file indexIterator.h.
|
inline |
Assign the container and position from another iterator.
Definition at line 74 of file indexIterator.h.
|
inline |
|
inline |
Definition at line 138 of file indexIterator.h.
|
inline |
Definition at line 156 of file indexIterator.h.