MADNESS 0.10.1
|
#include <worldhashmap.h>
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 |
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 > |
typedef Hash_private::HashAccessor<hashT,entryT::WRITELOCK> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::accessor |
typedef Hash_private::bin<keyT,valueT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::binT |
typedef Hash_private::HashAccessor<const hashT,entryT::READLOCK> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::const_accessor |
typedef Hash_private::HashIterator<const hashT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::const_iterator |
typedef std::pair<const keyT,valueT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::datumT |
typedef Hash_private::entry<keyT,valueT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::entryT |
typedef ConcurrentHashMap<keyT,valueT,hashfunT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hashT |
typedef Hash_private::HashIterator<hashT> madness::ConcurrentHashMap< keyT, valueT, hashfunT >::iterator |
|
inline |
|
inline |
References h().
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
Referenced by madness::ConcurrentHashMap< keyT, valueT, hashfunT >::end().
|
inline |
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::ConcurrentHashMap< keyT, valueT, hashfunT >::clear(), and madness::ConcurrentHashMap< keyT, valueT, hashfunT >::nbins.
Referenced by madness::WorldContainerImpl< keyT, valueT, hashfunT >::clear(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::clear(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::operator=(), madness::SimpleCache< Q, NDIM >::operator=(), and madness::Timer::reset().
|
inline |
Referenced by madness::WorldContainerImpl< keyT, valueT, hashfunT >::end(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::end(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::erase(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::find_handler(), madness::SimpleCache< Q, NDIM >::getptr(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::probe(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::redistribute_phase1(), and test_coverage().
|
inline |
|
inline |
|
inline |
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::end(), MADNESS_ASSERT, MADNESS_EXCEPTION, and madness::ConcurrentHashMap< keyT, valueT, hashfunT >::try_erase().
Referenced by madness::detail::DistCache< keyT >::get_cache_value(), madness::detail::DistCache< keyT >::get_cache_value(), madness::detail::DistCache< keyT >::set_cache_value(), and madness::World::unregister_ptr().
|
inline |
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::Hash_private::HashAccessor< hashT, lockmode >::convert_read_lock_to_write_lock(), madness::Hash_private::bin< keyT, valueT >::del(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hash_to_bin(), madness::Hash_private::HashAccessor< hashT, lockmode >::unset(), and madness::MutexReaderWriter::WRITELOCK.
|
inline |
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::Hash_private::bin< keyT, valueT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hash_to_bin(), madness::Hash_private::HashAccessor< hashT, lockmode >::release(), madness::Hash_private::HashAccessor< hashT, lockmode >::set(), and madness::MutexReaderWriter::WRITELOCK.
|
inline |
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::ConcurrentHashMap< keyT, valueT, hashfunT >::end(), madness::Hash_private::bin< keyT, valueT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hash_to_bin(), and madness::MutexReaderWriter::NOLOCK.
Referenced by madness::Timer::accumulate(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::find(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::find(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::find(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::find_handler(), madness::SimpleCache< Q, NDIM >::getptr(), madness::World::id_from_ptr(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::probe(), madness::World::ptr_from_id(), Peasant::run(), test_coverage(), and madness::World::unregister_ptr().
|
inline |
|
inline |
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::Hash_private::bin< keyT, valueT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hash_to_bin(), madness::MutexReaderWriter::READLOCK, madness::Hash_private::HashAccessor< hashT, lockmode >::release(), and madness::Hash_private::HashAccessor< hashT, lockmode >::set().
|
inline |
|
inlineprivate |
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hashfun, and madness::ConcurrentHashMap< keyT, valueT, hashfunT >::nbins.
Referenced by madness::ConcurrentHashMap< keyT, valueT, hashfunT >::erase(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::erase(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert(), and madness::ConcurrentHashMap< keyT, valueT, hashfunT >::try_erase().
|
inline |
Returns true if new pair was inserted; false if key is already in the map and the datum was not inserted.
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hash_to_bin(), madness::Hash_private::bin< keyT, valueT >::insert(), madness::Hash_private::HashAccessor< hashT, lockmode >::release(), madness::Hash_private::HashAccessor< hashT, lockmode >::set(), and madness::MutexReaderWriter::WRITELOCK.
|
inline |
Returns true if new pair was inserted; false if key is already in the map.
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert().
|
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().
|
inline |
Returns true if new pair was inserted; false if key is already in the map and the datum was not inserted.
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hash_to_bin(), madness::Hash_private::bin< keyT, valueT >::insert(), madness::MutexReaderWriter::READLOCK, madness::Hash_private::HashAccessor< hashT, lockmode >::release(), and madness::Hash_private::HashAccessor< hashT, lockmode >::set().
|
inline |
Returns true if new pair was inserted; false if key is already in the map.
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert().
|
inlinestaticprivate |
|
inline |
|
inline |
|
inline |
|
inline |
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::ConcurrentHashMap< keyT, valueT, hashfunT >::nbins, madness::ConcurrentHashMap< keyT, valueT, hashfunT >::size(), and sum.
Referenced by madness::ConcurrentHashMap< keyT, valueT, hashfunT >::print_stats(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::size(), and madness::ConcurrentHashMap< keyT, valueT, hashfunT >::size().
|
inline |
References madness::ConcurrentHashMap< keyT, valueT, hashfunT >::bins, madness::ConcurrentHashMap< keyT, valueT, hashfunT >::hash_to_bin(), and madness::MutexReaderWriter::NOLOCK.
Referenced by madness::ConcurrentHashMap< keyT, valueT, hashfunT >::erase(), madness::WorldContainerImpl< keyT, valueT, hashfunT >::erase(), and madness::World::unregister_ptr().
|
friend |
|
friend |
|
protected |
Referenced by madness::ConcurrentHashMap< keyT, valueT, hashfunT >::~ConcurrentHashMap(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::clear(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::erase(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::erase(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::print_stats(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::size(), and madness::ConcurrentHashMap< keyT, valueT, hashfunT >::try_erase().
|
private |
|
protected |