|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
STL-compatible const iterator adapter for Aleph containers. More...
#include <ah-iterator.H>
Public Types | |
| using | T = typename SetType::Item_Type |
| using | Itor = typename SetType::Iterator |
| using | Base = Aleph::Const_Iterator< Itor > |
| using | iterator_category = std::conditional_t< AlephRandomAccessItor< Itor >, std::random_access_iterator_tag, std::forward_iterator_tag > |
| Category is promoted to random-access when the underlying Aleph iterator opts in (see AlephRandomAccessItor); otherwise it stays forward, which is the historical default and never a regression. | |
| using | iterator_concept = iterator_category |
| using | difference_type = std::ptrdiff_t |
| using | pointer = const T * |
| using | reference = const T & |
| using | value_type = T |
Public Types inherited from Aleph::Const_Iterator< SetType::Iterator > | |
| using | Itor = SetType::Iterator |
| The underlying iterator. | |
| using | aleph_random_access_iterator = std::conditional_t< AlephRandomAccessItor< SetType::Iterator >, Const_Iterator, void > |
| Random access when the underlying iterator opts in; see AlephRandomAccessItor. | |
Public Member Functions | |
| StlConstIterator () noexcept=default | |
| Default constructor creates an "end" iterator (no current element). | |
| StlConstIterator (const SetType &s) | |
Positioned on the first item of s, which is never modified. | |
| StlConstIterator & | operator++ () |
| Pre-increment: advance to the next element. | |
| StlConstIterator | operator++ (int) |
| Post-increment: advance to the next element and return the old iterator. | |
| bool | operator== (const StlConstIterator &it) const |
| Equality compares positions when both iterators are valid; otherwise both must be in the end state. | |
| bool | operator!= (const StlConstIterator &it) const |
| Inequality. | |
| const T & | operator* () const |
| Dereference: return the current element. | |
| const T * | operator-> () const |
| Member access to the current element. | |
| StlConstIterator & | operator-- () |
| Pre-decrement: move to the previous element. | |
| StlConstIterator | operator-- (int) |
| Post-decrement: move to the previous element and return the old iterator. | |
| StlConstIterator & | operator+= (difference_type n) |
Advance the iterator n positions (n may be negative). | |
| StlConstIterator & | operator-= (difference_type n) |
Move the iterator back n positions (n may be negative). | |
| StlConstIterator | operator+ (difference_type n) const |
Return an iterator advanced n positions. | |
| StlConstIterator | operator- (difference_type n) const |
Return an iterator moved back n positions. | |
| difference_type | operator- (const StlConstIterator &it) const |
| Return the signed distance between two iterators. | |
| reference | operator[] (difference_type n) const |
Access the element n positions away from the current one. | |
| std::strong_ordering | operator<=> (const StlConstIterator &it) const |
| Order two iterators by their logical position. | |
Public Member Functions inherited from Aleph::Const_Iterator< SetType::Iterator > | |
| Const_Iterator ()=default | |
| A view with no current item. | |
| Const_Iterator (const C &c) | |
View positioned on the first item of the container c. | |
| Const_Iterator (SetType::Iterator underlying) noexcept(std::is_nothrow_move_constructible_v< SetType::Iterator >) | |
| Read-only view over an existing iterator. | |
| auto | has_curr () const noexcept(noexcept(std::declval< I & >().has_curr())) -> decltype(std::declval< I & >().has_curr()) |
true if there is a current item. | |
| auto | get_curr () const noexcept(noexcept(std::declval< I & >().get_curr())) -> const_iterator_detail::const_item_t< decltype(std::declval< I & >().get_curr())> |
| The current item, read-only. | |
| auto | get_curr_ne () const noexcept(noexcept(std::declval< I & >().get_curr_ne())) -> const_iterator_detail::const_item_t< decltype(std::declval< I & >().get_curr_ne())> |
| get_curr() without the checks of the underlying iterator. | |
| auto | next () noexcept(noexcept(std::declval< I & >().next())) -> decltype(std::declval< I & >().next()) |
| Move to the next item; what the underlying iterator throws. | |
| auto | next_ne () noexcept(noexcept(std::declval< I & >().next_ne())) -> decltype(std::declval< I & >().next_ne()) |
| next() without checks. | |
| auto | prev () noexcept(noexcept(std::declval< I & >().prev())) -> decltype(std::declval< I & >().prev()) |
| Move to the previous item; what the underlying iterator throws. | |
| auto | prev_ne () noexcept(noexcept(std::declval< I & >().prev_ne())) -> decltype(std::declval< I & >().prev_ne()) |
| prev() without checks. | |
| auto | reset_first () noexcept(noexcept(std::declval< I & >().reset_first())) -> decltype(std::declval< I & >().reset_first()) |
| Position the view on the first item. | |
| auto | reset_last () noexcept(noexcept(std::declval< I & >().reset_last())) -> decltype(std::declval< I & >().reset_last()) |
| Position the view on the last item. | |
| auto | reset () noexcept(noexcept(std::declval< I & >().reset())) -> decltype(std::declval< I & >().reset()) |
| Position the view on the first item. | |
| auto | end () noexcept(noexcept(std::declval< I & >().end())) -> decltype(std::declval< I & >().end()) |
| Position the view past the last item. | |
| auto | get_pos () const noexcept(noexcept(std::declval< I & >().get_pos())) -> decltype(std::declval< I & >().get_pos()) |
| Ordinal position of the current item. | |
| auto | set_pos (const long pos) noexcept(noexcept(std::declval< I & >().set_pos(pos))) -> decltype(std::declval< I & >().set_pos(pos)) |
Position the view on the item at ordinal position pos. | |
| auto | is_last () const noexcept(noexcept(std::declval< I & >().is_last())) -> decltype(std::declval< I & >().is_last()) |
true if the current item is the last one. | |
| auto | is_in_first () const noexcept(noexcept(std::declval< I & >().is_in_first())) -> decltype(std::declval< I & >().is_in_first()) |
true if the current item is the first one. | |
| auto | is_in_last () const noexcept(noexcept(std::declval< I & >().is_in_last())) -> decltype(std::declval< I & >().is_in_last()) |
true if the current item is the last one. | |
| void | swap (Const_Iterator &other) noexcept(std::is_nothrow_swappable_v< SetType::Iterator >) |
| Exchange the views. | |
| auto | operator== (const Const_Iterator &other) const -> decltype(std::declval< I & >()==std::declval< I & >()) |
| Equality of the underlying iterators, when they have it. | |
| auto | operator!= (const Const_Iterator &other) const -> decltype(not(std::declval< I & >()==std::declval< I & >())) |
Negation of ==. | |
Static Public Member Functions | |
| static StlConstIterator | cbegin (const SetType &s) |
| Create a const iterator positioned at the first element of the container. | |
| static StlConstIterator | cend (const SetType &s) |
| Create a const end iterator for the container. | |
Friends | |
| StlConstIterator | operator+ (difference_type n, const StlConstIterator &it) |
Return an iterator advanced n positions (symmetric form). | |
Additional Inherited Members | |
Protected Member Functions inherited from Aleph::Const_Iterator< SetType::Iterator > | |
| SetType::Iterator & | underlying () const noexcept |
The underlying iterator, for the views that extend the reading protocol with members of their own (the read-only iterators of the graphs do it with get_src_node() and get_tgt_node()). | |
STL-compatible const iterator adapter for Aleph containers.
This adapter provides a read-only view over the underlying Aleph iterator.
| SetType | Aleph container type. |
Definition at line 572 of file ah-iterator.H.
| using StlConstIterator< SetType >::Base = Aleph::Const_Iterator<Itor> |
Definition at line 576 of file ah-iterator.H.
| using StlConstIterator< SetType >::difference_type = std::ptrdiff_t |
Definition at line 585 of file ah-iterator.H.
| using StlConstIterator< SetType >::iterator_category = std::conditional_t<AlephRandomAccessItor<Itor>, std::random_access_iterator_tag, std::forward_iterator_tag> |
Category is promoted to random-access when the underlying Aleph iterator opts in (see AlephRandomAccessItor); otherwise it stays forward, which is the historical default and never a regression.
Definition at line 581 of file ah-iterator.H.
| using StlConstIterator< SetType >::iterator_concept = iterator_category |
Definition at line 583 of file ah-iterator.H.
| using StlConstIterator< SetType >::Itor = typename SetType::Iterator |
Definition at line 575 of file ah-iterator.H.
| using StlConstIterator< SetType >::pointer = const T * |
Definition at line 587 of file ah-iterator.H.
| using StlConstIterator< SetType >::reference = const T & |
Definition at line 589 of file ah-iterator.H.
| using StlConstIterator< SetType >::T = typename SetType::Item_Type |
Definition at line 574 of file ah-iterator.H.
| using StlConstIterator< SetType >::value_type = T |
Definition at line 591 of file ah-iterator.H.
|
defaultnoexcept |
Default constructor creates an "end" iterator (no current element).
Referenced by StlConstIterator< SetType >::cbegin().
|
inline |
Positioned on the first item of s, which is never modified.
Definition at line 597 of file ah-iterator.H.
|
inlinestatic |
Create a const iterator positioned at the first element of the container.
Definition at line 738 of file ah-iterator.H.
References StlConstIterator< SetType >::StlConstIterator().
Referenced by StlAlephIterator< SetName >::begin(), and StlAlephIterator< SetName >::cbegin().
|
inlinestatic |
Create a const end iterator for the container.
Definition at line 744 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::it.
Referenced by StlAlephIterator< SetName >::cend(), and StlAlephIterator< SetName >::end().
|
inline |
Inequality.
Definition at line 633 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::it.
|
inline |
Dereference: return the current element.
Definition at line 639 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::get_curr().
|
inline |
Return an iterator advanced n positions.
Definition at line 690 of file ah-iterator.H.
|
inline |
Pre-increment: advance to the next element.
Definition at line 600 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::next().
|
inline |
Post-increment: advance to the next element and return the old iterator.
Definition at line 607 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::next().
|
inline |
Advance the iterator n positions (n may be negative).
Definition at line 674 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::get_pos(), and Aleph::Const_Iterator< SetType::Iterator >::set_pos().
|
inline |
Return the signed distance between two iterators.
Definition at line 715 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::get_pos().
|
inline |
Return an iterator moved back n positions.
Definition at line 706 of file ah-iterator.H.
|
inline |
Pre-decrement: move to the previous element.
Definition at line 657 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::prev().
|
inline |
Post-decrement: move to the previous element and return the old iterator.
Definition at line 665 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::prev().
|
inline |
Move the iterator back n positions (n may be negative).
Definition at line 682 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::get_pos(), and Aleph::Const_Iterator< SetType::Iterator >::set_pos().
|
inline |
Member access to the current element.
Definition at line 645 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::get_curr().
|
inline |
Order two iterators by their logical position.
Definition at line 731 of file ah-iterator.H.
References Aleph::Const_Iterator< SetType::Iterator >::get_pos().
|
inline |
Equality compares positions when both iterators are valid; otherwise both must be in the end state.
Definition at line 616 of file ah-iterator.H.
References Aleph::Const_Iterator< It >::get_pos(), Aleph::Const_Iterator< SetType::Iterator >::get_pos(), Aleph::Const_Iterator< SetType::Iterator >::has_curr(), and Aleph::Const_Iterator< SetType::Iterator >::it.
|
inline |
Access the element n positions away from the current one.
Definition at line 722 of file ah-iterator.H.
|
friend |
Return an iterator advanced n positions (symmetric form).
Definition at line 699 of file ah-iterator.H.