CatapultServer  v0.5.0.1 (Elephant)
catapult::state::CompactArrayStack< T, N >::const_iterator Class Reference

Public Types

using difference_type = std::ptrdiff_t
 
using value_type = const T
 
using pointer = const T *
 
using reference = const T &
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

 const_iterator (const std::array< T, N > *pArray, size_t index)
 Creates an iterator around pArray with index current position. More...
 
bool operator== (const const_iterator &rhs) const
 Returns true if this iterator and rhs are equal. More...
 
bool operator!= (const const_iterator &rhs) const
 Returns true if this iterator and rhs are not equal. More...
 
const_iteratoroperator++ ()
 Advances the iterator to the next position. More...
 
const_iterator operator++ (int)
 Advances the iterator to the next position. More...
 
reference operator* () const
 Returns a reference to the current value. More...
 
pointer operator-> () const
 Returns a pointer to the current value. More...
 

Private Member Functions

bool isEnd () const
 

Private Attributes

const std::array< T, N > * m_pArray
 
size_t m_index
 
m_defaultValue
 

Detailed Description

template<typename T, size_t N>
class catapult::state::CompactArrayStack< T, N >::const_iterator

Compact array stack const iterator.

Note
Iterator will always return N values to mimic std::array behavior.
Custom iterator is needed in order to support iteration when std::array member is nullptr (memory optimization).

Member Typedef Documentation

◆ difference_type

template<typename T, size_t N>
using catapult::state::CompactArrayStack< T, N >::const_iterator::difference_type = std::ptrdiff_t

◆ iterator_category

template<typename T, size_t N>
using catapult::state::CompactArrayStack< T, N >::const_iterator::iterator_category = std::forward_iterator_tag

◆ pointer

template<typename T, size_t N>
using catapult::state::CompactArrayStack< T, N >::const_iterator::pointer = const T*

◆ reference

template<typename T, size_t N>
using catapult::state::CompactArrayStack< T, N >::const_iterator::reference = const T&

◆ value_type

template<typename T, size_t N>
using catapult::state::CompactArrayStack< T, N >::const_iterator::value_type = const T

Constructor & Destructor Documentation

◆ const_iterator()

template<typename T, size_t N>
catapult::state::CompactArrayStack< T, N >::const_iterator::const_iterator ( const std::array< T, N > *  pArray,
size_t  index 
)
inlineexplicit

Creates an iterator around pArray with index current position.

Member Function Documentation

◆ isEnd()

template<typename T, size_t N>
bool catapult::state::CompactArrayStack< T, N >::const_iterator::isEnd ( ) const
inlineprivate
Here is the caller graph for this function:

◆ operator!=()

template<typename T, size_t N>
bool catapult::state::CompactArrayStack< T, N >::const_iterator::operator!= ( const const_iterator rhs) const
inline

Returns true if this iterator and rhs are not equal.

◆ operator*()

template<typename T, size_t N>
reference catapult::state::CompactArrayStack< T, N >::const_iterator::operator* ( ) const
inline

Returns a reference to the current value.

Here is the call graph for this function:

◆ operator++() [1/2]

template<typename T, size_t N>
const_iterator& catapult::state::CompactArrayStack< T, N >::const_iterator::operator++ ( )
inline

Advances the iterator to the next position.

Here is the call graph for this function:

◆ operator++() [2/2]

template<typename T, size_t N>
const_iterator catapult::state::CompactArrayStack< T, N >::const_iterator::operator++ ( int  )
inline

Advances the iterator to the next position.

◆ operator->()

template<typename T, size_t N>
pointer catapult::state::CompactArrayStack< T, N >::const_iterator::operator-> ( ) const
inline

Returns a pointer to the current value.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator==()

template<typename T, size_t N>
bool catapult::state::CompactArrayStack< T, N >::const_iterator::operator== ( const const_iterator rhs) const
inline

Returns true if this iterator and rhs are equal.

Member Data Documentation

◆ m_defaultValue

template<typename T, size_t N>
T catapult::state::CompactArrayStack< T, N >::const_iterator::m_defaultValue
private

◆ m_index

template<typename T, size_t N>
size_t catapult::state::CompactArrayStack< T, N >::const_iterator::m_index
private

◆ m_pArray

template<typename T, size_t N>
const std::array<T, N>* catapult::state::CompactArrayStack< T, N >::const_iterator::m_pArray
private

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