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

IntrusiveForwardList class is an intrusive linear singly linked list. More...

#include <IntrusiveForwardList.hpp>

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

Public Types

using const_iterator = IntrusiveForwardListConstIterator< T, NodePointer, U >
 const 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 = IntrusiveForwardListIterator< T, NodePointer, U >
 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 IntrusiveForwardList ()
 IntrusiveForwardList's constructor. More...
 
iterator before_begin ()
 
const_iterator before_begin () const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbefore_begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 Unlinks all elements from the list. More...
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
reference front ()
 
const_reference front () const
 
void pop_front ()
 Unlinks the first element from the list. More...
 
void push_front (reference newElement)
 Links the element at the beginning of the list. More...
 
void swap (IntrusiveForwardList &other)
 Swaps contents with another list. More...
 
 IntrusiveForwardList (const IntrusiveForwardList &)=delete
 
 IntrusiveForwardList (IntrusiveForwardList &&)=default
 
const IntrusiveForwardListoperator= (const IntrusiveForwardList &)=delete
 
IntrusiveForwardListoperator= (IntrusiveForwardList &&)=delete
 

Static Public Member Functions

static iterator erase_after (const iterator position)
 Unlinks the element following position from the list. More...
 
static iterator insert_after (const iterator position, reference newElement)
 Links the element in the list after position. More...
 
static void splice_after (const iterator position, const iterator beforeSplicedElement)
 Transfers the element from one list to another list after position. More...
 

Private Attributes

internal::IntrusiveForwardListBase intrusiveForwardListBase_
 internal IntrusiveForwardListBase object More...
 

Detailed Description

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
class estd::IntrusiveForwardList< T, NodePointer, U >

IntrusiveForwardList class is an intrusive linear singly linked list.

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

Template Parameters
Tis the type that has the IntrusiveForwardListNode variable
NodePointeris a pointer-to-member to IntrusiveForwardListNode 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; 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, IntrusiveForwardListNode T::* NodePointer, typename U = T>
using estd::IntrusiveForwardList< T, NodePointer, U >::const_iterator = IntrusiveForwardListConstIterator<T, NodePointer, U>

const iterator of elements on the list

◆ const_pointer

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
using estd::IntrusiveForwardList< T, NodePointer, U >::const_pointer = const U*

const pointer to value linked in the list

◆ const_reference

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

const reference to value linked in the list

◆ iterator

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
using estd::IntrusiveForwardList< T, NodePointer, U >::iterator = IntrusiveForwardListIterator<T, NodePointer, U>

iterator of elements on the list

◆ pointer

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
using estd::IntrusiveForwardList< T, NodePointer, U >::pointer = U*

pointer to value linked in the list

◆ reference

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
using estd::IntrusiveForwardList< T, NodePointer, U >::reference = U&

reference to value linked in the list

◆ value_type

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
using estd::IntrusiveForwardList< T, NodePointer, U >::value_type = U

value linked in the list

Constructor & Destructor Documentation

◆ IntrusiveForwardList()

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

IntrusiveForwardList's constructor.

Member Function Documentation

◆ before_begin() [1/2]

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
iterator estd::IntrusiveForwardList< T, NodePointer, U >::before_begin ( )
inline
Returns
iterator of "one before the first" element on the list
Here is the caller graph for this function:

◆ before_begin() [2/2]

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveForwardList< T, NodePointer, U >::before_begin ( ) const
inline
Returns
const iterator of "one before the first" element on the list

◆ begin() [1/2]

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
iterator estd::IntrusiveForwardList< 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, IntrusiveForwardListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveForwardList< T, NodePointer, U >::begin ( ) const
inline
Returns
const iterator of first element on the list

◆ cbefore_begin()

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveForwardList< T, NodePointer, U >::cbefore_begin ( ) const
inline
Returns
const iterator of "one before the first" element on the list
Here is the caller graph for this function:

◆ cbegin()

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveForwardList< 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, IntrusiveForwardListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveForwardList< 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, IntrusiveForwardListNode T::* NodePointer, typename U = T>
void estd::IntrusiveForwardList< T, NodePointer, U >::clear ( )
inline

Unlinks all elements from the list.

Here is the caller graph for this function:

◆ empty()

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
bool estd::IntrusiveForwardList< 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, IntrusiveForwardListNode T::* NodePointer, typename U = T>
iterator estd::IntrusiveForwardList< 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, IntrusiveForwardListNode T::* NodePointer, typename U = T>
const_iterator estd::IntrusiveForwardList< T, NodePointer, U >::end ( ) const
inline
Returns
const iterator of "one past the last" element on the list

◆ erase_after()

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
static iterator estd::IntrusiveForwardList< T, NodePointer, U >::erase_after ( const iterator  position)
inlinestatic

Unlinks the element following position from the list.

Note
No instance of the list is needed for this operation.
Parameters
[in]positionis an iterator preceding the element which 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, IntrusiveForwardListNode T::* NodePointer, typename U = T>
reference estd::IntrusiveForwardList< 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, IntrusiveForwardListNode T::* NodePointer, typename U = T>
const_reference estd::IntrusiveForwardList< T, NodePointer, U >::front ( ) const
inline
Returns
const reference to first element on the list

◆ insert_after()

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
static iterator estd::IntrusiveForwardList< T, NodePointer, U >::insert_after ( const iterator  position,
reference  newElement 
)
inlinestatic

Links the element in the list after position.

Note
No instance of the list is needed for this operation.
Parameters
[in]positionis an iterator of the element after 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_front()

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

Unlinks the first element from the list.

Here is the caller graph for this function:

◆ push_front()

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
void estd::IntrusiveForwardList< 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:

◆ splice_after()

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
static void estd::IntrusiveForwardList< T, NodePointer, U >::splice_after ( const iterator  position,
const iterator  beforeSplicedElement 
)
inlinestatic

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

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

◆ swap()

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

Swaps contents with another list.

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

Member Data Documentation

◆ intrusiveForwardListBase_

template<typename T, IntrusiveForwardListNode T::* NodePointer, typename U = T>
internal::IntrusiveForwardListBase estd::IntrusiveForwardList< T, NodePointer, U >::intrusiveForwardListBase_
private

internal IntrusiveForwardListBase object


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