rpa::obuf_base< IterOut, Buffer > Class Template Reference

Just for storing some internal data types. More...

#include <common.h>

Inheritance diagram for rpa::obuf_base< IterOut, Buffer >:

rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex > rpa::obuf_iterator< IterOut, Buffer, IterBuf, void > rpa::obuf_iterator< IterOut, Buffer, void, Mutex > rpa::obuf_iterator< IterOut, Buffer, void, void > List of all members.

Public Types

typedef std::output_iterator_tag iterator_category
typedef iter_traits::value_type value_type
typedef std::ptrdiff_t difference_type
typedef iter_traits::value_type * pointer
typedef iter_traits::value_type & reference
typedef Buffer flush_buffer_t
typedef cont_trts::iterator flush_iterator_t
typedef const cont_trts::const_iterator flush_const_iterator_t
typedef IterOut container_ref_t
 TODO: Change the name of this typedef.
typedef IterOut seq_out_iterator

Public Member Functions

 obuf_base (IterOut *ptrIter)
bool operator!= (const obuf_base &refOB) const
 Allows the check the return value of rpa::transform.
seq_out_iterator flush_itr (flush_buffer_t &aBufRef, flush_iterator_t aEnd)
seq_out_iterator flush_all (flush_buffer_t &aBufRef)
seq_out_iterator base_inserter (void) const

Private Types

typedef container_traits<
Buffer > 
cont_trts
typedef std::iterator_traits<
IterOut > 
iter_traits

Private Attributes

IterOut _currIterOut

Detailed Description

template<class IterOut, class Buffer>
class rpa::obuf_base< IterOut, Buffer >

Just for storing some internal data types.

These templates just deal with containers and iterators types, not with mutex and allocation of internal buffers with external buffers. IterOut is the type of output iterator. Buffer is the internal buffer type - There is one buffer per thread.


Member Typedef Documentation

template<class IterOut, class Buffer>
typedef container_traits< Buffer > rpa::obuf_base< IterOut, Buffer >::cont_trts [private]

template<class IterOut, class Buffer>
typedef IterOut rpa::obuf_base< IterOut, Buffer >::container_ref_t

TODO: Change the name of this typedef.

template<class IterOut, class Buffer>
typedef std::ptrdiff_t rpa::obuf_base< IterOut, Buffer >::difference_type

template<class IterOut, class Buffer>
typedef Buffer rpa::obuf_base< IterOut, Buffer >::flush_buffer_t

template<class IterOut, class Buffer>
typedef const cont_trts::const_iterator rpa::obuf_base< IterOut, Buffer >::flush_const_iterator_t

template<class IterOut, class Buffer>
typedef cont_trts::iterator rpa::obuf_base< IterOut, Buffer >::flush_iterator_t

Reimplemented in rpa::obuf_iterator< IterOut, Buffer, IterBuf, Mutex >, and rpa::obuf_iterator< IterOut, Buffer, void, Mutex >.

template<class IterOut, class Buffer>
typedef std::iterator_traits< IterOut > rpa::obuf_base< IterOut, Buffer >::iter_traits [private]

template<class IterOut, class Buffer>
typedef std::output_iterator_tag rpa::obuf_base< IterOut, Buffer >::iterator_category

Beware that the iterator category may not be a output_iterator. This means that the input range may not select the appropriate specialization of range_outp, but a simple range (For example, if the output iterator type is just random_access, we can simply write in it). But why would we bufferize writes in a random_access iterator ? anyway, theoretically, the input_range should not be free to decide which output range to use based on the output category.

template<class IterOut, class Buffer>
typedef iter_traits::value_type* rpa::obuf_base< IterOut, Buffer >::pointer

template<class IterOut, class Buffer>
typedef iter_traits::value_type& rpa::obuf_base< IterOut, Buffer >::reference

template<class IterOut, class Buffer>
typedef IterOut rpa::obuf_base< IterOut, Buffer >::seq_out_iterator

template<class IterOut, class Buffer>
typedef iter_traits::value_type rpa::obuf_base< IterOut, Buffer >::value_type


Constructor & Destructor Documentation

template<class IterOut, class Buffer>
rpa::obuf_base< IterOut, Buffer >::obuf_base ( IterOut *  ptrIter  )  [inline]

We receive a pointer because it is homogeneous with the specialization of std::back_inserter.


Member Function Documentation

template<class IterOut, class Buffer>
seq_out_iterator rpa::obuf_base< IterOut, Buffer >::base_inserter ( void   )  const [inline]

template<class IterOut, class Buffer>
seq_out_iterator rpa::obuf_base< IterOut, Buffer >::flush_all ( flush_buffer_t aBufRef  )  [inline]

If the derived class 'obuf_iterator' has a mutex, it first locks it and then later on, calls this method. Otherwise, this method is directly called through the deriver class obuf_iterator.

template<class IterOut, class Buffer>
seq_out_iterator rpa::obuf_base< IterOut, Buffer >::flush_itr ( flush_buffer_t aBufRef,
flush_iterator_t  aEnd 
) [inline]

This one is never called with a mutex, because we control the maximum number of insertions.

This, to be sure that beg and end have the same type.

In the general case, we can only make a copy. In fact, it is much better to swap the elements, because there is no need to protect the content of the buffer.

template<class IterOut, class Buffer>
bool rpa::obuf_base< IterOut, Buffer >::operator!= ( const obuf_base< IterOut, Buffer > &  refOB  )  const [inline]

Allows the check the return value of rpa::transform.


Member Data Documentation

template<class IterOut, class Buffer>
IterOut rpa::obuf_base< IterOut, Buffer >::_currIterOut [private]


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