#include <pipeline.h>
Inheritance diagram for rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >:
Public Types | |
typedef container_traits< Container >::iterator | iterator |
typedef CondVar::mutex_type | mutex_type |
typedef piplin_t::sync_iter | sync_iter |
Public Member Functions | |
range_step_archiver (piplin_t *aPipe, size_t aStep, chunk_t minChkSz=chunk_t()) | |
sync_iter | begin (void) const |
sync_iter | end (void) const |
bool | empty (void) const |
slice | chop (void) |
This 'chop' will change only the local value of 'begin'. | |
template<class Rng2> | |
tuple2< slice, typename Rng2::slice > | chop_init_lock_cond (Rng2 &aSq2, bool) |
template<class Rng2> | |
size_t | chop_again (tuple2< slice, typename Rng2::slice > &refPair, Rng2 &aSq2) |
Private Types | |
typedef pipe_arc_aux< Container, CondVar, insertInvalidatesIterators > | piplin_t |
typedef range_step_aux< iterator > | rsa_base |
Private Member Functions | |
void | rng_refresh_archiver (void) |
Private Attributes | |
piplin_t * | _pipe |
Classes | |
class | slice |
typedef container_traits< Container >::iterator rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::iterator |
Reimplemented from rpa::range_step_aux< It >.
typedef CondVar::mutex_type rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::mutex_type |
typedef pipe_arc_aux< Container, CondVar, insertInvalidatesIterators > rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::piplin_t [private] |
typedef range_step_aux< iterator > rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::rsa_base [private] |
typedef piplin_t::sync_iter rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::sync_iter |
rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::range_step_archiver | ( | piplin_t * | aPipe, | |
size_t | aStep, | |||
chunk_t | minChkSz = chunk_t() | |||
) | [inline] |
If the useful part of the buffer (That is, the interval of values available for reading) is wrapped from the end of the buffer to its beginning, this is shown with this flag.
sync_iter rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::begin | ( | void | ) | const [inline] |
In sequential mode, use another type of iterator to allow refreshing. Each value can be read only once. This overrides the same method of range_step_aux.
Reimplemented from rpa::range_step_aux< It >.
slice rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::chop | ( | void | ) | [inline] |
This 'chop' will change only the local value of 'begin'.
The pipe_archiver buffer cannot overwrite the value which are in the interval of the range.
Reimplemented from rpa::range_step_aux< It >.
size_t rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::chop_again | ( | tuple2< slice, typename Rng2::slice > & | refPair, | |
Rng2 & | aSq2 | |||
) | [inline] |
Flushes the output buffer, then gets a new iterator pair. The range_step mutex is used to protect the flush, AND to 'chop' a new pair of slices.
Protects the slice assignation AND the chop.
Assigns instead of returning the new pair, because we want to benefit from the mutex.
tuple2< slice, typename Rng2::slice > rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::chop_init_lock_cond | ( | Rng2 & | aSq2, | |
bool | ||||
) | [inline] |
When looping on the sub-threads creation, there are no other reading thread, but there might be writes in this container. Therefore, we must absolutely lock.
bool rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::empty | ( | void | ) | const [inline] |
sync_iter rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::end | ( | void | ) | const [inline] |
In sequential mode, use another type of iterator to allow refreshing. Each value can be read only once. This overrides the same method of range_step_aux.
Reimplemented from rpa::range_step_aux< It >.
void rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::rng_refresh_archiver | ( | void | ) | [inline, private] |
The end of the buffer may have changed in the mean time. We never change the beginning of our range except for looping back to the beginning: Rather, it is the buffer which gets the value of the beginning of the range. It may be worth to wait until there are more than just one element to compute. On the other hand, once this thread is scheduled for execution by the signaling of the thread, it is probably better to do as much things as possible instead of simply returning.
The end of the available input data to read is simply refreshed. It might be necessary to change the beginning of the range too, because due to an insertion, it may have changed. All 'chops' will change it too.
piplin_t* rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >::_pipe [private] |