#include <common.h>
Public Types | |
typedef std::iterator_traits< It > | it_traits |
typedef it_traits::iterator_category | iterator_category |
typedef it_traits::value_type | value_type |
typedef it_traits::difference_type | difference_type |
typedef it_traits::pointer | pointer |
typedef it_traits::reference | reference |
Public Member Functions | |
iterator_jump_lead () | |
iterator_jump_lead (const It &aBeg, const It &aEnd, size_t aJump) | |
iterator_jump_lead & | operator++ (void) |
iterator_jump_lead | operator++ (int) |
Much more expensive than oper++(void). | |
iterator_jump_lead & | operator+= (size_t anOffset) |
If the base iterator is random_access, so are we. | |
ptrdiff_t | operator- (const iterator_jump_lead &aIJM) const |
bool | operator== (const iterator_jump_lead &aIJM) const |
Do NOT use operator -, because it may increment the iterators. | |
bool | operator!= (const iterator_jump_lead &aIJM) const |
const value_type & | operator * (void) const |
If we must write in a iterator_jump_lead, we'll need a non-const oper*. | |
value_type | operator * (void) |
This is for std::istream_iterator. | |
Private Member Functions | |
void | check (void) const |
ptrdiff_t | dist_to_end (void) const |
Private Attributes | |
It | _Beg |
It | _End |
Modified only by 'operator='. | |
size_t | _jump |
typedef it_traits::difference_type rpa::iterator_jump_lead< It >::difference_type |
typedef std::iterator_traits< It > rpa::iterator_jump_lead< It >::it_traits |
typedef it_traits::iterator_category rpa::iterator_jump_lead< It >::iterator_category |
typedef it_traits::pointer rpa::iterator_jump_lead< It >::pointer |
typedef it_traits::reference rpa::iterator_jump_lead< It >::reference |
typedef it_traits::value_type rpa::iterator_jump_lead< It >::value_type |
rpa::iterator_jump_lead< It >::iterator_jump_lead | ( | ) | [inline] |
The two iterators have the same value, even if they have no constructors, like pointers. This figures out that the iterator is pointing on nothing, i.e. is ended.
rpa::iterator_jump_lead< It >::iterator_jump_lead | ( | const It & | aBeg, | |
const It & | aEnd, | |||
size_t | aJump | |||
) | [inline] |
void rpa::iterator_jump_lead< It >::check | ( | void | ) | const [inline, private] |
ptrdiff_t rpa::iterator_jump_lead< It >::dist_to_end | ( | void | ) | const [inline, private] |
Computes the number of increments to do, to reach the end. The division has a remainder, and this is normal.
value_type rpa::iterator_jump_lead< It >::operator * | ( | void | ) | [inline] |
This is for std::istream_iterator.
const value_type& rpa::iterator_jump_lead< It >::operator * | ( | void | ) | const [inline] |
If we must write in a iterator_jump_lead, we'll need a non-const oper*.
bool rpa::iterator_jump_lead< It >::operator!= | ( | const iterator_jump_lead< It > & | aIJM | ) | const [inline] |
iterator_jump_lead rpa::iterator_jump_lead< It >::operator++ | ( | int | ) | [inline] |
Much more expensive than oper++(void).
iterator_jump_lead& rpa::iterator_jump_lead< It >::operator++ | ( | void | ) | [inline] |
The compiler-generated copy constructor and operator=, are OK. Incr and decr operators must 'jump' by the number of threads.
If we reached 'theEnd', we set _jump=0. Tests first if we could succesfully advance, which is the fastest and most probable case.
iterator_jump_lead& rpa::iterator_jump_lead< It >::operator+= | ( | size_t | anOffset | ) | [inline] |
If the base iterator is random_access, so are we.
It is probably possible to optimise it because some tests are already done in 'adv'
ptrdiff_t rpa::iterator_jump_lead< It >::operator- | ( | const iterator_jump_lead< It > & | aIJM | ) | const [inline] |
We assume that both iterators points to the same container : Therefore, all cases will not occur.
It never happened for the moment, due to the kind of algorithms we have implemented yet : 'transform' and 'accumulate'. This case has a meaning but, for safety, we want to detect it,
bool rpa::iterator_jump_lead< It >::operator== | ( | const iterator_jump_lead< It > & | aIJM | ) | const [inline] |
Do NOT use operator -, because it may increment the iterators.
It never happened for the moment, due to the kind of algorithms we have implemented yet : 'transform' and 'accumulate'. This case has a meaning but, for safety, we want to detect it,
The two iterators should point on the same container ??? FALSE FOR POINTERS ??
It rpa::iterator_jump_lead< It >::_Beg [private] |
It rpa::iterator_jump_lead< It >::_End [private] |
Modified only by 'operator='.
size_t rpa::iterator_jump_lead< It >::_jump [private] |