openMSX
Public Types | Public Member Functions | List of all members
hash_map< Key, Value, Hasher, Equal > Class Template Reference

#include <hash_map.hh>

Inheritance diagram for hash_map< Key, Value, Hasher, Equal >:
Inheritance graph
[legend]
Collaboration diagram for hash_map< Key, Value, Hasher, Equal >:
Collaboration graph
[legend]

Public Types

using key_type = Key
 
using mapped_type = Value
 
using value_type = std::pair< Key, Value >
 
using iterator = typename BaseType::iterator
 
using const_iterator = typename BaseType::const_iterator
 
- Public Types inherited from hash_set< Value, Extractor, Hasher, Equal >
using value_type = Value
 
using iterator = Iter< hash_set, Value >
 
using const_iterator = Iter< const hash_set, const Value >
 

Public Member Functions

 hash_map (unsigned initialSize=0, Hasher hasher_=Hasher(), Equal equal_=Equal())
 
 hash_map (std::initializer_list< std::pair< Key, Value > > list)
 
template<typename K >
Value & operator[] (K &&key)
 
template<typename K , typename... Args>
std::pair< iterator, bool > try_emplace (K &&key, Args &&...args)
 
template<typename K , typename V >
std::pair< iterator, bool > insert_or_assign (K &&key, V &&value)
 
template<typename K >
bool contains (const K &k) const
 
- Public Member Functions inherited from hash_set< Value, Extractor, Hasher, Equal >
 hash_set (unsigned initialSize=0, Extractor extract_=Extractor(), Hasher hasher_=Hasher(), Equal equal_=Equal())
 
 hash_set (const hash_set &source)
 
 hash_set (hash_set &&source) noexcept
 
 hash_set (std::initializer_list< Value > args)
 
 ~hash_set ()
 
hash_setoperator= (const hash_set &source)
 
hash_setoperator= (hash_set &&source) noexcept
 
template<typename K >
bool contains (const K &key) const
 
template<typename V >
std::pair< iterator, bool > insert (V &&value)
 
template<typename V >
std::pair< iterator, bool > insert_noCapacityCheck (V &&value)
 
template<typename V >
iterator insert_noDuplicateCheck (V &&value)
 
template<typename V >
iterator insert_noCapacityCheck_noDuplicateCheck (V &&value)
 
template<typename... Args>
std::pair< iterator, bool > emplace (Args &&... args)
 
template<typename... Args>
std::pair< iterator, bool > emplace_noCapacityCheck (Args &&... args)
 
template<typename... Args>
iterator emplace_noDuplicateCheck (Args &&... args)
 
template<typename... Args>
iterator emplace_noCapacityCheck_noDuplicateCheck (Args &&... args)
 
template<typename K >
bool erase (const K &key)
 
void erase (iterator it)
 
bool empty () const
 
unsigned size () const
 
void clear ()
 
template<typename K >
iterator find (const K &key)
 
template<typename K >
const_iterator find (const K &key) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
unsigned capacity () const
 
void reserve (unsigned count)
 

Additional Inherited Members

- Protected Types inherited from hash_set< Value, Extractor, Hasher, Equal >
using PoolIndex = hash_set_impl::PoolIndex
 
- Protected Member Functions inherited from hash_set< Value, Extractor, Hasher, Equal >
template<bool CHECK_CAPACITY, bool CHECK_DUPLICATE, typename V >
std::pair< iterator, bool > insert_impl (V &&value)
 
template<bool CHECK_CAPACITY, bool CHECK_DUPLICATE, typename... Args>
std::pair< iterator, bool > emplace_impl (Args &&... args)
 
void grow ()
 
void rehash (unsigned oldCount)
 
template<typename K >
PoolIndex locateElement (const K &key) const
 
- Static Protected Member Functions inherited from hash_set< Value, Extractor, Hasher, Equal >
static unsigned nextPowerOf2 (unsigned x)
 
- Protected Attributes inherited from hash_set< Value, Extractor, Hasher, Equal >
PoolIndextable = nullptr
 
hash_set_impl::Pool< Value > pool
 
unsigned allocMask = unsigned(-1)
 
unsigned elemCount = 0
 
Extractor extract
 
Hasher hasher
 
Equal equal
 
- Static Protected Attributes inherited from hash_set< Value, Extractor, Hasher, Equal >
static constexpr auto invalidIndex = hash_set_impl::invalidIndex
 

Detailed Description

template<typename Key, typename Value, typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
class hash_map< Key, Value, Hasher, Equal >

Definition at line 31 of file hash_map.hh.

Member Typedef Documentation

◆ const_iterator

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
using hash_map< Key, Value, Hasher, Equal >::const_iterator = typename BaseType::const_iterator

Definition at line 39 of file hash_map.hh.

◆ iterator

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
using hash_map< Key, Value, Hasher, Equal >::iterator = typename BaseType:: iterator

Definition at line 38 of file hash_map.hh.

◆ key_type

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
using hash_map< Key, Value, Hasher, Equal >::key_type = Key

Definition at line 35 of file hash_map.hh.

◆ mapped_type

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
using hash_map< Key, Value, Hasher, Equal >::mapped_type = Value

Definition at line 36 of file hash_map.hh.

◆ value_type

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
using hash_map< Key, Value, Hasher, Equal >::value_type = std::pair<Key, Value>

Definition at line 37 of file hash_map.hh.

Constructor & Destructor Documentation

◆ hash_map() [1/2]

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
hash_map< Key, Value, Hasher, Equal >::hash_map ( unsigned  initialSize = 0,
Hasher  hasher_ = Hasher(),
Equal  equal_ = Equal() 
)
inlineexplicit

Definition at line 41 of file hash_map.hh.

◆ hash_map() [2/2]

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
hash_map< Key, Value, Hasher, Equal >::hash_map ( std::initializer_list< std::pair< Key, Value > >  list)
inline

Definition at line 48 of file hash_map.hh.

Member Function Documentation

◆ contains()

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
template<typename K >
bool hash_map< Key, Value, Hasher, Equal >::contains ( const K &  k) const
inline

◆ insert_or_assign()

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
template<typename K , typename V >
std::pair< iterator, bool > hash_map< Key, Value, Hasher, Equal >::insert_or_assign ( K &&  key,
V &&  value 
)
inline

◆ operator[]()

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
template<typename K >
Value & hash_map< Key, Value, Hasher, Equal >::operator[] ( K &&  key)
inline

◆ try_emplace()

template<typename Key , typename Value , typename Hasher = std::hash<Key>, typename Equal = std::equal_to<>>
template<typename K , typename... Args>
std::pair< iterator, bool > hash_map< Key, Value, Hasher, Equal >::try_emplace ( K &&  key,
Args &&...  args 
)
inline

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