20 #ifndef BEAST_INTRUSIVE_LIST_H_INCLUDED
21 #define BEAST_INTRUSIVE_LIST_H_INCLUDED
28 template <
typename,
typename>
35 template <
typename T,
typename U>
43 template <
typename T,
typename U>
56 template <
typename T,
typename Tag>
98 return m_node == other.m_node;
101 template <
typename M>
105 return !((*this) == other);
278 template <
typename T,
typename Tag =
void>
437 Node* node =
static_cast<Node*
>(&element);
438 node->m_next = &*pos;
439 node->m_prev = node->m_next->m_prev;
440 node->m_next->m_prev = node;
441 node->m_prev->m_next = node;
456 Node* before = &*pos;
457 other.m_head.m_next->m_prev = before->m_prev;
458 before->m_prev->m_next = other.m_head.m_next;
459 other.m_tail.m_prev->m_next = before;
460 before->m_prev = other.m_tail.m_prev;
476 node->m_next->m_prev = node->m_prev;
477 node->m_prev->m_next = node->m_next;
582 return *(
static_cast<pointer>(node));
ListIterator(N *node=nullptr) noexcept
const_reference front() const noexcept
Obtain a const reference to the first element.
size_type size() const noexcept
Returns the number of elements in the list.
List & operator=(List const &)=delete
void decrement() noexcept
void increment() noexcept
detail::ListIterator< Node const > const_iterator
iterator prepend(List &list) noexcept
Insert another list at the beginning of this list.
ListIterator(ListIterator< M > const &other) noexcept
typename std::remove_const< U >::type type
iterator iterator_to(T &element) const noexcept
Obtain an iterator from an element.
iterator end() noexcept
Obtain a iterator to the end of the list.
const_iterator const_iterator_to(T const &element) const noexcept
Obtain a const iterator from an element.
bool empty() const noexcept
Determine if the list is empty.
detail::ListIterator< Node > iterator
const_iterator cend() const noexcept
Obtain a const iterator to the end of the list.
void clear() noexcept
Clear the list.
iterator push_front(T &element) noexcept
Insert an element at the beginning of the list.
typename std::remove_const< U >::type const type
bool operator!=(ListIterator< M > const &other) const noexcept
ListIterator & operator++() noexcept
void insert(iterator pos, List &other) noexcept
Insert another list into this one.
const_iterator cbegin() const noexcept
Obtain a const iterator to the beginning of the list.
ListIterator & operator--() noexcept
iterator begin() noexcept
Obtain an iterator to the beginning of the list.
iterator insert(iterator pos, T &element) noexcept
Insert an element.
ListIterator operator--(int) noexcept
ListIterator operator++(int) noexcept
typename detail::ListNode< beast::insight::detail::StatsDMetricBase, void > Node
reference element_from(Node *node) noexcept
T & pop_front() noexcept
Remove the element at the beginning of the list.
const_reference element_from(Node const *node) const noexcept
value_type const & const_reference
reference front() noexcept
Obtain a reference to the first element.
reference dereference() const noexcept
bool operator==(ListIterator< M > const &other) const noexcept
reference operator*() const noexcept
void swap(List &other) noexcept
Swap contents with another list.
Copy const attribute from T to U if present.
iterator append(List &list) noexcept
Append another list at the end of this list.
const_iterator begin() const noexcept
Obtain a const iterator to the beginning of the list.
iterator erase(iterator pos) noexcept
Remove an element.
pointer operator->() const noexcept
const_iterator end() const noexcept
Obtain a const iterator to the end of the list.
const_reference back() const noexcept
Obtain a const reference to the last element.
List()
Create an empty list.
iterator push_back(T &element) noexcept
Append an element at the end of the list.
typename beast::detail::CopyConst< N, typename N::value_type >::type value_type
value_type const * const_pointer
Intrusive doubly linked list.
T & pop_back() noexcept
Remove the element at the end of the list.
reference back() noexcept
Obtain a reference to the last element.