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_)
196 : parent(ETL_NULLPTR)
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;
246 node.parent = parent;
263 Node* detached = position;
271 replacement =
swap->children[1 -
swap->dir];
273 if (replacement != ETL_NULLPTR)
275 replacement->parent =
swap->parent;
279 swap->parent = detached->parent;
280 swap->children[kLeft] = detached->children[kLeft];
281 swap->children[kRight] = detached->children[kRight];
282 if (
swap->children[kLeft])
284 swap->children[kLeft]->parent =
swap;
286 if (
swap->children[kRight])
288 swap->children[kRight]->parent =
swap;
290 swap->weight = detached->weight;
301 Node* weight_node = critical_node->children[critical_node->dir];
305 if (kNeither != weight_node->dir)
308 if (weight_node->weight == 1 - weight_node->dir)
310 weight_node->weight = kNeither;
314 weight_node->weight = weight_node->dir;
318 weight_node = weight_node->children[weight_node->dir];
328 if (kNeither == critical_node->weight)
330 critical_node->weight = critical_node->dir;
333 else if (critical_node->dir != critical_node->weight)
335 critical_node->weight = kNeither;
342 if (critical_node->children[critical_node->dir] != ETL_NULLPTR) ETL_UNLIKELY
344 if (critical_node->weight == critical_node->children[critical_node->dir]->dir)
352 if (critical_node->children[critical_node->dir]->children[1 - critical_node->dir] != ETL_NULLPTR) ETL_UNLIKELY
354 rotate_3node(critical_node, critical_node->dir, critical_node->children[critical_node->dir]->children[1 - critical_node->dir]->dir);
368 Node* limit_node = position;
369 while (limit_node && limit_node->children[dir])
371 limit_node = limit_node->children[dir];
386 if (position->children[kRight])
395 Node* parent = position;
400 parent = position->parent;
403 }
while (parent && parent->children[kRight] == position);
419 if (position->children[kRight])
428 const Node* parent = position;
433 parent = position->parent;
435 }
while (parent && parent->children[kRight] == position);
457 if (position->children[kLeft])
466 Node* parent = position;
471 parent = position->parent;
473 }
while (parent && parent->children[kLeft] == position);
495 if (position->children[kLeft])
504 const Node* parent = position;
509 parent = position->parent;
511 }
while (parent && parent->children[kLeft] == position);
536 Node* new_root = position->children[dir];
539 position->children[dir] = new_root->children[1 - dir];
541 if (position->children[dir])
543 position->children[dir]->parent = position;
547 new_root->parent = position->parent;
548 new_root->children[1 - dir] = position;
549 new_root->dir = 1 - dir;
552 position->weight = kNeither;
554 position->parent = new_root;
557 position->weight = kNeither;
578 Node* new_root = position->children[dir]->children[1 - dir];
581 position->children[dir]->weight = third != kNeither && third != dir ? dir : uint_least8_t(kNeither);
584 position->children[dir]->children[1 - dir] = new_root->children[dir];
586 if (new_root->children[dir])
588 new_root->children[dir]->parent = position->children[dir];
592 new_root->children[dir] = position->children[dir];
593 position->children[dir]->parent = new_root;
596 position->weight = third != kNeither && third == dir ? 1 - dir : kNeither;
599 position->children[dir] = new_root->children[1 - dir];
600 if (new_root->children[1 - dir])
602 new_root->children[1 - dir]->parent = position;
606 new_root->parent = position->parent;
607 new_root->children[1 - dir] = position;
608 new_root->dir = 1 - dir;
611 position->parent = new_root;
614 position->weight = kNeither;
620 ETL_DECLARE_DEBUG_COUNT;
627 template <
typename TKey,
typename TCompare = ETL_OR_STD::less<TKey> >
632 typedef TKey key_type;
633 typedef TKey value_type;
634 typedef TCompare key_compare;
635 typedef TCompare value_compare;
636 typedef value_type& reference;
637 typedef const value_type& const_reference;
639 typedef value_type&& rvalue_reference;
641 typedef value_type* pointer;
642 typedef const value_type* const_pointer;
643 typedef size_t size_type;
652 explicit Data_Node(value_type value_)
668 return compare(node1.value, node2.value);
673 return compare(node.value, key);
678 return compare(key, node.value);
682 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
685 return compare(node.value, key);
688 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
691 return compare(key, node.value);
723 return static_cast<const Data_Node*
>(p_node);
731 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)
772 iterator& operator++()
774 p_multiset->next_node(p_node);
778 iterator operator++(
int)
780 iterator temp(*
this);
781 p_multiset->next_node(p_node);
785 iterator& operator--()
787 p_multiset->prev_node(p_node);
791 iterator operator--(
int)
793 iterator temp(*
this);
794 p_multiset->prev_node(p_node);
798 iterator& operator=(
const iterator& other)
800 p_multiset = other.p_multiset;
801 p_node = other.p_node;
805 reference operator*()
const
807 return imultiset::data_cast(p_node)->value;
810 pointer operator&()
const
812 return &(imultiset::data_cast(p_node)->value);
815 pointer operator->()
const
817 return &(imultiset::data_cast(p_node)->value);
820 friend bool operator==(
const iterator& lhs,
const iterator& rhs)
822 return lhs.p_multiset == rhs.p_multiset && lhs.p_node == rhs.p_node;
825 friend bool operator!=(
const iterator& lhs,
const iterator& rhs)
827 return !(lhs == rhs);
833 imultiset* p_multiset;
844 class const_iterator :
public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, const value_type>
848 friend class imultiset;
851 : p_multiset(ETL_NULLPTR)
852 , p_node(ETL_NULLPTR)
856 const_iterator(
const imultiset&
multiset)
858 , p_node(ETL_NULLPTR)
862 const_iterator(
const imultiset&
multiset,
const Node* node)
869 : p_multiset(other.p_multiset)
870 , p_node(other.p_node)
874 const_iterator(
const const_iterator& other)
875 : p_multiset(other.p_multiset)
876 , p_node(other.p_node)
882 const_iterator& operator++()
884 p_multiset->next_node(p_node);
888 const_iterator operator++(
int)
890 const_iterator temp(*
this);
891 p_multiset->next_node(p_node);
895 const_iterator& operator--()
897 p_multiset->prev_node(p_node);
901 const_iterator operator--(
int)
903 const_iterator temp(*
this);
904 p_multiset->prev_node(p_node);
908 const_iterator& operator=(
const const_iterator& other)
910 p_multiset = other.p_multiset;
911 p_node = other.p_node;
915 const_reference operator*()
const
917 return imultiset::data_cast(p_node)->value;
920 const_pointer operator&()
const
922 return imultiset::data_cast(p_node)->value;
925 const_pointer operator->()
const
927 return &(imultiset::data_cast(p_node)->value);
930 friend bool operator==(
const const_iterator& lhs,
const const_iterator& rhs)
932 return lhs.p_multiset == rhs.p_multiset && lhs.p_node == rhs.p_node;
935 friend bool operator!=(
const const_iterator& lhs,
const const_iterator& rhs)
937 return !(lhs == rhs);
949 const imultiset* p_multiset;
957 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
959 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
960 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
1015 return reverse_iterator(
iterator(*
this));
1037 const_reverse_iterator
rend()
const
1066 template <
typename TIterator>
1088 return count_nodes(key);
1093 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1096 return count_nodes(key);
1106 return ETL_OR_STD::make_pair<iterator, iterator>(
iterator(*
this, find_lower_node(
root_node, key)),
1112 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1113 ETL_OR_STD::pair<iterator, iterator>
equal_range(
const K& key)
1115 return ETL_OR_STD::make_pair<iterator, iterator>(
iterator(*
this, find_lower_node(
root_node, key)),
1126 return ETL_OR_STD::make_pair<const_iterator, const_iterator>(
const_iterator(*
this, find_lower_node(
root_node, key)),
1132 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1135 return ETL_OR_STD::make_pair<const_iterator, const_iterator>(
const_iterator(*
this, find_lower_node(
root_node, key)),
1157 Node* node =
const_cast<Node*
>(position.p_node);
1176 while (lower != upper)
1181 lower =
erase(lower);
1190 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1191 size_type
erase(K&& key_value)
1197 while (lower != upper)
1202 lower =
erase(lower);
1216 while (first != last)
1218 first =
erase(first);
1221 return last.to_iterator();
1236 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1255 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1271 Node* inserted_node = ETL_NULLPTR;
1276 Data_Node& node = allocate_data_node(value);
1279 inserted_node = insert_node(
root_node, node);
1282 return iterator(*
this, inserted_node);
1295 Node* inserted_node = ETL_NULLPTR;
1300 Data_Node& node = allocate_data_node(etl::move(value));
1303 inserted_node = insert_node(
root_node, node);
1306 return iterator(*
this, inserted_node);
1334 return insert(etl::move(value));
1346 template <
class TIterator>
1349 while (first != last)
1369 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1389 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1409 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1429 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1463 while (from != rhs.end())
1468 this->
insert(etl::move(*from));
1503 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1517 , p_node_pool(&node_pool)
1528 while (item !=
end())
1539 Data_Node& allocate_data_node(const_reference value)
1541 Data_Node* node = allocate_data_node();
1542 ::new ((
void*)&node->value)
value_type(value);
1543 ETL_INCREMENT_DEBUG_COUNT;
1551 Data_Node& allocate_data_node(rvalue_reference value)
1553 Data_Node* node = allocate_data_node();
1554 ::new ((
void*)&node->value) value_type(etl::move(value));
1555 ETL_INCREMENT_DEBUG_COUNT;
1566 return (p_node_pool->*func)();
1574 node.value.~value_type();
1575 p_node_pool->release(&node);
1576 ETL_DECREMENT_DEBUG_COUNT;
1585 size_type result = 0;
1592 while (lower != upper)
1595 const Data_Node& data_node = imultiset::data_cast(*lower);
1613 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1614 size_type count_nodes(
const K& key)
const
1617 size_type result = 0;
1624 while (lower != upper)
1627 const Data_Node& data_node = imultiset::data_cast(*lower);
1649 Node* found = ETL_NULLPTR;
1653 Data_Node& data_node = imultiset::data_cast(*position);
1658 position = position->children[kLeft];
1663 position = position->children[kRight];
1669 position = position->children[kLeft];
1679 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1680 Node* find_node(
Node* position,
const K& key)
1682 Node* found = ETL_NULLPTR;
1686 Data_Node& data_node = imultiset::data_cast(*position);
1691 position = position->children[kLeft];
1696 position = position->children[kRight];
1702 position = position->children[kLeft];
1716 const Node* found = ETL_NULLPTR;
1720 const Data_Node& data_node = imultiset::data_cast(*position);
1725 position = position->children[kLeft];
1730 position = position->children[kRight];
1736 position = position->children[kLeft];
1746 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1747 const Node* find_node(
const Node* position,
const K& key)
const
1749 const Node* found = ETL_NULLPTR;
1753 const Data_Node& data_node = imultiset::data_cast(*position);
1758 position = position->children[kLeft];
1763 position = position->children[kRight];
1769 position = position->children[kLeft];
1784 Node* lower_node = ETL_NULLPTR;
1788 Data_Node& data_node = imultiset::data_cast(*position);
1792 lower_node = position;
1793 if (position->children[kLeft])
1795 position = position->children[kLeft];
1805 position = position->children[kRight];
1810 lower_node = position;
1811 position = position->children[kLeft];
1821 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1822 Node* find_lower_node(
Node* position,
const K& key)
const
1825 Node* lower_node = ETL_NULLPTR;
1829 Data_Node& data_node = imultiset::data_cast(*position);
1833 lower_node = position;
1834 if (position->children[kLeft])
1836 position = position->children[kLeft];
1846 position = position->children[kRight];
1851 lower_node = position;
1852 position = position->children[kLeft];
1867 Node* upper_node = ETL_NULLPTR;
1873 Data_Node& data_node = imultiset::data_cast(*position);
1877 position = position->children[kRight];
1881 upper_node = position;
1883 if (!found && position->children[kLeft])
1885 position = position->children[kLeft];
1906 template <typename K, typename KC = TCompare, etl::enable_if_t<comparator_is_transparent<KC>::value,
int> = 0>
1907 Node* find_upper_node(
Node* position,
const K& key)
const
1910 Node* upper_node = ETL_NULLPTR;
1916 Data_Node& data_node = imultiset::data_cast(*position);
1920 position = position->children[kRight];
1924 upper_node = position;
1926 if (!found && position->children[kLeft])
1928 position = position->children[kLeft];
1954 Node* found = position;
1960 Node* critical_parent_node = ETL_NULLPTR;
1967 if (kNeither != found->weight)
1969 critical_node = found;
1974 Data_Node& found_data_node = imultiset::data_cast(*found);
1983 else if (
node_comp(found_data_node, node))
1986 found->dir = kRight;
1992 found->dir = kRight;
1996 if (found->children[found->dir])
2000 if (kNeither != found->children[found->dir]->weight)
2002 critical_parent_node = found;
2006 found = found->children[found->dir];
2011 attach_node(found, found->children[found->dir], node);
2014 found = found->children[found->dir];
2024 if (critical_parent_node == ETL_NULLPTR && critical_node ==
root_node)
2028 else if (critical_parent_node == ETL_NULLPTR && critical_node == position)
2034 if (critical_parent_node != ETL_NULLPTR)
2036 balance_node(critical_parent_node->children[critical_parent_node->dir]);
2058 void remove_node(
Node* node)
2064 Data_Node& data_node = imultiset::data_cast(*node);
2078 node->parent->dir = node->parent->children[kLeft] == node ? kLeft : kRight;
2081 node = node->parent;
2100 node->dir = node->children[kLeft] ? kLeft : kRight;
2111 if ((node->weight == kNeither) || (node->weight == (1 - node->dir) && 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) || (node->weight == (1 - node->dir) && node->children[1 - node->dir]->weight == kNeither))
2150 node = node->children[node->dir];
2153 Data_Node& replace_data_node = imultiset::data_cast(*node);
2156 if (
node_comp(data_node, replace_data_node))
2161 else if (
node_comp(replace_data_node, data_node))
2169 node->dir = 1 - found->dir;
2178 if (balance->children[balance->dir] == ETL_NULLPTR)
2185 if (balance->weight == kNeither)
2187 balance->weight = 1 - balance->dir;
2191 else if (balance->weight == balance->dir)
2193 balance->weight = kNeither;
2198 int weight = balance->children[1 - balance->dir]->weight;
2200 if (weight == balance->dir)
2203 if (balance->parent == ETL_NULLPTR)
2205 rotate_3node(
root_node, 1 - balance->dir, balance->children[1 - balance->dir]->children[balance->dir]->weight);
2209 rotate_3node(balance->parent->children[balance->parent->dir], 1 - balance->dir,
2210 balance->children[1 - balance->dir]->children[balance->dir]->weight);
2215 else if (weight == kNeither)
2218 if (balance->parent == ETL_NULLPTR)
2228 Node* old_parent = balance->parent;
2229 rotate_2node(balance->parent->children[balance->parent->dir], 1 - balance->dir);
2230 old_parent->children[old_parent->dir]->weight = balance->dir;
2234 balance->weight = 1 - balance->dir;
2240 if (balance->parent == ETL_NULLPTR)
2246 rotate_2node(balance->parent->children[balance->parent->dir], 1 - balance->dir);
2252 balance = balance->children[balance->dir];
2259 detach_node(found->parent->children[found->parent->dir], node->parent->children[node->parent->dir]);
2280 destroy_data_node(data_node);
2290#if defined(ETL_POLYMORPHIC_MULTISET) || defined(ETL_POLYMORPHIC_CONTAINERS)
2306 template <
typename TKey, const
size_t MAX_SIZE_,
typename TCompare = ETL_OR_STD::less<TKey> >
2311 static ETL_CONSTANT
size_t MAX_SIZE = MAX_SIZE_;
2342 while (from != other.end())
2347 this->
insert(etl::move(*from));
2360 template <
typename TIterator>
2364 this->
assign(first, last);
2367#if ETL_HAS_INITIALIZER_LIST
2371 multiset(std::initializer_list<
typename etl::imultiset<TKey, TCompare>::value_type> init)
2374 this->
assign(init.begin(), init.end());
2412 while (from != rhs.end())
2414 this->
insert(etl::move(*from));
2426 etl::pool<typename etl::imultiset<TKey, TCompare>::Data_Node, MAX_SIZE> node_pool;
2429 template <
typename TKey, const
size_t MAX_SIZE_,
typename TCompare>
2430 ETL_CONSTANT
size_t multiset<TKey, MAX_SIZE_, TCompare>::MAX_SIZE;
2435#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST
2436 template <
typename... T>
2443#if ETL_USING_CPP11 && ETL_HAS_INITIALIZER_LIST
2444 template <
typename TKey,
typename TKeyCompare = etl::less<TKey>,
typename... T>
2445 constexpr auto make_multiset(T&&... keys) -> etl::multiset<TKey,
sizeof...(T), TKeyCompare>
2447 return {etl::forward<T>(keys)...};
2458 template <
typename TKey,
typename TCompare>
2471 template <
typename TKey,
typename TCompare>
2474 return !(lhs == rhs);
2484 template <
typename TKey,
typename TCompare>
2487 return ETL_OR_STD::lexicographical_compare(lhs.
begin(), lhs.
end(), rhs.
begin(), rhs.
end(), etl::imultiset<TKey, TCompare>::value_compare());
2497 template <
typename TKey,
typename TCompare>
2511 template <
typename TKey,
typename TCompare>
2514 return !(lhs > rhs);
2524 template <
typename TKey,
typename TCompare>
2527 return !(lhs < rhs);
const_iterator
Definition multiset.h:845
iterator.
Definition multiset.h:740
A templated multiset implementation that uses a fixed size buffer.
Definition multiset.h:2308
multiset(const multiset &other)
Copy constructor.
Definition multiset.h:2325
multiset()
Default constructor.
Definition multiset.h:2316
~multiset()
Destructor.
Definition multiset.h:2381
multiset & operator=(const multiset &rhs)
Assignment operator.
Definition multiset.h:2389
multiset(TIterator first, TIterator last)
Definition multiset.h:2361
ETL_CONSTEXPR14 bool operator!=(const etl::bitset< Active_Bits, TElement > &lhs, const etl::bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
Definition bitset_new.h:2529
#define ETL_ASSERT(b, e)
Definition error_handler.h:511
Definition exception.h:59
T * allocate()
Definition ipool.h:333
iterator begin()
Gets the beginning of the multiset.
Definition multiset.h:965
iterator lower_bound(key_parameter_t key)
Definition multiset.h:1362
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:414
reverse_iterator rbegin()
Gets the reverse beginning of the list.
Definition multiset.h:1013
iterator insert(const_reference value)
Definition multiset.h:1268
void clear()
Clears the multiset.
Definition multiset.h:1076
const_iterator upper_bound(key_parameter_t key) const
Definition multiset.h:1422
size_type count(key_parameter_t key) const
Definition multiset.h:1086
imultiset & operator=(const imultiset &rhs)
Assignment operator.
Definition multiset.h:1439
bool contains(key_parameter_t key) const
Check if the set contains the key.
Definition multiset.h:1496
bool node_comp(const Data_Node &node1, const Data_Node &node2) const
How to compare node elements.
Definition multiset.h:666
const size_type CAPACITY
The maximum size of the set.
Definition multiset.h:618
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:661
void rotate_2node(Node *&position, uint_least8_t dir)
Rotate two nodes at the position provided the to balance the tree.
Definition multiset.h:522
const_reverse_iterator crbegin() const
Gets the reverse beginning of the list.
Definition multiset.h:1045
Node * find_limit_node(Node *position, const int8_t dir) const
Definition multiset.h:365
iterator erase(const_iterator first, const_iterator last)
Erases a range of elements.
Definition multiset.h:1213
iterator end()
Gets the end of the multiset.
Definition multiset.h:981
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(key_parameter_t key) const
Definition multiset.h:1124
const_iterator lower_bound(key_parameter_t key) const
Definition multiset.h:1382
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:296
const_iterator end() const
Gets the end of the multiset.
Definition multiset.h:989
const_iterator cend() const
Gets the end of the multiset.
Definition multiset.h:1005
const_iterator cbegin() const
Gets the beginning of the multiset.
Definition multiset.h:997
iterator find(key_parameter_t key_value)
Definition multiset.h:1229
void next_node(Node *&position) const
Find the next node in sequence from the node provided.
Definition multiset.h:381
void initialise()
Initialise the multiset.
Definition multiset.h:1524
void assign(TIterator first, TIterator last)
Definition multiset.h:1067
const_iterator find(key_parameter_t key_value) const
Definition multiset.h:1248
size_type capacity() const
Definition multiset.h:164
reverse_iterator rend()
Gets the reverse end of the list.
Definition multiset.h:1029
void attach_node(Node *parent, Node *&position, Node &node)
Attach the provided node to the position provided.
Definition multiset.h:240
const_iterator begin() const
Gets the beginning of the multiset.
Definition multiset.h:973
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition multiset.h:1104
void prev_node(Node *&position) const
Find the previous node in sequence from the node provided.
Definition multiset.h:446
void prev_node(const Node *&position) const
Find the previous node in sequence from the node provided.
Definition multiset.h:484
imultiset(etl::ipool &node_pool, size_t max_size_)
Constructor.
Definition multiset.h:1515
Node * root_node
The node that acts as the multiset root.
Definition multiset.h:619
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:1037
~imultiset()
Destructor.
Definition multiset.h:2299
void insert(TIterator first, TIterator last)
Definition multiset.h:1347
value_compare value_comp() const
How to compare two value elements.
Definition multiset.h:1488
~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:1402
key_compare key_comp() const
How to compare two key elements.
Definition multiset.h:1480
iterator erase(const_iterator position)
Erases the value at the specified position.
Definition multiset.h:1152
const_reverse_iterator rbegin() const
Gets the reverse beginning of the list.
Definition multiset.h:1021
void detach_node(Node *&position, Node *&replacement)
Detach the node at the position provided.
Definition multiset.h:258
iterator erase(iterator position)
Erases the value at the specified position.
Definition multiset.h:1143
const_reverse_iterator crend() const
Gets the reverse end of the list.
Definition multiset.h:1053
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:617
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:563
Definition multiset.h:629
Definition multiset.h:123
bitset_ext
Definition absolute.h:40
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:856
ETL_CONSTEXPR14 bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1081
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1133
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1147
ETL_CONSTEXPR14 bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1093
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1106
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1120
The data node element in the multiset.
Definition multiset.h:651
iterator
Definition iterator.h:424
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