rpa::range_fwrd< It > Class Template Reference

For forward_tag iterators if single-thread access. This is an output range. More...

#include <common.h>

List of all members.

Public Types

typedef It iterator
typedef It result_t

Public Member Functions

 range_fwrd (const result_t &aBeg)
const result_tresult (void) const
 Always returns the same data type as the one given to the constructor.
void leave_seq (const iterator &anIter)
 This is used to set, what will be the return value of the parallel algorithm.
void leave_par (const iterator &anIter)
iterator begout (void) const
slice chop (size_t aN)
void chop (size_t aN, slice &aSR)
 Naive implementation for reusing objects, because we assume they're cheap.
slice tail (void)
size_t ceiling (void) const
 Limits the maximum size of a 'chop' if the output is a fixed-size buffer.

Protected Attributes

It _It
seqnum_t _NbChops

Private Member Functions

 range_fwrd ()

Classes

class  slice


Detailed Description

template<class It>
class rpa::range_fwrd< It >

For forward_tag iterators if single-thread access. This is an output range.

What ranges are :


Member Typedef Documentation

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

template<class It>
typedef It rpa::range_fwrd< It >::result_t


Constructor & Destructor Documentation

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

template<class It>
rpa::range_fwrd< It >::range_fwrd ( const result_t aBeg  )  [inline, explicit]

The input parameter is an iterator that may, for example, given as output iterator to a STL algorithm.


Member Function Documentation

template<class It>
iterator rpa::range_fwrd< It >::begout ( void   )  const [inline]

This is passed to an algorithm in the main thread, when executing in sequential context (For exemple, when there are no sub-threads).

template<class It>
size_t rpa::range_fwrd< It >::ceiling ( void   )  const [inline]

Limits the maximum size of a 'chop' if the output is a fixed-size buffer.

In all other cases including this one, simply returns the step range_step.

template<class It>
void rpa::range_fwrd< It >::chop ( size_t  aN,
slice aSR 
) [inline]

Naive implementation for reusing objects, because we assume they're cheap.

Needed only for 'heavy' slices (buffers). Must call 'chop(int)' first.

template<class It>
slice rpa::range_fwrd< It >::chop ( size_t  aN  )  [inline]

Is called by '<input-sequence>.chop()' 'chop' may be called with aN=0 elements, because :

template<class It>
void rpa::range_fwrd< It >::leave_par ( const iterator anIter  )  [inline]

template<class It>
void rpa::range_fwrd< It >::leave_seq ( const iterator anIter  )  [inline]

This is used to set, what will be the return value of the parallel algorithm.

Because the return value is homogeneous to the output iterator, this return value can be used for later insertions in other algorithms.

template<class It>
const result_t& rpa::range_fwrd< It >::result ( void   )  const [inline]

Always returns the same data type as the one given to the constructor.

This way, if the range was initialised with a back_insert_iterator, we still get a back_insert_iterator as return type.

template<class It>
slice rpa::range_fwrd< It >::tail ( void   )  [inline]

Is called by '<input-sequence>.tail()', when the input sequence is a range_size. Last call after zero or several 'chop' calls.


Member Data Documentation

template<class It>
It rpa::range_fwrd< It >::_It [protected]

Stores the output iterator when threads are allocated. It is read by several threads, and therefore must be volatile.

template<class It>
seqnum_t rpa::range_fwrd< It >::_NbChops [protected]


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