distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
estd::IntrusiveListIterator< T, NodePointer, U > Class Template Reference

IntrusiveListIterator class is an iterator of elements on IntrusiveList. More...

#include <IntrusiveList.hpp>

Collaboration diagram for estd::IntrusiveListIterator< T, NodePointer, U >:
[legend]

Public Types

using difference_type = ptrdiff_t
 difference type More...
 
using iterator_category = std::bidirectional_iterator_tag
 category of the iterator More...
 
using pointer = U *
 pointer to object "pointed to" by the iterator More...
 
using reference = U &
 reference to object "pointed to" by the iterator More...
 
using value_type = U
 value "pointed to" by the iterator More...
 

Public Member Functions

constexpr IntrusiveListIterator ()
 IntrusiveListIterator's constructor. More...
 
constexpr IntrusiveListIterator (IntrusiveListNode *const node)
 IntrusiveListIterator's constructor. More...
 
constexpr IntrusiveListIterator (reference element)
 IntrusiveListIterator's constructor. More...
 
pointer operator-> () const
 IntrusiveListIterator's binary infix pointer member access operator. More...
 
reference operator* () const
 IntrusiveListIterator's unary prefix dereference operator. More...
 
IntrusiveListIteratoroperator++ ()
 IntrusiveListIterator's unary prefix increment operator. More...
 
IntrusiveListIterator operator++ (int)
 IntrusiveListIterator's unary postfix increment operator. More...
 
IntrusiveListIteratoroperator-- ()
 IntrusiveListIterator's unary prefix decrement operator. More...
 
IntrusiveListIterator operator-- (int)
 IntrusiveListIterator's unary postfix decrement operator. More...
 
bool operator== (const IntrusiveListIterator &other) const
 IntrusiveListIterator's "equal to" comparison operator. More...
 

Private Member Functions

pointer getPointer () const
 Converts contained pointer to IntrusiveListNode to pointer to object that contains this node. More...
 

Private Attributes

IntrusiveListNodenode_
 pointer to IntrusiveListNode of the object "pointed to" by the iterator More...
 

Detailed Description

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
class estd::IntrusiveListIterator< T, NodePointer, U >

IntrusiveListIterator class is an iterator of elements on IntrusiveList.

This class provides an interface similar to std::list::iterator.

Template Parameters
Tis the type that has the IntrusiveListNode variable
NodePointeris a pointer-to-member to IntrusiveListNode variable in T
Uis the type that will be stored on the list; it can be different from T, but must be implicitly convertible to T (so usually a type derived from T); default - T;

Member Typedef Documentation

◆ difference_type

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveListIterator< T, NodePointer, U >::difference_type = ptrdiff_t

difference type

◆ iterator_category

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveListIterator< T, NodePointer, U >::iterator_category = std::bidirectional_iterator_tag

category of the iterator

◆ pointer

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveListIterator< T, NodePointer, U >::pointer = U*

pointer to object "pointed to" by the iterator

◆ reference

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveListIterator< T, NodePointer, U >::reference = U&

reference to object "pointed to" by the iterator

◆ value_type

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveListIterator< T, NodePointer, U >::value_type = U

value "pointed to" by the iterator

Constructor & Destructor Documentation

◆ IntrusiveListIterator() [1/3]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
constexpr estd::IntrusiveListIterator< T, NodePointer, U >::IntrusiveListIterator ( )
inline

IntrusiveListIterator's constructor.

◆ IntrusiveListIterator() [2/3]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
constexpr estd::IntrusiveListIterator< T, NodePointer, U >::IntrusiveListIterator ( IntrusiveListNode *const  node)
inlineexplicit

IntrusiveListIterator's constructor.

Parameters
[in]nodeis a pointer to IntrusiveListNode of element that will be "pointed to" by the iterator

◆ IntrusiveListIterator() [3/3]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
constexpr estd::IntrusiveListIterator< T, NodePointer, U >::IntrusiveListIterator ( reference  element)
inlineexplicit

IntrusiveListIterator's constructor.

Parameters
[in]elementis a reference to element that will be "pointed to" by the iterator

Member Function Documentation

◆ getPointer()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
pointer estd::IntrusiveListIterator< T, NodePointer, U >::getPointer ( ) const
inlineprivate

Converts contained pointer to IntrusiveListNode to pointer to object that contains this node.

Returns
pointer to object "pointed to" by the iterator

◆ operator*()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
reference estd::IntrusiveListIterator< T, NodePointer, U >::operator* ( ) const
inline

IntrusiveListIterator's unary prefix dereference operator.

Returns
reference to object "pointed to" by the iterator

◆ operator++() [1/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
IntrusiveListIterator& estd::IntrusiveListIterator< T, NodePointer, U >::operator++ ( )
inline

IntrusiveListIterator's unary prefix increment operator.

Returns
reference to "this" iterator

◆ operator++() [2/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
IntrusiveListIterator estd::IntrusiveListIterator< T, NodePointer, U >::operator++ ( int  )
inline

IntrusiveListIterator's unary postfix increment operator.

Returns
copy of "this" iterator before increment

◆ operator--() [1/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
IntrusiveListIterator& estd::IntrusiveListIterator< T, NodePointer, U >::operator-- ( )
inline

IntrusiveListIterator's unary prefix decrement operator.

Returns
reference to "this" iterator

◆ operator--() [2/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
IntrusiveListIterator estd::IntrusiveListIterator< T, NodePointer, U >::operator-- ( int  )
inline

IntrusiveListIterator's unary postfix decrement operator.

Returns
copy of "this" iterator before decrement

◆ operator->()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
pointer estd::IntrusiveListIterator< T, NodePointer, U >::operator-> ( ) const
inline

IntrusiveListIterator's binary infix pointer member access operator.

Returns
pointer to object "pointed to" by the iterator

◆ operator==()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
bool estd::IntrusiveListIterator< T, NodePointer, U >::operator== ( const IntrusiveListIterator< T, NodePointer, U > &  other) const
inline

IntrusiveListIterator's "equal to" comparison operator.

Parameters
[in]otheris a const reference to IntrusiveListIterator on right-hand side of comparison operator
Returns
true if both iterators are equal, false otherwise

Member Data Documentation

◆ node_

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
IntrusiveListNode* estd::IntrusiveListIterator< T, NodePointer, U >::node_
private

pointer to IntrusiveListNode of the object "pointed to" by the iterator


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