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

IntrusiveList class is an intrusive circular doubly linked list. More...

#include "estd/IntrusiveList.hpp"

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

Public Types

using const_iterator = IntrusiveListConstIterator< T, NodePointer, U >
 const iterator of elements on the list More...
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 const reverse iterator of elements on the list More...
 
using const_pointer = const U *
 const pointer to value linked in the list More...
 
using const_reference = const U &
 const reference to value linked in the list More...
 
using iterator = IntrusiveListIterator< T, NodePointer, U >
 iterator of elements on the list More...
 
using reverse_iterator = std::reverse_iterator< iterator >
 reverse iterator of elements on the list More...
 
using pointer = U *
 pointer to value linked in the list More...
 
using reference = U &
 reference to value linked in the list More...
 
using value_type = U
 value linked in the list More...
 

Public Member Functions

constexpr IntrusiveList ()
 IntrusiveList's constructor. More...
 
reference back ()
 
const_reference back () const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 Unlinks all elements from the list. More...
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
reference front ()
 
const_reference front () const
 
void pop_back ()
 Unlinks the last element from the list. More...
 
void pop_front ()
 Unlinks the first element from the list. More...
 
void push_back (reference newElement)
 Links the element at the end of the list. More...
 
void push_front (reference newElement)
 Links the element at the beginning of the list. More...
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
void swap (IntrusiveList &other)
 Swaps contents with another list. More...
 
 IntrusiveList (const IntrusiveList &)=delete
 
 IntrusiveList (IntrusiveList &&)=default
 
const IntrusiveListoperator= (const IntrusiveList &)=delete
 
IntrusiveListoperator= (IntrusiveList &&)=delete
 

Static Public Member Functions

static iterator erase (const iterator position)
 Unlinks the element at position from the list. More...
 
static iterator insert (const iterator position, reference newElement)
 Links the element in the list before position. More...
 
static void splice (const iterator position, const iterator splicedElement)
 Transfers the element from one list to another list before position. More...
 

Private Attributes

internal::IntrusiveListBase intrusiveListBase_
 internal IntrusiveListBase object More...
 

Detailed Description

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

IntrusiveList class is an intrusive circular doubly linked list.

This class tries to provide an interface similar to std::list.

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 U* must be implicitly convertible to T* (so usually a type derived from T); default - T; using different type than T can be used to break circular dependencies, because T must be fully defined to instantiate this class, but it is enough to forward declare U - it only needs to be fully defined to use member functions

Member Typedef Documentation

◆ const_iterator

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveList< T, NodePointer, U >::const_iterator = IntrusiveListConstIterator<T, NodePointer, U>

const iterator of elements on the list

◆ const_pointer

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveList< T, NodePointer, U >::const_pointer = const U*

const pointer to value linked in the list

◆ const_reference

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveList< T, NodePointer, U >::const_reference = const U&

const reference to value linked in the list

◆ const_reverse_iterator

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveList< T, NodePointer, U >::const_reverse_iterator = std::reverse_iterator<const_iterator>

const reverse iterator of elements on the list

◆ iterator

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

iterator of elements on the list

◆ pointer

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

pointer to value linked in the list

◆ reference

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

reference to value linked in the list

◆ reverse_iterator

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
using estd::IntrusiveList< T, NodePointer, U >::reverse_iterator = std::reverse_iterator<iterator>

reverse iterator of elements on the list

◆ value_type

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

value linked in the list

Constructor & Destructor Documentation

◆ IntrusiveList()

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

IntrusiveList's constructor.

Member Function Documentation

