Template Class ConcurrentCuckooTable
Defined in File ConcurrentCuckooTable.h
Nested Relationships
Nested Types
Class Documentation
-
template<class K, class V, class H = DefaultHash<K>, class Eq = std::equal_to<K>>
class ConcurrentCuckooTable a DICTIONARY shared by threads, cuckoo hashing with a lock per region
Public Functions
-
explicit ConcurrentCuckooTable(std::size_t n = 0, H h = H(), Eq eq = Eq())
the empty table, with room for n pairs before it grows
-
ConcurrentCuckooTable(const ConcurrentCuckooTable&) = delete
-
ConcurrentCuckooTable &operator=(const ConcurrentCuckooTable&) = delete
-
bool insert(const K &k, const V &v)
associates the value v to the key k if k is not there; true if it was not, and otherwise the value of k stays
-
bool insertOrAssign(const K &k, const V &v)
associates the value v to the key k; true if k was not there
-
template<class F>
bool update(const K &k, F &&f) applies f( V & ) to the value of the key k under its locks; true if k is there
-
std::size_t size(void) const
the pairs, exact when no operation runs
-
bool empty(void) const
-
std::size_t capacity(void) const
the places, 4 per bucket
-
std::size_t rehashes(void) const
the doublings of the table
-
void reserve(std::size_t n)
room for n pairs before the table grows
-
void clear(void)
removes every pair, keeping the capacity
-
template<class F>
void forEach(F &&f) applies f( const K & , V & ) to every pair, under all the locks
-
template<class F>
void forEach(F &&f) const applies f( const K & , const V & ) to every pair, under all the locks
-
bool consistent(void) const
each key in one of its two buckets with its tag and once, and the counters summing to the pairs; under all the locks
-
explicit ConcurrentCuckooTable(std::size_t n = 0, H h = H(), Eq eq = Eq())