XSTL
|
#include <association_map.hpp>
Classes | |
struct | containers |
struct | Extents |
struct | View |
Public Member Functions | |
association_map (size_type values, size_type keys) | |
Constructs an association map with a specified number of values and keys. | |
auto | empty () const |
Checks if the association map is empty. | |
auto | size () const |
Returns the number of values in the association map. | |
auto | extents () const |
Returns the extents of the containers in the association map. | |
iterator | begin () |
Returns an iterator to the beginning of the values array. | |
const_iterator | begin () const |
Returns a const iterator to the beginning of the values array. | |
const_iterator | cbegin () const |
Returns a const iterator to the beginning of the values array. | |
iterator | end () |
Returns an iterator to the end of the values array. | |
const_iterator | end () const |
const_iterator | cend () const |
Returns a const iterator to the end of the values array. | |
iterator | find (key_type key) |
Returns an iterator to the first element with a specific key. | |
const_iterator | find (key_type key) const |
Returns a const iterator to the first element with a specific key. | |
size_type | count (key_type key) const |
Returns the number of values with a specific key. | |
bool | contains (key_type key) const |
Checks if the association map contains values associated to a specific key. | |
iterator | lower_bound (key_type key) |
Returns an iterator to the first element with a key not less than the specified key. | |
const_iterator | lower_bound (key_type key) const |
Returns a const iterator to the first element with a key not less than the specified key. | |
iterator | upper_bound (key_type key) |
Returns an iterator to the first element with a key greater than the specified key. | |
const_iterator | upper_bound (key_type key) const |
Returns a const iterator to the first element with a key greater than the specified key. | |
std::pair< iterator, iterator > | equal_range (key_type key) |
Returns a pair of iterators representing the range of values with a specific key. | |
std::pair< const_iterator, const_iterator > | equal_range (key_type key) const |
Returns a pair of const iterators representing the range of values with a specific key. | |
void | fill (std::span< key_type > keys, std::span< mapped_type > values) |
Fills the association map with keys and values from the provided spans. | |
View | view () |
Returns a view of the association map. | |
Friends | |
struct | internal::map_interface< association_map< T > > |
association_map is a map-like structure that associates keys with values. It is designed to efficiently store and retrieve values associated with integer keys.
T | The type of the values stored in the association map. |
|
inlineexplicit |
Constructs an association map with a specified number of values and keys.
values | The number of values to be stored in the association map. |
keys | The number of bins (or keys) in the association map. |
iterator xstd::association_map< T >::begin | ( | ) |
Returns an iterator to the beginning of the values array.
const_iterator xstd::association_map< T >::begin | ( | ) | const |
Returns a const iterator to the beginning of the values array.
const_iterator xstd::association_map< T >::cbegin | ( | ) | const |
Returns a const iterator to the beginning of the values array.
const_iterator xstd::association_map< T >::cend | ( | ) | const |
Returns a const iterator to the end of the values array.
bool xstd::association_map< T >::contains | ( | key_type | key | ) | const |
Checks if the association map contains values associated to a specific key.
key | The key to check for. |
size_type xstd::association_map< T >::count | ( | key_type | key | ) | const |
Returns the number of values with a specific key.
key | The key to count. |
auto xstd::association_map< T >::empty | ( | ) | const |
Checks if the association map is empty.
iterator xstd::association_map< T >::end | ( | ) |
Returns an iterator to the end of the values array.
std::pair< iterator, iterator > xstd::association_map< T >::equal_range | ( | key_type | key | ) |
Returns a pair of iterators representing the range of values with a specific key.
key | The key to search for. |
std::pair< const_iterator, const_iterator > xstd::association_map< T >::equal_range | ( | key_type | key | ) | const |
Returns a pair of const iterators representing the range of values with a specific key.
key | The key to search for. |
auto xstd::association_map< T >::extents | ( | ) | const |
Returns the extents of the containers in the association map.
void xstd::association_map< T >::fill | ( | std::span< key_type > | keys, |
std::span< mapped_type > | values ) |
Fills the association map with keys and values from the provided spans.
keys | A span of keys to be associated with the values. |
values | A span of values to be associated with the keys. |
iterator xstd::association_map< T >::find | ( | key_type | key | ) |
Returns an iterator to the first element with a specific key.
key | The key to search for. |
const_iterator xstd::association_map< T >::find | ( | key_type | key | ) | const |
Returns a const iterator to the first element with a specific key.
key | The key to search for. |
iterator xstd::association_map< T >::lower_bound | ( | key_type | key | ) |
Returns an iterator to the first element with a key not less than the specified key.
key | The key to search for. |
const_iterator xstd::association_map< T >::lower_bound | ( | key_type | key | ) | const |
Returns a const iterator to the first element with a key not less than the specified key.
key | The key to search for. |
auto xstd::association_map< T >::size | ( | ) | const |
Returns the number of values in the association map.
iterator xstd::association_map< T >::upper_bound | ( | key_type | key | ) |
Returns an iterator to the first element with a key greater than the specified key.
key | The key to search for. |
const_iterator xstd::association_map< T >::upper_bound | ( | key_type | key | ) | const |
Returns a const iterator to the first element with a key greater than the specified key.
key | The key to search for. |
View xstd::association_map< T >::view | ( | ) |
Returns a view of the association map.