◆ back() [1/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
reference estd::IntrusiveList< T, NodePointer, U >::back ( )
inline
Returns
reference to last element on the list
Here is the caller graph for this function:

◆ back() [2/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_reference estd::IntrusiveList< T, NodePointer, U >::back ( ) const
inline
Returns
const reference to last element on the list

◆ begin() [1/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
iterator estd::IntrusiveList< T, NodePointer, U >::begin ( )
inline
Returns
iterator of first element on the list
Here is the caller graph for this function:

◆ begin() [2/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveList< T, NodePointer, U >::begin ( ) const
inline
Returns
const iterator of first element on the list

◆ cbegin()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveList< T, NodePointer, U >::cbegin ( ) const
inline
Returns
const iterator of first element on the list
Here is the caller graph for this function:

◆ cend()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveList< T, NodePointer, U >::cend ( ) const
inline
Returns
const iterator of "one past the last" element on the list
Here is the caller graph for this function:

◆ clear()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
void estd::IntrusiveList< T, NodePointer, U >::clear ( )
inline

Unlinks all elements from the list.

Here is the caller graph for this function:

◆ crbegin()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_reverse_iterator estd::IntrusiveList< T, NodePointer, U >::crbegin ( ) const
inline
Returns
const reverse iterator to first element in the reversed list (last element of the non-reversed list)
Here is the caller graph for this function:

◆ crend()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_reverse_iterator estd::IntrusiveList< T, NodePointer, U >::crend ( ) const
inline
Returns
const reverse iterator to "one past the last" element in the reversed list ("one before the first" element of the non-reversed list)
Here is the caller graph for this function:

◆ empty()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
bool estd::IntrusiveList< T, NodePointer, U >::empty ( ) const
inline
Returns
true is the list is empty, false otherwise
Here is the caller graph for this function:

◆ end() [1/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
iterator estd::IntrusiveList< T, NodePointer, U >::end ( )
inline
Returns
iterator of "one past the last" element on the list
Here is the caller graph for this function:

◆ end() [2/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveList< T, NodePointer, U >::end ( ) const
inline
Returns
const iterator of "one past the last" element on the list

◆ erase()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
static iterator estd::IntrusiveList< T, NodePointer, U >::erase ( const iterator  position)
inlinestatic

Unlinks the element at position from the list.

Note
No instance of the list is needed for this operation.
Parameters
[in]positionis an iterator of the element that will be unlinked from the list
Returns
iterator of the element that was following the element which was unlinked
Here is the caller graph for this function:

◆ front() [1/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
reference estd::IntrusiveList< T, NodePointer, U >::front ( )
inline
Returns
reference to first element on the list
Here is the caller graph for this function:

◆ front() [2/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_reference estd::IntrusiveList< T, NodePointer, U >::front ( ) const
inline
Returns
const reference to first element on the list

◆ insert()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
static iterator estd::IntrusiveList< T, NodePointer, U >::insert ( const iterator  position,
reference  newElement 
)
inlinestatic

Links the element in the list before position.

Note
No instance of the list is needed for this operation.
Parameters
[in]positionis an iterator of the element before which newNode will be linked
[in]newElementis a reference to the element that will be linked in the list
Returns
iterator of newElement
Here is the caller graph for this function:

◆ pop_back()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
void estd::IntrusiveList< T, NodePointer, U >::pop_back ( )
inline

Unlinks the last element from the list.

Here is the caller graph for this function:

◆ pop_front()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
void estd::IntrusiveList< T, NodePointer, U >::pop_front ( )
inline

Unlinks the first element from the list.

Here is the caller graph for this function:

◆ push_back()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
void estd::IntrusiveList< T, NodePointer, U >::push_back ( reference  newElement)
inline

Links the element at the end of the list.

Parameters
[in]newElementis a reference to the element that will be linked in the list
Here is the caller graph for this function:

◆ push_front()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
void estd::IntrusiveList< T, NodePointer, U >::push_front ( reference  newElement)
inline

Links the element at the beginning of the list.

Parameters
[in]newElementis a reference to the element that will be linked in the list
Here is the caller graph for this function:

◆ rbegin() [1/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
reverse_iterator estd::IntrusiveList< T, NodePointer, U >::rbegin ( )
inline
Returns
reverse iterator to first element in the reversed list (last element of the non-reversed list)
Here is the caller graph for this function:

◆ rbegin() [2/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_reverse_iterator estd::IntrusiveList< T, NodePointer, U >::rbegin ( ) const
inline
Returns
const reverse iterator to first element in the reversed list (last element of the non-reversed list)

◆ rend() [1/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
reverse_iterator estd::IntrusiveList< T, NodePointer, U >::rend ( )
inline
Returns
reverse iterator to "one past the last" element in the reversed list ("one before the first" element of the non-reversed list)
Here is the caller graph for this function:

◆ rend() [2/2]

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
const_reverse_iterator estd::IntrusiveList< T, NodePointer, U >::rend ( ) const
inline
Returns
const reverse iterator to "one past the last" element in the reversed list ("one before the first" element of the non-reversed list)

◆ splice()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
static void estd::IntrusiveList< T, NodePointer, U >::splice ( const iterator  position,
const iterator  splicedElement 
)
inlinestatic

Transfers the element from one list to another list before position.

Note
No instance of any list is needed for this operation.
Parameters
[in]positionis an iterator of the element before which splicedElement will be linked
[in]splicedElementis an iterator of the element that will be spliced from one list to another
Here is the caller graph for this function:

◆ swap()

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
void estd::IntrusiveList< T, NodePointer, U >::swap ( IntrusiveList< T, NodePointer, U > &  other)
inline

Swaps contents with another list.

Parameters
[in]otheris a reference to IntrusiveList with which contents of this list will be swapped
Here is the caller graph for this function:

Member Data Documentation

◆ intrusiveListBase_

template<typename T, IntrusiveListNode T::* NodePointer, typename U = T>
internal::IntrusiveListBase estd::IntrusiveList< T, NodePointer, U >::intrusiveListBase_
private

internal IntrusiveListBase object


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