CoreComponents 3.0.0
A Modern C++ Toolkit
|
Value iterator. More...
#include <cc/Iterator>
Public Types | |
using | iterator_category = std::bidirectional_iterator_tag |
using | value_type = typename Container::Item |
using | difference_type = long |
using | pointer = typename Container::Item * |
using | reference = typename Container::Item & |
using | Item = typename Container::Item |
Item type. | |
using | Access = typename MakeAccessType<Item, std::is_const<Container>::value>::Type |
Item access type. | |
Public Member Functions | |
Iterator (const Locator &pos) | |
Create a value iterator from the locator pos. | |
Access & | operator* () const |
Get access to current item value. | |
long | operator+ () const |
Return the index value of the iterator (unary plus operator) | |
Iterator & | operator++ () |
Step to the next item (prefix increment operator) | |
Iterator & | operator-- () |
Step to the previous item (prefix decrement operator) | |
Iterator | operator++ (int) |
Step to the next item and return the old iterator value (postfix increment operator) | |
Iterator | operator-- (int) |
Step to the previous item and return the old iterator value (postfix decrement operator) | |
Iterator | operator+ (long delta) |
Get iterator value stepped delta items forward (addition operator) | |
Iterator | operator- (long delta) |
Get iterator value stepped delta items backward (substraction operator) | |
long | operator- (const Iterator &b) const |
Get distance between this and another iterator (substraction operator) | |
bool | operator== (const Iterator &b) const |
Equality operator. | |
std::strong_ordering | operator<=> (const Iterator &b) const |
Ordering operator. | |
operator bool () const | |
Check if this iterator is valid (explicitly cast to bool) | |
Public Member Functions inherited from Locator | |
Locator (long index=0) | |
Create a locator pointing to index. | |
long | index () const |
Return the index value of the locator (unary plus operator) | |
long | operator+ () const |
Return the index value of the locator (unary plus operator) | |
Locator & | operator++ () |
Step to the next item (prefix increment operator) | |
Locator & | operator-- () |
Step to the previous item (prefix decrement operator) | |
Locator | operator++ (int) |
Step to the next item and return the old locator value (postfix increment operator) | |
Locator | operator-- (int) |
Step to the previous item and return the old locator value (postfix decrement operator) | |
Locator | operator+ (long delta) |
Get locator value stepped delta items forward (addition operator) | |
Locator | operator- (long delta) |
Get locator value stepped delta items backward (substraction operator) | |
long | operator- (const Locator &other) const |
Get distance between this and another locator (substraction operator) | |
bool | operator== (const Locator &other) const |
Equality operator. | |
std::strong_ordering | operator<=> (const Locator &other) const |
Ordering operator. | |
bool | isValid () const |
Check if this locator is valid. | |
operator bool () const | |
Check if this locator is valid. | |
Additional Inherited Members | |
Protected Member Functions inherited from Locator | |
Locator (const unsigned *revision, long index, BucketStop *stop, unsigned egress) | |
void | stepNext () |
void | stepBack () |
Protected Attributes inherited from Locator | |
long | index_ |
BucketStop * | stop_ |
unsigned | egress_ |
unsigned | revisionSaved_ { 0 } |
const unsigned * | revisionPtr_ { &revisionSaved_ } |
Value iterator.
Container | Container type |
using Item = typename Container::Item |
Item type.
using Access = typename MakeAccessType<Item, std::is_const<Container>::value>::Type |
Item access type.
Create a value iterator from the locator pos.
Access & operator* | ( | ) | const |
Get access to current item value.
long operator+ | ( | ) | const |
Return the index value of the iterator (unary plus operator)
Iterator & operator++ | ( | ) |
Step to the next item (prefix increment operator)
Iterator & operator-- | ( | ) |
Step to the previous item (prefix decrement operator)
Iterator operator++ | ( | int | ) |
Step to the next item and return the old iterator value (postfix increment operator)
Iterator operator-- | ( | int | ) |
Step to the previous item and return the old iterator value (postfix decrement operator)
Iterator operator+ | ( | long | delta | ) |
Get iterator value stepped delta items forward (addition operator)
Iterator operator- | ( | long | delta | ) |
Get iterator value stepped delta items backward (substraction operator)
long operator- | ( | const Iterator< Container > & | b | ) | const |
Get distance between this and another iterator (substraction operator)
bool operator== | ( | const Iterator< Container > & | b | ) | const |
Equality operator.
std::strong_ordering operator<=> | ( | const Iterator< Container > & | b | ) | const |
Ordering operator.
|
explicit |
Check if this iterator is valid (explicitly cast to bool)