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

Adapter for begin and end iterators - usable as return and parameter value in interfaces. More...

#include <iterator_intf.h>

Public Types

typedef T value_type
 value type
 
typedef iterator_adapter< value_type, IteratorType > self_type
 self type
 
typedef IteratorType< const value_typeconst_iterator
 const iterator type
 
typedef std::conditional< std::is_const< value_type >::value, const_iterator, IteratorType< value_type > >::type iterator
 iterator type
 

Public Member Functions

iterator begin () const
 Get iterator to the beginning of the container sequence (STL compliant)
 
iterator end () const
 Get iterator to the end of the container sequence (STL compliant)
 
const_iterator cbegin () const
 Get const iterator to the beginning of the container sequence (STL compliant)
 
const_iterator cend () const
 Get const iterator to the end of the container sequence (STL compliant)
 

Static Private Member Functions

template<typename IteratorInterfaceType>
static self_type create (IteratorInterfaceType &o_oIterator)
 Create the adapter by assigning iterator interface to begin and end iterators.
 

Private Attributes

iterator m_oBegin
 iterator to the beginning of the containers sequence
 
iterator m_oEnd
 iterator to past the last element of the container sequence
 

Detailed Description

template<typename T, template< typename > class IteratorType = forward_iterator>
struct adtf::ucom::ant::iterator_adapter< T, IteratorType >

Adapter for begin and end iterators - usable as return and parameter value in interfaces.

Template Parameters
TValue type of the container both end and begin iterators operate on
IteratorTypeActual type of the iterator - must be POD type

Definition at line 189 of file iterator_intf.h.

Member Typedef Documentation

◆ const_iterator

template<typename T, template< typename > class IteratorType = forward_iterator>
typedef IteratorType<const value_type> const_iterator

const iterator type

Definition at line 194 of file iterator_intf.h.

◆ iterator

template<typename T, template< typename > class IteratorType = forward_iterator>
typedef std::conditional<std::is_const<value_type>::value,const_iterator,IteratorType<value_type>>::type iterator

iterator type

Definition at line 198 of file iterator_intf.h.

◆ self_type

template<typename T, template< typename > class IteratorType = forward_iterator>
typedef iterator_adapter<value_type, IteratorType> self_type

self type

Definition at line 193 of file iterator_intf.h.

◆ value_type

template<typename T, template< typename > class IteratorType = forward_iterator>
typedef T value_type

value type

Definition at line 192 of file iterator_intf.h.

Member Function Documentation

◆ begin()

template<typename T, template< typename > class IteratorType = forward_iterator>
iterator begin ( ) const
inline

Get iterator to the beginning of the container sequence (STL compliant)

Returns
Iterator to the beginning of the container sequence

Definition at line 204 of file iterator_intf.h.

Referenced by iterator_adapter< T, pointer_iterator >::cbegin(), and iterator_adapter< value_type, IteratorType >::cbegin().

◆ cbegin()

template<typename T, template< typename > class IteratorType = forward_iterator>
const_iterator cbegin ( ) const
inline

Get const iterator to the beginning of the container sequence (STL compliant)

Returns
Const iterator to the beginning of the container sequence

Definition at line 216 of file iterator_intf.h.

◆ cend()

template<typename T, template< typename > class IteratorType = forward_iterator>
const_iterator cend ( ) const
inline

Get const iterator to the end of the container sequence (STL compliant)

Returns
Const iterator to the end of the container sequence

Definition at line 222 of file iterator_intf.h.

◆ create()

template<typename T, template< typename > class IteratorType = forward_iterator>
template<typename IteratorInterfaceType>
static self_type create ( IteratorInterfaceType & o_oIterator)
inlinestaticprivate

Create the adapter by assigning iterator interface to begin and end iterators.

Template Parameters
IteratorInterfaceTypeIterator interface used to traverse the container sequence. Must correspond to the IteratorType of this class template.
Parameters
[in]o_oIteratorInstance of the iterator interface used to traverse the container
Returns
Correctly assigned instance of self_type

Definition at line 236 of file iterator_intf.h.

◆ end()

template<typename T, template< typename > class IteratorType = forward_iterator>
iterator end ( ) const
inline

Get iterator to the end of the container sequence (STL compliant)

Returns
Iterator to the end of the container sequence

Definition at line 210 of file iterator_intf.h.

Referenced by iterator_adapter< T, pointer_iterator >::cend(), and iterator_adapter< value_type, IteratorType >::cend().

Member Data Documentation

◆ m_oBegin

template<typename T, template< typename > class IteratorType = forward_iterator>
iterator m_oBegin
private

iterator to the beginning of the containers sequence

Definition at line 246 of file iterator_intf.h.

Referenced by iterator_adapter< T, pointer_iterator >::create(), and iterator_adapter< value_type, IteratorType >::create().

◆ m_oEnd

template<typename T, template< typename > class IteratorType = forward_iterator>
iterator m_oEnd
private

iterator to past the last element of the container sequence

Definition at line 247 of file iterator_intf.h.

Referenced by iterator_adapter< T, pointer_iterator >::create(), and iterator_adapter< value_type, IteratorType >::create().