Audio Processing Framework (APF) version 0.5.0
Public Types | Public Member Functions | Friends | List of all members
apf::index_iterator< T > Class Template Reference

Iterator with a built-in number. More...

#include <apf/iterator.h>

Public Types

using iterator_category = std::random_access_iterator_tag
 
using value_type = T
 
using reference = T
 
using difference_type = T
 
using pointer = void
 

Public Member Functions

 index_iterator (T start=T())
 Constructor. More...
 
reference operator* () const
 Dereference operator. More...
 
bool operator== (const self &rhs) const
 Straightforward equality operator. More...
 
selfoperator++ ()
 Straightforward preincrement operator. More...
 
selfoperator-- ()
 Straightforward predecrement operator. More...
 
selfoperator+= (difference_type n)
 Straightforward addition/assignment operator. More...
 
reference operator[] (difference_type n) const
 Straightforward subscript operator (using + and dereference op). More...
 
bool operator!= (const self &rhs) const
 Unequality operator (using equality operator). More...
 
self operator++ (int)
 Postincrement operator (using preincrement operator). More...
 
self operator-- (int)
 Postdecrement operator (using predecrement operator). More...
 
self operator+ (difference_type n) const
 Addition operator (iterator plus integer, using +=). More...
 
selfoperator-= (difference_type n)
 Subtraction/assignment operator (using +=). More...
 
self operator- (difference_type n) const
 Subtraction operator (using +=). More...
 

Friends

difference_type operator- (const self &lhs, const self &rhs)
 Straightforward difference operator. More...
 
bool operator< (const self &lhs, const self &rhs)
 Straightforward less-than operator. More...
 
bool operator> (const self &lhs, const self &rhs)
 Straightforward greater-than operator (using less-than operator). More...
 
bool operator<= (const self &lhs, const self &rhs)
 Straightforward less-or-equal operator (using less-than operator). More...
 
bool operator>= (const self &lhs, const self &rhs)
 Straightforward greater-or-equal operator (using less-than operator). More...
 
self operator+ (difference_type n, const self &it)
 Addition operator (integer plus iterator, using +=). More...
 

Detailed Description

template<typename T>
class apf::index_iterator< T >

Iterator with a built-in number.

This can be used, for example, as a base iterator in transform_iterator.

Template Parameters
Ttype of the number
Warning
If T is an unsigned type, strange things may happen!

Definition at line 985 of file iterator.h.

Member Typedef Documentation

◆ iterator_category

template<typename T >
using apf::index_iterator< T >::iterator_category = std::random_access_iterator_tag

Definition at line 991 of file iterator.h.

◆ value_type

template<typename T >
using apf::index_iterator< T >::value_type = T

Definition at line 992 of file iterator.h.

◆ reference

template<typename T >
using apf::index_iterator< T >::reference = T

Definition at line 993 of file iterator.h.

◆ difference_type

template<typename T >
using apf::index_iterator< T >::difference_type = T

Definition at line 994 of file iterator.h.

◆ pointer

template<typename T >
using apf::index_iterator< T >::pointer = void

Definition at line 995 of file iterator.h.

Constructor & Destructor Documentation

◆ index_iterator()

template<typename T >
apf::index_iterator< T >::index_iterator ( start = T())
inlineexplicit

Constructor.

Parameters
startStarting index

Definition at line 998 of file iterator.h.

Member Function Documentation

◆ operator*()

template<typename T >
reference apf::index_iterator< T >::operator* ( ) const
inline

Dereference operator.

Returns
The current index

Definition at line 1003 of file iterator.h.

◆ operator==()

template<typename T >
bool apf::index_iterator< T >::operator== ( const self rhs) const
inline

Straightforward equality operator.

Definition at line 1007 of file iterator.h.

◆ operator++() [1/2]

template<typename T >
self & apf::index_iterator< T >::operator++ ( )
inline

Straightforward preincrement operator.

Definition at line 1008 of file iterator.h.

◆ operator--() [1/2]

template<typename T >
self & apf::index_iterator< T >::operator-- ( )
inline

Straightforward predecrement operator.

Definition at line 1009 of file iterator.h.

◆ operator+=()

template<typename T >
self & apf::index_iterator< T >::operator+= ( difference_type  n)
inline

Straightforward addition/assignment operator.

Definition at line 1010 of file iterator.h.

◆ operator[]()

template<typename T >
reference apf::index_iterator< T >::operator[] ( difference_type  n) const
inline

Straightforward subscript operator (using + and dereference op).

Definition at line 1013 of file iterator.h.

◆ operator!=()

template<typename T >
bool apf::index_iterator< T >::operator!= ( const self rhs) const
inline

Unequality operator (using equality operator).

Definition at line 1014 of file iterator.h.

◆ operator++() [2/2]

template<typename T >
self apf::index_iterator< T >::operator++ ( int  )
inline

Postincrement operator (using preincrement operator).

Definition at line 1016 of file iterator.h.

◆ operator--() [2/2]

template<typename T >
self apf::index_iterator< T >::operator-- ( int  )
inline

Postdecrement operator (using predecrement operator).

Definition at line 1017 of file iterator.h.

◆ operator+()

template<typename T >
self apf::index_iterator< T >::operator+ ( difference_type  n) const
inline

Addition operator (iterator plus integer, using +=).

Definition at line 1018 of file iterator.h.

◆ operator-=()

template<typename T >
self & apf::index_iterator< T >::operator-= ( difference_type  n)
inline

Subtraction/assignment operator (using +=).

Definition at line 1018 of file iterator.h.

◆ operator-()

template<typename T >
self apf::index_iterator< T >::operator- ( difference_type  n) const
inline

Subtraction operator (using +=).

Definition at line 1018 of file iterator.h.

Friends And Related Function Documentation

◆ operator-

template<typename T >
difference_type operator- ( const self lhs,
const self rhs 
)
friend

Straightforward difference operator.

Definition at line 1011 of file iterator.h.

◆ operator<

template<typename T >
bool operator< ( const self lhs,
const self rhs 
)
friend

Straightforward less-than operator.

Definition at line 1012 of file iterator.h.

◆ operator>

template<typename T >
bool operator> ( const self lhs,
const self rhs 
)
friend

Straightforward greater-than operator (using less-than operator).

Definition at line 1015 of file iterator.h.

◆ operator<=

template<typename T >
bool operator<= ( const self lhs,
const self rhs 
)
friend

Straightforward less-or-equal operator (using less-than operator).

Definition at line 1015 of file iterator.h.

◆ operator>=

template<typename T >
bool operator>= ( const self lhs,
const self rhs 
)
friend

Straightforward greater-or-equal operator (using less-than operator).

Definition at line 1015 of file iterator.h.

◆ operator+

template<typename T >
self operator+ ( difference_type  n,
const self it 
)
friend

Addition operator (integer plus iterator, using +=).

Definition at line 1018 of file iterator.h.


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