MySQL 8.0.39
Source Code Documentation
temptable::Storage::Iterator Class Reference

Iterator over a Storage object. More...

#include <storage.h>

Public Member Functions

 Iterator ()
 Default constructor. More...
 
 Iterator (const Storage *storage, const Element *element)
 Constructor where the Storage object to iterate over and the starting position are provided. More...
 
 Iterator (const Iterator &)=default
 Copy-construct from another iterator. More...
 
Elementoperator* () const
 Dereference the iterator to the element it points to. More...
 
Iteratoroperator= (const Element *element)
 Assign a new position within the same Storage object. More...
 
Iteratoroperator= (const Iterator &)=default
 Copy-assign from another iterator. More...
 
bool operator== (const Iterator &rhs) const
 Compare with another iterator. More...
 
bool operator!= (const Iterator &rhs) const
 Compare with another iterator. More...
 
Iteratoroperator++ ()
 Advance the iterator one element forward. More...
 
Iteratoroperator-- ()
 Recede the iterator one element backwards. More...
 

Private Attributes

Storagem_storage
 Storage over which the iterator operates. More...
 
Elementm_element
 Current element. More...
 

Detailed Description

Iterator over a Storage object.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

temptable::Storage::Iterator::Iterator ( )
inline

Default constructor.

This creates a hollow iterator object, that must be assigned afterwards.

◆ Iterator() [2/3]

temptable::Storage::Iterator::Iterator ( const Storage storage,
const Element element 
)
inline

Constructor where the Storage object to iterate over and the starting position are provided.

The iterator is fully initialized after this and ready for iteration.

Parameters
[in]storageStorage object to iterate over.
[in]elementInitial position of the iterator, must point to an element inside `storage`.

◆ Iterator() [3/3]

temptable::Storage::Iterator::Iterator ( const Iterator )
default

Copy-construct from another iterator.

Member Function Documentation

◆ operator!=()

bool temptable::Storage::Iterator::operator!= ( const Iterator rhs) const
inline

Compare with another iterator.

For two iterators to be equal, they must be positioned on the same element in the same storage.

Returns
true if not equal
Parameters
[in]rhsIterator to compare with.

◆ operator*()

Storage::Element * temptable::Storage::Iterator::operator* ( ) const
inline

Dereference the iterator to the element it points to.

Returns
the element where the iterator is positioned

◆ operator++()

Storage::Iterator & temptable::Storage::Iterator::operator++ ( )
inline

Advance the iterator one element forward.

If the iterator points to end() before this call, then the behavior is undefined.

Returns
*this

◆ operator--()

Storage::Iterator & temptable::Storage::Iterator::operator-- ( )
inline

Recede the iterator one element backwards.

If the iterator points to begin() before this call, then the behavior is undefined.

Returns
*this

◆ operator=() [1/2]

Storage::Iterator & temptable::Storage::Iterator::operator= ( const Element element)
inline

Assign a new position within the same Storage object.

Returns
*this
Parameters
[in]elementNew position for the iterator.

◆ operator=() [2/2]

Iterator & temptable::Storage::Iterator::operator= ( const Iterator )
default

Copy-assign from another iterator.

◆ operator==()

bool temptable::Storage::Iterator::operator== ( const Iterator rhs) const
inline

Compare with another iterator.

For two iterators to be equal, they must be positioned on the same element in the same storage.

Returns
true if equal
Parameters
[in]rhsIterator to compare with.

Member Data Documentation

◆ m_element

Element* temptable::Storage::Iterator::m_element
private

Current element.

◆ m_storage

Storage* temptable::Storage::Iterator::m_storage
private

Storage over which the iterator operates.


The documentation for this class was generated from the following file: