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

An output iterator which adds on assignment. More...

#include <apf/iterator.h>

Classes

class  output_proxy
 Helper class. More...
 

Public Types

using iterator_category = std::output_iterator_tag
 
using value_type = void
 
using difference_type = void
 
using pointer = void
 
using reference = void
 

Public Member Functions

 accumulating_iterator (I base_iterator)
 Constructor from base iterator. More...
 
 accumulating_iterator ()
 Default constructor. More...
 
output_proxy operator* ()
 Dereference operator. More...
 
selfoperator++ ()
 Straightforward preincrement operator. More...
 
self operator++ (int)
 Postincrement operator (using preincrement operator). More...
 
base () const
 Get the base iterator, inspired by std::reverse_iterator::base(). More...
 

Detailed Description

template<typename I>
class apf::accumulating_iterator< I >

An output iterator which adds on assignment.

Whenever the operator= of a pointee is called, its operator+= is invoked. This is done by the helper class output_proxy.

The idea to this iterator comes from boost::function_output_iterator: http://www.boost.org/doc/libs/release/libs/iterator/doc/function_output_iterator.html

Template Parameters
IBase iterator type
See also
make_accumulating_iterator (helper function)

Definition at line 445 of file iterator.h.

Member Typedef Documentation

◆ iterator_category

template<typename I >
using apf::accumulating_iterator< I >::iterator_category = std::output_iterator_tag

Definition at line 451 of file iterator.h.

◆ value_type

template<typename I >
using apf::accumulating_iterator< I >::value_type = void

Definition at line 452 of file iterator.h.

◆ difference_type

template<typename I >
using apf::accumulating_iterator< I >::difference_type = void

Definition at line 453 of file iterator.h.

◆ pointer

template<typename I >
using apf::accumulating_iterator< I >::pointer = void

Definition at line 454 of file iterator.h.

◆ reference

template<typename I >
using apf::accumulating_iterator< I >::reference = void

Definition at line 455 of file iterator.h.

Constructor & Destructor Documentation

◆ accumulating_iterator() [1/2]

template<typename I >
apf::accumulating_iterator< I >::accumulating_iterator ( base_iterator)
inlineexplicit

Constructor from base iterator.

Parameters
base_iteratorbase iterator

Definition at line 457 of file iterator.h.

◆ accumulating_iterator() [2/2]

template<typename I >
apf::accumulating_iterator< I >::accumulating_iterator ( )
inline

Default constructor.

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

Definition at line 457 of file iterator.h.

Member Function Documentation

◆ operator*()

template<typename I >
output_proxy apf::accumulating_iterator< I >::operator* ( )
inline

Dereference operator.

Returns
a temporary object of type output_proxy

Definition at line 477 of file iterator.h.

References apf::no_nullptr().

Referenced by apf::transform_iterator< I, F >::operator->().

◆ operator++() [1/2]

template<typename I >
self & apf::accumulating_iterator< I >::operator++ ( )
inline

Straightforward preincrement operator.

Definition at line 486 of file iterator.h.

◆ operator++() [2/2]

template<typename I >
self apf::accumulating_iterator< I >::operator++ ( int  )
inline

Postincrement operator (using preincrement operator).

Definition at line 487 of file iterator.h.

◆ base()

template<typename I >
I apf::accumulating_iterator< I >::base ( ) const
inline

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

Definition at line 489 of file iterator.h.


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