|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
#include <triqs/utility/dressed_iterator.hpp>
STL-compatible iterator that wraps an underlying iterator and dereferences to a user-supplied dressing type.
Given an iterator type IteratorType and a small dressing struct Dressing whose constructor takes the iterator (and optionally an auxiliary pointer) and exposes the data via references, dressed_iterator produces a bidirectional or forward iterator (depending on the iterator category of the given iterator type) generated via boost::iterator_facade. Dereferencing the iterator returns a fresh Dressing constructed from the current underlying iterator state.
Optionally, an auxiliary pointer (typically to the parent container) can be carried along — useful e.g. for cyclic iterators that need to consult the container size.
| IteratorType | Underlying iterator type. |
| Dressing | Lightweight view struct constructed from a single iterator (or iterator + aux pointer). |
| DressingAuxiliaryArgumentPtrType | Optional pointer type stored alongside the iterator (void to disable). |
Definition at line 69 of file dressed_iterator.hpp.
Public Member Functions | |
| dressed_iterator ()=default | |
| Default constructor leaves the underlying iterator and auxiliary pointer uninitialized. | |
| template<typename T> | |
| dressed_iterator (T const &it, DressingAuxiliaryArgumentPtrType *aux) | |
| Construct a dressed iterator from an underlying iterator and an auxiliary pointer. | |
| IteratorType & | get () |
| Access the underlying iterator. | |
| IteratorType const & | get () const |
| Access the underlying iterator. | |
| auto * | get_aux () |
| Access the auxiliary pointer. | |
| const auto * | get_aux () const |
| Access the auxiliary pointer. | |
| operator IteratorType () const | |
| Implicit conversion back to the underlying iterator type. | |
| template<typename OtherSentinel> | |
| bool | operator== (itertools::sentinel_t< OtherSentinel > other) |
| Equal-to operator to compare a itertools::sentinel_t type with a dressed iterator. | |
|
inline |
Construct a dressed iterator from an underlying iterator and an auxiliary pointer.
| it | Underlying iterator. |
| aux | Auxiliary pointer (typically to the parent container). |
Definition at line 83 of file dressed_iterator.hpp.
|
inline |
Access the underlying iterator.
Definition at line 106 of file dressed_iterator.hpp.
|
inline |
Access the underlying iterator.
Definition at line 100 of file dressed_iterator.hpp.
|
inline |
Access the auxiliary pointer.
Definition at line 115 of file dressed_iterator.hpp.
|
inline |
Access the auxiliary pointer.
Definition at line 121 of file dressed_iterator.hpp.
|
inline |
Equal-to operator to compare a itertools::sentinel_t type with a dressed iterator.
| OtherSentinel | Type of the other sentinel. |
| other | Sentinel object to compare with. |
Definition at line 130 of file dressed_iterator.hpp.