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

Convenience class providing begin() and end(). More...

#include <apf/iterator.h>

Public Types

using iterator = I
 
using reference = typename std::iterator_traits< I >::reference
 
using difference_type = typename std::iterator_traits< I >::difference_type
 

Public Member Functions

 has_begin_and_end ()
 Default constructor. Singular iterators are created. More...
 
 has_begin_and_end (iterator b, iterator e)
 Constructor with begin and end. More...
 
template<typename Distance >
 has_begin_and_end (iterator b, Distance length)
 Constructor with begin and length. More...
 
iterator begin () const
 Get begin. More...
 
iterator end () const
 Get end. More...
 
reference operator[] (difference_type n) const
 Subscript operator. More...
 

Protected Attributes

iterator _begin
 
iterator _end
 

Detailed Description

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

Convenience class providing begin() and end().

The derived class can manipulate the protected members _begin and _end.

Warning
If you use this as base class, don't use a base class pointer (or reference). This class has a public non-virtual destructor, which is generally not recommended for base classes.

Definition at line 334 of file iterator.h.

Member Typedef Documentation

◆ iterator

template<typename I >
using apf::has_begin_and_end< I >::iterator = I

Definition at line 337 of file iterator.h.

◆ reference

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

Definition at line 338 of file iterator.h.

◆ difference_type

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

Definition at line 339 of file iterator.h.

Constructor & Destructor Documentation

◆ has_begin_and_end() [1/3]

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

Default constructor. Singular iterators are created.

Definition at line 342 of file iterator.h.

◆ has_begin_and_end() [2/3]

template<typename I >
apf::has_begin_and_end< I >::has_begin_and_end ( iterator  b,
iterator  e 
)
inline

Constructor with begin and end.

Definition at line 345 of file iterator.h.

◆ has_begin_and_end() [3/3]

template<typename I >
template<typename Distance >
apf::has_begin_and_end< I >::has_begin_and_end ( iterator  b,
Distance  length 
)
inline

Constructor with begin and length.

Definition at line 349 of file iterator.h.

Member Function Documentation

◆ begin()

template<typename I >
iterator apf::has_begin_and_end< I >::begin ( ) const
inline

Get begin.

Note
There is no const-ness propagation. The const-ness of the original iterator I is maintained.

Definition at line 361 of file iterator.h.

◆ end()

template<typename I >
iterator apf::has_begin_and_end< I >::end ( ) const
inline

Get end.

Note
There is no const-ness propagation. The const-ness of the original iterator I is maintained.

Definition at line 366 of file iterator.h.

◆ operator[]()

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

Subscript operator.

Note
This only works if I is a random access iterator!

Definition at line 370 of file iterator.h.

Member Data Documentation

◆ _begin

template<typename I >
iterator apf::has_begin_and_end< I >::_begin
protected

Definition at line 373 of file iterator.h.

◆ _end

template<typename I >
iterator apf::has_begin_and_end< I >::_end
protected

Definition at line 373 of file iterator.h.


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