MADNESS 0.10.1
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
madness::ConcurrentHashMap< keyT, valueT, hashfunT > Class Template Reference

#include <worldhashmap.h>

Collaboration diagram for madness::ConcurrentHashMap< keyT, valueT, hashfunT >:
Collaboration graph
[legend]

Public Types

typedef Hash_private::HashAccessor< hashT, entryT::WRITELOCKaccessor
 
typedef Hash_private::bin< keyT, valueTbinT
 
typedef Hash_private::HashAccessor< const hashT, entryT::READLOCKconst_accessor
 
typedef Hash_private::HashIterator< const hashTconst_iterator
 
typedef std::pair< const keyT, valueTdatumT
 
typedef Hash_private::entry< keyT, valueTentryT
 
typedef ConcurrentHashMap< keyT, valueT, hashfunT > hashT
 
typedef Hash_private::HashIterator< hashTiterator
 

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
 
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.
 
hashToperator= (const hashT &h)
 
valueToperator[] (const keyT &key)
 
void print_stats () const
 
size_t size () const
 
bool try_erase (const keyT &key)
 

Protected Attributes

binTbins
 
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

References h().

◆ ~ConcurrentHashMap()

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

Member Function Documentation

◆ begin() [1/2]

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

◆ begin() [2/2]

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

◆ cbegin()

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

◆ cend()

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

◆ clear()

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

◆ end() [1/2]

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

◆ end() [2/2]

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

◆ 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 
)
inline

◆ find() [2/4]

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

◆ find() [3/4]

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

◆ 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
inline

◆ get_hash()

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

◆ hash_to_bin()

template<class keyT , class valueT , class hashfunT = Hash<keyT>>
unsigned int madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hash_to_bin ( const keyT &  key) const
inlineprivate

◆ insert() [1/5]

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

◆ insert() [2/5]

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

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

References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert().

◆ 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)
inline

References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hash_to_bin(), madness::Hash_private::bin< keyT, valueT >::insert(), and madness::MutexReaderWriter::NOLOCK.

Referenced by madness::Timer::accumulate(), madness::detail::DistCache< keyT >::get_cache_value(), madness::detail::DistCache< keyT >::get_cache_value(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::insert(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::insert_acc(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::insert_const_acc(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::itemfun(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::itemfun(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::itemfun(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::itemfun(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::itemfun(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::itemfun(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::itemfun(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::itemfun(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::operator=(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::operator[](), madness::World::register_ptr(), madness::SimpleCache< Q, NDIM >::set(), and madness::detail::DistCache< keyT >::set_cache_value().

◆ 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 
)
inline

◆ 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 
)
inline

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

References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert().

◆ nbins_prime()

template<class keyT , class valueT , class hashfunT = Hash<keyT>>
static 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)
inline

◆ print_stats()

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

◆ size()

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

◆ try_erase()

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

Friends And Related Symbol Documentation

◆ 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: