momo  3.9
momo::stdish::unordered_map_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator > Class Template Reference

momo::stdish::unordered_map_open is similar to std::unordered_map, but much more efficient in operation speed. The implementation is based on open addressing hash table. More...

#include <unordered_map.h>

Inheritance diagram for momo::stdish::unordered_map_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator >:

Public Types

typedef TKey key_type
 
typedef TMapped mapped_type
 
typedef size_t size_type
 
typedef std::pair< const key_type, mapped_typevalue_type
 
typedef const_iterator::Reference const_reference
 

Public Member Functions

 unordered_map_open ()
 
unordered_map_openoperator= (std::initializer_list< value_type > values)
 

Friends

void swap (unordered_map_open &left, unordered_map_open &right) noexcept
 
template<typename ValueFilter >
size_type erase_if (unordered_map_open &cont, const ValueFilter &valueFilter)
 

Detailed Description

template<typename TKey, typename TMapped, typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
class momo::stdish::unordered_map_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator >

momo::stdish::unordered_map_open is similar to std::unordered_map, but much more efficient in operation speed. The implementation is based on open addressing hash table.

Deviations from the std::unordered_map:

  1. Container items must be movable (preferably without exceptions) or copyable, similar to items of std::vector.
  2. After each addition or removal of the item all iterators and references to items become invalid and should not be used.
  3. Type reference is not the same as value_type&, so for (auto& p : map) is illegal, but for (auto p : map) or for (const auto& p : map) or for (auto&& p : map) is allowed.
  4. Functions clear, begin, cbegin and iterator increment take O(bucket_count) time in worst case.
  5. If ObjectManager<key_type>::isNothrowAnywayAssignable is false or ObjectManager<mapped_type>::isNothrowAnywayAssignable is false, functions erase can throw exceptions.
  6. Functions merge, extract and insert(node_type&&) move items.

It is allowed to pass to functions insert and emplace references to items within the container.

Member Typedef Documentation

◆ const_reference

template<typename TKey , typename TMapped , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
typedef const_iterator::Reference momo::stdish::unordered_map< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMap >::const_reference

◆ key_type

template<typename TKey , typename TMapped , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
typedef TKey momo::stdish::unordered_map< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMap >::key_type

◆ mapped_type

template<typename TKey , typename TMapped , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
typedef TMapped momo::stdish::unordered_map< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMap >::mapped_type

◆ size_type

template<typename TKey , typename TMapped , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
typedef size_t momo::stdish::unordered_map< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMap >::size_type

◆ value_type

template<typename TKey , typename TMapped , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
typedef std::pair<const key_type, mapped_type> momo::stdish::unordered_map< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMap >::value_type

Constructor & Destructor Documentation

◆ unordered_map_open()

template<typename TKey , typename TMapped , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
momo::stdish::unordered_map_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator >::unordered_map_open ( )
inline

Member Function Documentation

◆ operator=()

template<typename TKey , typename TMapped , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
unordered_map_open& momo::stdish::unordered_map_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator >::operator= ( std::initializer_list< value_type values)
inline

Friends And Related Function Documentation

◆ erase_if

template<typename TKey , typename TMapped , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
template<typename ValueFilter >
size_type erase_if ( unordered_map_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator > &  cont,
const ValueFilter &  valueFilter 
)
friend

◆ swap

template<typename TKey , typename TMapped , typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
void swap ( unordered_map_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator > &  left,
unordered_map_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator > &  right 
)
friend

The documentation for this class was generated from the following file: