#include <common.h>
Public Types | |
typedef std::iterator_traits< It > | it_traits |
typedef std::output_iterator_tag | iterator_category |
THIS CAN BE DISCUSSED : All iterator_lock are output iterators. | |
typedef output_iterator_traits< It >::value_type | value_type |
typedef it_traits::difference_type | difference_type |
typedef it_traits::pointer | pointer |
typedef it_traits::reference | reference |
Public Member Functions | |
iterator_lock (const It &anIter, Mutex &aMtx) | |
iterator_lock (const iterator_lock &anILH) | |
It | base_iterator (void) const |
Converts into the original iterator's value. | |
void | base_set (const It &refIt) |
Sets the iterator only because the mutex reference cannot change. | |
void | base_set_and_incr (const value_type &refVal) |
Mutex & | mutex (void) |
Returns a reference on the mutex. | |
Private Member Functions | |
iterator_lock & | operator++ (void) |
iterator_lock | operator++ (int) |
Private Attributes | |
It | _It |
Mutex & | _MtxRef |
Please note that it is a REFERENCE !! |
For parallel use, this is just a helper, that tells to an algorithm how to lock an output iterator. This unique iterator will be shared by several sub-threads writing into it. It is possible to use any mutex type as long as it is compatible with the interface of mutex_base. See guard.h for possible evolutions into a full-fledged smart pointer.
typedef it_traits::difference_type rpa::iterator_lock< It, Mutex >::difference_type |
typedef std::iterator_traits< It > rpa::iterator_lock< It, Mutex >::it_traits |
typedef std::output_iterator_tag rpa::iterator_lock< It, Mutex >::iterator_category |
THIS CAN BE DISCUSSED : All iterator_lock are output iterators.
typedef it_traits::pointer rpa::iterator_lock< It, Mutex >::pointer |
typedef it_traits::reference rpa::iterator_lock< It, Mutex >::reference |
typedef output_iterator_traits< It >::value_type rpa::iterator_lock< It, Mutex >::value_type |
rpa::iterator_lock< It, Mutex >::iterator_lock | ( | const It & | anIter, | |
Mutex & | aMtx | |||
) | [inline] |
rpa::iterator_lock< It, Mutex >::iterator_lock | ( | const iterator_lock< It, Mutex > & | anILH | ) | [inline] |
It rpa::iterator_lock< It, Mutex >::base_iterator | ( | void | ) | const [inline] |
Converts into the original iterator's value.
void rpa::iterator_lock< It, Mutex >::base_set | ( | const It & | refIt | ) | [inline] |
Sets the iterator only because the mutex reference cannot change.
void rpa::iterator_lock< It, Mutex >::base_set_and_incr | ( | const value_type & | refVal | ) | [inline] |
Mutex& rpa::iterator_lock< It, Mutex >::mutex | ( | void | ) | [inline] |
Returns a reference on the mutex.
Mutexes are not copiable nor assignable, and we want to use only the original mutex passed as a parameter.
iterator_lock rpa::iterator_lock< It, Mutex >::operator++ | ( | int | ) | [private] |
iterator_lock& rpa::iterator_lock< It, Mutex >::operator++ | ( | void | ) | [private] |
It rpa::iterator_lock< It, Mutex >::_It [private] |
Mutex& rpa::iterator_lock< It, Mutex >::_MtxRef [private] |
Please note that it is a REFERENCE !!