28 #ifndef CMSIS_PLUS_UTILS_LISTS_H_ 29 #define CMSIS_PLUS_UTILS_LISTS_H_ 213 template<
typename T,
typename N, T* N::* MP,
typename U = T>
319 get_pointer (
void)
const;
322 get_iterator_pointer ()
const;
406 uninitialized (
void)
const;
555 template<
typename T,
typename N, N T::* MP,
typename U = T>
661 get_pointer (
void)
const;
664 get_iterator_pointer ()
const;
707 template<
typename T,
typename N, N T::* MP,
typename U = T>
849 return (
next_ ==
nullptr);
892 template<
typename T,
typename N, T* N::* MP,
typename U>
901 template<
typename T,
typename N, T* N::* MP,
typename U>
911 template<
typename T,
typename N, T* N::* MP,
typename U>
918 static_assert(std::is_convertible<U, T>::value ==
true,
"U must be implicitly convertible to T!");
921 template<
typename T,
typename N, T* N::* MP,
typename U>
928 template<
typename T,
typename N, T* N::* MP,
typename U>
935 template<
typename T,
typename N, T* N::* MP,
typename U>
943 template<
typename T,
typename N, T* N::* MP,
typename U>
947 const auto tmp = *
this;
952 template<
typename T,
typename N, T* N::* MP,
typename U>
960 template<
typename T,
typename N, T* N::* MP,
typename U>
964 const auto tmp = *
this;
969 template<
typename T,
typename N, T* N::* MP,
typename U>
977 template<
typename T,
typename N, T* N::* MP,
typename U>
986 template<
typename T,
typename N, T* N::* MP,
typename U>
993 template<
typename T,
typename N, T* N::* MP,
typename U>
1028 return (head_.prev () ==
nullptr);
1035 return (head_.next () == &head_) || (head_.next () ==
nullptr);
1047 return (head_.prev ());
1052 template<
typename T,
typename N, N T::* MP,
typename U>
1061 template<
typename T,
typename N, N T::* MP,
typename U>
1071 template<
typename T,
typename N, N T::* MP,
typename U>
1078 static_assert(std::is_convertible<U, T>::value ==
true,
"U must be implicitly convertible to T!");
1081 template<
typename T,
typename N, N T::* MP,
typename U>
1088 template<
typename T,
typename N, N T::* MP,
typename U>
1095 template<
typename T,
typename N, N T::* MP,
typename U>
1103 template<
typename T,
typename N, N T::* MP,
typename U>
1107 const auto tmp = *
this;
1112 template<
typename T,
typename N, N T::* MP,
typename U>
1120 template<
typename T,
typename N, N T::* MP,
typename U>
1124 const auto tmp = *
this;
1129 template<
typename T,
typename N, N T::* MP,
typename U>
1137 template<
typename T,
typename N, N T::* MP,
typename U>
1145 template<
typename T,
typename N, N T::* MP,
typename U>
1154 reinterpret_cast<difference_type> (&(
static_cast<T*
> (
nullptr)->*MP));
1162 template<
typename T,
typename N, N T::* MP,
typename U>
1171 template<
typename T,
typename N, N T::* MP,
typename U>
1178 template<
typename T,
typename N, N T::* MP,
typename U>
1188 template<
typename T,
typename N, N T::* MP,
typename U>
1195 template<
typename T,
typename N, N T::* MP,
typename U>
1199 if (uninitialized ())
1208 reinterpret_cast<difference_type> (&(
static_cast<T*
> (
nullptr)->*MP));
1212 *reinterpret_cast<static_double_list_links*> (reinterpret_cast<difference_type> (&node)
1214 const_cast<static_double_list_links *> (tail ()));
1221 template<
typename T,
typename N, N T::* MP,
typename U>
1225 if (uninitialized ())
1234 template<
typename T,
typename N, N T::* MP,
typename U>
1243 template<
typename T,
typename N, N T::* MP,
typename U>
1252 reinterpret_cast<difference_type> (&(
static_cast<T*
> (
nullptr)->*MP));
1260 template<
typename T,
typename N, N T::* MP,
typename U>
1273 template<
typename T,
typename N, N T::* MP,
typename U>
pointer unlink_tail(void)
Unlink the last element from the list.
ptrdiff_t difference_type
Type of pointer difference.
bool unlinked(void)
Check if the node is unlinked.
ptrdiff_t difference_type
static_double_list_links * prev(void) const
bool operator==(const double_list_iterator &other) const
pointer get_pointer(void) const
Get the object node from the intrusive node.
bool operator!=(thread::id x, thread::id y) noexcept
static_double_list_links()
Construct a list node (BSS initialised).
Ask for flags to be cleared after read.
~intrusive_list()
Destruct the list.
Statically allocated core of a double linked list, pointers to next, previous.
volatile static_double_list_links * head(void) const
Get the list head.
ptrdiff_t difference_type
Type of pointer difference.
static_double_list_links * prev_
Pointer to previous node.
U & reference
Type of reference to object "pointed to" by the iterator.
U & reference
Type of reference to object "pointed to" by the iterator.
bool operator!=(const intrusive_list_iterator &other) const
double_list_iterator & operator++()
bool uninitialized(void) const
Check if the list is unitialised.
bool operator==(thread::id x, thread::id y) noexcept
volatile static_double_list_links * tail(void) const
Get the list tail.
N * iterator_pointer
Type of reference to the iterator internal pointer.
iterator_pointer node_
Pointer to intrusive node.
pointer unlink_head(void)
Unlink the first element from the list.
iterator_pointer get_iterator_pointer() const
std::forward_iterator_tag iterator_category
Category of iterator.
static_double_list_links * next_
Pointer to next node.
iterator begin()
Iterator begin.
N * iterator_pointer
Type of reference to the iterator internal pointer.
Statically allocated circular double linked list of nodes.
U * pointer
Type of pointer to object "pointed to" by the iterator.
void link(reference node)
Add a node to the tail of the list.
intrusive_list_iterator & operator--()
U value_type
Type of value "pointed to" by the iterator.
The core of a double linked list, pointers to next, previous.
pointer operator->() const
constexpr double_list_iterator()
pointer get_pointer(iterator_pointer node) const
double_list_links()
Construct a list node (explicitly set to nullptr).
pointer get_pointer(void) const
Get the object node from the intrusive node.
int link(const char *existing, const char *_new)
static_double_list()
Construct a list.
~double_list_links()
Destruct the node.
Template for a double linked list iterator.
std::forward_iterator_tag iterator_category
Category of iterator.
static_double_list_links head_
A list node used to point to head and tail.
constexpr intrusive_list_iterator()
static_double_list_links * next(void) const
bool empty(void) const
Check if the list is empty.
N * iterator_pointer
Type of reference to the iterator internal pointer.
intrusive_list()
Construct an intrusive list.
reference operator*() const
Circular double linked list of nodes.
iterator_pointer get_iterator_pointer() const
U * pointer
Type of pointer to object "pointed to" by the iterator.
void unlink(void)
Remove the node from the list.
pointer operator->() const
bool operator==(const intrusive_list_iterator &other) const
intrusive_list_iterator & operator++()
double_list_iterator & operator--()
~static_double_list_links()
Destruct the node.
Template for an intrusive list iterator.
bool operator!=(const double_list_iterator &other) const
U value_type
Type of value "pointed to" by the iterator.
iterator end() const
Iterator begin.
~static_double_list()
Destruct the list.
iterator_pointer node_
Pointer to intrusive node.
reference operator*() const