utils-lists 4.0.0
µOS++ C++ intrusive lists utilities
Loading...
Searching...
No Matches
micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U > Class Template Reference

A class template for an intrusive list iterator. More...

#include <micro-os-plus/utils/lists.h>

Public Types

using difference_type = ptrdiff_t
 Type of pointer difference.
 
using iterator_category = std::forward_iterator_tag
 Category of iterator.
 
using iterator_pointer = N*
 Type of reference to the iterator internal pointer.
 
using pointer = value_type*
 Type of pointer to object "pointed to" by the iterator.
 
using reference = value_type&
 Type of reference to object "pointed to" by the iterator.
 
using value_type = U
 Type of value "pointed to" by the iterator.
 

Public Member Functions

constexpr intrusive_list_iterator ()
 
constexpr intrusive_list_iterator (iterator_pointer const node)
 
constexpr intrusive_list_iterator (reference element)
 
iterator_pointer get_iterator_pointer () const
 
pointer get_pointer (void) const
 Get the object node from the intrusive node.
 
bool operator!= (const intrusive_list_iterator &other) const
 
reference operator* () const
 
intrusive_list_iteratoroperator++ ()
 
intrusive_list_iterator operator++ (int)
 
intrusive_list_iteratoroperator-- ()
 
intrusive_list_iterator operator-- (int)
 
pointer operator-> () const
 
bool operator== (const intrusive_list_iterator &other) const
 

Protected Attributes

iterator_pointer node_
 Pointer to intrusive node.
 

Detailed Description

template<class T, class N, N T::* MP, class U = T>
class micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >

A class template for an intrusive list iterator.

Template Parameters
TType of object that includes the intrusive node.
NType of intrusive node. Must have the public members previous & next.
MPName of the intrusive node member in object T.
UType stored in the list, derived from T.

This class provides an interface similar to std::list::iterator, except that it keeps track of the offset where the intrusive list element is located in the parent object.

Definition at line 695 of file lists.h.

Member Typedef Documentation

◆ difference_type

template<class T , class N , N T::* MP, class U = T>
using micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::difference_type = ptrdiff_t

Type of pointer difference.

Definition at line 721 of file lists.h.

◆ iterator_category

template<class T , class N , N T::* MP, class U = T>
using micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::iterator_category = std::forward_iterator_tag

Category of iterator.

Definition at line 726 of file lists.h.

◆ iterator_pointer

template<class T , class N , N T::* MP, class U = T>
using micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::iterator_pointer = N*

Type of reference to the iterator internal pointer.

Definition at line 716 of file lists.h.

◆ pointer

template<class T , class N , N T::* MP, class U = T>
using micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::pointer = value_type*

Type of pointer to object "pointed to" by the iterator.

Definition at line 706 of file lists.h.

◆ reference

template<class T , class N , N T::* MP, class U = T>
using micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::reference = value_type&

Type of reference to object "pointed to" by the iterator.

Definition at line 711 of file lists.h.

◆ value_type

template<class T , class N , N T::* MP, class U = T>
using micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::value_type = U

Type of value "pointed to" by the iterator.

Definition at line 701 of file lists.h.

Constructor & Destructor Documentation

◆ intrusive_list_iterator() [1/3]

template<class T , class N , N T::* MP, class U >
constexpr micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::intrusive_list_iterator ( )
constexpr

Definition at line 445 of file inlines.h.

◆ intrusive_list_iterator() [2/3]

template<class T , class N , N T::* MP, class U >
constexpr micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::intrusive_list_iterator ( iterator_pointer const node)
explicitconstexpr

Definition at line 451 of file inlines.h.

◆ intrusive_list_iterator() [3/3]

template<class T , class N , N T::* MP, class U >
constexpr micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::intrusive_list_iterator ( reference element)
explicitconstexpr

Definition at line 458 of file inlines.h.

Member Function Documentation

◆ get_iterator_pointer()

template<class T , class N , N T::* MP, class U >
intrusive_list_iterator< T, N, MP, U >::iterator_pointer micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::get_iterator_pointer ( ) const
inline

Definition at line 550 of file inlines.h.

◆ get_pointer()

template<class T , class N , N T::* MP, class U >
intrusive_list_iterator< T, N, MP, U >::pointer micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::get_pointer ( void ) const
inline

Get the object node from the intrusive node.

Returns
Pointer to object node.

Definition at line 532 of file inlines.h.

◆ operator!=()

template<class T , class N , N T::* MP, class U >
bool micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::operator!= ( const intrusive_list_iterator< T, N, MP, U > & other) const
inline

Definition at line 524 of file inlines.h.

◆ operator*()

template<class T , class N , N T::* MP, class U >
intrusive_list_iterator< T, N, MP, U >::reference micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::operator* ( ) const
inline

Definition at line 475 of file inlines.h.

◆ operator++() [1/2]

template<class T , class N , N T::* MP, class U >
intrusive_list_iterator< T, N, MP, U > & micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::operator++ ( )
inline

Definition at line 482 of file inlines.h.

◆ operator++() [2/2]

template<class T , class N , N T::* MP, class U >
intrusive_list_iterator< T, N, MP, U > micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::operator++ ( int )
inline

Definition at line 490 of file inlines.h.

◆ operator--() [1/2]

template<class T , class N , N T::* MP, class U >
intrusive_list_iterator< T, N, MP, U > & micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::operator-- ( )
inline

Definition at line 499 of file inlines.h.

◆ operator--() [2/2]

template<class T , class N , N T::* MP, class U >
intrusive_list_iterator< T, N, MP, U > micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::operator-- ( int )

Definition at line 507 of file inlines.h.

◆ operator->()

template<class T , class N , N T::* MP, class U >
intrusive_list_iterator< T, N, MP, U >::pointer micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::operator-> ( ) const
inline

Definition at line 468 of file inlines.h.

◆ operator==()

template<class T , class N , N T::* MP, class U >
bool micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::operator== ( const intrusive_list_iterator< T, N, MP, U > & other) const
inline

Definition at line 516 of file inlines.h.

Member Data Documentation

◆ node_

template<class T , class N , N T::* MP, class U = T>
iterator_pointer micro_os_plus::utils::intrusive_list_iterator< T, N, MP, U >::node_
protected

Pointer to intrusive node.

Definition at line 776 of file lists.h.


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