Audio Processing Framework (APF) version 0.5.0
List of all members
apf::stride_iterator< I > Class Template Reference

A stride iterator. More...

#include <apf/iterator.h>

Type Definitions from the Underlying Iterator

using iterator_category = typename std::iterator_traits< I >::iterator_category
 Base iterator. More...
 
using value_type = typename std::iterator_traits< I >::value_type
 Base iterator. More...
 
using difference_type = typename std::iterator_traits< I >::difference_type
 Base iterator. More...
 
using reference = typename std::iterator_traits< I >::reference
 Base iterator. More...
 
using pointer = typename std::iterator_traits< I >::pointer
 Base iterator. More...
 
 stride_iterator (I base_iterator, difference_type step)
 This is the normal constructor. More...
 
 stride_iterator (stride_iterator< I > base_iterator, difference_type step)
 Create a stride iterator from another stride iterator. More...
 
 stride_iterator ()
 Default constructor. More...
 
bool operator== (const self &rhs) const
 Base iterator. More...
 
selfoperator++ ()
 Base iterator. More...
 
selfoperator-- ()
 Base iterator. More...
 
reference operator[] (difference_type n) const
 Base iterator. More...
 
selfoperator+= (difference_type n)
 Base iterator. More...
 
reference operator* () const
 Straightforward dereference operator. More...
 
pointer operator-> () const
 Straightforward arrow operator. 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...
 
base () const
 Get the base iterator, inspired by std::reverse_iterator::base(). More...
 
difference_type step_size () const
 Get step size. More...
 
difference_type operator- (const self &lhs, const self &rhs)
 Base iterator. More...
 
bool operator< (const self &lhs, const self &rhs)
 Base iterator. More...
 
bool operator<= (const self &lhs, const self &rhs)
 Base iterator. More...
 
bool operator> (const self &lhs, const self &rhs)
 Base iterator. More...
 
bool operator>= (const self &lhs, const self &rhs)
 Base iterator. More...
 
self operator+ (difference_type n, const self &it)
 Addition operator (integer plus iterator, using +=). More...
 

Detailed Description

template<class I>
class apf::stride_iterator< I >

A stride iterator.

Template Parameters
IBase iterator type

Most of the code is taken from the C++ Cookbook, recipe 11.13: http://flylib.com/books/en/2.131.1.171/1/

Some modifications are based on this: http://stackoverflow.com/questions/1649529/sorting-blocks-of-l-elements/1649650#1649650

Definition at line 1050 of file iterator.h.

Member Typedef Documentation

◆ iterator_category

template<class I >
using apf::stride_iterator< I >::iterator_category = typename std::iterator_traits<I>::iterator_category

Base iterator.

Definition at line 1058 of file iterator.h.

◆ value_type

template<class I >
using apf::stride_iterator< I >::value_type = typename std::iterator_traits<I>::value_type

Base iterator.

Definition at line 1060 of file iterator.h.

◆ difference_type

template<class I >
using apf::stride_iterator< I >::difference_type = typename std::iterator_traits<I>::difference_type

Base iterator.

Definition at line 1061 of file iterator.h.

◆ reference

template<class I >
using apf::stride_iterator< I >::reference = typename std::iterator_traits<I>::reference

Base iterator.

Definition at line 1062 of file iterator.h.

◆ pointer

template<class I >
using apf::stride_iterator< I >::pointer = typename std::iterator_traits<I>::pointer

Base iterator.

Definition at line 1063 of file iterator.h.

Constructor & Destructor Documentation

◆ stride_iterator() [1/3]

template<class I >
apf::stride_iterator< I >::stride_iterator ( base_iterator,
difference_type  step 
)
inlineexplicit

This is the normal constructor.

Parameters
base_iteratorthe base iterator
stepthe step size

Definition at line 1069 of file iterator.h.

◆ stride_iterator() [2/3]

template<class I >
apf::stride_iterator< I >::stride_iterator ( stride_iterator< I >  base_iterator,
difference_type  step 
)
inline

Create a stride iterator from another stride iterator.

Parameters
base_iteratorthe base (stride) iterator
stepthe step size (in addition to the already present step size)

Definition at line 1081 of file iterator.h.

◆ stride_iterator() [3/3]

