Kanzi 4.1.0
kanzi::indexed_list< T >::iterator Class Reference

Iterator over the values. More...

#include <kanzi/core/cpp/indexed_list.hpp>

Inheritance diagram for kanzi::indexed_list< T >::iterator:
[legend]

Public Types

using difference_type
 Difference type.
 
using iterator_category
 Iterator category.
 
using parent_type
 Parent class type.
 
using pointer
 Pointer type.
 
using reference
 Reference type.
 
using value_type
 Value type.
 
- Public Types inherited from kanzi::indexed_list< T >::IteratorBase< indexed_list >
using difference_type
 Difference type. Required for stable_partition.
 
using iterator_category
 Iterator category.
 
using value_type
 Value type.
 

Public Member Functions

element_typegetElement ()
 Gets a reference to the element at location.
 
const element_typegetElement () const
 Gets a reference to the element at location.
 
 iterator (const iterator &other)=default
 Default copy constructor.
 
 iterator (indexed_list &host)
 Default constructor.
 
 iterator (indexed_list &host, size_t index)
 Constructor to given index.
 
 iterator (iterator &&other)=default
 Default move constructor.
 
 operator const_iterator () const
 Implicit conversion to const_iterator.
 
bool operator!= (const const_iterator &other) const
 Not equals operator.
 
bool operator!= (const iterator &other) const
 Not equals operator.
 
Toperator* ()
 Dereference operator.
 
iteratoroperator++ ()
 Increment operator (prefix).
 
iterator operator++ (int)
 Increment operator (postfix).
 
iteratoroperator-- ()
 Decrement operator (prefix).
 
iterator operator-- (int)
 Decrement operator (postfix).
 
Toperator-> ()
 Member access operator.
 
iteratoroperator= (const iterator &other)=default
 Default copy operator.
 
iteratoroperator= (iterator &&other)=default
 Default move operator.
 
bool operator== (const const_iterator &other) const
 Equals operator.
 
bool operator== (const iterator &other) const
 Equals operator.
 
- Public Member Functions inherited from kanzi::indexed_list< T >::IteratorBase< indexed_list >
size_t getIndex () const
 Gets the index the iterator is pointing at.
 
 IteratorBase (const IteratorBase &other)=default
 Copy constructor.
 
 IteratorBase (indexed_list &host)
 Constructor to end.
 
 IteratorBase (indexed_list &host, size_t index)
 Constructor to given index.
 
 IteratorBase (IteratorBase &&other)=default
 Move constructor.
 
bool iteratorEquals (const indexed_list *otherHost, size_t otherIndex) const
 Indicates whether this iterator equals given parameters.
 
const T & operator* () const
 Const dereference operator.
 
const T * operator-> () const
 Const member access operator.
 
IteratorBaseoperator= (const IteratorBase &other)=default
 Copy operator.
 
IteratorBaseoperator= (IteratorBase &&other)=default
 Move operator.
 

Additional Inherited Members

- Protected Attributes inherited from kanzi::indexed_list< T >::IteratorBase< indexed_list >
indexed_listm_host
 Host list.
 
size_t m_index
 Index being iterated.
 

Detailed Description

template<typename T>
class kanzi::indexed_list< T >::iterator

Iterator over the values.

Not invalidated if the container is resized.

Member Typedef Documentation

◆ parent_type

template<typename T >
using kanzi::indexed_list< T >::iterator::parent_type

Parent class type.

◆ difference_type

template<typename T >
using kanzi::indexed_list< T >::iterator::difference_type

Difference type.

◆ iterator_category

template<typename T >
using kanzi::indexed_list< T >::iterator::iterator_category

Iterator category.

◆ value_type

template<typename T >
using kanzi::indexed_list< T >::iterator::value_type

Value type.

◆ pointer

template<typename T >
using kanzi::indexed_list< T >::iterator::pointer

Pointer type.

◆ reference

template<typename T >
using kanzi::indexed_list< T >::iterator::reference

Reference type.

Constructor & Destructor Documentation

◆ iterator() [1/4]

