CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
Locator Class Reference

Locate items inside containers. More...

#include <cc/Locator>

Inheritance diagram for Locator:

Public Member Functions

 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.
 

Protected Member Functions

 Locator (const unsigned *revision, long index, BucketStop *stop, unsigned egress)
 
void stepNext ()
 
void stepBack ()
 

Protected Attributes

long index_
 
BucketStop * stop_
 
unsigned egress_
 
unsigned revisionSaved_ { 0 }
 
const unsigned * revisionPtr_ { &revisionSaved_ }
 

Detailed Description

Locate items inside containers.

Constructor & Destructor Documentation

◆ Locator()

Locator ( long index = 0)

Create a locator pointing to index.

Member Function Documentation

◆ index()

long index ( ) const

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

◆ operator+() [1/2]

long operator+ ( ) const

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

◆ operator++() [1/2]

Locator & operator++ ( )

Step to the next item (prefix increment operator)

◆ operator--() [1/2]

Locator & operator-- ( )

Step to the previous item (prefix decrement operator)

◆ operator++() [2/2]

Locator operator++ ( int )

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

◆ operator--() [2/2]

Locator operator-- ( int )

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

◆ operator+() [2/2]

Locator operator+ ( long delta)

Get locator value stepped delta items forward (addition operator)

◆ operator-() [1/2]

Locator operator- ( long delta)

Get locator value stepped delta items backward (substraction operator)

◆ operator-() [2/2]

long operator- ( const Locator & other) const

Get distance between this and another locator (substraction operator)

◆ operator==()

bool operator== ( const Locator & other) const

Equality operator.

◆ operator<=>()

std::strong_ordering operator<=> ( const Locator & other) const

Ordering operator.

◆ isValid()

bool isValid ( ) const

Check if this locator is valid.

◆ operator bool()

operator bool ( ) const
explicit

Check if this locator is valid.