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.
iflat_map< TKey, TMapped, TKeyCompare > Class Template Reference
[flat_map]
The base class for specifically sized flat_maps. More...
#include <flat_map.h>
Inherits etl::ireference_flat_map< TKey, TMapped, TKeyCompare >.
Public Member Functions | |
iterator | begin () |
Returns an iterator to the beginning of the flat_map. | |
const_iterator | begin () const |
Returns a const_iterator to the beginning of the flat_map. | |
iterator | end () |
Returns an iterator to the end of the flat_map. | |
const_iterator | end () const |
Returns a const_iterator to the end of the flat_map. | |
const_iterator | cbegin () const |
Returns a const_iterator to the beginning of the flat_map. | |
const_iterator | cend () const |
Returns a const_iterator to the end of the flat_map. | |
reverse_iterator | rbegin () |
Returns an reverse iterator to the reverse beginning of the flat_map. | |
const_reverse_iterator | rbegin () const |
Returns a const reverse iterator to the reverse beginning of the flat_map. | |
reverse_iterator | rend () |
Returns a reverse iterator to the end + 1 of the flat_map. | |
const_reverse_iterator | rend () const |
Returns a const reverse iterator to the end + 1 of the flat_map. | |
const_reverse_iterator | crbegin () const |
Returns a const reverse iterator to the reverse beginning of the flat_map. | |
const_reverse_iterator | crend () const |
Returns a const reverse iterator to the end + 1 of the flat_map. | |
mapped_type & | operator[] (key_parameter_t key) |
Returns a reference to the value at index 'key'. | |
mapped_type & | at (key_parameter_t key) |
Returns a reference to the value at index 'key' If asserts or exceptions are enabled, emits an etl::flat_map_out_of_bounds if the key is not in the range. | |
const mapped_type & | at (key_parameter_t key) const |
Returns a const reference to the value at index 'key' If asserts or exceptions are enabled, emits an etl::flat_map_out_of_bounds if the key is not in the range. | |
template<typename TIterator > | |
void | assign (TIterator first, TIterator last) |
Assigns values to the flat_map. | |
std::pair< iterator, bool > | insert (const_reference value) |
Inserts a value to the flat_map. | |
iterator | insert (iterator position, const_reference value) |
Inserts a value to the flat_map. | |
template<class TIterator > | |
void | insert (TIterator first, TIterator last) |
Inserts a range of values to the flat_map. | |
size_t | erase (key_parameter_t key) |
Erases an element. | |
void | erase (iterator i_element) |
Erases an element. | |
void | erase (iterator first, iterator last) |
Erases a range of elements. | |
void | clear () |
Clears the flat_map. | |
iterator | find (key_parameter_t key) |
Finds an element. | |
const_iterator | find (key_parameter_t key) const |
Finds an element. | |
size_t | count (key_parameter_t key) const |
Counts an element. | |
iterator | lower_bound (key_parameter_t key) |
Finds the lower bound of a key. | |
const_iterator | lower_bound (key_parameter_t key) const |
Finds the lower bound of a key. | |
iterator | upper_bound (key_parameter_t key) |
Finds the upper bound of a key. | |
const_iterator | upper_bound (key_parameter_t key) const |
Finds the upper bound of a key. | |
std::pair< iterator, iterator > | equal_range (key_parameter_t key) |
Finds the range of equal elements of a key. | |
std::pair< const_iterator, const_iterator > | equal_range (key_parameter_t key) const |
Finds the range of equal elements of a key. | |
iflat_map & | operator= (const iflat_map &rhs) |
Assignment operator. | |
size_type | size () const |
Gets the current size of the flat_map. | |
bool | empty () const |
Checks the 'empty' state of the flat_map. | |
bool | full () const |
Checks the 'full' state of the flat_map. | |
size_type | capacity () const |
Returns the capacity of the flat_map. | |
size_type | max_size () const |
Returns the maximum possible size of the flat_map. | |
size_t | available () const |
Returns the remaining capacity. | |
Protected Member Functions | |
iflat_map (lookup_t &lookup_, storage_t &storage_) | |
Constructor. | |
Private Member Functions | |
mapped_type & | operator[] (key_parameter_t key) |
Returns a reference to the value at index 'key'. | |
const mapped_type & | operator[] (key_parameter_t key) const |
Returns a const reference to the value at index 'key'. | |
mapped_type & | at (key_parameter_t key) |
Returns a reference to the value at index 'key' If asserts or exceptions are enabled, emits an etl::flat_map_out_of_bounds if the key is not in the range. | |
const mapped_type & | at (key_parameter_t key) const |
Returns a const reference to the value at index 'key' If asserts or exceptions are enabled, emits an etl::flat_map_out_of_bounds if the key is not in the range. | |
std::pair< iterator, bool > | insert (reference value) |
Inserts a value to the reference_flat_map. | |
iterator | insert (iterator position, reference value) |
Inserts a value to the reference_flat_map. | |
size_t | erase (key_parameter_t key) |
Erases an element. | |
iterator | find (key_parameter_t key) |
Finds an element. | |
const_iterator | find (key_parameter_t key) const |
Finds an element. | |
size_t | count (key_parameter_t key) const |
Counts an element. | |
iterator | lower_bound (key_parameter_t key) |
Finds the lower bound of a key. | |
const_iterator | lower_bound (key_parameter_t key) const |
Finds the lower bound of a key. | |
iterator | upper_bound (key_parameter_t key) |
Finds the upper bound of a key. | |
const_iterator | upper_bound (key_parameter_t key) const |
Finds the upper bound of a key. | |
std::pair< iterator, iterator > | equal_range (key_parameter_t key) |
Finds the range of equal elements of a key. | |
std::pair< const_iterator, const_iterator > | equal_range (key_parameter_t key) const |
Finds the range of equal elements of a key. | |
std::pair< iterator, bool > | insert_at (iterator i_element, value_type &value) |
Inserts a value to the reference_flat_map. |
Detailed Description
template<typename TKey, typename TMapped, typename TKeyCompare = std::less<TKey>>
class etl::iflat_map< TKey, TMapped, TKeyCompare >
The base class for specifically sized flat_maps.
Can be used as a reference type for all flat_maps containing a specific type.
Definition at line 57 of file flat_map.h.
Constructor & Destructor Documentation
Constructor.
Definition at line 566 of file flat_map.h.
Member Function Documentation
void assign | ( | TIterator | first, |
TIterator | last | ||
) |
Assigns values to the flat_map.
If ETL_THROW_EXCEPTIONS & ETL_DEBUG are defined, emits flat_map_full if the flat_map does not have enough free space. If ETL_THROW_EXCEPTIONS & ETL_DEBUG are defined, emits flat_map_iterator if the iterators are reversed.
- Parameters:
-
first The iterator to the first element. last The iterator to the last element + 1.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 272 of file flat_map.h.
mapped_type& at | ( | key_parameter_t | key ) |
Returns a reference to the value at index 'key' If asserts or exceptions are enabled, emits an etl::flat_map_out_of_bounds if the key is not in the range.
- Parameters:
-
i The index.
- Returns:
- A reference to the value at index 'key'
Definition at line 248 of file flat_map.h.
const mapped_type& at | ( | key_parameter_t | key ) | const |
Returns a const reference to the value at index 'key' If asserts or exceptions are enabled, emits an etl::flat_map_out_of_bounds if the key is not in the range.
- Parameters:
-
i The index.
- Returns:
- A const reference to the value at index 'key'
Definition at line 259 of file flat_map.h.
size_t available | ( | ) | const |
Returns the remaining capacity.
- Returns:
- The remaining capacity.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 556 of file flat_map.h.
const_iterator begin | ( | ) | const |
Returns a const_iterator to the beginning of the flat_map.
- Returns:
- A const iterator to the beginning of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 124 of file flat_map.h.
iterator begin | ( | ) |
Returns an iterator to the beginning of the flat_map.
- Returns:
- An iterator to the beginning of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 115 of file flat_map.h.
size_type capacity | ( | ) | const |
Returns the capacity of the flat_map.
- Returns:
- The capacity of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 538 of file flat_map.h.
const_iterator cbegin | ( | ) | const |
Returns a const_iterator to the beginning of the flat_map.
- Returns:
- A const iterator to the beginning of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 151 of file flat_map.h.
const_iterator cend | ( | ) | const |
Returns a const_iterator to the end of the flat_map.
- Returns:
- A const iterator to the end of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 160 of file flat_map.h.
void clear | ( | ) |
Clears the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 399 of file flat_map.h.
size_t count | ( | key_parameter_t | key ) | const |
Counts an element.
- Parameters:
-
key The key to search for.
- Returns:
- 1 if the key exists, otherwise 0.
Definition at line 429 of file flat_map.h.
const_reverse_iterator crbegin | ( | ) | const |
Returns a const reverse iterator to the reverse beginning of the flat_map.
- Returns:
- Const reverse iterator to the reverse beginning of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 205 of file flat_map.h.
const_reverse_iterator crend | ( | ) | const |
Returns a const reverse iterator to the end + 1 of the flat_map.
- Returns:
- Const reverse iterator to the end + 1 of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 214 of file flat_map.h.
bool empty | ( | ) | const |
Checks the 'empty' state of the flat_map.
- Returns:
- true if empty.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 520 of file flat_map.h.
const_iterator end | ( | ) | const |
Returns a const_iterator to the end of the flat_map.
- Returns:
- A const iterator to the end of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 142 of file flat_map.h.
iterator end | ( | ) |
Returns an iterator to the end of the flat_map.
- Returns:
- An iterator to the end of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 133 of file flat_map.h.
std::pair<const_iterator, const_iterator> equal_range | ( | key_parameter_t | key ) | const |
Finds the range of equal elements of a key.
- Parameters:
-
key The key to search for.
- Returns:
- An iterator pair.
Definition at line 489 of file flat_map.h.
std::pair<iterator, iterator> equal_range | ( | key_parameter_t | key ) |
Finds the range of equal elements of a key.
- Parameters:
-
key The key to search for.
- Returns:
- An iterator pair.
Definition at line 479 of file flat_map.h.
size_t erase | ( | key_parameter_t | key ) |
Erases an element.
- Parameters:
-
key The key to erase.
- Returns:
- The number of elements erased. 0 or 1.
Definition at line 344 of file flat_map.h.
void erase | ( | iterator | i_element ) |
Erases an element.
- Parameters:
-
i_element Iterator to the element.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 366 of file flat_map.h.
void erase | ( | iterator | first, |
iterator | last | ||
) |
Erases a range of elements.
The range includes all the elements between first and last, including the element pointed by first, but not the one pointed by last.
- Parameters:
-
first Iterator to the first element. last Iterator to the last element.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 381 of file flat_map.h.
iterator find | ( | key_parameter_t | key ) |
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 409 of file flat_map.h.
const_iterator find | ( | key_parameter_t | key ) | 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 419 of file flat_map.h.
bool full | ( | ) | const |
Checks the 'full' state of the flat_map.
- Returns:
- true if full.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 529 of file flat_map.h.
std::pair<iterator, bool> insert | ( | const_reference | value ) |
Inserts a value to the flat_map.
If asserts or exceptions are enabled, emits flat_map_full if the flat_map is already full.
- Parameters:
-
value The value to insert.
Definition at line 292 of file flat_map.h.
iterator insert | ( | iterator | position, |
const_reference | value | ||
) |
Inserts a value to the flat_map.
If asserts or exceptions are enabled, emits flat_map_full if the flat_map is already full.
- Parameters:
-
position The position to insert at. value The value to insert.
Definition at line 318 of file flat_map.h.
void insert | ( | TIterator | first, |
TIterator | last | ||
) |
Inserts a range of values to the flat_map.
If asserts or exceptions are enabled, emits flat_map_full if the flat_map 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.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 331 of file flat_map.h.
iterator lower_bound | ( | key_parameter_t | key ) |
Finds the lower bound of a key.
- Parameters:
-
key The key to search for.
- Returns:
- An iterator.
Definition at line 439 of file flat_map.h.
const_iterator lower_bound | ( | key_parameter_t | key ) | const |
Finds the lower bound of a key.
- Parameters:
-
key The key to search for.
- Returns:
- An iterator.
Definition at line 449 of file flat_map.h.
size_type max_size | ( | ) | const |
Returns the maximum possible size of the flat_map.
- Returns:
- The maximum size of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 547 of file flat_map.h.
Assignment operator.
Definition at line 497 of file flat_map.h.
mapped_type& operator[] | ( | key_parameter_t | key ) |
Returns a reference to the value at index 'key'.
- Parameters:
-
i The index.
- Returns:
- A reference to the value at index 'key'
Definition at line 224 of file flat_map.h.
const_reverse_iterator rbegin | ( | ) | const |
Returns a const reverse iterator to the reverse beginning of the flat_map.
- Returns:
- Const iterator to the reverse beginning of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 178 of file flat_map.h.
reverse_iterator rbegin | ( | ) |
Returns an reverse iterator to the reverse beginning of the flat_map.
- Returns:
- Iterator to the reverse beginning of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 169 of file flat_map.h.
const_reverse_iterator rend | ( | ) | const |
Returns a const reverse iterator to the end + 1 of the flat_map.
- Returns:
- Const reverse iterator to the end + 1 of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 196 of file flat_map.h.
reverse_iterator rend | ( | ) |
Returns a reverse iterator to the end + 1 of the flat_map.
- Returns:
- Reverse iterator to the end + 1 of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 187 of file flat_map.h.
size_type size | ( | ) | const |
Gets the current size of the flat_map.
- Returns:
- The current size of the flat_map.
Reimplemented from ireference_flat_map< TKey, TMapped, TKeyCompare >.
Definition at line 511 of file flat_map.h.
iterator upper_bound | ( | key_parameter_t | key ) |
Finds the upper bound of a key.
- Parameters:
-
key The key to search for.
- Returns:
- An iterator.
Definition at line 459 of file flat_map.h.
const_iterator upper_bound | ( | key_parameter_t | key ) | const |
Finds the upper bound of a key.
- Parameters:
-
key The key to search for.
- Returns:
- An iterator.
Definition at line 469 of file flat_map.h.
Generated on Tue Jul 12 2022 14:05:49 by
