ATLAS Offline Software
Loading...
Searching...
No Matches
ConcurrentMap.h File Reference

Hash map from integers/pointers allowing concurrent, lockless reads. More...

#include "CxxUtils/ConcurrentHashmapImpl.h"
#include "CxxUtils/UIntConv.h"
#include "CxxUtils/concepts.h"
#include "CxxUtils/IsUpdater.h"
#include "CxxUtils/iterator_range.h"
#include "boost/iterator/iterator_facade.hpp"
#include <type_traits>
#include <stdexcept>
#include "CxxUtils/ConcurrentMap.icc"
Include dependency graph for ConcurrentMap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CxxUtils::const_iterator
 Iterator over all 1 bits in the set. More...

Namespaces

namespace  CxxUtils

Typedefs

using CxxUtils::const_iterator_value = std::pair<const key_type, mapped_type>
 Value structure for iterators.
using CxxUtils::const_iterator_range = CxxUtils::iterator_range<const_iterator>
 A range defined by two iterators.

Functions

 CxxUtils::ConcurrentMap (Updater_t &&updater, size_type capacity=64, const Context_t &ctx=Updater_t::defaultContext())
 Hash map from integers/pointers allowing concurrent, lockless reads.
 CxxUtils::ConcurrentMap (const ConcurrentMap &other, Updater_t &&updater, size_t capacity=64, const Context_t &ctx=Updater_t::defaultContext())
 Constructor from another map.
template<class InputIterator>
 CxxUtils::ConcurrentMap (InputIterator f, InputIterator l, Updater_t &&updater, size_type capacity=64, const Context_t &ctx=Updater_t::defaultContext())
 Constructor from a range.
 CxxUtils::ConcurrentMap (const ConcurrentMap &other)=delete
 Copy / move / assign not supported.
 CxxUtils::ConcurrentMap (ConcurrentMap &&other)=delete
ConcurrentMapCxxUtils::operator= (const ConcurrentMap &other)=delete
ConcurrentMapCxxUtils::operator= (ConcurrentMap &&other)=delete
 CxxUtils::~ConcurrentMap ()=default
 Destructor.
size_t CxxUtils::erased () const
 The number of erased elements in the current table.
const_iterator_range CxxUtils::range () const
 Return an iterator range covering the entire map.
const_iterator CxxUtils::cbegin () const
 Iterator at the start of the map.
const_iterator CxxUtils::cend () const
 Iterator at the end of the map.
bool CxxUtils::contains (key_type key) const
 Test if a key is in the container.
size_type CxxUtils::count (key_type key) const
 Return the number of times a given key is in the container.
const_iterator CxxUtils::find (key_type key) const
 Look up an element in the map.
mapped_type CxxUtils::at (key_type key) const
 Look up an element in the map.
std::pair< const_iterator, const_iteratorCxxUtils::equal_range (key_type key) const
 Return a range of iterators with entries matching key.
Lock_t CxxUtils::lock ()
 Take a lock on the container.
std::pair< const_iterator, bool > CxxUtils::emplace (key_type key, mapped_type val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map.
std::pair< const_iterator, bool > CxxUtils::emplace (const Lock_t &lock, key_type key, mapped_type val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map, with external locking.
std::pair< const_iterator, bool > CxxUtils::insert_or_assign (key_type key, mapped_type val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map, or overwrite an existing one.
std::pair< const_iterator, bool > CxxUtils::insert_or_assign (const Lock_t &lock, key_type key, mapped_type val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map, or overwrite an existing one, with external locking.
template<class PAIR>
std::pair< const_iterator, bool > CxxUtils::insert (const PAIR &p)
 Add an element to the map.
template<class InputIterator>
void CxxUtils::insert (InputIterator first, InputIterator last)
 Insert a range of elements to the map.
bool CxxUtils::erase (key_type key)
 Erase an entry from the table.
bool CxxUtils::erase (const Lock_t &lock, key_type key)
 Erase an entry from the table, with external locking.
void CxxUtils::reserve (size_type capacity, const Context_t &ctx=Updater_t::defaultContext())
 Increase the table capacity.
void CxxUtils::rehash (size_type capacity)
 Increase the table capacity.
void CxxUtils::clear (size_t capacity, const Context_t &ctx=Updater_t::defaultContext())
 Erase the table and change the capacity.
void CxxUtils::clear (const Context_t &ctx=Updater_t::defaultContext())
 Erase the table (don't change the capacity).
void CxxUtils::forceClear ()
 Erase the table in-place.
void CxxUtils::quiescent (const Context_t &ctx)
 Called when this thread is no longer referencing anything from this container.
void CxxUtils::swap (ConcurrentMap &other)
 Swap this container with another.
Updater_tCxxUtils::updater ()
 Access the Updater instance.
static key_type CxxUtils::keyAsKey (val_t val)
 Convert an underlying key value to this type's key value.
static val_t CxxUtils::keyAsVal (key_type k)
 Convert this type's key value to an underlying key value.
static mapped_type CxxUtils::mappedAsMapped (val_t val)
 Convert an underlying mapped value to this type's mapped value.
static val_t CxxUtils::mappedAsVal (mapped_type val)
 Convert this type's mapped value to an underlying mapped value.
Impl_t::const_iterator CxxUtils::get (key_type key) const
 Do a lookup in the table.
std::pair< const_iterator, bool > CxxUtils::put (key_type key, mapped_type val, bool overwrite=true, const Context_t &ctx=Updater_t::defaultContext())
 Insert / overwrite an entry in the table.
std::pair< const_iterator, bool > CxxUtils::put (const Lock_t &lock, key_type key, mapped_type val, bool overwrite=true, const Context_t &ctx=Updater_t::defaultContext())
 Insert / overwrite an entry in the table, with external locking.
Size, bit testing
bit_t CxxUtils::size () const
 Count the number of 1 bits in the set.
bool CxxUtils::empty () const
 Return true if there are no 1 bits in the set.
bit_t CxxUtils::capacity () const
 The number of bits that this container can hold.
Iterator operations.
const_iterator CxxUtils::begin () const
 Return a begin iterator.
const_iterator CxxUtils::end () const
 Return an end iterator.

Detailed Description

Hash map from integers/pointers allowing concurrent, lockless reads.

Author
scott snyder snyde.nosp@m.r@bn.nosp@m.l.gov
Date
Jan, 2023

Definition in file ConcurrentMap.h.