distortos
v0.7.0
object-oriented C++ RTOS for microcontrollers
|
SortedIntrusiveForwardList class is an IntrusiveForwardList with sorted elements. More...
#include "estd/SortedIntrusiveForwardList.hpp"
Classes | |
struct | Implementation |
Implementation struct is used primarily for "Empty Base Optimization" with Compare type. More... | |
Public Types | |
using | UnsortedIntrusiveForwardList = IntrusiveForwardList< T, NodePointer, U > |
unsorted intrusive forward list used internally More... | |
using | const_iterator = typename UnsortedIntrusiveForwardList::const_iterator |
const iterator of elements on the list More... | |
using | const_pointer = typename UnsortedIntrusiveForwardList::const_pointer |
const pointer to value linked in the list More... | |
using | const_reference = typename UnsortedIntrusiveForwardList::const_reference |
const reference to value linked in the list More... | |
using | iterator = typename UnsortedIntrusiveForwardList::iterator |
iterator of elements on the list More... | |
using | pointer = typename UnsortedIntrusiveForwardList::pointer |
pointer to value linked in the list More... | |
using | reference = typename UnsortedIntrusiveForwardList::reference |
reference to value linked in the list More... | |
using | value_type = typename UnsortedIntrusiveForwardList::value_type |
value linked in the list More... | |
Public Member Functions | |
constexpr | SortedIntrusiveForwardList (const Compare &compare=Compare{}) |
SortedIntrusiveForwardList'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 |
iterator | insert (reference newElement) |
Links the element in the list, keeping it sorted. More... | |
void | pop_front () |
Unlinks the first element from the list. More... | |
void | splice_after (const iterator beforeSplicedElement) |
Transfers the element from another list to this one, keeping it sorted. More... | |
void | swap (SortedIntrusiveForwardList &other) |
Swaps contents with another list. More... | |
SortedIntrusiveForwardList (const SortedIntrusiveForwardList &)=delete | |
SortedIntrusiveForwardList (SortedIntrusiveForwardList &&)=default | |
const SortedIntrusiveForwardList & | operator= (const SortedIntrusiveForwardList &)=delete |
SortedIntrusiveForwardList & | operator= (SortedIntrusiveForwardList &&)=delete |
Static Public Member Functions | |
static iterator | erase_after (const iterator position) |
Unlinks the element following position from the list. More... | |
Private Attributes | |
Implementation | implementation_ |
internal Implementation object - unsorted IntrusiveForwardList and Compare instance More... | |
SortedIntrusiveForwardList class is an IntrusiveForwardList with sorted elements.
This class tries to provide an interface similar to std::forward_list.
Compare | is a type of functor used for comparison, std::less results in descending order, std::greater - in ascending order |
T | is the type that has the IntrusiveForwardListNode variable |
NodePointer | is a pointer-to-member to IntrusiveForwardListNode variable in T |
U | is 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 |
using estd::SortedIntrusiveForwardList< Compare, T, NodePointer, U >::const_iterator = typename UnsortedIntrusiveForwardList::const_iterator |
const iterator of elements on the list
using estd::SortedIntrusiveForwardList< Compare, T, NodePointer, U >::const_pointer = typename UnsortedIntrusiveForwardList::const_pointer |
const pointer to value linked in the list
using estd::SortedIntrusiveForwardList< Compare, T, NodePointer, U >::const_reference = typename UnsortedIntrusiveForwardList::const_reference |
const reference to value linked in the list
using estd::SortedIntrusiveForwardList< Compare, T, NodePointer, U >::iterator = typename UnsortedIntrusiveForwardList::iterator |
iterator of elements on the list
using estd::SortedIntrusiveForwardList< Compare, T, NodePointer, U >::pointer = typename UnsortedIntrusiveForwardList::pointer |
pointer to value linked in the list
using estd::SortedIntrusiveForwardList< Compare, T, NodePointer, U >::reference = typename UnsortedIntrusiveForwardList::reference |
reference to value linked in the list
using estd::SortedIntrusiveForwardList< Compare, T, NodePointer, U >::UnsortedIntrusiveForwardList = IntrusiveForwardList<T, NodePointer, U> |
unsorted intrusive forward list used internally
using estd::SortedIntrusiveForwardList< Compare, T, NodePointer, U >::value_type = typename UnsortedIntrusiveForwardList::value_type |
value linked in the list
|
inlineexplicit |
SortedIntrusiveForwardList's constructor.
[in] | compare | is a reference to Compare object used to copy-construct internal comparison functor |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Unlinks all elements from the list.
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Unlinks the element following position from the list.
[in] | position | is an iterator preceding the element which will be unlinked from the list |
|
inline |
|
inline |
|
inline |
Links the element in the list, keeping it sorted.
[in] | newElement | is a reference to the element that will be linked in the list |
|
inline |
Unlinks the first element from the list.
|
inline |
Transfers the element from another list to this one, keeping it sorted.
[in] | beforeSplicedElement | is an iterator of the element preceding the one which will be spliced from another list to this one |
|
inline |
Swaps contents with another list.
[in] | other | is a reference to SortedIntrusiveForwardList with which contents of this list will be swapped |
|
private |
internal Implementation object - unsorted IntrusiveForwardList and Compare instance