11#ifndef CONCURRENTMAP_H
12#define CONCURRENTMAP_H
17template <
typename K,
typename V,
class KT = DefaultKeyTraits<K>,
class VT = DefaultValueTraits<V> >
51 return quint64(
m_root.loadNonatomic()->jobCoordinator.loadConsume()) > 1;
83 Hash hash = KeyTraits::hash(key);
106 Hash hash = KeyTraits::hash(key);
162 if (oldValue ==
Value(ValueTraits::NullValue) &&
m_value !=
Value(ValueTraits::NullValue)) {
223 return Value(ValueTraits::NullValue);
255 return Mutator(*
this, key,
false);
261 Hash hash = KeyTraits::hash(key);
266 return Value(ValueTraits::NullValue);
293 Mutator iter(*
this, key,
false);
327 while (++m_idx <= m_table->sizeMask) {
333 if (
m_hash != KeyTraits::NullHash) {
341 m_hash = KeyTraits::NullHash;
356 return KeyTraits::dehash(
m_hash);
float value(const T *src, size_t ch)
bool compareExchangeStrong(T &expected, T desired, MemoryOrder memoryOrder)
T load(MemoryOrder memoryOrder) const
void setMap(ConcurrentMap &map)
Iterator(ConcurrentMap &map)
Value exchangeValue(Value desired)
Mutator(ConcurrentMap &map, Key key, bool)
void assignValue(Value desired)
Mutator(ConcurrentMap &map, Key key)
Atomic< typename Details::Table * > m_root
bool migrationInProcess()
Value exchange(Key key, Value desired)
Value assign(Key key, Value desired)
void publishTableMigration(typename Details::TableMigration *migration)
Mutator insertOrFind(Key key)
ConcurrentMap(quint64 capacity=Details::InitialSize)
Leapfrog< ConcurrentMap > Details
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
CellGroup * getCellGroups() const
SimpleJobCoordinator jobCoordinator
static Cell * find(Hash hash, Table *table)
@ InsertResult_InsertedNew
@ InsertResult_AlreadyFound
static const quint64 InitialSize
static void beginTableMigration(Map &map, Table *table, quint64 overflowIdx)
static InsertResult insertOrFind(Hash hash, Table *table, Cell *&cell, quint64 &overflowIdx)