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