#include <IteratorBase.h>
Public Types | |
typedef base_iterator::value_type | value_type |
Public Types inherited from base_iterator< Value > | |
using | difference_type = typename traits_t::difference_type |
using | value_type = typename traits_t::value_type |
using | pointer = typename traits_t::pointer |
using | reference = typename traits_t::reference |
using | iterator_category = typename traits_t::iterator_category |
Public Member Functions | |
IteratorAdapter (adapted_iterator it) | |
virtual | ~IteratorAdapter () |
const IteratorAdapter & | dc (const base_iterator &other) const |
bool | operator== (const base_iterator &rhs) const |
bool | operator!= (const base_iterator &rhs) const |
base_iterator & | operator= (const base_iterator &rhs) |
base_iterator & | operator++ () |
value_type | operator* () const |
base_iterator * | clone () const |
Public Member Functions inherited from base_iterator< Value > | |
base_iterator (pointer ptr=nullptr) | |
reference | operator* () const |
pointer | operator-> () const |
base_iterator & | operator++ () |
base_iterator & | operator-- () |
reference | operator[] (difference_type offset) const |
difference_type | operator- (base_iterator const &other) const |
Private Attributes | |
adapted_iterator | m_it |
Additional Inherited Members | |
Public Attributes inherited from base_iterator< Value > | |
pointer | ptr = nullptr |
Handy adapter from an iterator to an abstract base iterator.
Eg:
class MyData : virtual public IData {...}; typedef IteratorBase< const IData* > my_base_iterator; typedef std::vector<MyData*> MyStore; typedef IteratorAdapter< MyStore::iterator, my_base_iterator > my_iterator;
typedef std::Iterator<const IMyData*> data_iterator; typedef std::pair<data_iterator, data_iterator> data_range;
In interface class:
data_range get_data() const = 0;
In implementation with
MyStore m_store;
data_range MyImp::get_data() { return data_range(my_iterator(m_store.begin(), my_iterator(m_store.end())); }
Reasons not to use this adapter and go to the trouble to write your own iterator class:
Definition at line 72 of file IteratorBase.h.
typedef base_iterator::value_type WireCell::IteratorAdapter< adapted_iterator, base_iterator >::value_type |
Definition at line 76 of file IteratorBase.h.
|
inline |
Definition at line 78 of file IteratorBase.h.
|
inlinevirtual |
Definition at line 79 of file IteratorBase.h.
|
inline |
Definition at line 102 of file IteratorBase.h.
|
inline |
Definition at line 81 of file IteratorBase.h.
|
inline |
Definition at line 87 of file IteratorBase.h.
|
inline |
Definition at line 98 of file IteratorBase.h.
|
inline |
Definition at line 94 of file IteratorBase.h.
|
inline |
Definition at line 90 of file IteratorBase.h.
|
inline |
Definition at line 84 of file IteratorBase.h.
|
private |
Definition at line 106 of file IteratorBase.h.