Skip to content

iox::cxx::list::IteratorBase🔗

nested iterator class for list element operations including element access comparison of iterator from different list is rejected by terminate() More...

Public Types🔗

Name
using std::bidirectional_iterator_tag iterator_category
using typename std::conditional< IsConstIterator, const T, T >::type value_type
using void difference_type
using typename std::conditional< IsConstIterator, const T *, T * >::type pointer
using typename std::conditional< IsConstIterator, const T &, T & >::type reference

Public Functions🔗

Name
IteratorBase(const IteratorBase< false > & iter)
construct a const_iterator from an iterator
IteratorBase & operator=(const IteratorBase< false > & rhs)
assigns a const_iterator from an iterator; needs to be implemented because the copy c'tor is also explicitly implemented
IteratorBase & operator++()
prefix increment iterator, so it points to the next list element when trying to increment beyond the end of the list, iterator stays pointing at the end
IteratorBase & operator--()
prefix decrement iterator, so it points to the previous list element decrementing an iterator pointing already towards begin() has no effect (iterator stays at begin())
template <bool IsConstIteratorOther>
bool
operator==(const IteratorBase< IsConstIteratorOther > & rhs) const
comparing list iterators for equality the referenced list position is compared, not the content of the list element (T-typed) -> there is no content for fictional elements at BEGIN_END_LINK_INDEX only iterators of the same parent list can be compared; in case of misuse, terminate() is invoked
template <bool IsConstIteratorOther>
bool
operator!=(const IteratorBase< IsConstIteratorOther > & rhs) const
comparing list iterators for non-equality the referenced list position is compared, not the content of the list element (T-typed) -> there is no content for fictional elements at BEGIN_END_LINK_INDEX only iterators of the same parent list can be compared; in case of misuse, terminate() is invoked
reference operator*() const
dereferencing element content via iterator-position element
pointer operator->() const
dereferencing element content via iterator-position element

Friends🔗

Name
class IteratorBase< true >
class list< T, Capacity >

Detailed Description🔗

template <bool IsConstIterator =true>
class iox::cxx::list::IteratorBase;

nested iterator class for list element operations including element access comparison of iterator from different list is rejected by terminate()

Public Types Documentation🔗

using iterator_category🔗

using iox::cxx::list< T, Capacity >::IteratorBase< IsConstIterator >::iterator_category =  std::bidirectional_iterator_tag;

using value_type🔗

using iox::cxx::list< T, Capacity >::IteratorBase< IsConstIterator >::value_type =  typename std::conditional<IsConstIterator, const T, T>::type;

using difference_type🔗

using iox::cxx::list< T, Capacity >::IteratorBase< IsConstIterator >::difference_type =  void;

using pointer🔗

using iox::cxx::list< T, Capacity >::IteratorBase< IsConstIterator >::pointer =  typename std::conditional<IsConstIterator, const T*, T*>::type;

using reference🔗

using iox::cxx::list< T, Capacity >::IteratorBase< IsConstIterator >::reference =  typename std::conditional<IsConstIterator, const T&, T&>::type;

Public Functions Documentation🔗

function IteratorBase🔗

IteratorBase(
    const IteratorBase< false > & iter
)

construct a const_iterator from an iterator

Parameters:

  • iter is the iterator which will deliver list and index info for the const_iterator

function operator=🔗

IteratorBase & operator=(
    const IteratorBase< false > & rhs
)

assigns a const_iterator from an iterator; needs to be implemented because the copy c'tor is also explicitly implemented

Parameters:

  • rhs is the iterator which will deliver list and index info for the const_iterator

Return: reference to this iterator object

function operator++🔗

IteratorBase & operator++()

prefix increment iterator, so it points to the next list element when trying to increment beyond the end of the list, iterator stays pointing at the end

Return: reference to this iterator object

function operator--🔗

IteratorBase & operator--()

prefix decrement iterator, so it points to the previous list element decrementing an iterator pointing already towards begin() has no effect (iterator stays at begin())

Return: reference to this iterator object

function operator==🔗

template <bool IsConstIteratorOther>
bool operator==(
    const IteratorBase< IsConstIteratorOther > & rhs
) const

comparing list iterators for equality the referenced list position is compared, not the content of the list element (T-typed) -> there is no content for fictional elements at BEGIN_END_LINK_INDEX only iterators of the same parent list can be compared; in case of misuse, terminate() is invoked

Parameters:

  • rhs is the 2nd iterator to compare to

Return: list position for two iterators is the same (true) or different (false)

function operator!=🔗

template <bool IsConstIteratorOther>
bool operator!=(
    const IteratorBase< IsConstIteratorOther > & rhs
) const

comparing list iterators for non-equality the referenced list position is compared, not the content of the list element (T-typed) -> there is no content for fictional elements at BEGIN_END_LINK_INDEX only iterators of the same parent list can be compared; in case of misuse, terminate() is invoked

Parameters:

  • rhs is the 2nd iterator to compare to

Return: list position for two iterators is the same (true) or different (false)

function operator*🔗

reference operator*() const

dereferencing element content via iterator-position element

Return: reference to list element data

function operator->🔗

pointer operator->() const

dereferencing element content via iterator-position element

Return: pointer to const list data element

Friends🔗

friend IteratorBase< true >🔗

friend class IteratorBase< true >(
    IteratorBase< true > 
);

friend list< T, Capacity >🔗

friend class list< T, Capacity >(
    list< T, Capacity > 
);

Updated on 31 May 2022 at 11:34:55 CEST