31#ifndef ETL_MULTISET_INCLUDED
32#define ETL_MULTISET_INCLUDED
70 multiset_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
84 multiset_full(string_type file_name_, numeric_type line_number_)
98 multiset_out_of_bounds(string_type file_name_, numeric_type line_number_)
112 multiset_iterator(string_type file_name_, numeric_type line_number_)
113 :
etl::multiset_exception(ETL_ERROR_TEXT(
"multiset:iterator", ETL_MULTISET_FILE_ID
"C"), file_name_, line_number_)
200 children[0] = ETL_NULLPTR;
201 children[1] = ETL_NULLPTR;
211 parent = ETL_NULLPTR;
212 children[0] = ETL_NULLPTR;
213 children[1] = ETL_NULLPTR;
218 uint_least8_t weight;
248 node.parent = parent;
265 Node* detached = position;
273 replacement =
swap->children[1 -
swap->dir];
275 if (replacement != ETL_NULLPTR)
277 replacement->parent =
swap->parent;
281 swap->parent = detached->parent;
282 swap->children[kLeft] = detached->children[kLeft];
283 swap->children[kRight] = detached->children[kRight];
284 if (
swap->children[kLeft])
286 swap->children[kLeft]->parent =
swap;
288 if (
swap->children[kRight])
290 swap->children[kRight]->parent =
swap;
292 swap->weight = detached->weight;
303 Node* weight_node = critical_node->children[critical_node->dir];
307 if (kNeither != weight_node->dir)
310 if (weight_node->weight == 1 - weight_node->dir)
312 weight_node->weight = kNeither;
316 weight_node->weight = weight_node->dir;
320 weight_node = weight_node->children[weight_node->dir];
330 if (kNeither == critical_node->weight)
332 critical_node->weight = critical_node->dir;
335 else if (critical_node->dir != critical_node->weight)
337 critical_node->weight = kNeither;
344 if (critical_node->children[critical_node->dir] != ETL_NULLPTR) ETL_UNLIKELY
346 if (critical_node->weight == critical_node->children[critical_node->dir]->dir)
354 if (critical_node->children[critical_node->dir]->children[1 - critical_node->dir] != ETL_NULLPTR) ETL_UNLIKELY
357 critical_node->children[critical_node->dir]->children[1 - critical_node->dir]->dir);
371 Node* limit_node = position;
372 while (limit_node && limit_node->children[dir])
374 limit_node = limit_node->children[dir];
389 if (position->children[kRight])
398 Node* parent = position;
403 parent = position->parent;
405 }
while (parent && parent->children[kRight] == position);
421 if (position->children[kRight])
430 const Node* parent = position;
435 parent = position->parent;
437 }
while (parent && parent->children[kRight] == position);
459 if (position->children[kLeft])
468 Node* parent = position;
473 parent = position->parent;
475 }
while (parent && parent->children[kLeft] == position);
497 if (position->children[kLeft])
506 const Node* parent = position;
511 parent = position->parent;
513 }
while (parent && parent->children[kLeft] == position);
538 Node* new_root = position->children[dir];
541 position->children[dir] = new_root->children[1 - dir];
543 if (position->children[dir])
545 position->children[dir]->parent = position;
549 new_root->parent = position->parent;
550 new_root->children[1 - dir] = position;
551 new_root->dir = 1 - dir;
554 position->weight = kNeither;
556 position->parent = new_root;
559 position->weight = kNeither;
580 Node* new_root = position->children[dir]->children[1 - dir];
582 position->children[dir]->weight = third != kNeither && third != dir ? dir : uint_least8_t(kNeither);
585 position->children[dir]->children[1 - dir] = new_root->children[dir];
587 if (new_root->children[dir])
589 new_root->children[dir]->parent = position->children[dir];
593 new_root->children[dir] = position->children[dir];
594 position->children[dir]->parent = new_root;
597 position->weight = third != kNeither && third == dir ? 1 - dir : kNeither;
600 position->children[dir] = new_root->children[1 - dir];
601 if (new_root->children[1 - dir])
603 new_root->children[1 - dir]->parent = position;
607 new_root->parent = position->parent;
608 new_root->children[1 - dir] = position;
609 new_root->dir = 1 - dir;
612 position->parent = new_root;
615 position->weight = kNeither;
621 ETL_DECLARE_DEBUG_COUNT;
628 template <
typename TKey,
typename TCompare = ETL_OR_STD::less<TKey> >
633 typedef TKey key_type;
634 typedef TKey value_type;
635 typedef TCompare key_compare;
636 typedef TCompare value_compare;
637 typedef value_type& reference;
638 typedef const value_type& const_reference;
640 typedef value_type&& rvalue_reference;
642 typedef value_type* pointer;
643 typedef const value_type* const_pointer;
644 typedef size_t size_type;
653 explicit Data_Node(value_type value_)
669 return compare(node1.value, node2.value);
674 return compare(node.value, key);
679 return compare(key, node.value);
683 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
686 return compare(node.value, key);
689 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
692 return compare(key, node.value);
724 return static_cast<const Data_Node*
>(p_node);
732 return static_cast<const Data_Node&
>(node);
739 class iterator :
public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, value_type>
743 friend class imultiset;
744 friend class const_iterator;
747 : p_multiset(ETL_NULLPTR)
748 , p_node(ETL_NULLPTR)
754 , p_node(ETL_NULLPTR)
764 iterator(
const iterator& other)
765 : p_multiset(other.p_multiset)
766 , p_node(other.p_node)
774 iterator& operator ++()
776 p_multiset->next_node(p_node);
780 iterator operator ++(
int)
782 iterator temp(*
this);
783 p_multiset->next_node(p_node);
787 iterator& operator --()
789 p_multiset->prev_node(p_node);
793 iterator operator --(
int)
795 iterator temp(*
this);
796 p_multiset->prev_node(p_node);
800 iterator& operator =(
const iterator& other)
802 p_multiset = other.p_multiset;
803 p_node = other.p_node;
807 reference operator *()
const
809 return imultiset::data_cast(p_node)->value;
812 pointer operator &()
const
814 return &(imultiset::data_cast(p_node)->value);
817 pointer operator ->()
const
819 return &(imultiset::data_cast(p_node)->value);
822 friend bool operator == (
const iterator& lhs,
const iterator& rhs)
824 return lhs.p_multiset == rhs.p_multiset && lhs.p_node == rhs.p_node;
827 friend bool operator != (
const iterator& lhs,
const iterator& rhs)
829 return !(lhs == rhs);
835 imultiset* p_multiset;
846 class const_iterator :
public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, const value_type>
850 friend class imultiset;
853 : p_multiset(ETL_NULLPTR)
854 , p_node(ETL_NULLPTR)
858 const_iterator(
const imultiset&
multiset)
860 , p_node(ETL_NULLPTR)
864 const_iterator(
const imultiset&
multiset,
const Node* node)
871 : p_multiset(other.p_multiset)
872 , p_node(other.p_node)
876 const_iterator(
const const_iterator& other)
877 : p_multiset(other.p_multiset)
878 , p_node(other.p_node)
886 const_iterator& operator ++()
888 p_multiset->next_node(p_node);
892 const_iterator operator ++(
int)
894 const_iterator temp(*
this);
895 p_multiset->next_node(p_node);
899 const_iterator& operator --()
901 p_multiset->prev_node(p_node);
905 const_iterator operator --(
int)
907 const_iterator temp(*
this);
908 p_multiset->prev_node(p_node);
912 const_iterator& operator =(
const const_iterator& other)
914 p_multiset = other.p_multiset;
915 p_node = other.p_node;
919 const_reference operator *()
const
921 return imultiset::data_cast(p_node)->value;
924 const_pointer operator &()
const
926 return imultiset::data_cast(p_node)->value;
929 const_pointer operator ->()
const
931 return &(imultiset::data_cast(p_node)->value);
934 friend bool operator == (
const const_iterator& lhs,
const const_iterator& rhs)
936 return lhs.p_multiset == rhs.p_multiset && lhs.p_node == rhs.p_node;
939 friend bool operator != (
const const_iterator& lhs,
const const_iterator& rhs)
941 return !(lhs == rhs);
953 const imultiset* p_multiset;
961 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
963 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
964 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
1019 return reverse_iterator(
iterator(*
this));
1041 const_reverse_iterator
rend()
const
1069 template <
typename TIterator>
1091 return count_nodes(key);
1096 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1099 return count_nodes(key);
1109 return ETL_OR_STD::make_pair<iterator, iterator>(
iterator(*
this, find_lower_node(
root_node, key)),
1115 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1116 ETL_OR_STD::pair<iterator, iterator>
equal_range(
const K& key)
1118 return ETL_OR_STD::make_pair<iterator, iterator>(
iterator(*
this, find_lower_node(
root_node, key)),
1129 return ETL_OR_STD::make_pair<const_iterator, const_iterator>(
const_iterator(*
this, find_lower_node(
root_node, key)),
1135 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1138 return ETL_OR_STD::make_pair<const_iterator, const_iterator>(
const_iterator(*
this, find_lower_node(
root_node, key)),
1160 Node* node =
const_cast<Node*
>(position.p_node);
1179 while (lower != upper)
1184 lower =
erase(lower);
1193 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1194 size_type
erase(K&& key_value)
1200 while (lower != upper)
1205 lower =
erase(lower);
1219 while (first != last)
1221 first =
erase(first);
1224 return last.to_iterator();
1239 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1258 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1273 Node* inserted_node = ETL_NULLPTR;
1278 Data_Node& node = allocate_data_node(value);
1281 inserted_node = insert_node(
root_node, node);
1284 return iterator(*
this, inserted_node);
1296 Node* inserted_node = ETL_NULLPTR;
1301 Data_Node& node = allocate_data_node(etl::move(value));
1304 inserted_node = insert_node(
root_node, node);
1307 return iterator(*
this, inserted_node);
1333 return insert(etl::move(value));
1344 template <
class TIterator>
1347 while (first != last)
1367 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1387 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1407 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1427 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1461 while (from != rhs.end())
1466 this->
insert(etl::move(*from));
1501 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1515 , p_node_pool(&node_pool)
1526 while (item !=
end())
1537 Data_Node& allocate_data_node(const_reference value)
1539 Data_Node* node = allocate_data_node();
1540 ::new ((
void*)&node->value)
value_type(value);
1541 ETL_INCREMENT_DEBUG_COUNT;
1549 Data_Node& allocate_data_node(rvalue_reference value)
1551 Data_Node* node = allocate_data_node();
1552 ::new ((
void*)&node->value) value_type(etl::move(value));
1553 ETL_INCREMENT_DEBUG_COUNT;
1564 return (p_node_pool->*func)();
1572 node.value.~value_type();
1573 p_node_pool->release(&node);
1574 ETL_DECREMENT_DEBUG_COUNT;
1583 size_type result = 0;
1590 while (lower != upper)
1593 const Data_Node& data_node = imultiset::data_cast(*lower);
1611 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1612 size_type count_nodes(
const K& key)
const
1615 size_type result = 0;
1622 while (lower != upper)
1625 const Data_Node& data_node = imultiset::data_cast(*lower);
1647 Node* found = ETL_NULLPTR;
1651 Data_Node& data_node = imultiset::data_cast(*position);
1656 position = position->children[kLeft];
1661 position = position->children[kRight];
1667 position = position->children[kLeft];
1677 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1678 Node* find_node(
Node* position,
const K& key)
1680 Node* found = ETL_NULLPTR;
1684 Data_Node& data_node = imultiset::data_cast(*position);
1689 position = position->children[kLeft];
1694 position = position->children[kRight];
1700 position = position->children[kLeft];
1714 const Node* found = ETL_NULLPTR;
1718 const Data_Node& data_node = imultiset::data_cast(*position);
1723 position = position->children[kLeft];
1728 position = position->children[kRight];
1734 position = position->children[kLeft];
1744 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1745 const Node* find_node(
const Node* position,
const K& key)
const
1747 const Node* found = ETL_NULLPTR;
1751 const Data_Node& data_node = imultiset::data_cast(*position);
1756 position = position->children[kLeft];
1761 position = position->children[kRight];
1767 position = position->children[kLeft];
1782 Node* lower_node = ETL_NULLPTR;
1786 Data_Node& data_node = imultiset::data_cast(*position);
1790 lower_node = position;
1791 if (position->children[kLeft])
1793 position = position->children[kLeft];
1803 position = position->children[kRight];
1808 lower_node = position;
1809 position = position->children[kLeft];
1819 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1820 Node* find_lower_node(
Node* position,
const K& key)
const
1823 Node* lower_node = ETL_NULLPTR;
1827 Data_Node& data_node = imultiset::data_cast(*position);
1831 lower_node = position;
1832 if (position->children[kLeft])
1834 position = position->children[kLeft];
1844 position = position->children[kRight];
1849 lower_node = position;
1850 position = position->children[kLeft];
1865 Node* upper_node = ETL_NULLPTR;
1871 Data_Node& data_node = imultiset::data_cast(*position);
1875 position = position->children[kRight];
1879 upper_node = position;
1881 if (!found && position->children[kLeft])
1883 position = position->children[kLeft];
1904 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1905 Node* find_upper_node(
Node* position,
const K& key)
const
1908 Node* upper_node = ETL_NULLPTR;
1914 Data_Node& data_node = imultiset::data_cast(*position);
1918 position = position->children[kRight];
1922 upper_node = position;
1924 if (!found && position->children[kLeft])
1926 position = position->children[kLeft];
1952 Node* found = position;
1958 Node* critical_parent_node = ETL_NULLPTR;
1965 if (kNeither != found->weight)
1967 critical_node = found;
1971 Data_Node& found_data_node = imultiset::data_cast(*found);
1980 else if (
node_comp(found_data_node, node))
1983 found->dir = kRight;
1989 found->dir = kRight;
1993 if (found->children[found->dir])
1997 if (kNeither != found->children[found->dir]->weight)
1999 critical_parent_node = found;
2003 found = found->children[found->dir];
2008 attach_node(found, found->children[found->dir], node);
2011 found = found->children[found->dir];
2021 if (critical_parent_node == ETL_NULLPTR && critical_node ==
root_node)
2025 else if (critical_parent_node == ETL_NULLPTR && critical_node == position)
2031 if (critical_parent_node != ETL_NULLPTR)
2033 balance_node(critical_parent_node->children[critical_parent_node->dir]);
2055 void remove_node(
Node* node)
2061 Data_Node& data_node = imultiset::data_cast(*node);
2076 node->parent->children[kLeft] == node ? kLeft : kRight;
2079 node = node->parent;
2098 node->dir = node->children[kLeft] ? kLeft : kRight;
2109 if ((node->weight == kNeither) ||
2110 (node->weight == (1 - node->dir) &&
2111 node->children[1 - node->dir]->weight == kNeither))
2118 node = node->children[node->dir];
2132 if (node->children[node->dir] == ETL_NULLPTR)
2142 if ((node->weight == kNeither) ||
2143 (node->weight == (1 - node->dir) &&
2144 node->children[1 - node->dir]->weight == kNeither))
2151 node = node->children[node->dir];
2154 Data_Node& replace_data_node = imultiset::data_cast(*node);
2157 if (
node_comp(data_node, replace_data_node))
2162 else if (
node_comp(replace_data_node, data_node))
2170 node->dir = node->children[kLeft] ? kLeft : kRight;
2179 if (balance->children[balance->dir] == ETL_NULLPTR)
2186 if (balance->weight == kNeither)
2188 balance->weight = 1 - balance->dir;
2192 else if (balance->weight == balance->dir)
2194 balance->weight = kNeither;
2199 int weight = balance->children[1 - balance->dir]->weight;
2201 if (weight == balance->dir)
2204 if (balance->parent == ETL_NULLPTR)
2207 balance->children[1 - balance->dir]->children[balance->dir]->weight);
2211 rotate_3node(balance->parent->children[balance->parent->dir], 1 - balance->dir,
2212 balance->children[1 - balance->dir]->children[balance->dir]->weight);
2217 else if (weight == kNeither)
2220 if (balance->parent == ETL_NULLPTR)
2230 Node* old_parent = balance->parent;
2231 rotate_2node(balance->parent->children[balance->parent->dir], 1 - balance->dir);
2232 old_parent->children[old_parent->dir]->weight = balance->dir;
2235 balance->weight = 1 - balance->dir;
2241 if (balance->parent == ETL_NULLPTR)
2247 rotate_2node(balance->parent->children[balance->parent->dir], 1 - balance->dir);
2253 balance = balance->children[balance->dir];
2260 detach_node(found->parent->children[found->parent->dir],
2261 node->parent->children[node->parent->dir]);
2282 destroy_data_node(data_node);
2292#if defined(ETL_POLYMORPHIC_MULTISET) || defined(ETL_POLYMORPHIC_CONTAINERS)
2308 template <
typename TKey, const
size_t MAX_SIZE_,
typename TCompare = ETL_OR_STD::less<TKey> >
2313 static ETL_CONSTANT
size_t MAX_SIZE = MAX_SIZE_;
2344 while (from != other.end())
2349 this->
insert(etl::move(*from));
2362 template <
typename TIterator>
2366 this->
assign(first, last);
2369#if ETL_HAS_INITIALIZER_LIST
2373 multiset(std::initializer_list<
typename etl::imultiset<TKey, TCompare>::value_type> init)
2376 this->
assign(init.begin(), init.end());
2414 while (from != rhs.end())
2416 this->
insert(etl::move(*from));
2428 etl::pool<typename etl::imultiset<TKey, TCompare>::Data_Node, MAX_SIZE> node_pool;
2431 template <
typename TKey, const
size_t MAX_SIZE_,
typename TCompare>
2432 ETL_CONSTANT
size_t multiset<TKey, MAX_SIZE_, TCompare>::MAX_SIZE;
2437#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST
2438 template <
typename... T>
2445#if ETL_USING_CPP11 && ETL_HAS_INITIALIZER_LIST
2446 template <
typename TKey,
typename TKeyCompare = etl::less<TKey>,
typename... T>
2447 constexpr auto make_multiset(T&&... keys) -> etl::multiset<TKey,
sizeof...(T), TKeyCompare>
2449 return { etl::forward<T>(keys)... };
2460 template <
typename TKey,
typename TCompare>
2473 template <
typename TKey,
typename TCompare>
2476 return !(lhs == rhs);
2486 template <
typename TKey,
typename TCompare>
2489 return ETL_OR_STD::lexicographical_compare(lhs.
begin(), lhs.
end(),
2491 etl::imultiset<TKey, TCompare>::value_compare());
2501 template <
typename TKey,
typename TCompare>
2514 template <
typename TKey,
typename TCompare>
2517 return !(lhs > rhs);
2527 template <
typename TKey,
typename TCompare>
2530 return !(lhs < rhs);
const_iterator
Definition multiset.h:847
iterator.
Definition multiset.h:740
A templated multiset implementation that uses a fixed size buffer.
Definition multiset.h:2310
multiset(const multiset &other)
Copy constructor.
Definition multiset.h:2327
multiset()
Default constructor.
Definition multiset.h:2318
~multiset()
Destructor.
Definition multiset.h:2383
multiset & operator=(const multiset &rhs)
Assignment operator.
Definition multiset.h:2391
multiset(TIterator first, TIterator last)
Definition multiset.h:2363
ETL_CONSTEXPR14 bool operator==(const etl::expected< TValue, TError > &lhs, const etl::expected< TValue2, TError2 > &rhs)
Equivalence operators.
Definition expected.h:962
#define ETL_ASSERT(b, e)
Definition error_handler.h:356
Definition exception.h:47
T * allocate()
Definition ipool.h:316
iterator begin()
Gets the beginning of the multiset.
Definition multiset.h:969
iterator lower_bound(key_parameter_t key)
Definition multiset.h:1360
bool full() const
Checks to see if the set is full.
Definition multiset.h:155
void next_node(const Node *&position) const
Find the next node in sequence from the node provided.
Definition multiset.h:416
reverse_iterator rbegin()
Gets the reverse beginning of the list.
Definition multiset.h:1017
iterator insert(const_reference value)
Definition multiset.h:1270
void clear()
Clears the multiset.
Definition multiset.h:1079
const_iterator upper_bound(key_parameter_t key) const
Definition multiset.h:1420
size_type count(key_parameter_t key) const
Definition multiset.h:1089
imultiset & operator=(const imultiset &rhs)
Assignment operator.
Definition multiset.h:1437
bool contains(key_parameter_t key) const
Check if the set contains the key.
Definition multiset.h:1494
bool node_comp(const Data_Node &node1, const Data_Node &node2) const
How to compare node elements.
Definition multiset.h:667
const size_type CAPACITY
The maximum size of the set.
Definition multiset.h:619
size_t size_type
The type used for determining the size of set.
Definition multiset.h:126
const TKey & key_parameter_t
Defines the key value parameter type.
Definition multiset.h:662
void rotate_2node(Node *&position, uint_least8_t dir)
Rotate two nodes at the position provided the to balance the tree.
Definition multiset.h:524
const_reverse_iterator crbegin() const
Gets the reverse beginning of the list.
Definition multiset.h:1049
Node * find_limit_node(Node *position, const int8_t dir) const
Definition multiset.h:368
iterator erase(const_iterator first, const_iterator last)
Erases a range of elements.
Definition multiset.h:1216
iterator end()
Gets the end of the multiset.
Definition multiset.h:985
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(key_parameter_t key) const
Definition multiset.h:1127
const_iterator lower_bound(key_parameter_t key) const
Definition multiset.h:1380
size_type size() const
Gets the size of the set.
Definition multiset.h:131
void balance_node(Node *&critical_node)
Balance the critical node at the position provided as needed.
Definition multiset.h:298
const_iterator end() const
Gets the end of the multiset.
Definition multiset.h:993
const_iterator cend() const
Gets the end of the multiset.
Definition multiset.h:1009
const_iterator cbegin() const
Gets the beginning of the multiset.
Definition multiset.h:1001
iterator find(key_parameter_t key_value)
Definition multiset.h:1232
void next_node(Node *&position) const
Find the next node in sequence from the node provided.
Definition multiset.h:384
void initialise()
Initialise the multiset.
Definition multiset.h:1522
void assign(TIterator first, TIterator last)
Definition multiset.h:1070
const_iterator find(key_parameter_t key_value) const
Definition multiset.h:1251
size_type capacity() const
Definition multiset.h:164
reverse_iterator rend()
Gets the reverse end of the list.
Definition multiset.h:1033
void attach_node(Node *parent, Node *&position, Node &node)
Attach the provided node to the position provided.
Definition multiset.h:242
const_iterator begin() const
Gets the beginning of the multiset.
Definition multiset.h:977
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition multiset.h:1107
void prev_node(Node *&position) const
Find the previous node in sequence from the node provided.
Definition multiset.h:448
void prev_node(const Node *&position) const
Find the previous node in sequence from the node provided.
Definition multiset.h:486
imultiset(etl::ipool &node_pool, size_t max_size_)
Constructor.
Definition multiset.h:1513
Node * root_node
The node that acts as the multiset root.
Definition multiset.h:620
size_type max_size() const
Gets the maximum possible size of the set.
Definition multiset.h:139
const_reverse_iterator rend() const
Gets the reverse end of the list.
Definition multiset.h:1041
~imultiset()
Destructor.
Definition multiset.h:2299
void insert(TIterator first, TIterator last)
Definition multiset.h:1345
value_compare value_comp() const
How to compare two value elements.
Definition multiset.h:1486
~multiset_base()
Destructor.
Definition multiset.h:235
iterator insert(const_iterator, const_reference value)
Definition multiset.h:1317
multiset_base(size_type max_size_)
The constructor that is called from derived classes.
Definition multiset.h:225
iterator upper_bound(key_parameter_t key)
Definition multiset.h:1400
key_compare key_comp() const
How to compare two key elements.
Definition multiset.h:1478
iterator erase(const_iterator position)
Erases the value at the specified position.
Definition multiset.h:1155
const_reverse_iterator rbegin() const
Gets the reverse beginning of the list.
Definition multiset.h:1025
void detach_node(Node *&position, Node *&replacement)
Detach the node at the position provided.
Definition multiset.h:260
iterator erase(iterator position)
Erases the value at the specified position.
Definition multiset.h:1146
const_reverse_iterator crend() const
Gets the reverse end of the list.
Definition multiset.h:1057
bool empty() const
Checks to see if the set is empty.
Definition multiset.h:147
size_type current_size
The number of the used nodes.
Definition multiset.h:618
size_t available() const
Definition multiset.h:173
void rotate_3node(Node *&position, uint_least8_t dir, uint_least8_t third)
Rotate three nodes at the position provided the to balance the tree.
Definition multiset.h:565
Definition multiset.h:630
Definition multiset.h:123
bitset_ext
Definition absolute.h:39
ETL_CONSTEXPR14 void swap(etl::typed_storage_ext< T > &lhs, etl::typed_storage_ext< T > &rhs) ETL_NOEXCEPT
Swap two etl::typed_storage_ext.
Definition alignment.h:838
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1190
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1202
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1151
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1139
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1163
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1178
The data node element in the multiset.
Definition multiset.h:652
iterator
Definition iterator.h:399
The node element in the multiset.
Definition multiset.h:191
void mark_as_leaf()
Marks the node as a leaf.
Definition multiset.h:207
Node()
Constructor.
Definition multiset.h:195