#include <pipeline.h>
Inheritance diagram for rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >:
Public Types | |
typedef pipe_arc_base< Container, CondVar > | pipebase_t |
typedef pipebase_t::iterator | iterator |
typedef pipebase_t::sync_iter | sync_iter |
typedef pipebase_t::value_type | value_type |
typedef pipebase_t::mutex_type | mutex_type |
typedef pipe_archiver< Container, CondVar > | piparc_t |
typedef range_step< piparc_t, piparc_t > | range_step_type |
Public Member Functions | |
pipe_arc_aux (mutex_type *mtxPtr) | |
template<class Iter> | |
pipe_arc_aux (mutex_type *mtxPtr, Iter begIter, Iter endIter, bool shutFlag=true) | |
pipe_arc_aux (mutex_type *mtxPtr, const Container &aCont, bool shutFlag=true) | |
void | update_after_chop_archiver (iterator sliceEnd) |
void | push_back (const value_type &aV) |
template<class IterIn> | |
void | append (IterIn itBeg, IterIn itEnd, size_t szReserve) |
range_step_type | build_range (size_t nbSteps, chunk_t aCM=chunk_t()) |
Friends | |
class | range_step_archiver< Container, CondVar, insertInvalidatesIterators > |
class | range_step_type::slice |
The slice needs to access the pipe, to wait when there are no data. |
typedef pipebase_t::iterator rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::iterator |
Reimplemented from rpa::pipe_arc_base< Container, CondVar >.
Reimplemented in rpa::pipe_archiver< Container, CondVar >.
typedef pipebase_t::mutex_type rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::mutex_type |
Reimplemented from rpa::pipe_arc_base< Container, CondVar >.
Reimplemented in rpa::pipe_archiver< Container, CondVar >.
typedef pipe_archiver< Container, CondVar > rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::piparc_t |
This range can be used into any algorithm of this library. It is synchronized with the internal mutex of the container.
typedef pipe_arc_base< Container, CondVar > rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::pipebase_t |
Reimplemented from rpa::pipe_arc_base< Container, CondVar >.
typedef range_step< piparc_t, piparc_t > rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::range_step_type |
typedef pipebase_t::sync_iter rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::sync_iter |
Reimplemented from rpa::pipe_arc_base< Container, CondVar >.
Reimplemented in rpa::pipe_archiver< Container, CondVar >.
typedef pipebase_t::value_type rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::value_type |
Reimplemented from rpa::pipe_arc_base< Container, CondVar >.
rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::pipe_arc_aux | ( | mutex_type * | mtxPtr | ) | [inline] |
The container is set to the proper size. If this is a plain array, we do nothing. We could do a lazy-resizing, only when it is necessary, but there is no point to wait : If a given size is necessary, why not resizing now ? More: By setting the right size immediately, we ensure that the iterators are always valid. On the other hand, the real shame of it is that we must always pay the price of a full allocation even for a couple of data. (This is also true for output buffers obuf_iterator). To compensate this, a buffer can be reused, once allocated.
rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::pipe_arc_aux | ( | mutex_type * | mtxPtr, | |
Iter | begIter, | |||
Iter | endIter, | |||
bool | shutFlag = true | |||
) | [inline] |
rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::pipe_arc_aux | ( | mutex_type * | mtxPtr, | |
const Container & | aCont, | |||
bool | shutFlag = true | |||
) | [inline] |
void rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::append | ( | IterIn | itBeg, | |
IterIn | itEnd, | |||
size_t | szReserve | |||
) | [inline] |
range_step_type rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::build_range | ( | size_t | nbSteps, | |
chunk_t | aCM = chunk_t() | |||
) | [inline] |
The creation of a range is protected by a mutex, because its reads some internal data.
void rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::push_back | ( | const value_type & | aV | ) | [inline] |
This is compatible with std::back_inserter. If necessary, if the iterators are invalid after the insertion, they are refreshed (std::vector ...) If it is the first inserted element, things are refreshed too.
If the container is empty, all its iterators must have a meaningful value after the first insertion.
If the rd iterator points on the end, it must be restored because 'end()' is not a real value for an iterator.
void rpa::pipe_arc_aux< Container, CondVar, insertInvalidatesIterators >::update_after_chop_archiver | ( | iterator | sliceEnd | ) | [inline] |
When a slice is just created with a 'chop', or is chopped again, the end of the slice becomes the 'Rd' of the slice, that is, the first place to read from. The mutex stays locked between the lock and this method.
friend class range_step_archiver< Container, CondVar, insertInvalidatesIterators > [friend] |
The range step really needs to access the inner guts of the pipe. It is possible to avoid this with accessors everywhere.
friend class range_step_type::slice [friend] |
The slice needs to access the pipe, to wait when there are no data.