arcstk::v_1_0_0::SampleInputIterator class final

Type erasing interface for iterators over PCM 32 bit samples.

Wraps the concrete iterator to be passed to update a Calculation. This allows to pass in fact iterators of any type to a Calculation.

SampleInputIterator can wrap any iterator with a value_type of uint32_t except instances of itself, e.g. it can not be "nested".

The type erasure interface only ensures that (most of) the requirements of a LegacyInputIterator are met. Those requirements are sufficient for updating a Calculation.

Although SampleInputIterator is intended to provide the functionality of an input iterator, it does not provide operator->() and does therefore not completely fulfill the requirements for a LegacyInputIterator.

SampleInputIterator provides iteration over values of type sample_t which is defined as a primitve type. Since samples therefore do not have members, operator -> would not provide any reasonable function.

Public types

using difference_type = std::ptrdiff_t
Pointer difference type.
using iterator_category = std::input_iterator_tag
Iterator category is std::input_iterator_tag.
using pointer = const value_type*
Pointer to element.
using reference = sample_t
Same as value_type, not a reference type.
using value_type = sample_t
The type this iterator enumerates.

Constructors, destructors, conversion operators

template<class Iterator, typename = IsSampleIterator<Iterator>>
SampleInputIterator(const Iterator& i)
Converting constructor.
SampleInputIterator(const SampleInputIterator& rhs)
Copy constructor.
SampleInputIterator(SampleInputIterator&& rhs) noexcept
Move constructor.
~SampleInputIterator() defaulted noexcept
Destructor.

Public functions

auto operator*() const -> reference noexcept
Dereferences the iterator to the sample pointed to.
auto operator++() -> SampleInputIterator& noexcept
Pre-increment iterator.
auto operator++(int) -> SampleInputIterator noexcept
Post-increment iterator.
auto operator=(SampleInputIterator rhs) -> SampleInputIterator& noexcept
Copy assignment.

Typedef documentation

using arcstk::v_1_0_0::SampleInputIterator::reference = sample_t

Same as value_type, not a reference type.

Note that some iterator types like SampleIterator for instance do not yield lvalues, thererfore no reference to the value under the iterator is available.

Function documentation

template<class Iterator, typename = IsSampleIterator<Iterator>>
arcstk::v_1_0_0::SampleInputIterator::SampleInputIterator(const Iterator& i)

Converting constructor.

Template parameters
Iterator The iterator type to wrap
Parameters
in Instance of an iterator over sample_t

arcstk::v_1_0_0::SampleInputIterator::SampleInputIterator(const SampleInputIterator& rhs)

Copy constructor.

Parameters
rhs in Instance to copy

arcstk::v_1_0_0::SampleInputIterator::SampleInputIterator(SampleInputIterator&& rhs) noexcept

Move constructor.

Parameters
rhs in Instance to move

reference arcstk::v_1_0_0::SampleInputIterator::operator*() const noexcept

Dereferences the iterator to the sample pointed to.

Returns A sample_t sample, returned by value

SampleInputIterator& arcstk::v_1_0_0::SampleInputIterator::operator++() noexcept

Pre-increment iterator.

Returns Incremented iterator

SampleInputIterator arcstk::v_1_0_0::SampleInputIterator::operator++(int) noexcept

Post-increment iterator.

Returns Iterator representing the state befor the increment