commonlib
VectorWithIdsIterators::VectorWithIdsIterator< T, ConstSwitch > Class Template Reference

Public Types

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

Public Member Functions

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

Friends

class VectorWithIds< T >
 

Member Function Documentation

◆ getId()

template<typename T , ConstTypeSwitch ConstSwitch>
int32_t VectorWithIdsIterators::VectorWithIdsIterator< T, ConstSwitch >::getId ( ) const
Returns
id number of the element pointed by the iterator

◆ operator!=()

template<typename T , ConstTypeSwitch ConstSwitch>
bool VectorWithIdsIterators::VectorWithIdsIterator< T, ConstSwitch >::operator!= ( const VectorWithIdsIterator< T, 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 T , ConstTypeSwitch ConstSwitch>
VectorWithIdsIterator< T, ConstSwitch >::ValueType & VectorWithIdsIterators::VectorWithIdsIterator< T, ConstSwitch >::operator* ( )
Returns
reference to the pointed element

◆ operator+()

template<typename T , ConstTypeSwitch ConstSwitch>
VectorWithIdsIterator< T, ConstSwitch > VectorWithIdsIterators::VectorWithIdsIterator< T, 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 T , ConstTypeSwitch ConstSwitch>
const VectorWithIdsIterator< T, ConstSwitch > & VectorWithIdsIterators::VectorWithIdsIterator< T, ConstSwitch >::operator++ ( )

Post increment iterator to the next element in container.

Returns
constant reference to self

◆ operator++() [2/2]

template<typename T , ConstTypeSwitch ConstSwitch>
VectorWithIdsIterator< T, ConstSwitch > VectorWithIdsIterators::VectorWithIdsIterator< T, ConstSwitch >::operator++ ( int32_t  )

Pre increment iterator to the next element in container.

Returns
iterator pointing to the element before increment

◆ operator->()

template<typename T , ConstTypeSwitch ConstSwitch>
VectorWithIdsIterator< T, ConstSwitch >::ValueType * VectorWithIdsIterators::VectorWithIdsIterator< T, ConstSwitch >::operator-> ( )
Returns
pointer to the pointed element

◆ operator==()

template<typename T , ConstTypeSwitch ConstSwitch>
bool VectorWithIdsIterators::VectorWithIdsIterator< T, ConstSwitch >::operator== ( const VectorWithIdsIterator< T, 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: