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

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

#include <unordered_multimap.h>

Inheritance diagram for momo::stdish::unordered_multimap_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_multimap_open ()
 
unordered_multimap_openoperator= (std::initializer_list< value_type > values)
 

Friends

void swap (unordered_multimap_open &left, unordered_multimap_open &right) noexcept
 
template<typename ValueFilter >
size_type erase_if (unordered_multimap_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_multimap_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator >

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

Deviations from the std::unordered_multimap:

  1. Each of duplicate keys stored only once.
  2. max_load_factor, rehash, reserve, load_factor and all the functions, associated with buckets or nodes, are not implemented.
  3. Container items must be movable (preferably without exceptions) or copyable, similar to items of std::vector.
  4. After each addition or removal of the item all iterators and references to items become invalid and should not be used.
  5. 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.
  6. Functions clear, begin, cbegin and iterator increment take O(bucket_count) time in worst case.
  7. Functions erase can throw exceptions thrown by key_type and mapped_type move assignment operators.

It is allowed to pass to functions insert and emplace references to items within the container. But in case of the function insert, receiving pair of iterators, it's not allowed to pass iterators pointing to the 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_multimap< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMultiMap >::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_multimap< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMultiMap >::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_multimap< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMultiMap >::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_multimap< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMultiMap >::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_multimap< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMultiMap >::value_type

Constructor & Destructor Documentation

◆ unordered_multimap_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_multimap_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator >::unordered_multimap_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_multimap_open& momo::stdish::unordered_multimap_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_multimap_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_multimap_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator > &  left,
unordered_multimap_open< TKey, TMapped, THashFunc, TEqualFunc, TAllocator > &  right 
)
friend

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