|
| fastmap (BitExtractor bx=BitExtractor(), Compare cmp=Compare(), ArbitraryAllocator alloc=ArbitraryAllocator()) |
| fastmap (std::initializer_list< std::pair< Key, Value > > array, BitExtractor bx=BitExtractor(), Compare cmp=Compare(), ArbitraryAllocator alloc=ArbitraryAllocator()) |
| fastmap (const fastmap &other)=delete |
| fastmap (fastmap &&other) noexcept=default |
std::size_t | size () const |
bool | empty () const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
reverse_iterator | rbegin () |
reverse_iterator | rend () |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | crend () const |
iterator | find (const Key &key) |
const_iterator | find (const Key &key) const |
iterator | pred (const Key &key, bool strict=false) |
const_iterator | pred (const Key &key, bool strict=false) const |
iterator | succ (const Key &key, bool strict=false) |
const_iterator | succ (const Key &key, bool strict=false) const |
iterator | lower_bound (const Key &key) |
const_iterator | lower_bound (const Key &key) const |
iterator | upper_bound (const Key &key) |
const_iterator | upper_bound (const Key &key) const |
iterator::value_type & | operator[] (const Key &key) |
const_iterator::value_type & | at (const Key &key) const |
template<typename ... Args> |
iterator | insert (const Key &key, Args ... args) |
template<typename Iterator> |
Iterator | erase (const Iterator &i) |
bool | erase (const Key &key) |
void | clear () |
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
class yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >
sorted associative container
- Template Parameters
-
Key | key type |
Value | value type |
H | key length in bits |
BitExtractor | helper type to provide key shifts and bit extractions |
Hash | map from shifted keys to std::uintptr_t |
Compare | key comparator |
ArbitraryAllocator | allocator |
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
typedef Key yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::key_type |
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
typedef Value yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::value_type |
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
const_iterator::value_type & yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::at |
( |
const Key & | key | ) |
const |
|
inline |
get value by key
- Parameters
-
- Returns
- const reference to the value indexed by key; if not present, std::out_of_range is thrown
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- mutable forward iterator pointing at the leftmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- const forward iterator pointing at the leftmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- const forward iterator pointing at the leftmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- const forward iterator right after the rightmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
void yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::clear |
( |
| ) |
|
|
inline |
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- const reverse iterator pointing at the rightmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- const reverse iterator right after the leftmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
bool yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::empty |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- true if the container is empty otherwise false
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- mutable forward iterator right after the rightmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- const forward iterator right after the rightmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
template<typename Iterator>
Iterator yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::erase |
( |
const Iterator & | i | ) |
|
|
inline |
erase entry by iterator
- Parameters
-
i | iterator (may be a const iterator and/or a reverse iterator) |
- Returns
- iterator following the removed entry with respect to the iterator direction
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
bool yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::erase |
( |
const Key & | key | ) |
|
|
inline |
find and erase entry by key
- Parameters
-
- Returns
- true if the entry has been found and erased or false otherwise
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
iterator yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::find |
( |
const Key & | key | ) |
|
|
inline |
find an entry by key
- Parameters
-
- Returns
- iterator pointing to the entry with the key equal to key if any or end() otherwise
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
find an entry by key
- Parameters
-
- Returns
- const iterator pointing to the entry with the key equal to key if any or end() otherwise
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
template<typename ... Args>
iterator yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::insert |
( |
const Key & | key, |
|
|
Args ... | args ) |
|
inline |
insert an entry, possibly replacing the existing one
- Parameters
-
key | key to insert |
args | const reference or move-reference to the value to insert |
- Returns
- iterator pointing to the inserted entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
iterator yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::lower_bound |
( |
const Key & | key | ) |
|
|
inline |
find a successor entry for a key
- Parameters
-
- Returns
- iterator pointing to the entry with the key not less than key
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
find a successor entry for a key
- Parameters
-
- Returns
- const iterator pointing to the entry with the key not less than key
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
iterator::value_type & yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::operator[] |
( |
const Key & | key | ) |
|
|
inline |
get value by key
- Parameters
-
- Returns
- reference to the value indexed by key; if not present, a default-constructed value is inserted
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
iterator yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::pred |
( |
const Key & | key, |
|
|
bool | strict = false ) |
|
inline |
find a predecessor entry for a key
- Parameters
-
key | key |
strict | whether an entry with the key strictly less than key should be returned |
- Returns
- iterator pointing to the entry with the key either not greater or strictly less than key
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
const_iterator yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::pred |
( |
const Key & | key, |
|
|
bool | strict = false ) const |
|
inline |
find a predecessor entry for a key
- Parameters
-
key | key |
strict | whether an entry with the key strictly less than key should be returned |
- Returns
- const iterator pointing to the entry with the key either not greater or strictly less than key
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- mutable reverse iterator pointing at the rightmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- const reverse iterator pointing at the rightmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- mutable reverse iterator right after the leftmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
- Returns
- const reverse iterator right after the leftmost entry
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
std::size_t yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::size |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- the number of entries in the container
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
iterator yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::succ |
( |
const Key & | key, |
|
|
bool | strict = false ) |
|
inline |
find a successor entry for a key
- Parameters
-
key | key |
strict | whether an entry with the key strictly greater than key should be returned |
- Returns
- iterator pointing to the entry with the key either not less or strictly greater than key
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
const_iterator yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::succ |
( |
const Key & | key, |
|
|
bool | strict = false ) const |
|
inline |
find a successor entry for a key
- Parameters
-
key | key |
strict | whether an entry with the key strictly greater than key should be returned |
- Returns
- const iterator pointing to the entry with the key either not less or strictly greater than key
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
iterator yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::upper_bound |
( |
const Key & | key | ) |
|
|
inline |
find a successor entry for a key
- Parameters
-
- Returns
- iterator pointing to the entry with the key strictly greater than key
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
find a successor entry for a key
- Parameters
-
- Returns
- const iterator pointing to the entry with the key strictly greater than key
template<typename Key, typename Value, unsigned int H, internal::BitExtractorGeneric< Key > BitExtractor = internal::BitExtractor<Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<Key>, typename ArbitraryAllocator = std::allocator<std::pair<Key, Value>>>
unsigned int yfast::fastmap< Key, Value, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::KeyLength = H |
|
staticconstexpr |