#include <common.h>
Inheritance diagram for rpa::obuf_base< IterOut, Buffer >:
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 |
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.
typedef container_traits< Buffer > rpa::obuf_base< IterOut, Buffer >::cont_trts [private] |
typedef IterOut rpa::obuf_base< IterOut, Buffer >::container_ref_t |
TODO: Change the name of this typedef.
typedef std::ptrdiff_t rpa::obuf_base< IterOut, Buffer >::difference_type |
typedef Buffer rpa::obuf_base< IterOut, Buffer >::flush_buffer_t |
typedef const cont_trts::const_iterator rpa::obuf_base< IterOut, Buffer >::flush_const_iterator_t |
typedef cont_trts::iterator rpa::obuf_base< IterOut, Buffer >::flush_iterator_t |
typedef std::iterator_traits< IterOut > rpa::obuf_base< IterOut, Buffer >::iter_traits [private] |
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.
typedef iter_traits::value_type* rpa::obuf_base< IterOut, Buffer >::pointer |
typedef iter_traits::value_type& rpa::obuf_base< IterOut, Buffer >::reference |
typedef IterOut rpa::obuf_base< IterOut, Buffer >::seq_out_iterator |
typedef iter_traits::value_type rpa::obuf_base< IterOut, Buffer >::value_type |
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.
seq_out_iterator rpa::obuf_base< IterOut, Buffer >::base_inserter | ( | void | ) | const [inline] |
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.
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.
bool rpa::obuf_base< IterOut, Buffer >::operator!= | ( | const obuf_base< IterOut, Buffer > & | refOB | ) | const [inline] |
Allows the check the return value of rpa::transform.
IterOut rpa::obuf_base< IterOut, Buffer >::_currIterOut [private] |