template<typename T >
kanzi::indexed_list< T >::iterator::iterator ( indexed_list & host)
inlineexplicit

Default constructor.

Qualifies as invalid iterator or end.

Parameters
hostHost list.

◆ iterator() [2/4]

template<typename T >
kanzi::indexed_list< T >::iterator::iterator ( indexed_list & host,
size_t index )
inlineexplicit

Constructor to given index.

Parameters
hostHost list.
indexIndex to point at.

◆ iterator() [3/4]

template<typename T >
kanzi::indexed_list< T >::iterator::iterator ( const iterator & other)
default

Default copy constructor.

Parameters
otherSource iterator.

◆ iterator() [4/4]

template<typename T >
kanzi::indexed_list< T >::iterator::iterator ( iterator && other)
default

Default move constructor.

Parameters
otherSource iterator.

Member Function Documentation

◆ operator=() [1/2]

template<typename T >
iterator & kanzi::indexed_list< T >::iterator::operator= ( const iterator & other)
default

Default copy operator.

Parameters
otherSource iterator.

◆ operator=() [2/2]

template<typename T >
iterator & kanzi::indexed_list< T >::iterator::operator= ( iterator && other)
default

Default move operator.

Parameters
otherSource iterator.

◆ getElement() [1/2]

template<typename T >
element_type & kanzi::indexed_list< T >::iterator::getElement ( )
inline

Gets a reference to the element at location.

Returns
Reference to the element.

◆ getElement() [2/2]

template<typename T >
const element_type & kanzi::indexed_list< T >::iterator::getElement ( ) const
inline

Gets a reference to the element at location.

Returns
Reference to the element.

◆ operator++() [1/2]

template<typename T >
iterator & kanzi::indexed_list< T >::iterator::operator++ ( )
inline

Increment operator (prefix).

Returns
Reference to this iterator.

◆ operator++() [2/2]

template<typename T >
iterator kanzi::indexed_list< T >::iterator::operator++ ( int )
inline

Increment operator (postfix).

Returns
Iterator value before increment.

◆ operator--() [1/2]

template<typename T >
iterator & kanzi::indexed_list< T >::iterator::operator-- ( )
inline

Decrement operator (prefix).

Returns
Reference to this iterator.

◆ operator--() [2/2]

template<typename T >
iterator kanzi::indexed_list< T >::iterator::operator-- ( int )
inline

Decrement operator (postfix).

Returns
Iterator value before decrement.

◆ operator*()

template<typename T >
T & kanzi::indexed_list< T >::iterator::operator* ( )
inline

Dereference operator.

Returns
Reference to value at iterator.

◆ operator->()

template<typename T >
T * kanzi::indexed_list< T >::iterator::operator-> ( )
inline

Member access operator.

Returns
Pointer to value at iterator.

◆ operator==() [1/2]

template<typename T >
bool kanzi::indexed_list< T >::iterator::operator== ( const iterator & other) const
inline

Equals operator.

Parameters
otherOther iterator.
Returns
If iterators are equal true, false otherwise.

◆ operator==() [2/2]

template<typename T >
bool kanzi::indexed_list< T >::iterator::operator== ( const const_iterator & other) const
inline

Equals operator.

Parameters
otherOther iterator.
Returns
If iterators are equal true, false otherwise.

◆ operator!=() [1/2]

template<typename T >
bool kanzi::indexed_list< T >::iterator::operator!= ( const iterator & other) const
inline

Not equals operator.

Parameters
otherOther iterator.
Returns
If iterators are not equal true, false otherwise.

◆ operator!=() [2/2]

template<typename T >
bool kanzi::indexed_list< T >::iterator::operator!= ( const const_iterator & other) const
inline

Not equals operator.

Parameters
otherOther iterator.
Returns
If iterators are not equal true, false otherwise.

◆ operator const_iterator()

template<typename T >
kanzi::indexed_list< T >::iterator::operator const_iterator ( ) const
inline

Implicit conversion to const_iterator.

Returns
Const iterator at same location.

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