commonlib
VectorWithKeysIterators::VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > Class Template Reference

Public Types

using ValType = typename UnderlyingTypes< KeyType, ValueType, ConstSwitch >::ValType
 
using PointeeType = typename UnderlyingTypes< KeyType, ValueType, ConstSwitch >::PointeeType
 
using iterator_category = std::forward_iterator_tag
 
using value_type = ValType
 
using difference_type = std::ptrdiff_t
 
using pointer = ValType *
 
using reference = ValType &
 

Public Member Functions

const KeyType & getKey () const
 
ValType & operator* ()
 
ValType * operator-> ()
 
const VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > & operator++ ()
 Post increment iterator to the next element in container. More...
 
VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > operator++ (int32_t)
 Pre increment iterator to the next element in container. More...
 
VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > operator+ (int32_t increment)
 Increment iterator to by the number of elements passed as an increment. More...
 
bool operator== (const VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > &other) const
 Check if iterators point to the same element in the container. More...
 
bool operator!= (const VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > &other) const
 Check if iterators don't point to the same element in the container. More...
 

Friends

class VectorWithKeys< KeyType, ValueType >
 

Member Function Documentation

◆ getKey()

template<typename KeyType , typename ValueType , ConstTypeSwitch ConstSwitch>
const KeyType & VectorWithKeysIterators::VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::getKey ( ) const
Returns
constant reference to the key of the element pointed by the iterator

◆ operator!=()

template<typename KeyType , typename ValueType , ConstTypeSwitch ConstSwitch>
bool VectorWithKeysIterators::VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::operator!= ( const VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > &  other) const

Check if iterators don't point to the same element in the container.

Parameters
otheriterator used for comparison
Returns
true if iterators don't point to the same element in container, false otherwise

◆ operator*()

template<typename KeyType , typename ValueType , ConstTypeSwitch ConstSwitch>
VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::ValType & VectorWithKeysIterators::VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::operator* ( )
Returns
reference to the pointed element

◆ operator+()

template<typename KeyType , typename ValueType , ConstTypeSwitch ConstSwitch>
VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > VectorWithKeysIterators::VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::operator+ ( int32_t  increment)

Increment iterator to by the number of elements passed as an increment.

Parameters
incrementthe number of element by which the iterator is incremented
Returns
iterator pointing to the element offset by an increment to the original pointed element

◆ operator++() [1/2]

template<typename KeyType , typename ValueType , ConstTypeSwitch ConstSwitch>
const VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > & VectorWithKeysIterators::VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::operator++ ( )

Post increment iterator to the next element in container.

Returns
constant reference to self

◆ operator++() [2/2]

template<typename KeyType , typename ValueType , ConstTypeSwitch ConstSwitch>
VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > VectorWithKeysIterators::VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::operator++ ( int32_t  )

Pre increment iterator to the next element in container.

Returns
iterator pointing to the element before increment

◆ operator->()

template<typename KeyType , typename ValueType , ConstTypeSwitch ConstSwitch>
VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::ValType * VectorWithKeysIterators::VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::operator-> ( )
Returns
pointer to the pointed element

◆ operator==()

template<typename KeyType , typename ValueType , ConstTypeSwitch ConstSwitch>
bool VectorWithKeysIterators::VectorWithKeysIterator< KeyType, ValueType, ConstSwitch >::operator== ( const VectorWithKeysIterator< KeyType, ValueType, ConstSwitch > &  other) const

Check if iterators point to the same element in the container.

Parameters
otheriterator used for comparison
Returns
true if iterators point to the same element in container, false otherwise

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