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

#include <hash_multimap.hpp>

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

List of all members.

Classes

class  writer

Public Types

typedef Key key_type
typedef T mapped_type
typedef pod_pair< Key, T > value_type
typedef const value_typeconst_iterator
typedef size_t size_type
typedef const T & const_reference
typedef const T * const_pointer
typedef IndexType index_type
typedef
std::bidirectional_iterator_tag 
iterator_category

Public Member Functions

 mmd_hash_multimap ()
 mmd_hash_multimap (const memory_mapped_dataset &mmd, const std::string &name)
void set (const memory_mapped_dataset &mmd, const std::string &name)
size_type hash_bits () const
void warm_cache () const
const_iterator begin () const
const_iterator end () const
size_type size () const
bool empty () const
const_iterator lower_bound (const key_type &x) const

Static Public Attributes

static const size_t MMD_HASH_ALIGNMENT = 16
static const size_t MMD_HASH_BITS = 10

Private Member Functions

 BOOST_STATIC_ASSERT_MSG (boost::is_pod< Key >::value,"mmd_hash_multimap<> template can only handle POD key types")
 BOOST_STATIC_ASSERT_MSG (boost::is_pod< T >::value,"mmd_hash_multimap<> template can only handle POD value types")

Static Private Member Functions

static bool compare (const value_type &a, const value_type &b)

Private Attributes

const index_typem_index
size_t m_hash_mask
const_iterator m_begin
const_iterator m_end
size_type m_hash_bits

Detailed Description

template<typename Key, typename T, class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
class moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >

Memory-mapped dataset section representing a POD hash multimap

This is a little more versatile than the mmd_vector if you're really looking for fast lookup by a key instead of lookup by index.

It is supposed to offer faster lookup than the non-hashed map at the expense of not having the key-value pairs in a deterministic order when iterating over the map.

Definition at line 56 of file hash_multimap.hpp.


Member Typedef Documentation

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
typedef const value_type* moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::const_iterator

Definition at line 69 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
typedef const T* moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::const_pointer

Definition at line 73 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
typedef const T& moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::const_reference

Definition at line 72 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
typedef IndexType moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::index_type

Definition at line 75 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
typedef std::bidirectional_iterator_tag moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::iterator_category

Definition at line 77 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
typedef Key moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::key_type

Definition at line 65 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
typedef T moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::mapped_type

Definition at line 66 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
typedef size_t moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::size_type

Definition at line 70 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
typedef pod_pair<Key, T> moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::value_type

Definition at line 67 of file hash_multimap.hpp.


Constructor & Destructor Documentation

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::mmd_hash_multimap ( ) [inline]

Definition at line 151 of file hash_multimap.hpp.

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

Definition at line 160 of file hash_multimap.hpp.


Member Function Documentation

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

Definition at line 210 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::BOOST_STATIC_ASSERT_MSG ( boost::is_pod< Key >::value  ,
"mmd_hash_multimap<> template can only handle POD key types"   
) [private]
template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::BOOST_STATIC_ASSERT_MSG ( boost::is_pod< T >::value  ,
"mmd_hash_multimap<> template can only handle POD value types"   
) [private]
template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
static bool moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::compare ( const value_type a,
const value_type b 
) [inline, static, private]

Definition at line 80 of file hash_multimap.hpp.

Here is the caller graph for this function:

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

Definition at line 225 of file hash_multimap.hpp.

Here is the call graph for this function:

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

Definition at line 215 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
size_type moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::hash_bits ( ) const [inline]

Definition at line 200 of file hash_multimap.hpp.

Here is the caller graph for this function:

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
const_iterator moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::lower_bound ( const key_type x) const [inline]

Definition at line 230 of file hash_multimap.hpp.

Here is the call graph for this function:

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

Definition at line 165 of file hash_multimap.hpp.

Here is the call graph for this function:

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

Definition at line 220 of file hash_multimap.hpp.

Here is the caller graph for this function:

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

Definition at line 205 of file hash_multimap.hpp.


Member Data Documentation

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
const_iterator moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::m_begin [private]

Definition at line 250 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
const_iterator moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::m_end [private]

Definition at line 251 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
size_type moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::m_hash_bits [private]

Definition at line 252 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
size_t moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::m_hash_mask [private]

Definition at line 249 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
const index_type* moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::m_index [private]

Definition at line 248 of file hash_multimap.hpp.

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

Definition at line 62 of file hash_multimap.hpp.

template<typename Key , typename T , class HashFcn = MMD_DEFAULT_HASH_FCN<Key>, typename IndexType = boost::uint64_t>
const size_t moost::container::mmd_hash_multimap< Key, T, HashFcn, IndexType >::MMD_HASH_BITS = 10 [static]

Definition at line 63 of file hash_multimap.hpp.


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