rpa::range_outp< It > Class Template Reference

General case, for thread-unsafe iterators. More...

#include <common.h>

Inheritance diagram for rpa::range_outp< It >:

rpa::range_step< It, void >::range_type_iterator_lock< It2, Mutex > List of all members.

Public Types

typedef It iterator
typedef It result_t

Public Member Functions

 range_outp (const result_t &aBeg)
 Allowed, because used in sequential context.
const result_tresult (void) const
void leave_seq (const result_t &aR)
void leave_par (const result_t &aR)
iterator begout (void) const
slice chop (size_t aN)
void chop (size_t aN, slice &aR)
slice tail (void)
 Used only for simple scheduling, and for the last thread.
size_t ceiling (void) const

Protected Attributes

It _It
 Not VOLATILE because for sequential use only.
seqnum_t _NbChops

Private Member Functions

 range_outp ()
range_outpoperator= (const range_outp &)

Classes

struct  slice

Detailed Description

template<class It>
class rpa::range_outp< It >

General case, for thread-unsafe iterators.

Does compile but does not link for parallel use, because we FORBID the use of non-explicitly thread-safe output iterators. Allowed for sequential use.


Member Typedef Documentation

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

Reimplemented in rpa::range_step< It, void >::range_type_iterator_lock< It2, Mutex >.

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

Reimplemented in rpa::range_step< It, void >::range_type_iterator_lock< It2, Mutex >.


Constructor & Destructor Documentation

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

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

Allowed, because used in sequential context.


Member Function Documentation

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

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

Used to limit the maximum size of a 'chop' when the output is a fixed-size output buffer. In all other cases including this one, simply returns the step of the dynamic scheduling scheme.

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

Once a slice was created by the first 'chop' in a given sub-thread, it is later reused and receive new 'segments' to process. This allows to reuse resources such as buffers.

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

Example of use : The output iterator is a buffered output iterator into a std::list as a buffer, with a limited size, and therefore with a mutex. This is absurd because std::list can hold as many elements as wished. Because we can use std::list::splice which is constant-time, this uses a back_insert_iterator as output buffer : Pre-allocating elements would be useless because the buffers are not reallocated, simply reinjected into the main output container. The best we could do would be to reserve elements.

template<class It>
void rpa::range_outp< It >::leave_par ( const result_t aR  )  [inline]

template<class It>
void rpa::range_outp< It >::leave_seq ( const result_t aR  )  [inline]

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

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

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

Used only for simple scheduling, and for the last thread.

Was not necessary now because there is normally no use of an iterator_lock with a non-input_iterator. on the contrary, range_size is used with random_access (Exceptionnaly with forward_iterator).


Member Data Documentation

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

Not VOLATILE because for sequential use only.

And protected because 'obuf_iterator' uses it as a base class, and only redefines 'chop'.

template<class It>
seqnum_t rpa::range_outp< 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