template<class I >
apf::stride_iterator< I >::stride_iterator ( )
inline

Default constructor.

Note
This constructor creates a singular iterator. Another circular_iterator can be assigned to it, but nothing else works.

Definition at line 1089 of file iterator.h.

Member Function Documentation

◆ operator==()

template<class I >
bool apf::stride_iterator< I >::operator== ( const self rhs) const
inline

Base iterator.

Definition at line 1095 of file iterator.h.

◆ operator++() [1/2]

template<class I >
self & apf::stride_iterator< I >::operator++ ( )
inline

Base iterator.

Definition at line 1101 of file iterator.h.

References apf::no_nullptr().

◆ operator--() [1/2]

template<class I >
self & apf::stride_iterator< I >::operator-- ( )
inline

Base iterator.

Definition at line 1109 of file iterator.h.

References apf::no_nullptr().

◆ operator[]()

template<class I >
reference apf::stride_iterator< I >::operator[] ( difference_type  n) const
inline

Base iterator.

Definition at line 1117 of file iterator.h.

References apf::no_nullptr().

◆ operator+=()

template<class I >
self & apf::stride_iterator< I >::operator+= ( difference_type  n)
inline

Base iterator.

Definition at line 1124 of file iterator.h.

References apf::no_nullptr().

◆ operator*()

template<class I >
reference apf::stride_iterator< I >::operator* ( ) const
inline

Straightforward dereference operator.

Definition at line 1177 of file iterator.h.

◆ operator->()

template<class I >
pointer apf::stride_iterator< I >::operator-> ( ) const
inline

Straightforward arrow operator.

Definition at line 1178 of file iterator.h.

◆ operator!=()

template<class I >
bool apf::stride_iterator< I >::operator!= ( const self rhs) const
inline

Unequality operator (using equality operator).

Definition at line 1179 of file iterator.h.

◆ operator++() [2/2]

template<class I >
self apf::stride_iterator< I >::operator++ ( int  )
inline

Postincrement operator (using preincrement operator).

Definition at line 1180 of file iterator.h.

◆ operator--() [2/2]

template<class I >
self apf::stride_iterator< I >::operator-- ( int  )
inline

Postdecrement operator (using predecrement operator).

Definition at line 1181 of file iterator.h.

◆ operator+()

template<class I >
self apf::stride_iterator< I >::operator+ ( difference_type  n) const
inline

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

Definition at line 1182 of file iterator.h.

◆ operator-=()

template<class I >
self & apf::stride_iterator< I >::operator-= ( difference_type  n)
inline

Subtraction/assignment operator (using +=).

Definition at line 1182 of file iterator.h.

◆ operator-()

template<class I >
self apf::stride_iterator< I >::operator- ( difference_type  n) const
inline

Subtraction operator (using +=).

Definition at line 1182 of file iterator.h.

◆ base()

template<class I >
I apf::stride_iterator< I >::base ( ) const
inline

Get the base iterator, inspired by std::reverse_iterator::base().

Definition at line 1184 of file iterator.h.

◆ step_size()

template<class I >
difference_type apf::stride_iterator< I >::step_size ( ) const
inline

Get step size.

Definition at line 1187 of file iterator.h.

Friends And Related Function Documentation

◆ operator-

template<class I >
difference_type operator- ( const self lhs,
const self rhs 
)
friend

Base iterator.

Definition at line 1133 of file iterator.h.

◆ operator<

template<class I >
bool operator< ( const self lhs,
const self rhs 
)
friend

Base iterator.

Definition at line 1141 of file iterator.h.

◆ operator<=

template<class I >
bool operator<= ( const self lhs,
const self rhs 
)
friend

Base iterator.

Definition at line 1150 of file iterator.h.

◆ operator>

template<class I >
bool operator> ( const self lhs,
const self rhs 
)
friend

Base iterator.

Definition at line 1160 of file iterator.h.

◆ operator>=

template<class I >
bool operator>= ( const self lhs,
const self rhs 
)
friend

Base iterator.

Definition at line 1169 of file iterator.h.

◆ operator+

template<class I >
self operator+ ( difference_type  n,
const self it 
)
friend

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

Definition at line 1182 of file iterator.h.


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