rpa::range_step_aux< It > Class Template Reference

#include <common.h>

Inheritance diagram for rpa::range_step_aux< It >:

rpa::range_step_base< It > rpa::range_step< It, Mutex > rpa::range_step< pipe_circular< Container, CondVar >, pipe_circular< Container, CondVar > > rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators > rpa::range_step_archiver< Container, CondVar, rpa::insert_invalidates_iterators< Container >::value > rpa::range_step_archiver< Container, CondVar, true > rpa::range_step< pipe_archiver< Container, CondVar >, pipe_archiver< Container, CondVar > > List of all members.

Public Types

typedef range_step_base< It > rs_base
typedef rs_base::slice slice
typedef It iterator
typedef std::iterator_traits<
It >::value_type 
value_type

Public Member Functions

iterator begin (void) const
 Used only for sequential execution.
const iterator end (void) const
 Sequential execution, and input range.
size_t size_safe (void) const
 For debugging. Returns an 'absurd' value if the iterators are 'output_type'.
void set_all (It aBeg, It aEnd)
 Used only for pipelines.
 range_step_aux (It aBeg, It aEnd, size_t aStep, chunk_t aMinChkSz=chunk_t())
slice chop (void)
 Returns an empty slice if the range is empty.
size_t chop_again (slice &refSlice)
template<class Rng2>
tuple2< slice, typename Rng2::slice > chop_init_nolock (Rng2 &aSq2)
template<class Rng2>
size_t chop_again_nolock (slice &firstSlice, typename Rng2::slice &secondSlice, Rng2 &aSq2)

Private Member Functions

 range_step_aux ()
range_step_auxoperator= (const range_step_aux &)
size_t adv_to (size_t aNb)

Private Attributes

It _RngBeg
It _RngEnd
 It can be set only for pipelines because the begin and end may change at any time.

Classes

struct  range_out
struct  range_out< It2, std::output_iterator_tag >
 Most general case. More...

Detailed Description

template<class It>
class rpa::range_step_aux< It >

Contains all the code for manipulating a range_step with mutex, except the mutex. Used also for output buffers with a limited size.


Member Typedef Documentation

template<class It>
typedef It rpa::range_step_aux< It >::iterator

Reimplemented in rpa::range_step< pipe_circular< Container, CondVar >, pipe_circular< Container, CondVar > >, rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >, rpa::range_step_archiver< Container, CondVar, true >, and rpa::range_step_archiver< Container, CondVar, rpa::insert_invalidates_iterators< Container >::value >.

template<class It>
typedef range_step_base< It > rpa::range_step_aux< It >::rs_base

template<class It>
typedef rs_base::slice rpa::range_step_aux< It >::slice

Reimplemented in rpa::range_step< It, Mutex >, and rpa::range_step< pipe_circular< Container, CondVar >, pipe_circular< Container, CondVar > >.

template<class It>
typedef std::iterator_traits< It >::value_type rpa::range_step_aux< It >::value_type

Reimplemented in rpa::range_step< pipe_circular< Container, CondVar >, pipe_circular< Container, CondVar > >.


Constructor & Destructor Documentation

template<class It>
rpa::range_step_aux< It >::range_step_aux (  )  [private]

template<class It>
rpa::range_step_aux< It >::range_step_aux ( It  aBeg,
It  aEnd,
size_t  aStep,
chunk_t  aMinChkSz = chunk_t() 
) [inline]


Member Function Documentation

template<class It>
size_t rpa::range_step_aux< It >::adv_to ( size_t  aNb  )  [inline, private]

template<class It>
iterator rpa::range_step_aux< It >::begin ( void   )  const [inline]

Used only for sequential execution.

Reimplemented in rpa::range_step< pipe_circular< Container, CondVar >, pipe_circular< Container, CondVar > >, rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >, rpa::range_step_archiver< Container, CondVar, true >, and rpa::range_step_archiver< Container, CondVar, rpa::insert_invalidates_iterators< Container >::value >.

template<class It>
slice rpa::range_step_aux< It >::chop ( void   )  [inline]

Returns an empty slice if the range is empty.

If the resulting slice is empty, or not.

Reimplemented in rpa::range_step< It, Mutex >, rpa::range_step< pipe_circular< Container, CondVar >, pipe_circular< Container, CondVar > >, rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >, rpa::range_step_archiver< Container, CondVar, true >, and rpa::range_step_archiver< Container, CondVar, rpa::insert_invalidates_iterators< Container >::value >.

template<class It>
size_t rpa::range_step_aux< It >::chop_again ( slice refSlice  )  [inline]

It is cheaper to reuse the same slice, and avoiding the ctor/dtor is useful because they may make other complicated things which are good to avoid. The assignment is done only on the slice. So, if we use in fact a derived class, the derived part of the slice is untouched.

If the resulting slice is empty, or not.

template<class It>
template<class Rng2>
size_t rpa::range_step_aux< It >::chop_again_nolock ( slice firstSlice,
typename Rng2::slice &  secondSlice,
Rng2 &  aSq2 
) [inline]

When we reuse a pair of slices. We pass separately the two slices instead of a pair, because, the first slice may be a base class of the slice that is actually used.

Beware that _RngBeg is incremented.

If the output sequence is buffered, with a limited-size buffer, 'mySz' will be and must be smaller than this limit. NOTE: The constructor is not called.

Here, we can reuse resources allocated in the slice.

template<class It>
template<class Rng2>
tuple2< slice, typename Rng2::slice > rpa::range_step_aux< It >::chop_init_nolock ( Rng2 &  aSq2  )  [inline]

Needed by the algorithm : Called directly, without lock, at sub-thread creation - therefore the sequence is accessed only by the main thread.

Reduces the step to less or equal than the output 's ceiling (obuf_iterator). Done only once.

Beware that _RngBeg is incremented.

If the output sequence is buffered, with a limited-size buffer, 'mySz' will be and must be smaller than this limit.

template<class It>
const iterator rpa::range_step_aux< It >::end ( void   )  const [inline]

Sequential execution, and input range.

Reimplemented in rpa::range_step< pipe_circular< Container, CondVar >, pipe_circular< Container, CondVar > >, rpa::range_step_archiver< Container, CondVar, insertInvalidatesIterators >, rpa::range_step_archiver< Container, CondVar, true >, and rpa::range_step_archiver< Container, CondVar, rpa::insert_invalidates_iterators< Container >::value >.

template<class It>
range_step_aux& rpa::range_step_aux< It >::operator= ( const range_step_aux< It > &   )  [private]

template<class It>
void rpa::range_step_aux< It >::set_all ( It  aBeg,
It  aEnd 
) [inline]

Used only for pipelines.

template<class It>
size_t rpa::range_step_aux< It >::size_safe ( void   )  const [inline]

For debugging. Returns an 'absurd' value if the iterators are 'output_type'.


Member Data Documentation

template<class It>
It rpa::range_step_aux< It >::_RngBeg [private]

This iterator which points on the beginning of the range, progresses to the end at each creation of a slice with 'chop' and others.

template<class It>
It rpa::range_step_aux< It >::_RngEnd [private]

It can be set only for pipelines because the begin and end may change at any time.


The documentation for this class was generated from the following file:
Generated on Tue Sep 25 10:20:36 2007 for rpa by  doxygen 1.4.7