CoreComponents 4.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
ReverseIterator< Container > Class Template Reference

Reverse value iterator. More...

#include <cc/Iterator>

Inheritance diagram for ReverseIterator< Container >:

Public Types

using Item = typename Container::Item
 Item type.
using Access = typename MakeAccessType<Item, std::is_const<Container>::value>::Type
 Item access type.

Public Member Functions

 ReverseIterator (const Locator &pos)
 Create a value iterator from locator pos.
Accessoperator* () const
 Get access to current item value.
long operator+ () const
 Return the index value of the iterator (unary plus operator)
ReverseIteratoroperator++ ()
 Step to the next item (prefix increment operator).
ReverseIteratoroperator-- ()
 Step to the previous item (prefix decrement operator).
ReverseIterator operator++ (int)
 Step to the next item and return the old iterator value (postfix increment operator).
ReverseIterator operator-- (int)
 Step to the previous item and return the old iterator value (postfix decrement operator).
ReverseIterator operator+ (long delta)
 Get iterator value stepped delta items forward (addition operator).
ReverseIterator operator- (long delta)
 Get iterator value stepped delta items backward (substraction operator).
long operator- (const ReverseIterator &b) const
 Get distance between this and another iterator (substraction operator).
bool operator== (const ReverseIterator &b) const
 Equality operator.
std::strong_ordering operator<=> (const ReverseIterator &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)
Locatoroperator++ ()
 Step to the next item (prefix increment operator).
Locatoroperator-- ()
 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, blist::Stop *stop, unsigned egress)
void stepNext ()
void stepBack ()
Protected Attributes inherited from Locator
long index_
blist::Stop * stop_
unsigned egress_
unsigned revisionSaved_ { 0 }
const unsigned * revisionPtr_ { &revisionSaved_ }

Detailed Description

template<class Container>
class cc::ReverseIterator< Container >

Reverse value iterator.

Template Parameters
ContainerContainer type

Member Typedef Documentation

◆ Item

template<class Container>
using Item = typename Container::Item

Item type.

◆ Access

template<class Container>
using Access = typename MakeAccessType<Item, std::is_const<Container>::value>::Type

Item access type.

Constructor & Destructor Documentation

◆ ReverseIterator()

template<class Container>
ReverseIterator ( const Locator & pos)

Create a value iterator from locator pos.

Member Function Documentation

◆ operator*()

template<class Container>
Access & operator* ( ) const

Get access to current item value.

◆ operator+() [1/2]

template<class Container>
long operator+ ( ) const

Return the index value of the iterator (unary plus operator)

◆ operator++() [1/2]

template<class Container>
ReverseIterator & operator++ ( )

Step to the next item (prefix increment operator).

◆ operator--() [1/2]

template<class Container>
ReverseIterator & operator-- ( )

Step to the previous item (prefix decrement operator).

◆ operator++() [2/2]

template<class Container>
ReverseIterator operator++ ( int )

Step to the next item and return the old iterator value (postfix increment operator).

◆ operator--() [2/2]

template<class Container>
ReverseIterator operator-- ( int )

Step to the previous item and return the old iterator value (postfix decrement operator).

◆ operator+() [2/2]

template<class Container>
ReverseIterator operator+ ( long delta)

Get iterator value stepped delta items forward (addition operator).

◆ operator-() [1/2]

template<class Container>
ReverseIterator operator- ( long delta)

Get iterator value stepped delta items backward (substraction operator).

◆ operator-() [2/2]

template<class Container>
long operator- ( const ReverseIterator< Container > & b) const

Get distance between this and another iterator (substraction operator).

◆ operator==()

template<class Container>
bool operator== ( const ReverseIterator< Container > & b) const

Equality operator.

◆ operator<=>()

template<class Container>
std::strong_ordering operator<=> ( const ReverseIterator< Container > & b) const

Ordering operator.

◆ operator bool()

template<class Container>
operator bool ( ) const
explicit

Check if this iterator is valid (explicitly cast to bool).