Embedded Template Library 1.0
|
Functions | |
template<typename TKey , typename TMapped , typename TKeyCompare > | |
bool | etl::operator== (const etl::ireference_flat_map< TKey, TMapped, TKeyCompare > &lhs, const etl::ireference_flat_map< TKey, TMapped, TKeyCompare > &rhs) |
template<typename TKey , typename TMapped , typename TKeyCompare > | |
bool | etl::operator!= (const etl::ireference_flat_map< TKey, TMapped, TKeyCompare > &lhs, const etl::ireference_flat_map< TKey, TMapped, TKeyCompare > &rhs) |
An reference_flat_map with the capacity defined at compile time. Has insertion of O(N) and search of O(logN) Duplicate entries are not allowed.
class etl::flat_map_exception |
Exception base for reference_flat_maps
Public Member Functions | |
flat_map_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
ETL_CONSTEXPR | exception (string_type reason_, string_type, numeric_type line_) |
Constructor. | |
ETL_CONSTEXPR string_type | what () const |
ETL_CONSTEXPR string_type | file_name () const |
ETL_CONSTEXPR numeric_type | line_number () const |
Additional Inherited Members | |
![]() | |
typedef const char * | string_type |
typedef int | numeric_type |
class etl::flat_map_full |
Vector full exception.
Public Member Functions | |
flat_map_full (string_type file_name_, numeric_type line_number_) | |
![]() | |
flat_map_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
ETL_CONSTEXPR | exception (string_type reason_, string_type, numeric_type line_) |
Constructor. | |
ETL_CONSTEXPR string_type | what () const |
ETL_CONSTEXPR string_type | file_name () const |
ETL_CONSTEXPR numeric_type | line_number () const |
Additional Inherited Members | |
![]() | |
typedef const char * | string_type |
typedef int | numeric_type |
class etl::flat_map_out_of_bounds |
Vector out of bounds exception.
Public Member Functions | |
flat_map_out_of_bounds (string_type file_name_, numeric_type line_number_) | |
![]() | |
flat_map_exception (string_type reason_, string_type file_name_, numeric_type line_number_) | |
![]() | |
ETL_CONSTEXPR | exception (string_type reason_, string_type, numeric_type line_) |
Constructor. | |
ETL_CONSTEXPR string_type | what () const |
ETL_CONSTEXPR string_type | file_name () const |
ETL_CONSTEXPR numeric_type | line_number () const |
Additional Inherited Members | |
![]() | |
typedef const char * | string_type |
typedef int | numeric_type |
class etl::ireference_flat_map |
The base class for specifically sized reference_flat_maps. Can be used as a reference type for all reference_flat_maps containing a specific type.
Public Types | |
typedef ETL_OR_STD::pair< const TKey, TMapped > | value_type |
typedef TKey | key_type |
typedef TMapped | mapped_type |
typedef TKeyCompare | key_compare |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef size_t | size_type |
typedef ETL_OR_STD::reverse_iterator< iterator > | reverse_iterator |
typedef ETL_OR_STD::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef etl::iterator_traits< iterator >::difference_type | difference_type |
Public Member Functions | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | crend () const |
mapped_type & | at (key_parameter_t key) |
const mapped_type & | at (key_parameter_t key) const |
template<typename TIterator > | |
void | assign (TIterator first, TIterator last) |
ETL_OR_STD::pair< iterator, bool > | insert (reference value) |
iterator | insert (const_iterator, reference value) |
template<class TIterator > | |
void | insert (TIterator first, TIterator last) |
size_t | erase (key_parameter_t key) |
iterator | erase (iterator i_element) |
iterator | erase (const_iterator i_element) |
iterator | erase (const_iterator first, const_iterator last) |
void | clear () |
Clears the reference_flat_map. | |
iterator | find (key_parameter_t key) |
const_iterator | find (key_parameter_t key) const |
size_t | count (key_parameter_t key) const |
iterator | lower_bound (key_parameter_t key) |
const_iterator | lower_bound (key_parameter_t key) const |
iterator | upper_bound (key_parameter_t key) |
const_iterator | upper_bound (key_parameter_t key) const |
ETL_OR_STD::pair< iterator, iterator > | equal_range (key_parameter_t key) |
ETL_OR_STD::pair< const_iterator, const_iterator > | equal_range (key_parameter_t key) const |
bool | contains (const TKey &key) const |
Check if the map contains the key. | |
size_type | size () const |
bool | empty () const |
bool | full () const |
size_type | capacity () const |
size_type | max_size () const |
size_t | available () const |
Protected Types | |
typedef etl::ivector< value_type * > | lookup_t |
typedef const TKey & | key_parameter_t |
Protected Member Functions | |
ireference_flat_map (lookup_t &lookup_) | |
Constructor. | |
ETL_OR_STD::pair< iterator, bool > | insert_at (iterator i_element, value_type &value) |
bool | keys_are_equal (key_parameter_t key1, key_parameter_t key2) const |
Check to see if the keys are equal. | |
~ireference_flat_map () | |
Destructor. | |
|
inline |
Assigns values to the reference_flat_map. If ETL_THROW_EXCEPTIONS & ETL_DEBUG are defined, emits flat_map_full if the reference_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.
first | The iterator to the first element. |
last | The iterator to the last element + 1. |
|
inline |
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.
i | The index. |
|
inline |
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.
i | The index. |
|
inline |
Returns the remaining capacity.
|
inline |
Returns an iterator to the beginning of the reference_flat_map.
|
inline |
Returns a const_iterator to the beginning of the reference_flat_map.
|
inline |
Returns the capacity of the reference_flat_map.
|
inline |
Returns a const_iterator to the beginning of the reference_flat_map.
|
inline |
Returns a const_iterator to the end of the reference_flat_map.
|
inline |
Counts an element.
key | The key to search for. |
|
inline |
Returns a const reverse iterator to the reverse beginning of the reference_flat_map.
|
inline |
Returns a const reverse iterator to the end + 1 of the reference_flat_map.
|
inline |
Checks the 'empty' state of the reference_flat_map.
|
inline |
Returns an iterator to the end of the reference_flat_map.
|
inline |
Returns a const_iterator to the end of the reference_flat_map.
|
inline |
Finds the range of equal elements of a key
key | The key to search for. |
|
inline |
Finds the range of equal elements of a key
key | The key to search for. |
|
inline |
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.
first | Iterator to the first element. |
last | Iterator to the last element. |
|
inline |
Erases an element.
i_element | Iterator to the element. |
|
inline |
Erases an element.
i_element | Iterator to the element. |
|
inline |
Erases an element.
key | The key to erase. |
|
inline |
Finds an element.
key | The key to search for. |
|
inline |
Finds an element.
key | The key to search for. |
|
inline |
Checks the 'full' state of the reference_flat_map.
|
inline |
Inserts a value to the reference_flat_map. If asserts or exceptions are enabled, emits flat_map_full if the reference_flat_map is already full.
position | The position to insert at. |
value | The value to insert. |
|
inline |
Inserts a value to the reference_flat_map. If asserts or exceptions are enabled, emits flat_map_full if the reference_flat_map is already full.
value | The value to insert. |
|
inline |
Inserts a range of values to the reference_flat_map. If asserts or exceptions are enabled, emits flat_map_full if the reference_flat_map does not have enough free space.
position | The position to insert at. |
first | The first element to add. |
last | The last + 1 element to add. |
|
inlineprotected |
Inserts a value to the reference_flat_map.
i_element | The place to insert. |
value | The value to insert. |
|
inline |
Finds the lower bound of a key
key | The key to search for. |
|
inline |
Finds the lower bound of a key
key | The key to search for. |
|
inline |
Returns the maximum possible size of the reference_flat_map.
|
inline |
Returns an reverse iterator to the reverse beginning of the reference_flat_map.
|
inline |
Returns a const reverse iterator to the reverse beginning of the reference_flat_map.
|
inline |
Returns a reverse iterator to the end + 1 of the reference_flat_map.
|
inline |
Returns a const reverse iterator to the end + 1 of the reference_flat_map.
|
inline |
Gets the current size of the reference_flat_map.
|
inline |
Finds the upper bound of a key
key | The key to search for. |
|
inline |
Finds the upper bound of a key
key | The key to search for. |
class etl::reference_flat_map |
A reference_flat_map implementation that uses a fixed size buffer.
TKey | The key type. |
TValue | The value type. |
TCompare | The type to compare keys. Default = etl::less<TKey> |
MAX_SIZE_ | The maximum number of elements that can be stored. |
Public Member Functions | |
reference_flat_map () | |
Constructor. | |
template<typename TIterator > | |
reference_flat_map (TIterator first, TIterator last) | |
~reference_flat_map () | |
Destructor. | |
reference_flat_map & | operator= (const reference_flat_map &rhs) |
Assignment operator. | |
![]() | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | crend () const |
mapped_type & | at (key_parameter_t key) |
const mapped_type & | at (key_parameter_t key) const |
void | assign (TIterator first, TIterator last) |
ETL_OR_STD::pair< iterator, bool > | insert (reference value) |
iterator | insert (const_iterator, reference value) |
void | insert (TIterator first, TIterator last) |
size_t | erase (key_parameter_t key) |
iterator | erase (iterator i_element) |
iterator | erase (const_iterator i_element) |
iterator | erase (const_iterator first, const_iterator last) |
void | clear () |
Clears the reference_flat_map. | |
iterator | find (key_parameter_t key) |
const_iterator | find (key_parameter_t key) const |
size_t | count (key_parameter_t key) const |
iterator | lower_bound (key_parameter_t key) |
const_iterator | lower_bound (key_parameter_t key) const |
iterator | upper_bound (key_parameter_t key) |
const_iterator | upper_bound (key_parameter_t key) const |
ETL_OR_STD::pair< iterator, iterator > | equal_range (key_parameter_t key) |
ETL_OR_STD::pair< const_iterator, const_iterator > | equal_range (key_parameter_t key) const |
bool | contains (const TKey &key) const |
Check if the map contains the key. | |
size_type | size () const |
bool | empty () const |
bool | full () const |
size_type | capacity () const |
size_type | max_size () const |
size_t | available () const |
Static Public Attributes | |
static ETL_CONSTANT size_t | MAX_SIZE = MAX_SIZE_ |
Additional Inherited Members | |
![]() | |
typedef ETL_OR_STD::pair< const TKey, TValue > | value_type |
typedef TKey | key_type |
typedef TValue | mapped_type |
typedef etl::less< TKey > | key_compare |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef size_t | size_type |
typedef ETL_OR_STD::reverse_iterator< iterator > | reverse_iterator |
typedef ETL_OR_STD::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef etl::iterator_traits< iterator >::difference_type | difference_type |
![]() | |
typedef etl::ivector< value_type * > | lookup_t |
typedef const TKey & | key_parameter_t |
![]() | |
ireference_flat_map (lookup_t &lookup_) | |
Constructor. | |
ETL_OR_STD::pair< iterator, bool > | insert_at (iterator i_element, value_type &value) |
bool | keys_are_equal (key_parameter_t key1, key_parameter_t key2) const |
Check to see if the keys are equal. | |
~ireference_flat_map () | |
Destructor. | |
|
inline |
Constructor, from an iterator range.
TIterator | The iterator type. |
first | The iterator to the first element. |
last | The iterator to the last element + 1. |
bool etl::operator!= | ( | const etl::ireference_flat_map< TKey, TMapped, TKeyCompare > & | lhs, |
const etl::ireference_flat_map< TKey, TMapped, TKeyCompare > & | rhs | ||
) |
Not equal operator.
lhs | Reference to the first reference_flat_map. |
rhs | Reference to the second reference_flat_map. |
bool etl::operator== | ( | const etl::ireference_flat_map< TKey, TMapped, TKeyCompare > & | lhs, |
const etl::ireference_flat_map< TKey, TMapped, TKeyCompare > & | rhs | ||
) |
Equal operator.
lhs | Reference to the first reference_flat_map. |
rhs | Reference to the second reference_flat_map. |