rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex > Class Template Reference

'obuf_iterator' attempts to encapsulate output iterators, More...

#include <common.h>

Inheritance diagram for rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >:

rpa::obuf_base< IterOut, Buffer > rpa::obuf_storage< Buffer, IterBuf > rpa::obuf_guard< Mutex > List of all members.

Public Types

typedef oi_base::flush_iterator_t flush_iterator_t

Public Member Functions

 obuf_iterator (typename oi_base::container_ref_t anObj, typename Carray_to_iterator< IterBuf >::iterator iterBuf, Mutex *aMtx, size_t aMaxSzBuf)
 Adjusts the desired buffer'size to this buffer type's maximum.
bool operator!= (const obuf_iterator &refOI) const
 For checking the reutnr value of rpa::transform etc...
IterOut flush_itr (typename oi_base::flush_buffer_t &aBufRef, flush_iterator_t aEnd)
IterOut flush_all (typename oi_base::flush_buffer_t &aBufRef)

Private Types

typedef obuf_base< IterOut,
Buffer > 
oi_base
typedef obuf_storage< Buffer,
IterBuf > 
oi_storage
typedef obuf_guard< Mutex > oi_guard

Detailed Description

template<class IterOut, class Buffer, class IterBuf, class Mutex>
class rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >

'obuf_iterator' attempts to encapsulate output iterators,

General case. This class must also manages the various combinations of parameters for the constructors. This iterator is not made to be used as a replacement of std::back_insert_iterator in the general case, but only when template specializations can use it in the algorithm. It could, but it would make things confusing. Therefore, if the compiler complains with missing operators '++' and '*', it means that it could not select a useful behaviour and then, you should use a plain std::back_insert_iterator. This will typically happen when using a range_avoid in input.


Member Typedef Documentation

template<class IterOut, class Buffer, class IterBuf, class Mutex>
typedef oi_base::flush_iterator_t rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >::flush_iterator_t

Reimplemented from rpa::obuf_base< IterOut, Buffer >.

template<class IterOut, class Buffer, class IterBuf, class Mutex>
typedef obuf_base< IterOut, Buffer > rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >::oi_base [private]

template<class IterOut, class Buffer, class IterBuf, class Mutex>
typedef obuf_guard< Mutex > rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >::oi_guard [private]

template<class IterOut, class Buffer, class IterBuf, class Mutex>
typedef obuf_storage< Buffer, IterBuf > rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >::oi_storage [private]


Constructor & Destructor Documentation

template<class IterOut, class Buffer, class IterBuf, class Mutex>
rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >::obuf_iterator ( typename oi_base::container_ref_t  anObj,
typename Carray_to_iterator< IterBuf >::iterator  iterBuf,
Mutex *  aMtx,
size_t  aMaxSzBuf 
) [inline]

Adjusts the desired buffer'size to this buffer type's maximum.

Beware : REFERENCE of a container. But value for ostream_iterator.


Member Function Documentation

template<class IterOut, class Buffer, class IterBuf, class Mutex>
IterOut rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >::flush_all ( typename oi_base::flush_buffer_t aBufRef  )  [inline]

template<class IterOut, class Buffer, class IterBuf, class Mutex>
IterOut rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >::flush_itr ( typename oi_base::flush_buffer_t aBufRef,
flush_iterator_t  aEnd 
) [inline]

Called when destructing a slice : The results collected into the buffer (or buffer reference) of the slice must be written into the external output iterator. Maybe with a lock. The parameter will always be a slice buffer reference.

Fixed-size buffers must always be protected by a mutex, because the flush is done at reduction time, when all sub-threads are not yet finished, and may still write into the output buffer.

template<class IterOut, class Buffer, class IterBuf, class Mutex>
bool rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >::operator!= ( const obuf_iterator< IterOut, Buffer, IterBuf, Mutex > &  refOI  )  const [inline]

For checking the reutnr value of rpa::transform etc...


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