ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
forward_iterator< T >

POD forward iterator type using a forward iterator interface to iterate over a sequence. More...

#include <iterator_intf.h>

Public Types

typedef T value_type
 value type
 
typedef forward_iterator< T > self_type
 self type
 
typedef T * pointer
 value pointer type
 
typedef const T * const_pointer
 const value pointer type
 
typedef T & reference
 value reference type
 
typedef const T & const_reference
 const value reference type
 
typedef std::forward_iterator_tag iterator_category
 category of the iterator
 
typedef std::ptrdiff_t difference_type
 pointer difference type
 

Public Member Functions

self_type operator++ ()
 Pre-increment operator using iterator interface method Next()
 
self_type operator++ (int32_t)
 Post-increment operator.
 
pointer operator-> ()
 Pointer operator.
 
const_pointer operator-> () const
 Pointer operator const version.
 
reference operator* ()
 Dereference operator.
 
const_reference operator* () const
 Dereference operator const version.
 

Private Types

typedef std::conditional< std::is_const< value_type >::value, constIForwardIterator< T > *, IForwardIterator< T > * >::type iterator_interface_pointer
 const correct pointer to the iterator interface used to increment this iterator
 

Private Attributes

iterator_interface_pointer m_pIt
 Pointer to iterator interface providing Next()
 
pointer m_pCur
 Pointer to the current value inside the sequence.
 

Detailed Description

template<typename T>
struct adtf::ucom::ant::forward_iterator< T >

POD forward iterator type using a forward iterator interface to iterate over a sequence.

Objects of this type are restricted to be correctly assigned only by friend type iterator_adapter

Template Parameters
TValue type of the container to iterator over

Definition at line 37 of file iterator_intf.h.

Member Typedef Documentation

◆ const_pointer

template<typename T>
typedef const T* const_pointer

const value pointer type

Definition at line 43 of file iterator_intf.h.

◆ const_reference

template<typename T>
typedef const T& const_reference

const value reference type

Definition at line 45 of file iterator_intf.h.

◆ difference_type

template<typename T>
typedef std::ptrdiff_t difference_type

pointer difference type

Definition at line 47 of file iterator_intf.h.

◆ iterator_category

template<typename T>
typedef std::forward_iterator_tag iterator_category

category of the iterator

Definition at line 46 of file iterator_intf.h.

◆ iterator_interface_pointer

template<typename T>
typedef std::conditional<std::is_const<value_type>::value,constIForwardIterator<T>*,IForwardIterator<T>*>::type iterator_interface_pointer
private

const correct pointer to the iterator interface used to increment this iterator

Definition at line 90 of file iterator_intf.h.

◆ pointer

template<typename T>
typedef T* pointer

value pointer type

Definition at line 42 of file iterator_intf.h.

◆ reference

template<typename T>
typedef T& reference

value reference type

Definition at line 44 of file iterator_intf.h.

◆ self_type

template<typename T>
typedef forward_iterator<T> self_type

self type

Definition at line 41 of file iterator_intf.h.

◆ value_type

template<typename T>
typedef T value_type

value type

Definition at line 40 of file iterator_intf.h.

Member Function Documentation

◆ operator*() [1/2]

template<typename T>
reference operator* ( )
inline

Dereference operator.

Returns
Reference to the current object of the sequence to iterate over

Definition at line 77 of file iterator_intf.h.

References m_pCur.

◆ operator*() [2/2]

template<typename T>
const_reference operator* ( ) const
inline

Dereference operator const version.

Returns
Reference to the current object of the sequence to iterate over

Definition at line 83 of file iterator_intf.h.

References m_pCur.

◆ operator++() [1/2]

template<typename T>
self_type operator++ ( )
inline

Pre-increment operator using iterator interface method Next()

Returns
self_type after incrementing

Definition at line 53 of file iterator_intf.h.

References m_pCur, and m_pIt.

◆ operator++() [2/2]

template<typename T>
self_type operator++ ( int32_t )
inline

Post-increment operator.

Returns
self_type before incrementing

Definition at line 59 of file iterator_intf.h.

◆ operator->() [1/2]

template<typename T>
pointer operator-> ( )
inline

Pointer operator.

Returns
Pointer to the current object of the sequence to iterate over

Definition at line 65 of file iterator_intf.h.

References m_pCur.

◆ operator->() [2/2]

template<typename T>
const_pointer operator-> ( ) const
inline

Pointer operator const version.

Returns
Pointer to the current object of the sequence to iterate over

Definition at line 71 of file iterator_intf.h.

References m_pCur.

Member Data Documentation

◆ m_pCur

template<typename T>
pointer m_pCur
private

Pointer to the current value inside the sequence.

Definition at line 96 of file iterator_intf.h.

Referenced by operator*(), operator*(), operator++(), operator->(), and operator->().

◆ m_pIt

template<typename T>
iterator_interface_pointer m_pIt
private

Pointer to iterator interface providing Next()

Definition at line 95 of file iterator_intf.h.

Referenced by operator++().