CatapultServer  v0.5.0.1 (Elephant)
catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator Class Reference

Iterator used for iterating over the view. More...

Collaboration diagram for catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator:

Public Types

using difference_type = std::ptrdiff_t
 
using value_type = const typename TSetTraits::StorageType
 
using pointer = value_type *
 
using reference = value_type &
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

 iterator (const SetType &elements, const DeltaElements< SetType > &deltas, size_t position, size_t size)
 Creates an iterator around the original elements and deltas at position given a total of size elements. More...
 
bool operator== (const iterator &rhs) const
 Returns true if this iterator and rhs are equal. More...
 
bool operator!= (const iterator &rhs) const
 Returns true if this iterator and rhs are not equal. More...
 
iteratoroperator++ ()
 Advances the iterator to the next position. More...
 
iterator operator++ (int)
 Advances the iterator to the next position. More...
 
value_typeoperator-> () const
 Returns a pointer to the current element. More...
 
value_typeoperator* () const
 Returns a reference to the current element. More...
 

Private Types

enum  IterationStage { IterationStage::Copied, IterationStage::Original, IterationStage::Added }
 

Private Member Functions

void moveToValidElement ()
 
bool handleCopiedStage ()
 
bool handleOriginalStage ()
 
bool handleAddedStage ()
 

Static Private Member Functions

static constexpr bool Contains (const SetType &set, const KeyType &key)
 

Private Attributes

const SetTypem_elements
 
DeltaElements< SetTypem_deltas
 
size_t m_position
 
size_t m_size
 
IterationStage m_stage
 
SetType::const_iterator m_iter
 

Detailed Description

template<typename TSetTraits>
class catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator

Iterator used for iterating over the view.

Member Typedef Documentation

◆ difference_type

template<typename TSetTraits>
using catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::difference_type = std::ptrdiff_t

◆ iterator_category

template<typename TSetTraits>
using catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::iterator_category = std::forward_iterator_tag

◆ pointer

template<typename TSetTraits>
using catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::pointer = value_type*

◆ reference

template<typename TSetTraits>
using catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::reference = value_type&

◆ value_type

template<typename TSetTraits>
using catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::value_type = const typename TSetTraits::StorageType

Member Enumeration Documentation

◆ IterationStage

template<typename TSetTraits>
enum catapult::deltaset::BaseSetDeltaIterationView::iterator::IterationStage
strongprivate
Enumerator
Copied 
Original 
Added 

Constructor & Destructor Documentation

◆ iterator()

template<typename TSetTraits>
catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::iterator ( const SetType elements,
const DeltaElements< SetType > &  deltas,
size_t  position,
size_t  size 
)
inline

Creates an iterator around the original elements and deltas at position given a total of size elements.

Here is the call graph for this function:

Member Function Documentation

◆ Contains()

template<typename TSetTraits>
static constexpr bool catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::Contains ( const SetType set,
const KeyType key 
)
inlinestaticconstexprprivate
Here is the caller graph for this function:

◆ handleAddedStage()

template<typename TSetTraits>
bool catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::handleAddedStage ( )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleCopiedStage()

template<typename TSetTraits>
bool catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::handleCopiedStage ( )
inlineprivate
Here is the caller graph for this function:

◆ handleOriginalStage()

template<typename TSetTraits>
bool catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::handleOriginalStage ( )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveToValidElement()

template<typename TSetTraits>
void catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::moveToValidElement ( )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

template<typename TSetTraits>
bool catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::operator!= ( const iterator rhs) const
inline

Returns true if this iterator and rhs are not equal.

◆ operator*()

template<typename TSetTraits>
value_type& catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::operator* ( ) const
inline

Returns a reference to the current element.

Here is the call graph for this function:

◆ operator++() [1/2]

template<typename TSetTraits>
iterator& catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::operator++ ( )
inline

Advances the iterator to the next position.

Here is the call graph for this function:

◆ operator++() [2/2]

template<typename TSetTraits>
iterator catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::operator++ ( int  )
inline

Advances the iterator to the next position.

◆ operator->()

template<typename TSetTraits>
value_type* catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::operator-> ( ) const
inline

Returns a pointer to the current element.

Here is the caller graph for this function:

◆ operator==()

template<typename TSetTraits>
bool catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::operator== ( const iterator rhs) const
inline

Returns true if this iterator and rhs are equal.

Member Data Documentation

◆ m_deltas

template<typename TSetTraits>
DeltaElements<SetType> catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::m_deltas
private

◆ m_elements

template<typename TSetTraits>
const SetType& catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::m_elements
private

◆ m_iter

template<typename TSetTraits>
SetType::const_iterator catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::m_iter
private

◆ m_position

template<typename TSetTraits>
size_t catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::m_position
private

◆ m_size

template<typename TSetTraits>
size_t catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::m_size
private

◆ m_stage

template<typename TSetTraits>
IterationStage catapult::deltaset::BaseSetDeltaIterationView< TSetTraits >::iterator::m_stage
private

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