![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/iter-adapter-ptr-deref.hpp"
wrapper for an existing Iterator type, automatically dereferencing the output of the former.
For this to work, the "source" iterator is expected to be declared on pointers rather than on values.
Definition at line 56 of file iter-adapter-ptr-deref.hpp.
Public Types | |
| using | pointer = meta::ValueTypeBinding< IT >::value_type |
| this iterator adapter is meant to wrap an iterator yielding pointer values | |
| using | value_type = std::remove_pointer_t< pointer > |
| using | reference = value_type & |
| using | ValueTypeBase = std::remove_const_t< value_type > |
| using | WrappedIterType = IterType< IT >::template SimilarIter< ValueTypeBase ** >::Type |
| using | WrappedConstIterType = IterType< IT >::template SimilarIter< const ValueTypeBase ** >::Type |
| using | IterType = PtrDerefIter< WrappedIterType > |
| using | ConstIterType = PtrDerefIter< WrappedConstIterType > |
Static Public Member Functions | |
| static PtrDerefIter | build_by_cast (WrappedIterType const &srcIter) |
| explicit builder to allow creating a const variant from the basic srcIter type. | |
| static PtrDerefIter | nil () |
Public Member Functions | |
| ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (PtrDerefIter) | |
| PtrDerefIter (IT srcIter) | |
| PtrDerefIter is always created by wrapping an existing iterator. | |
| PtrDerefIter () | |
| PtrDerefIter (PtrDerefIter< WrappedIterType > const &oIter) | |
| allow copy initialisation also when the wrapped iterator is based on some variation of a pointer. | |
| PtrDerefIter & | operator= (PtrDerefIter< WrappedIterType > const &ref) |
| operator bool () const | |
| reference | operator* () const |
| pointer | operator-> () const |
| PtrDerefIter & | operator++ () |
| bool | isValid () const |
| bool | empty () const |
| IT const & | getBase () const |
| access the wrapped implementation iterator | |
Private Attributes | |
| IT | i_ |
| nested source iterator | |
|
inlineexplicit |
PtrDerefIter is always created by wrapping an existing iterator.
Definition at line 89 of file iter-adapter-ptr-deref.hpp.
|
inline |
Definition at line 93 of file iter-adapter-ptr-deref.hpp.
Referenced by PtrDerefIter< IT >::build_by_cast(), and PtrDerefIter< IT >::nil().
Here is the caller graph for this function:
|
inline |
allow copy initialisation also when the wrapped iterator is based on some variation of a pointer.
Especially, this includes initialisation of the "const variant" from the "normal variant" of PtrDerefIter. Actually, we need to convert in this case by brute force, because indeed (const TY *)* is not assignable from (TY *)* – just we know that our intention is to dereference both levels of pointers, and then the resulting conversion is correct.
Definition at line 108 of file iter-adapter-ptr-deref.hpp.
| using pointer = meta::ValueTypeBinding<IT>::value_type |
this iterator adapter is meant to wrap an iterator yielding pointer values
Definition at line 63 of file iter-adapter-ptr-deref.hpp.
| using value_type = std::remove_pointer_t<pointer> |
Definition at line 66 of file iter-adapter-ptr-deref.hpp.
| using reference = value_type& |
Definition at line 67 of file iter-adapter-ptr-deref.hpp.
| using ValueTypeBase = std::remove_const_t<value_type> |
Definition at line 75 of file iter-adapter-ptr-deref.hpp.
| using WrappedIterType = IterType<IT>::template SimilarIter< ValueTypeBase* * >::Type |
Definition at line 77 of file iter-adapter-ptr-deref.hpp.
| using WrappedConstIterType = IterType<IT>::template SimilarIter<const ValueTypeBase* * >::Type |
Definition at line 78 of file iter-adapter-ptr-deref.hpp.
| using IterType = PtrDerefIter<WrappedIterType> |
Definition at line 80 of file iter-adapter-ptr-deref.hpp.
| using ConstIterType = PtrDerefIter<WrappedConstIterType> |
Definition at line 81 of file iter-adapter-ptr-deref.hpp.
| ENABLE_USE_IN_STD_RANGE_FOR_LOOPS | ( | PtrDerefIter< IT > | ) |
|
inline |
Definition at line 113 of file iter-adapter-ptr-deref.hpp.
References PtrDerefIter< IT >::getBase(), and PtrDerefIter< IT >::i_.
Here is the call graph for this function:
|
inlineexplicit |
Definition at line 120 of file iter-adapter-ptr-deref.hpp.
References PtrDerefIter< IT >::isValid().
Here is the call graph for this function:
|
inlinestatic |
explicit builder to allow creating a const variant from the basic srcIter type.
Again, the reason necessitating this "backdoor" is that we want to swallow one level of indirection. Generally speaking const T ** is not the same as T * const *, but in our specific case the API ensures that a PtrDerefIter<WrappedConstIterType> only exposes const elements.
Definition at line 134 of file iter-adapter-ptr-deref.hpp.
References PtrDerefIter< IT >::PtrDerefIter().
Here is the call graph for this function:
|
inlinestatic |
Definition at line 140 of file iter-adapter-ptr-deref.hpp.
References PtrDerefIter< IT >::PtrDerefIter().
Here is the call graph for this function:
|
inline |
Definition at line 153 of file iter-adapter-ptr-deref.hpp.
|
inline |
Definition at line 159 of file iter-adapter-ptr-deref.hpp.
References PtrDerefIter< IT >::i_.
|
inline |
Definition at line 165 of file iter-adapter-ptr-deref.hpp.
References PtrDerefIter< IT >::i_.
|
inline |
Definition at line 172 of file iter-adapter-ptr-deref.hpp.
References PtrDerefIter< IT >::i_.
Referenced by PtrDerefIter< IT >::empty(), and PtrDerefIter< IT >::operator bool().
Here is the caller graph for this function:
|
inline |
Definition at line 178 of file iter-adapter-ptr-deref.hpp.
References PtrDerefIter< IT >::isValid().
Here is the call graph for this function:
|
inline |
access the wrapped implementation iterator
Definition at line 186 of file iter-adapter-ptr-deref.hpp.
References PtrDerefIter< IT >::i_.
Referenced by PtrDerefIter< IT >::operator=(), and lib::operator==().
Here is the caller graph for this function:
|
private |
nested source iterator
Definition at line 58 of file iter-adapter-ptr-deref.hpp.
Referenced by PtrDerefIter< IT >::getBase(), PtrDerefIter< IT >::isValid(), PtrDerefIter< IT >::operator++(), PtrDerefIter< IT >::operator->(), and PtrDerefIter< IT >::operator=().
Collaboration diagram for PtrDerefIter< IT >: