rpa::range_step_base< It > Class Template Reference

#include <common.h>

Inheritance diagram for rpa::range_step_base< It >:

rpa::range_step< It, void > rpa::range_step_aux< It > rpa::range_step_aux< rpa::container_traits< Container >::container_traits< Container >::iterator > 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 Member Functions

 range_step_base (size_t aStep, chunk_t aMinChkSz)
size_t step (void) const
template<class Rng2>
void calibrate (Rng2 &aSq2)
void calc_wdth (thread_tree_core &aThrTree)
 Computes a realistic minimum number of threads.

Private Member Functions

 range_step_base ()
void check (void) const
 As usual, called by bugchk().

Private Attributes

size_t _Step

Classes

class  slice
 Created by 'segmenting' an input range, ie, a range made of a pair of iterators. More...

Detailed Description

template<class It>
class rpa::range_step_base< It >

Contains core features of 'range_step' method, without mutex management. When the output iterator is a obuf_iterator<?,?,?,Mutex>, therefore with LIMITED buffer size, we must ensure that its mutex protects the output. We do not try to enforce that the input chunk size is identical to the output buffer size (As we -sort of- do for input_size and input_jump).


Constructor & Destructor Documentation

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

template<class It>
rpa::range_step_base< It >::range_step_base ( size_t  aStep,
chunk_t  aMinChkSz 
) [inline]

The number of steps must be at least one,1, otherwise nothing can work. By the way, '0' is a special value for the number of steps.

Store the biggest of the three values : 1, aStep, MinChunk. We do not use the function std::max because we want to be sure that it is inlined.


Member Function Documentation

template<class It>
void rpa::range_step_base< It >::calc_wdth ( thread_tree_core aThrTree  )  [inline]

Computes a realistic minimum number of threads.

The output range parameter is not necessary for this kind of scheduling. We do not and cannot change the number of threads.

If the given number of elements to process at a time, is smaller than the (probably known at compile-time) minimum number of elements to process in one go to be efficient, then we increase this number. The constructor already did this check.

We cannot really discuss the number of threads given, because we do not know how many elements must be processed.

template<class It>
template<class Rng2>
void rpa::range_step_base< It >::calibrate ( Rng2 &  aSq2  )  [inline]

This operation must be done only once and before any 'chop' : Its use is to calibrate the 'step' to the output sizing requirements : Typically obuf_iterator with a fixed-size buffer : These buffers must be filled with a single 'chop'. The algo 'stdmin' is not used for more inlining.

template<class It>
void rpa::range_step_base< It >::check ( void   )  const [inline, private]

As usual, called by bugchk().

template<class It>
size_t rpa::range_step_base< It >::step ( void   )  const [inline]


Member Data Documentation

template<class It>
size_t rpa::range_step_base< It >::_Step [private]

The 'step' depends of the iterator, the elements number to process, the other iterators and all the costs of incrementations, processing, etc.. and therefore has to be adjusted by the calling program.


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