|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Iterator that traverses multiple containers (STL or Aleph) in lockstep. More...
#include <ah-zip-utils.H>
Public Types | |
| using | value_type = std::tuple< uni_zip_detail::container_value_t< Containers >... > |
Public Member Functions | |
| UniZipIterator (const Containers &...cs) | |
| Constructor initializing wrappers for all containers. | |
| bool | has_curr () const noexcept |
| Returns true if ALL containers have current element (zip continues) | |
| bool | any_has_curr () const noexcept |
| Returns true if ANY container still has elements (for length checking) | |
| bool | all_completed () const noexcept |
| Returns true if ALL containers are exhausted (equal length check) | |
| bool | completed () const noexcept |
| Check if iterator has reached the end. | |
| auto | get_curr () const |
| Get the current element. | |
| void | next () |
| Advance to the next element. | |
| void | next_ne () |
Advance without checking; same as next(), which does not check. | |
| auto | operator* () const |
| Dereference operator for STL compatibility. | |
| UniZipIterator & | operator++ () |
| Pre-increment operator for STL compatibility. | |
| bool | operator== (UniZipSentinel) const noexcept |
| Comparison with sentinel - iterator is "at end" when any container exhausted. | |
| bool | operator!= (UniZipSentinel s) const noexcept |
| Inequality comparison with sentinel. | |
| bool | operator== (const UniZipIterator &other) const noexcept |
| Comparison with another iterator (for algorithms that need it) | |
| bool | operator!= (const UniZipIterator &other) const noexcept |
| Inequality comparison with another iterator. | |
Static Public Attributes | |
| static constexpr size_t | num_containers = sizeof...(Containers) |
Private Member Functions | |
| template<size_t... Is> | |
| bool | has_curr_impl (std::index_sequence< Is... >) const noexcept |
| template<size_t... Is> | |
| bool | any_has_curr_impl (std::index_sequence< Is... >) const noexcept |
| template<size_t... Is> | |
| bool | all_completed_impl (std::index_sequence< Is... >) const noexcept |
| template<size_t... Is> | |
| auto | get_curr_impl (std::index_sequence< Is... >) const |
| template<size_t... Is> | |
| void | next_impl (std::index_sequence< Is... >) |
Private Attributes | |
| std::tuple< uni_zip_detail::iterator_wrapper_t< Containers >... > | iters_ |
Iterator that traverses multiple containers (STL or Aleph) in lockstep.
This iterator automatically adapts to the container type, allowing you to zip together any combination of STL and Aleph containers.
| Containers | Parameter pack of container types. |
Definition at line 339 of file ah-zip-utils.H.
| using Aleph::UniZipIterator< Containers >::value_type = std::tuple<uni_zip_detail::container_value_t<Containers>...> |
Definition at line 345 of file ah-zip-utils.H.
|
inlineexplicit |
Constructor initializing wrappers for all containers.
Definition at line 384 of file ah-zip-utils.H.
|
inlinenoexcept |
Returns true if ALL containers are exhausted (equal length check)
Definition at line 402 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::all_completed_impl().
Referenced by Aleph::UniZipIterator< Containers >::completed().
|
inlineprivatenoexcept |
Definition at line 363 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::completed(), and Aleph::UniZipIterator< Containers >::iters_.
Referenced by Aleph::UniZipIterator< Containers >::all_completed().
|
inlinenoexcept |
Returns true if ANY container still has elements (for length checking)
Definition at line 396 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::any_has_curr_impl().
|
inlineprivatenoexcept |
Definition at line 357 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::has_curr(), and Aleph::UniZipIterator< Containers >::iters_.
Referenced by Aleph::UniZipIterator< Containers >::any_has_curr().
|
inlinenoexcept |
Check if iterator has reached the end.
Definition at line 409 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::all_completed().
Referenced by Aleph::UniZipIterator< Containers >::all_completed_impl().
|
inline |
Get the current element.
Get tuple of current elements from all containers
Definition at line 416 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::get_curr_impl().
Referenced by Aleph::UniZipIterator< Containers >::get_curr_impl(), Aleph::UniZipIterator< Containers >::operator*(), Aleph::uni_zip_assoc(), and Aleph::uni_zip_last().
|
inlineprivate |
Definition at line 369 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::get_curr(), and Aleph::UniZipIterator< Containers >::iters_.
Referenced by Aleph::UniZipIterator< Containers >::get_curr().
|
inlinenoexcept |
Returns true if ALL containers have current element (zip continues)
Check if iterator has a current element
Definition at line 390 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::has_curr_impl().
Referenced by Aleph::UniZipIterator< Containers >::any_has_curr_impl(), Aleph::UniZipView< Containers >::empty(), Aleph::UniZipIterator< Containers >::has_curr_impl(), Aleph::UniZipIterator< Containers >::operator==(), and Aleph::UniZipIterator< Containers >::operator==().
|
inlineprivatenoexcept |
Definition at line 351 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::has_curr(), and Aleph::UniZipIterator< Containers >::iters_.
Referenced by Aleph::UniZipIterator< Containers >::has_curr().
|
inline |
Advance to the next element.
Advance all iterators
Definition at line 423 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::next_impl().
Referenced by Aleph::UniZipIterator< Containers >::next_ne(), and Aleph::UniZipIterator< Containers >::operator++().
|
inlineprivate |
Definition at line 375 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::iters_.
Referenced by Aleph::UniZipIterator< Containers >::next().
|
inline |
Advance without checking; same as next(), which does not check.
Provided so the adaptor satisfies AlephIterator and works in generic code that advances with next_ne() under a has_curr() guard.
Definition at line 433 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::next().
|
inlinenoexcept |
Inequality comparison with another iterator.
Definition at line 472 of file ah-zip-utils.H.
|
inlinenoexcept |
Inequality comparison with sentinel.
Definition at line 459 of file ah-zip-utils.H.
|
inline |
Dereference operator for STL compatibility.
Definition at line 440 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::get_curr().
|
inline |
Pre-increment operator for STL compatibility.
Definition at line 446 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::next().
|
inlinenoexcept |
Comparison with another iterator (for algorithms that need it)
Definition at line 465 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::has_curr().
|
inlinenoexcept |
Comparison with sentinel - iterator is "at end" when any container exhausted.
Definition at line 453 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::has_curr().
|
private |
Definition at line 348 of file ah-zip-utils.H.
Referenced by Aleph::UniZipIterator< Containers >::all_completed_impl(), Aleph::UniZipIterator< Containers >::any_has_curr_impl(), Aleph::UniZipIterator< Containers >::get_curr_impl(), Aleph::UniZipIterator< Containers >::has_curr_impl(), and Aleph::UniZipIterator< Containers >::next_impl().
|
staticconstexpr |
Definition at line 381 of file ah-zip-utils.H.