Loading...
Searching...
No Matches
circular_iterator.h
Go to the documentation of this file.
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2022 John Wellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#ifndef ETL_CIRCULAR_ITERATOR_INCLUDED
#define ETL_CIRCULAR_ITERATOR_INCLUDED
#include "platform.h"
#include "iterator.h"
#include "static_assert.h"
namespace etl
{
namespace private_circular_iterator
{
//***************************************************************************
//***************************************************************************
template <typename TIterator>
class circular_iterator_common
: public etl::iterator< typename etl::iterator_traits<TIterator>::iterator_category, typename etl::iterator_traits<TIterator>::value_type>
{
public:
typedef typename etl::iterator_traits<TIterator>::value_type value_type;
typedef typename etl::iterator_traits<TIterator>::difference_type difference_type;
typedef typename etl::iterator_traits<TIterator>::pointer pointer;
typedef typename etl::iterator_traits<TIterator>::reference reference;
typedef typename etl::iterator_traits<TIterator>::iterator_category iterator_category;
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_common()
: itr_begin(TIterator())
, itr_end(TIterator())
, itr(TIterator())
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_common(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
: itr_begin(itr_begin_)
, itr_end(itr_end_)
, itr(start_)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_common(const circular_iterator_common& other)
: itr_begin(other.itr_begin)
, itr_end(other.itr_end)
, itr(other.itr)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_common& operator=(const circular_iterator_common& other)
{
itr_begin = other.itr_begin;
itr_end = other.itr_end;
itr = other.itr;
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 TIterator begin() const
{
return itr_begin;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 TIterator end() const
{
return itr_end;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 size_t size() const
{
return static_cast<size_t>(etl::distance(itr_begin, itr_end));
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 bool empty() const
{
return (itr_begin == itr_end);
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 value_type operator*()
{
return *itr;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 const value_type operator*() const
{
return *itr;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 TIterator operator->()
{
return itr;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 const TIterator operator->() const
{
return itr;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 operator TIterator() const
{
return itr;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 TIterator current() const
{
return itr;
}
protected:
TIterator itr_begin;
TIterator itr_end;
TIterator itr;
};
//***************************************************************************
//***************************************************************************
template <typename TIterator, typename TTag = typename etl::iterator_traits<TIterator>::iterator_category>
class circular_iterator_impl
{
ETL_STATIC_ASSERT((etl::is_same<TTag, ETL_OR_STD::input_iterator_tag>::value_type),
"input_iterator_catagory is not supported by circular_iterator");
ETL_STATIC_ASSERT((etl::is_same<TTag, ETL_OR_STD::output_iterator_tag>::value_type),
"output_iterator_catagory is not supported by circular_iterator");
};
//***************************************************************************
template <typename TIterator>
class circular_iterator_impl<TIterator, ETL_OR_STD::forward_iterator_tag> : public circular_iterator_common<TIterator>
{
private:
typedef circular_iterator_common<TIterator> common_t;
public:
using common_t::operator=;
typedef typename common_t::value_type value_type;
typedef typename common_t::difference_type difference_type;
typedef typename common_t::pointer pointer;
typedef typename common_t::reference reference;
typedef typename common_t::iterator_category iterator_category;
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl()
: common_t()
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_)
: common_t(itr_begin_, itr_end_, itr_begin_)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
: common_t(itr_begin_, itr_end_, start_)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl(const circular_iterator_impl& other)
: common_t(other)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator=(const circular_iterator_impl& other)
{
common_t::operator=(other);
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator++()
{
if (++this->itr == this->itr_end)
{
this->itr = this->itr_begin;
}
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl operator++(int)
{
circular_iterator_impl original(*this);
++(*this);
return (original);
}
};
//***************************************************************************
template <typename TIterator>
class circular_iterator_impl<TIterator, ETL_OR_STD::bidirectional_iterator_tag> : public circular_iterator_common<TIterator>
{
private:
typedef circular_iterator_common<TIterator> common_t;
public:
using common_t::operator=;
typedef typename common_t::value_type value_type;
typedef typename common_t::difference_type difference_type;
typedef typename common_t::pointer pointer;
typedef typename common_t::reference reference;
typedef typename common_t::iterator_category iterator_category;
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl()
: common_t()
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_)
: common_t(itr_begin_, itr_end_, itr_begin_)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
: common_t(itr_begin_, itr_end_, start_)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl(const circular_iterator_impl& other)
: common_t(other)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator=(const circular_iterator_impl& other)
{
common_t::operator=(other);
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator++()
{
if (++this->itr == this->itr_end)
{
this->itr = this->itr_begin;
}
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl operator++(int)
{
circular_iterator_impl original(*this);
++(*this);
return (original);
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator--()
{
if (this->itr == this->itr_begin)
{
typename etl::reverse_iterator<TIterator> ritr(this->itr_end);
++ritr;
this->itr = ritr.base();
}
else
{
--this->itr;
}
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl operator--(int)
{
circular_iterator_impl original(*this);
--(*this);
return (original);
}
};
//***************************************************************************
//***************************************************************************
template <typename TIterator>
class circular_iterator_impl<TIterator, ETL_OR_STD::random_access_iterator_tag>
: public etl::private_circular_iterator::circular_iterator_common< TIterator>
{
private:
typedef etl::private_circular_iterator::circular_iterator_common< TIterator> common_t;
public:
using common_t::operator=;
typedef typename common_t::value_type value_type;
typedef typename common_t::difference_type difference_type;
typedef typename common_t::pointer pointer;
typedef typename common_t::reference reference;
typedef typename common_t::iterator_category iterator_category;
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl()
: common_t()
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_)
: common_t(itr_begin_, itr_end_, itr_begin_)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
: common_t(itr_begin_, itr_end_, start_)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl(const circular_iterator_impl& other)
: common_t(other)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator=(const circular_iterator_impl& other)
{
common_t::operator=(other);
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator++()
{
if (++this->itr == this->itr_end)
{
this->itr = this->itr_begin;
}
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl operator++(int)
{
circular_iterator_impl original(*this);
++(*this);
return (original);
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator--()
{
if (this->itr == this->itr_begin)
{
typename etl::reverse_iterator<TIterator> ritr(this->itr_end);
++ritr;
this->itr = ritr.base();
}
else
{
--this->itr;
}
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl operator--(int)
{
circular_iterator_impl original(*this);
--(*this);
return (original);
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator+=(difference_type offset)
{
const difference_type length = difference_type(this->size());
offset %= length;
if (offset != 0)
{
const difference_type distance_from_begin = etl::distance(this->itr_begin, this->itr);
const difference_type distance_to_end = etl::distance(this->itr, this->itr_end);
if (offset > 0)
{
if (distance_to_end > offset)
{
offset = distance_from_begin + offset;
}
else
{
offset = offset - distance_to_end;
}
}
else
{
offset = -offset;
if (distance_from_begin >= offset)
{
offset = distance_from_begin - offset;
}
else
{
offset = offset - distance_from_begin;
offset = length - offset;
}
}
this->itr = this->itr_begin + offset;
}
return *this;
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator_impl& operator-=(typename etl::iterator_traits<TIterator>::difference_type offset)
{
return operator+=(-offset);
}
};
} // namespace private_circular_iterator
//***************************************************************************
//**************************************************************************
template <typename TIterator>
class circular_iterator ETL_FINAL
: public etl::private_circular_iterator::circular_iterator_impl< TIterator, typename etl::iterator_traits<TIterator>::iterator_category>
{
private:
typedef typename etl::private_circular_iterator::circular_iterator_impl< TIterator, typename etl::iterator_traits<TIterator>::iterator_category>
impl_t;
public:
using impl_t::operator=;
typedef typename impl_t::value_type value_type;
typedef typename impl_t::difference_type difference_type;
typedef typename impl_t::pointer pointer;
typedef typename impl_t::reference reference;
typedef typename impl_t::iterator_category iterator_category;
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator()
: impl_t()
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator(TIterator itr_begin_, TIterator itr_end_)
: impl_t(itr_begin_, itr_end_, itr_begin_)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
: impl_t(itr_begin_, itr_end_, start_)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator(const circular_iterator& other)
: impl_t(other)
{
}
//***************************************************************************
//***************************************************************************
ETL_CONSTEXPR14 circular_iterator& operator=(const circular_iterator& other)
{
impl_t::operator=(other);
return *this;
}
};
//*****************************************************************************
//*****************************************************************************
template <typename TIterator>
ETL_CONSTEXPR14 etl::circular_iterator<TIterator> operator+(etl::circular_iterator<TIterator>& lhs,
typename etl::iterator_traits<TIterator>::difference_type offset)
{
etl::circular_iterator<TIterator> result(lhs);
result += offset;
return result;
}
//*****************************************************************************
//*****************************************************************************
template <typename TIterator>
ETL_CONSTEXPR14 etl::circular_iterator<TIterator> operator-(etl::circular_iterator<TIterator>& lhs,
typename etl::iterator_traits<TIterator>::difference_type offset)
{
etl::circular_iterator<TIterator> result(lhs);
result -= offset;
return result;
}
//*****************************************************************************
//*****************************************************************************
template <typename TIterator>
ETL_CONSTEXPR14 typename etl::iterator_traits<TIterator>::difference_type operator-(etl::circular_iterator<TIterator>& lhs,
etl::circular_iterator<TIterator>& rhs)
{
return TIterator(lhs) - TIterator(rhs);
}
//*****************************************************************************
//*****************************************************************************
template <typename TIterator>
ETL_CONSTEXPR14 bool operator==(const etl::circular_iterator<TIterator>& lhs, const etl::circular_iterator<TIterator>& rhs)
{
return TIterator(lhs) == TIterator(rhs);
}
//*****************************************************************************
//*****************************************************************************
template <typename TIterator>
ETL_CONSTEXPR14 bool operator==(const etl::circular_iterator<TIterator>& lhs, TIterator rhs)
{
return TIterator(lhs) == rhs;
}
//*****************************************************************************
//*****************************************************************************
template <typename TIterator>
ETL_CONSTEXPR14 bool operator==(TIterator lhs, const etl::circular_iterator<TIterator>& rhs)
{
return lhs == TIterator(rhs);
}
//*****************************************************************************
//*****************************************************************************
template <typename TIterator>
ETL_CONSTEXPR14 bool operator!=(const etl::circular_iterator<TIterator>& lhs, const etl::circular_iterator<TIterator>& rhs)
{
return !(lhs == rhs);
}
//*****************************************************************************
//*****************************************************************************
template <typename TIterator>
ETL_CONSTEXPR14 bool operator!=(const etl::circular_iterator<TIterator>& lhs, TIterator rhs)
{
return !(lhs == rhs);
}
//*****************************************************************************
//*****************************************************************************
template <typename TIterator>
ETL_CONSTEXPR14 bool operator!=(TIterator& lhs, const etl::circular_iterator<TIterator>& rhs)
{
return !(lhs == rhs);
}
} // namespace etl
#endif
etl::private_circular_iterator::circular_iterator_common
Common circular iterator implementation.
Definition circular_iterator.h:50
etl::private_circular_iterator::circular_iterator_common::current
ETL_CONSTEXPR14 TIterator current() const
Conversion to base iterator type.
Definition circular_iterator.h:176
etl::private_circular_iterator::circular_iterator_common::operator*
ETL_CONSTEXPR14 value_type operator*()
Dereference operator.
Definition circular_iterator.h:136
etl::private_circular_iterator::circular_iterator_common::itr_end
TIterator itr_end
The underlying end iterator.
Definition circular_iterator.h:184
etl::private_circular_iterator::circular_iterator_common::empty
ETL_CONSTEXPR14 bool empty() const
Is there nothing to iterate over?
Definition circular_iterator.h:128
etl::private_circular_iterator::circular_iterator_common::operator->
ETL_CONSTEXPR14 TIterator operator->()
-> operator.
Definition circular_iterator.h:152
etl::private_circular_iterator::circular_iterator_common::operator*
ETL_CONSTEXPR14 const value_type operator*() const
Dereference operator.
Definition circular_iterator.h:144
etl::private_circular_iterator::circular_iterator_common::operator->
ETL_CONSTEXPR14 const TIterator operator->() const
-> operator.
Definition circular_iterator.h:160
etl::private_circular_iterator::circular_iterator_common::circular_iterator_common
ETL_CONSTEXPR14 circular_iterator_common(const circular_iterator_common &other)
Copy constructor.
Definition circular_iterator.h:82
etl::private_circular_iterator::circular_iterator_common::circular_iterator_common
ETL_CONSTEXPR14 circular_iterator_common()
Default constructor.
Definition circular_iterator.h:62
etl::private_circular_iterator::circular_iterator_common::begin
ETL_CONSTEXPR14 TIterator begin() const
Beginning of the range.
Definition circular_iterator.h:104
etl::private_circular_iterator::circular_iterator_common::circular_iterator_common
ETL_CONSTEXPR14 circular_iterator_common(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
Construct from iterators.
Definition circular_iterator.h:72
etl::private_circular_iterator::circular_iterator_common::itr_begin
TIterator itr_begin
The underlying begin iterator.
Definition circular_iterator.h:183
etl::private_circular_iterator::circular_iterator_common::end
ETL_CONSTEXPR14 TIterator end() const
End of the range.
Definition circular_iterator.h:112
etl::private_circular_iterator::circular_iterator_common::size
ETL_CONSTEXPR14 size_t size() const
How long is the range?
Definition circular_iterator.h:120
etl::private_circular_iterator::circular_iterator_common::itr
TIterator itr
The underlying iterator.
Definition circular_iterator.h:185
etl::private_circular_iterator::circular_iterator_common::operator=
ETL_CONSTEXPR14 circular_iterator_common & operator=(const circular_iterator_common &other)
Assignment.
Definition circular_iterator.h:92
etl::reverse_iterator
Definition iterator.h:310
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::operator--
ETL_CONSTEXPR14 circular_iterator_impl & operator--()
Decrement.
Definition circular_iterator.h:507
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl(const circular_iterator_impl &other)
Copy constructor.
Definition circular_iterator.h:464
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::operator+=
ETL_CONSTEXPR14 circular_iterator_impl & operator+=(difference_type offset)
+= operator.
Definition circular_iterator.h:538
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::operator++
ETL_CONSTEXPR14 circular_iterator_impl operator++(int)
Increment.
Definition circular_iterator.h:495
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::forward_iterator_tag >::operator++
ETL_CONSTEXPR14 circular_iterator_impl & operator++()
Increment.
Definition circular_iterator.h:270
etl::ETL_FINAL::circular_iterator
ETL_CONSTEXPR14 circular_iterator()
Default constructor.
Definition circular_iterator.h:618
etl::ETL_FINAL::operator=
ETL_CONSTEXPR14 circular_iterator & operator=(const circular_iterator &other)
Assignment.
Definition circular_iterator.h:650
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::operator=
ETL_CONSTEXPR14 circular_iterator_impl & operator=(const circular_iterator_impl &other)
Assignment.
Definition circular_iterator.h:472
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::bidirectional_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
Construct from start + iterators.
Definition circular_iterator.h:334
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::bidirectional_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl(const circular_iterator_impl &other)
Copy constructor.
Definition circular_iterator.h:342
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::forward_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
Construct from start + iterators.
Definition circular_iterator.h:244
etl::ETL_FINAL::circular_iterator
ETL_CONSTEXPR14 circular_iterator(const circular_iterator &other)
Copy constructor.
Definition circular_iterator.h:642
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::bidirectional_iterator_tag >::operator++
ETL_CONSTEXPR14 circular_iterator_impl operator++(int)
Increment.
Definition circular_iterator.h:373
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::bidirectional_iterator_tag >::operator--
ETL_CONSTEXPR14 circular_iterator_impl operator--(int)
Decrement.
Definition circular_iterator.h:404
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::bidirectional_iterator_tag >::operator=
ETL_CONSTEXPR14 circular_iterator_impl & operator=(const circular_iterator_impl &other)
Assignment.
Definition circular_iterator.h:350
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::bidirectional_iterator_tag >::operator++
ETL_CONSTEXPR14 circular_iterator_impl & operator++()
Increment.
Definition circular_iterator.h:360
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
Construct from start + iterators.
Definition circular_iterator.h:456
etl::ETL_FINAL::circular_iterator
ETL_CONSTEXPR14 circular_iterator(TIterator itr_begin_, TIterator itr_end_)
Construct from iterators.
Definition circular_iterator.h:626
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::forward_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl(const circular_iterator_impl &other)
Copy constructor.
Definition circular_iterator.h:252
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::bidirectional_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl()
Default constructor.
Definition circular_iterator.h:318
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::forward_iterator_tag >::operator++
ETL_CONSTEXPR14 circular_iterator_impl operator++(int)
Increment.
Definition circular_iterator.h:283
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::forward_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl()
Default constructor.
Definition circular_iterator.h:228
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::forward_iterator_tag >::operator=
ETL_CONSTEXPR14 circular_iterator_impl & operator=(const circular_iterator_impl &other)
Assignment.
Definition circular_iterator.h:260
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::operator--
ETL_CONSTEXPR14 circular_iterator_impl operator--(int)
Decrement.
Definition circular_iterator.h:526
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::forward_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_)
Construct from iterators.
Definition circular_iterator.h:236
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::bidirectional_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_)
Construct from iterators.
Definition circular_iterator.h:326
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl(TIterator itr_begin_, TIterator itr_end_)
Construct from iterators.
Definition circular_iterator.h:448
etl::ETL_FINAL::circular_iterator
ETL_CONSTEXPR14 circular_iterator(TIterator itr_begin_, TIterator itr_end_, TIterator start_)
Construct from start + iterators.
Definition circular_iterator.h:634
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::operator-=
ETL_CONSTEXPR14 circular_iterator_impl & operator-=(typename etl::iterator_traits< TIterator >::difference_type offset)
-= operator.
Definition circular_iterator.h:583
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::operator++
ETL_CONSTEXPR14 circular_iterator_impl & operator++()
Increment.
Definition circular_iterator.h:482
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::bidirectional_iterator_tag >::operator--
ETL_CONSTEXPR14 circular_iterator_impl & operator--()
Decrement.
Definition circular_iterator.h:385
etl::private_circular_iterator::circular_iterator_impl< TIterator, ETL_OR_STD::random_access_iterator_tag >::circular_iterator_impl
ETL_CONSTEXPR14 circular_iterator_impl()
Default constructor.
Definition circular_iterator.h:440
etl::ETL_FINAL
Definition circular_iterator.h:599
etl::private_circular_iterator::circular_iterator_impl
Definition circular_iterator.h:196
iterator.h
etl
Definition absolute.h:40
etl::operator==
ETL_CONSTEXPR14 bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1078
etl::operator-
ETL_CONSTEXPR14 etl::circular_iterator< TIterator > operator-(etl::circular_iterator< TIterator > &lhs, typename etl::iterator_traits< TIterator >::difference_type offset)
Definition circular_iterator.h:675
etl::operator!=
ETL_CONSTEXPR14 bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1090
etl::size
ETL_CONSTEXPR TContainer::size_type size(const TContainer &container)
Definition iterator.h:1434
etl::operator+
ETL_CONSTEXPR14 etl::circular_iterator< TIterator > operator+(etl::circular_iterator< TIterator > &lhs, typename etl::iterator_traits< TIterator >::difference_type offset)
Definition circular_iterator.h:662
platform.h
etl::bidirectional_iterator_tag
Definition iterator.h:61
etl::forward_iterator_tag
Definition iterator.h:58
etl::iterator
iterator
Definition iterator.h:482
etl::random_access_iterator_tag
Definition iterator.h:64