MADNESS 0.10.1
madness::ConcurrentHashMap< keyT, valueT, hashfunT > Class Template Reference

#include <worldhashmap.h>

Collaboration diagram for madness::ConcurrentHashMap< keyT, valueT, hashfunT >:

Public Types

typedef Hash_private::HashAccessor< hashT, entryT::WRITELOCK > accessor
typedef Hash_private::bin< keyT, valueT > binT
typedef Hash_private::HashAccessor< const hashT, entryT::READLOCK > const_accessor
typedef Hash_private::HashIterator< const hashT > const_iterator
typedef std::pair< const keyT, valueT > datumT
typedef Hash_private::entry< keyT, valueT > entryT
typedef ConcurrentHashMap< keyT, valueT, hashfunT > hashT
typedef Hash_private::HashIterator< hashT > iterator

Public Member Functions

 ConcurrentHashMap (const hashT &h)
 ConcurrentHashMap (int n=1021, const hashfunT &hf=hashfunT())
virtual ~ConcurrentHashMap ()
iterator begin ()
const_iterator begin () const
const_iterator cbegin () const
const_iterator cend () const
void clear ()
iterator end ()
const_iterator end () const
void erase (accessor &item)
void erase (const iterator &it)
void erase (const_accessor &item)
bool find (accessor &result, const keyT &key)
iterator find (const keyT &key)
const_iterator find (const keyT &key) const
bool find (const_accessor &result, const keyT &key) const
const hashfunT & get_hash () const
bool insert (accessor &result, const datumT &datum)
 Returns true if new pair was inserted; false if key is already in the map and the datum was not inserted.
bool insert (accessor &result, const keyT &key)
 Returns true if new pair was inserted; false if key is already in the map.
std::pair< iterator, bool > insert (const datumT &datum)
bool insert (const_accessor &result, const datumT &datum)
 Returns true if new pair was inserted; false if key is already in the map and the datum was not inserted.
bool insert (const_accessor &result, const keyT &key)
 Returns true if new pair was inserted; false if key is already in the map.
hashT & operator= (const hashT &h)
valueT & operator[] (const keyT &key)
void print_stats () const
size_t size () const
bool try_erase (const keyT &key)

Protected Attributes

binT * bins
const size_t nbins

Private Member Functions

unsigned int hash_to_bin (const keyT &key) const

Static Private Member Functions

static int nbins_prime (int n)

Private Attributes

hashfunT hashfun

Friends

class Hash_private::HashIterator< const hashT >
class Hash_private::HashIterator< hashT >

Member Typedef Documentation

◆ accessor

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
typedef Hash_private::HashAccessor<hashT,entryT::WRITELOCK> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::accessor

◆ binT

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
typedef Hash_private::bin<keyT,valueT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::binT

◆ const_accessor

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
typedef Hash_private::HashAccessor<const hashT,entryT::READLOCK> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::const_accessor

◆ const_iterator

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
typedef Hash_private::HashIterator<const hashT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::const_iterator

◆ datumT

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
typedef std::pair<const keyT,valueT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::datumT

◆ entryT

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
typedef Hash_private::entry<keyT,valueT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::entryT

◆ hashT

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
typedef ConcurrentHashMap<keyT,valueT,hashfunT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hashT

◆ iterator

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
typedef Hash_private::HashIterator<hashT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::iterator

Constructor & Destructor Documentation

◆ ConcurrentHashMap() [1/2]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
madness::ConcurrentHashMap< keyT, valueT, hashfunT >::ConcurrentHashMap ( int n = 1021,
const hashfunT & hf = hashfunT() )
inline

◆ ConcurrentHashMap() [2/2]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
madness::ConcurrentHashMap< keyT, valueT, hashfunT >::ConcurrentHashMap ( const hashT & h)
inline

◆ ~ConcurrentHashMap()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
virtual madness::ConcurrentHashMap< keyT, valueT, hashfunT >::~ConcurrentHashMap ( )
inlinevirtual

Member Function Documentation

◆ begin() [1/2]

◆ begin() [2/2]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
const_iterator madness::ConcurrentHashMap< keyT, valueT, hashfunT >::begin ( ) const
inlinenodiscard

◆ cbegin()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
const_iterator madness::ConcurrentHashMap< keyT, valueT, hashfunT >::cbegin ( ) const
inlinenodiscard

◆ cend()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
const_iterator madness::ConcurrentHashMap< keyT, valueT, hashfunT >::cend ( ) const
inlinenodiscard

◆ clear()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
void madness::ConcurrentHashMap< keyT, valueT, hashfunT >::clear ( )
inline

◆ end() [1/2]

◆ end() [2/2]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
const_iterator madness::ConcurrentHashMap< keyT, valueT, hashfunT >::end ( ) const
inlinenodiscard

◆ erase() [1/3]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
void madness::ConcurrentHashMap< keyT, valueT, hashfunT >::erase ( accessor & item)
inline

◆ erase() [2/3]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
void madness::ConcurrentHashMap< keyT, valueT, hashfunT >::erase ( const iterator & it)
inline

◆ erase() [3/3]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
void madness::ConcurrentHashMap< keyT, valueT, hashfunT >::erase ( const_accessor & item)
inline

◆ find() [1/4]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
bool madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find ( accessor & result,
const keyT & key )
inlinenodiscard

◆ find() [2/4]

◆ find() [3/4]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
const_iterator madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find ( const keyT & key) const
inlinenodiscard

◆ find() [4/4]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
bool madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find ( const_accessor & result,
const keyT & key ) const
inlinenodiscard

◆ get_hash()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
const hashfunT & madness::ConcurrentHashMap< keyT, valueT, hashfunT >::get_hash ( ) const
inline

◆ hash_to_bin()

◆ insert() [1/5]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
bool madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert ( accessor & result,
const datumT & datum )
inlinenodiscard

Returns true if new pair was inserted; false if key is already in the map and the datum was not inserted.

◆ insert() [2/5]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
bool madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert ( accessor & result,
const keyT & key )
inlinenodiscard

Returns true if new pair was inserted; false if key is already in the map.

◆ insert() [3/5]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
std::pair< iterator, bool > madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert ( const datumT & datum)
inlinenodiscard

◆ insert() [4/5]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
bool madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert ( const_accessor & result,
const datumT & datum )
inlinenodiscard

Returns true if new pair was inserted; false if key is already in the map and the datum was not inserted.

◆ insert() [5/5]

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
bool madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert ( const_accessor & result,
const keyT & key )
inlinenodiscard

Returns true if new pair was inserted; false if key is already in the map.

◆ nbins_prime()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
int madness::ConcurrentHashMap< keyT, valueT, hashfunT >::nbins_prime ( int n)
inlinestaticprivate

◆ operator=()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
hashT & madness::ConcurrentHashMap< keyT, valueT, hashfunT >::operator= ( const hashT & h)
inline

◆ operator[]()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
valueT & madness::ConcurrentHashMap< keyT, valueT, hashfunT >::operator[] ( const keyT & key)
inlinenodiscard

◆ print_stats()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
void madness::ConcurrentHashMap< keyT, valueT, hashfunT >::print_stats ( ) const
inline

◆ size()

◆ try_erase()

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
bool madness::ConcurrentHashMap< keyT, valueT, hashfunT >::try_erase ( const keyT & key)
inlinenodiscard

◆ Hash_private::HashIterator< const hashT >

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
friend class Hash_private::HashIterator< const hashT >
friend

◆ Hash_private::HashIterator< hashT >

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
friend class Hash_private::HashIterator< hashT >
friend

Member Data Documentation

◆ bins

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
binT* madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins
protected

◆ hashfun

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
hashfunT madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hashfun
private

◆ nbins

template<class keyT, class valueT, class hashfunT = Hash<keyT>>
const size_t madness::ConcurrentHashMap< keyT, valueT, hashfunT >::nbins
protected

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