Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
imultiset< T, TCompare > Class Template Reference
[set]
A templated base for all etl::multiset types. More...
#include <multiset.h>
Inherits etl::multiset_base.
Inherited by multiset< T, MAX_SIZE_, TCompare >.
Data Structures | |
class | const_iterator |
const_iterator More... | |
struct | Data_Node |
The data node element in the multiset. More... | |
class | iterator |
iterator. More... | |
struct | key_comp |
How to compare two key elements. More... | |
struct | value_comp |
How to compare two value elements. More... | |
Public Types | |
typedef size_t | size_type |
The type used for determining the size of set. | |
Public Member Functions | |
iterator | begin () |
Gets the beginning of the multiset. | |
const_iterator | begin () const |
Gets the beginning of the multiset. | |
iterator | end () |
Gets the end of the multiset. | |
const_iterator | end () const |
Gets the end of the multiset. | |
const_iterator | cbegin () const |
Gets the beginning of the multiset. | |
const_iterator | cend () const |
Gets the end of the multiset. | |
reverse_iterator | rbegin () |
Gets the reverse beginning of the list. | |
const_reverse_iterator | rbegin () const |
Gets the reverse beginning of the list. | |
reverse_iterator | rend () |
Gets the reverse end of the list. | |
const_reverse_iterator | rend () const |
Gets the reverse end of the list. | |
const_reverse_iterator | crbegin () const |
Gets the reverse beginning of the list. | |
const_reverse_iterator | crend () const |
Gets the reverse end of the list. | |
template<typename TIterator > | |
void | assign (TIterator first, TIterator last) |
Assigns values to the multiset. | |
void | clear () |
Clears the multiset. | |
size_type | count (key_parameter_t key) const |
Counts the number of elements that contain the key specified. | |
std::pair< iterator, iterator > | equal_range (const value_type &key) |
Returns two iterators with bounding (lower bound, upper bound) the key provided. | |
std::pair< const_iterator, const_iterator > | equal_range (const value_type &key) const |
Returns two const iterators with bounding (lower bound, upper bound) the key provided. | |
void | erase (iterator position) |
Erases the value at the specified position. | |
iterator | erase (const_iterator position) |
Erases the value at the specified position. | |
iterator | erase (iterator first, iterator last) |
Erases a range of elements. | |
iterator | erase (const_iterator first, const_iterator last) |
Erases a range of elements. | |
iterator | find (key_parameter_t key_value) |
Finds an element. | |
const_iterator | find (key_parameter_t key_value) const |
Finds an element. | |
iterator | insert (const value_type &value) |
Inserts a value to the multiset. | |
iterator | insert (iterator, const value_type &value) |
Inserts a value to the multiset starting at the position recommended. | |
iterator | insert (const_iterator, const value_type &value) |
Inserts a value to the multiset starting at the position recommended. | |
template<class TIterator > | |
void | insert (TIterator first, TIterator last) |
Inserts a range of values to the multiset. | |
iterator | lower_bound (key_parameter_t key) |
Returns an iterator pointing to the first element in the container whose key is not considered to go before the key provided or end() if all keys are considered to go before the key provided. | |
const_iterator | lower_bound (key_parameter_t key) const |
Returns a const_iterator pointing to the first element in the container whose key is not considered to go before the key provided or end() if all keys are considered to go before the key provided. | |
iterator | upper_bound (key_parameter_t key) |
Returns an iterator pointing to the first element in the container whose key is not considered to go after the key provided or end() if all keys are considered to go after the key provided. | |
const_iterator | upper_bound (key_parameter_t key) const |
Returns a const_iterator pointing to the first element in the container whose key is not considered to go after the key provided or end() if all keys are considered to go after the key provided. | |
imultiset & | operator= (const imultiset &rhs) |
Assignment operator. | |
size_type | size () const |
Gets the size of the set. | |
size_type | max_size () const |
Gets the maximum possible size of the set. | |
bool | empty () const |
Checks to see if the set is empty. | |
bool | full () const |
Checks to see if the set is full. | |
size_type | capacity () const |
Returns the capacity of the vector. | |
size_t | available () const |
Returns the remaining capacity. | |
Protected Types | |
typedef etl::parameter_type< T > ::type | key_parameter_t |
Defines the key value parameter type. | |
Protected Member Functions | |
bool | node_comp (const Data_Node &node1, const Data_Node &node2) const |
How to compare node elements. | |
imultiset (etl::ipool &node_pool, size_t max_size_) | |
Constructor. | |
void | initialise () |
Initialise the multiset. | |
void | attach_node (Node *parent, Node *&position, Node &node) |
Attach the provided node to the position provided. | |
void | detach_node (Node *&position, Node *&replacement) |
Detach the node at the position provided. | |
void | balance_node (Node *&critical_node) |
Balance the critical node at the position provided as needed. | |
Node * | find_limit_node (Node *position, const int8_t dir) const |
Find the node whose key would go before all the other keys from the position provided. | |
void | next_node (Node *&position) const |
Find the next node in sequence from the node provided. | |
void | next_node (const Node *&position) const |
Find the next node in sequence from the node provided. | |
void | prev_node (Node *&position) const |
Find the previous node in sequence from the node provided. | |
void | prev_node (const Node *&position) const |
Find the previous node in sequence from the node provided. | |
void | rotate_2node (Node *&position, uint_least8_t dir) |
Rotate two nodes at the position provided the to balance the tree. | |
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. | |
Protected Attributes | |
size_type | current_size |
The number of the used nodes. | |
const size_type | CAPACITY |
The maximum size of the set. | |
Node * | root_node |
The node that acts as the multiset root. |
Detailed Description
template<typename T, typename TCompare>
class etl::imultiset< T, TCompare >
A templated base for all etl::multiset types.
Definition at line 609 of file multiset.h.
Member Typedef Documentation
typedef etl::parameter_type<T>::type key_parameter_t [protected] |
Defines the key value parameter type.
Definition at line 659 of file multiset.h.
typedef size_t size_type |
The type used for determining the size of set.
Reimplemented from multiset_base.
Definition at line 619 of file multiset.h.
Constructor & Destructor Documentation
imultiset | ( | etl::ipool & | node_pool, |
size_t | max_size_ | ||
) | [protected] |
Constructor.
Definition at line 1307 of file multiset.h.
Member Function Documentation
void assign | ( | TIterator | first, |
TIterator | last | ||
) |
Assigns values to the multiset.
If asserts or exceptions are enabled, emits set_full if the multiset does not have enough free space. If asserts or exceptions are enabled, emits set_iterator if the iterators are reversed.
- Parameters:
-
first The iterator to the first element. last The iterator to the last element + 1.
Definition at line 1040 of file multiset.h.
Attach the provided node to the position provided.
Definition at line 233 of file multiset.h.
size_t available | ( | ) | const [inherited] |
Returns the remaining capacity.
- Returns:
- The remaining capacity.
Definition at line 174 of file multiset.h.
void balance_node | ( | Node *& | critical_node ) | [protected, inherited] |
Balance the critical node at the position provided as needed.
Definition at line 284 of file multiset.h.
const_iterator begin | ( | ) | const |
Gets the beginning of the multiset.
Definition at line 947 of file multiset.h.
iterator begin | ( | ) |
Gets the beginning of the multiset.
Definition at line 939 of file multiset.h.
size_type capacity | ( | ) | const [inherited] |
Returns the capacity of the vector.
- Returns:
- The capacity of the vector.
Definition at line 165 of file multiset.h.
const_iterator cbegin | ( | ) | const |
Gets the beginning of the multiset.
Definition at line 971 of file multiset.h.
const_iterator cend | ( | ) | const |
Gets the end of the multiset.
Definition at line 979 of file multiset.h.
void clear | ( | ) |
Clears the multiset.
Definition at line 1049 of file multiset.h.
size_type count | ( | key_parameter_t | key ) | const |
Counts the number of elements that contain the key specified.
- Parameters:
-
key The key to search for.
- Returns:
- 1 if element was found, 0 otherwise.
Definition at line 1059 of file multiset.h.
const_reverse_iterator crbegin | ( | ) | const |
Gets the reverse beginning of the list.
Definition at line 1019 of file multiset.h.
const_reverse_iterator crend | ( | ) | const |
Gets the reverse end of the list.
Definition at line 1027 of file multiset.h.
Detach the node at the position provided.
Definition at line 251 of file multiset.h.
bool empty | ( | ) | const [inherited] |
Checks to see if the set is empty.
Definition at line 148 of file multiset.h.
const_iterator end | ( | ) | const |
Gets the end of the multiset.
Definition at line 963 of file multiset.h.
iterator end | ( | ) |
Gets the end of the multiset.
Definition at line 955 of file multiset.h.
Returns two iterators with bounding (lower bound, upper bound) the key provided.
Definition at line 1068 of file multiset.h.
std::pair<const_iterator, const_iterator> equal_range | ( | const value_type & | key ) | const |
Returns two const iterators with bounding (lower bound, upper bound) the key provided.
Definition at line 1079 of file multiset.h.
void erase | ( | iterator | position ) |
Erases the value at the specified position.
Definition at line 1089 of file multiset.h.
iterator erase | ( | const_iterator | position ) |
Erases the value at the specified position.
Definition at line 1098 of file multiset.h.
Erases a range of elements.
Definition at line 1137 of file multiset.h.
iterator erase | ( | const_iterator | first, |
const_iterator | last | ||
) |
Erases a range of elements.
Definition at line 1151 of file multiset.h.
iterator find | ( | key_parameter_t | key_value ) |
Finds an element.
- Parameters:
-
key The key to search for.
- Returns:
- An iterator pointing to the element or end() if not found.
Definition at line 1167 of file multiset.h.
const_iterator find | ( | key_parameter_t | key_value ) | const |
Finds an element.
- Parameters:
-
key The key to search for.
- Returns:
- An iterator pointing to the element or end() if not found.
Definition at line 1177 of file multiset.h.
Find the node whose key would go before all the other keys from the position provided.
Definition at line 348 of file multiset.h.
bool full | ( | ) | const [inherited] |
Checks to see if the set is full.
Definition at line 156 of file multiset.h.
void initialise | ( | ) | [protected] |
Initialise the multiset.
Definition at line 1316 of file multiset.h.
void insert | ( | TIterator | first, |
TIterator | last | ||
) |
Inserts a range of values to the multiset.
If asserts or exceptions are enabled, emits set_full if the multiset does not have enough free space.
- Parameters:
-
position The position to insert at. first The first element to add. last The last + 1 element to add.
Definition at line 1236 of file multiset.h.
iterator insert | ( | const value_type & | value ) |
Inserts a value to the multiset.
If asserts or exceptions are enabled, emits set_full if the multiset is already full.
- Parameters:
-
value The value to insert.
Definition at line 1187 of file multiset.h.
Inserts a value to the multiset starting at the position recommended.
If asserts or exceptions are enabled, emits set_full if the multiset is already full.
- Parameters:
-
position The position that would precede the value to insert. value The value to insert.
Definition at line 1210 of file multiset.h.
iterator insert | ( | const_iterator | , |
const value_type & | value | ||
) |
Inserts a value to the multiset starting at the position recommended.
If asserts or exceptions are enabled, emits set_full if the multiset is already full.
- Parameters:
-
position The position that would precede the value to insert. value The value to insert.
Definition at line 1222 of file multiset.h.
iterator lower_bound | ( | key_parameter_t | key ) |
Returns an iterator pointing to the first element in the container whose key is not considered to go before the key provided or end() if all keys are considered to go before the key provided.
- Returns:
- An iterator pointing to the element not before key or end()
Definition at line 1250 of file multiset.h.
const_iterator lower_bound | ( | key_parameter_t | key ) | const |
Returns a const_iterator pointing to the first element in the container whose key is not considered to go before the key provided or end() if all keys are considered to go before the key provided.
- Returns:
- An const_iterator pointing to the element not before key or end()
Definition at line 1261 of file multiset.h.
size_type max_size | ( | ) | const [inherited] |
Gets the maximum possible size of the set.
Definition at line 140 of file multiset.h.
void next_node | ( | const Node *& | position ) | const [protected, inherited] |
Find the next node in sequence from the node provided.
Definition at line 396 of file multiset.h.
void next_node | ( | Node *& | position ) | const [protected, inherited] |
Find the next node in sequence from the node provided.
Definition at line 364 of file multiset.h.
How to compare node elements.
Definition at line 664 of file multiset.h.
Assignment operator.
Definition at line 1291 of file multiset.h.
void prev_node | ( | const Node *& | position ) | const [protected, inherited] |
Find the previous node in sequence from the node provided.
Definition at line 466 of file multiset.h.
void prev_node | ( | Node *& | position ) | const [protected, inherited] |
Find the previous node in sequence from the node provided.
Definition at line 428 of file multiset.h.
const_reverse_iterator rbegin | ( | ) | const |
Gets the reverse beginning of the list.
Definition at line 995 of file multiset.h.
reverse_iterator rbegin | ( | ) |
Gets the reverse beginning of the list.
Definition at line 987 of file multiset.h.
reverse_iterator rend | ( | ) |
Gets the reverse end of the list.
Definition at line 1003 of file multiset.h.
const_reverse_iterator rend | ( | ) | const |
Gets the reverse end of the list.
Definition at line 1011 of file multiset.h.
void rotate_2node | ( | Node *& | position, |
uint_least8_t | dir | ||
) | [protected, inherited] |
Rotate two nodes at the position provided the to balance the tree.
Definition at line 504 of file multiset.h.
void rotate_3node | ( | Node *& | position, |
uint_least8_t | dir, | ||
uint_least8_t | third | ||
) | [protected, inherited] |
Rotate three nodes at the position provided the to balance the tree.
Definition at line 545 of file multiset.h.
size_type size | ( | ) | const [inherited] |
Gets the size of the set.
Definition at line 132 of file multiset.h.
iterator upper_bound | ( | key_parameter_t | key ) |
Returns an iterator pointing to the first element in the container whose key is not considered to go after the key provided or end() if all keys are considered to go after the key provided.
- Returns:
- An iterator pointing to the element after key or end()
Definition at line 1272 of file multiset.h.
const_iterator upper_bound | ( | key_parameter_t | key ) | const |
Returns a const_iterator pointing to the first element in the container whose key is not considered to go after the key provided or end() if all keys are considered to go after the key provided.
- Returns:
- An const_iterator pointing to the element after key or end()
Definition at line 1283 of file multiset.h.
Field Documentation
The maximum size of the set.
Definition at line 599 of file multiset.h.
size_type current_size [protected, inherited] |
The number of the used nodes.
Definition at line 598 of file multiset.h.
The node that acts as the multiset root.
Definition at line 600 of file multiset.h.
Generated on Tue Jul 12 2022 14:05:52 by
