libmoost
moost::container::mmd_dense_hash_map< Key, T, HashFcn > Class Template Reference

#include <dense_hash_map.hpp>

Inheritance diagram for moost::container::mmd_dense_hash_map< Key, T, HashFcn >:
Collaboration diagram for moost::container::mmd_dense_hash_map< Key, T, HashFcn >:

List of all members.

Classes

class  const_iterator
struct  HashingPolicy
class  writer

Public Types

typedef Key key_type
typedef T mapped_type
typedef pod_pair< Key, T > value_type
typedef size_t size_type
typedef const value_typeconst_reference
typedef const value_typeconst_pointer
typedef std::forward_iterator_tag iterator_category

Public Member Functions

 mmd_dense_hash_map ()
 mmd_dense_hash_map (const memory_mapped_dataset &mmd, const std::string &name)
void set (const memory_mapped_dataset &mmd, const std::string &name)
void warm_cache () const
const_iterator begin () const
const_iterator end () const
size_type size () const
size_type capacity () const
bool empty () const
const key_typeempty_key () const
const_iterator find (const key_type &key) const
const mapped_typeoperator[] (const key_type &key) const

Static Public Member Functions

static float MAX_POPULATION_RATIO ()

Static Public Attributes

static const size_t MMD_HASH_ALIGNMENT = 16

Private Member Functions

 BOOST_STATIC_ASSERT_MSG (boost::is_pod< Key >::value,"mmd_dense_hash_map<> template can only handle POD key types")
 BOOST_STATIC_ASSERT_MSG (boost::is_pod< T >::value,"mmd_dense_hash_map<> template can only handle POD value types")
size_type find (const key_type &key, const value_type *begin, size_type size) const

Private Attributes

size_type m_size
size_type m_population
const value_typem_begin
key_type m_empty_key

Friends

class const_iterator

Detailed Description

template<typename Key, typename T, class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
class moost::container::mmd_dense_hash_map< Key, T, HashFcn >

Memory-mapped dataset section representing a POD dense hash map

This section provides extremely fast lookups at the expense of consuming more memory. It is suitable for medium sized high-performance hash maps. Thanks to some simplifications that could be made due to the read-only character of the memory-mapped dense hash map, read access is about 30% faster than using google's dense hash map implementation.

This is not a multimap, so there can only be one value per key. Just sayin' in case that wasn't obvious. ;)

Definition at line 58 of file dense_hash_map.hpp.


Member Typedef Documentation

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
typedef const value_type* moost::container::mmd_dense_hash_map< Key, T, HashFcn >::const_pointer

Definition at line 81 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
typedef const value_type& moost::container::mmd_dense_hash_map< Key, T, HashFcn >::const_reference

Definition at line 80 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
typedef std::forward_iterator_tag moost::container::mmd_dense_hash_map< Key, T, HashFcn >::iterator_category

Definition at line 83 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
typedef Key moost::container::mmd_dense_hash_map< Key, T, HashFcn >::key_type

Definition at line 74 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
typedef T moost::container::mmd_dense_hash_map< Key, T, HashFcn >::mapped_type

Definition at line 75 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
typedef size_t moost::container::mmd_dense_hash_map< Key, T, HashFcn >::size_type

Definition at line 78 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
typedef pod_pair<Key, T> moost::container::mmd_dense_hash_map< Key, T, HashFcn >::value_type

Definition at line 76 of file dense_hash_map.hpp.


Constructor & Destructor Documentation

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
moost::container::mmd_dense_hash_map< Key, T, HashFcn >::mmd_dense_hash_map ( ) [inline]

Definition at line 338 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
moost::container::mmd_dense_hash_map< Key, T, HashFcn >::mmd_dense_hash_map ( const memory_mapped_dataset mmd,
const std::string &  name 
) [inline]

Definition at line 345 of file dense_hash_map.hpp.


Member Function Documentation

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
const_iterator moost::container::mmd_dense_hash_map< Key, T, HashFcn >::begin ( ) const [inline]

Definition at line 381 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
moost::container::mmd_dense_hash_map< Key, T, HashFcn >::BOOST_STATIC_ASSERT_MSG ( boost::is_pod< Key >::value  ,
"mmd_dense_hash_map<> template can only handle POD key types"   
) [private]
template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
moost::container::mmd_dense_hash_map< Key, T, HashFcn >::BOOST_STATIC_ASSERT_MSG ( boost::is_pod< T >::value  ,
"mmd_dense_hash_map<> template can only handle POD value types"   
) [private]
template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
size_type moost::container::mmd_dense_hash_map< Key, T, HashFcn >::capacity ( ) const [inline]

Definition at line 396 of file dense_hash_map.hpp.

Here is the caller graph for this function:

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
bool moost::container::mmd_dense_hash_map< Key, T, HashFcn >::empty ( ) const [inline]

Definition at line 401 of file dense_hash_map.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
const key_type& moost::container::mmd_dense_hash_map< Key, T, HashFcn >::empty_key ( ) const [inline]

Definition at line 406 of file dense_hash_map.hpp.

Here is the caller graph for this function:

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
const_iterator moost::container::mmd_dense_hash_map< Key, T, HashFcn >::end ( ) const [inline]

Definition at line 386 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
const_iterator moost::container::mmd_dense_hash_map< Key, T, HashFcn >::find ( const key_type key) const [inline]

Definition at line 411 of file dense_hash_map.hpp.

Here is the caller graph for this function:

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
size_type moost::container::mmd_dense_hash_map< Key, T, HashFcn >::find ( const key_type key,
const value_type begin,
size_type  size 
) const [inline, private]

Definition at line 429 of file dense_hash_map.hpp.

Here is the call graph for this function:

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
static float moost::container::mmd_dense_hash_map< Key, T, HashFcn >::MAX_POPULATION_RATIO ( ) [inline, static]

Definition at line 68 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
const mapped_type& moost::container::mmd_dense_hash_map< Key, T, HashFcn >::operator[] ( const key_type key) const [inline]

Definition at line 416 of file dense_hash_map.hpp.

Here is the call graph for this function:

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
void moost::container::mmd_dense_hash_map< Key, T, HashFcn >::set ( const memory_mapped_dataset mmd,
const std::string &  name 
) [inline]

Definition at line 350 of file dense_hash_map.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
size_type moost::container::mmd_dense_hash_map< Key, T, HashFcn >::size ( ) const [inline]

Definition at line 391 of file dense_hash_map.hpp.

Here is the caller graph for this function:

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
void moost::container::mmd_dense_hash_map< Key, T, HashFcn >::warm_cache ( ) const [inline]

Definition at line 376 of file dense_hash_map.hpp.


Friends And Related Function Documentation

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
friend class const_iterator [friend]

Definition at line 63 of file dense_hash_map.hpp.


Member Data Documentation

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
const value_type* moost::container::mmd_dense_hash_map< Key, T, HashFcn >::m_begin [private]

Definition at line 455 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
key_type moost::container::mmd_dense_hash_map< Key, T, HashFcn >::m_empty_key [private]

Definition at line 456 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
size_type moost::container::mmd_dense_hash_map< Key, T, HashFcn >::m_population [private]

Definition at line 454 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
size_type moost::container::mmd_dense_hash_map< Key, T, HashFcn >::m_size [private]

Definition at line 453 of file dense_hash_map.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>>
const size_t moost::container::mmd_dense_hash_map< Key, T, HashFcn >::MMD_HASH_ALIGNMENT = 16 [static]

Definition at line 66 of file dense_hash_map.hpp.


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