ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER > Class Template Reference

Hash map from strings to arbitrary objects allowing concurrent, lockless reads. More...

#include <ConcurrentStrToValMap.h>

Collaboration diagram for CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >:

Classes

class  const_iterator
 Const iterator class. More...
 
struct  Hasher
 Hash functional for keys. More...
 
class  iterator
 Iterator class. More...
 
struct  Matcher
 Matching functional for keys. More...
 

Public Types

using key_type = std::string
 Standard STL types. More...
 
using mapped_type = VALUE
 
using size_type = size_t
 
using Updater_t = typename Impl_t::Updater_t
 Updater object. More...
 
using Context_t = typename Updater_t::Context_t
 Context type. More...
 
using const_iterator_value = std::pair< const key_type &, const mapped_type & >
 Value structures for iterators. More...
 
using iterator_value = std::pair< const key_type, mapped_type & >
 
typedef boost::iterator_range< const_iteratorconst_iterator_range
 A range defined by two iterators. More...
 
typedef boost::iterator_range< iteratoriterator_range
 

Public Member Functions

 ConcurrentStrToValMap (Updater_t &&updater, size_type capacity=64, const Context_t &ctx=Updater_t::defaultContext())
 Constructor. More...
 
 ConcurrentStrToValMap (const ConcurrentStrToValMap &other, Updater_t &&updater, size_t capacity=64, const Context_t &ctx=Updater_t::defaultContext())
 Constructor from another map. More...
 
template<class InputIterator >
 ConcurrentStrToValMap (InputIterator f, InputIterator l, Updater_t &&updater, size_type capacity=64, const Context_t &ctx=Updater_t::defaultContext())
 Constructor from a range. More...
 
 ConcurrentStrToValMap (const ConcurrentStrToValMap &other)=delete
 Copy / move / assign not supported. More...
 
 ConcurrentStrToValMap (ConcurrentStrToValMap &&other)=delete
 
ConcurrentStrToValMapoperator= (const ConcurrentStrToValMap &other)=delete
 
ConcurrentStrToValMapoperator= (ConcurrentStrToValMap &&other)=delete
 
 ~ConcurrentStrToValMap ()
 Destructor. More...
 
size_type size () const
 Return the number of items currently in the map. More...
 
bool empty () const
 Test if the map is currently empty. More...
 
size_t capacity () const
 Return the current size (capacity) of the hash table. More...
 
const_iterator_range range () const
 Return an iterator range covering the entire map. More...
 
iterator_range range ()
 Return an iterator range covering the entire map. More...
 
const_iterator begin () const
 Iterator at the start of the map. More...
 
const_iterator end () const
 Iterator at the end of the map. More...
 
iterator begin ()
 Iterator at the start of the map. More...
 
iterator end ()
 Iterator at the end of the map. More...
 
const_iterator cbegin () const
 Iterator at the start of the map. More...
 
const_iterator cend () const
 Iterator at the end of the map. More...
 
bool contains (const key_type &key) const
 Test if a key is in the container. More...
 
size_type count (const key_type &key) const
 Return the number of times a given key is in the container. More...
 
const_iterator find (const key_type &key) const
 Look up an element in the map. More...
 
iterator find (const key_type &key)
 Look up an element in the map. More...
 
const mapped_typeat (const key_type &key) const
 Look up an element in the map. More...
 
mapped_typeat (const key_type &key)
 Look up an element in the map. More...
 
std::pair< const_iterator, const_iteratorequal_range (const key_type &key) const
 Return a range of iterators with entries matching key. More...
 
std::pair< iterator, iteratorequal_range (const key_type &key)
 Return a range of iterators with entries matching key. More...
 
std::pair< const_iterator, bool > emplace (const key_type &key, const mapped_type &val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map. More...
 
std::pair< const_iterator, bool > emplace (key_type &&key, const mapped_type &val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map. More...
 
std::pair< const_iterator, bool > emplace (const key_type &key, mapped_type &&val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map. More...
 
std::pair< const_iterator, bool > emplace (key_type &&key, mapped_type &&val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map. More...
 
std::pair< const_iterator, bool > emplace (const key_type &key, std::unique_ptr< mapped_type > val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map. More...
 
std::pair< const_iterator, bool > emplace (key_type &&key, std::unique_ptr< mapped_type > val, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map. More...
 
template<class PAIR >
std::pair< const_iterator, bool > insert (const PAIR &p, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map. More...
 
template<class PAIR >
std::pair< const_iterator, bool > insert (PAIR &&p, const Context_t &ctx=Updater_t::defaultContext())
 Add an element to the map. More...
 
template<class InputIterator >
void insert (InputIterator first, InputIterator last, const Context_t &ctx=Updater_t::defaultContext())
 Insert a range of elements to the map. More...
 
void reserve (size_type capacity, const Context_t &ctx=Updater_t::defaultContext())
 Increase the table capacity. More...
 
void rehash (size_type capacity)
 Increase the table capacity. More...
 
void quiescent (const Context_t &ctx)
 Called when this thread is no longer referencing anything from this container. More...
 
void swap (ConcurrentStrToValMap &other)
 Swap this container with another. More...
 
Updater_tupdater ()
 Access the Updater instance. More...
 

Private Types

using Impl_t = typename detail::ConcurrentHashmapImpl< UPDATER, Hasher, Matcher >
 
using val_t = CxxUtils::detail::ConcurrentHashmapVal_t
 Representation type in the underlying map. More...
 

Private Member Functions

Impl_t::const_iterator get (const key_type &key) const
 Do a lookup in the table. More...
 
std::pair< const_iterator, bool > put (std::unique_ptr< key_type > key, std::unique_ptr< mapped_type > val, const Context_t &ctx=Updater_t::defaultContext())
 Insert an entry in the table. More...
 

Static Private Member Functions

static const std::string * keyAsString (val_t val)
 Convert an underlying key value to a string pointer. More...
 
static val_t keyAsVal (const std::string *s)
 Convert a string pointer to an underlying key value. More...
 
static mapped_typemappedAsMapped (val_t val)
 Convert an underlying mapped value a pointer to this type's mapped value. More...
 
static val_t mappedAsVal (mapped_type *val)
 Convert this type's mapped value to an underlying mapped value. More...
 

Private Attributes

Impl_t m_impl
 The underlying hash table. More...
 

Detailed Description

template<class VALUE, template< class > class UPDATER>
class CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >

Hash map from strings to arbitrary objects allowing concurrent, lockless reads.

This class implements a hash map from strings. The mapped type is arbitrary. It allows for concurrent access from many threads. Reads can proceed without taking out a lock, while writes are serialized with each other. Thus, this is appropriate for maps which are read-mostly.

This class includes non-const references that can be used to obtain non-const references to the mapped objects. Howeer, the mapped objects must themselves the thread-safe in order to safely modify them in a multithreaded context.

This is based on ConcurrentHashmapImpl.

Besides the key and mapped value types, this class is templated on an UPDATER class, which is used to manage the underlying memory. See IsUpdater.h for details. (AthenaKernel/RCUUpdater is a concrete version that should work in the context of Athena.)

This mostly supports the interface of std::unordered_map, with a few differences / omissions:

The mapped value can be given as any of:

I.e., any of these should work:

CxxUtils::ConcurrentToValMap<int, Payload> map;
const Payload p (1);
map.emplace ("key1", p); // By value / const reference
map.emplace ("key2", Payload (2)); // By rvalue-reference.
// Could also move() an instance.
map.emplace ("key3", std::make_unique<Payload> (3)); // By unique_ptr.

Definition at line 86 of file ConcurrentStrToValMap.h.

Member Typedef Documentation

◆ const_iterator_range

template<class VALUE , template< class > class UPDATER>
typedef boost::iterator_range<const_iterator> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::const_iterator_range

A range defined by two iterators.

Definition at line 363 of file ConcurrentStrToValMap.h.

◆ const_iterator_value

template<class VALUE , template< class > class UPDATER>
using CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::const_iterator_value = std::pair<const key_type&, const mapped_type&>

Value structures for iterators.

For a map from K to V, a STL-style iterator should dereference to a std::pair<const K, V>. However, we don't actually store an object like that anywhere. In order to be able to have STL-like iterators, we instead use a pair where the second element is a const reference to the mapped value. We will return this by value when we deference an iterator. (The compiler should be able to optimize out the redundant packing and unpacking of fields.)

Definition at line 200 of file ConcurrentStrToValMap.h.

◆ Context_t

template<class VALUE , template< class > class UPDATER>
using CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::Context_t = typename Updater_t::Context_t

Context type.

Definition at line 105 of file ConcurrentStrToValMap.h.

◆ Impl_t

template<class VALUE , template< class > class UPDATER>
using CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::Impl_t = typename detail::ConcurrentHashmapImpl<UPDATER, Hasher, Matcher>
private

Definition at line 92 of file ConcurrentStrToValMap.h.

◆ iterator_range

template<class VALUE , template< class > class UPDATER>
typedef boost::iterator_range<iterator> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::iterator_range

Definition at line 364 of file ConcurrentStrToValMap.h.

◆ iterator_value

template<class VALUE , template< class > class UPDATER>
using CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::iterator_value = std::pair<const key_type, mapped_type&>

Definition at line 201 of file ConcurrentStrToValMap.h.

◆ key_type

template<class VALUE , template< class > class UPDATER>
using CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::key_type = std::string

Standard STL types.

Definition at line 99 of file ConcurrentStrToValMap.h.

◆ mapped_type

template<class VALUE , template< class > class UPDATER>
using CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::mapped_type = VALUE

Definition at line 100 of file ConcurrentStrToValMap.h.

◆ size_type

template<class VALUE , template< class > class UPDATER>
using CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::size_type = size_t

Definition at line 101 of file ConcurrentStrToValMap.h.

◆ Updater_t

template<class VALUE , template< class > class UPDATER>
using CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::Updater_t = typename Impl_t::Updater_t

Updater object.

Definition at line 103 of file ConcurrentStrToValMap.h.

◆ val_t

template<class VALUE , template< class > class UPDATER>
using CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::val_t = CxxUtils::detail::ConcurrentHashmapVal_t
private

Representation type in the underlying map.

Definition at line 94 of file ConcurrentStrToValMap.h.

Constructor & Destructor Documentation

◆ ConcurrentStrToValMap() [1/5]

template<class VALUE , template< class > class UPDATER>
CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::ConcurrentStrToValMap ( Updater_t &&  updater,
size_type  capacity = 64,
const Context_t ctx = Updater_t::defaultContext() 
)

Constructor.

Parameters
updaterObject used to manage memory (see comments at the start of the class).
capacityThe initial table capacity. (Will be rounded up to a power of two.)
ctxExecution context.

◆ ConcurrentStrToValMap() [2/5]

template<class VALUE , template< class > class UPDATER>
CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::ConcurrentStrToValMap ( const ConcurrentStrToValMap< VALUE, UPDATER > &  other,
Updater_t &&  updater,
size_t  capacity = 64,
const Context_t ctx = Updater_t::defaultContext() 
)

Constructor from another map.

Parameters
updaterObject used to manage memory (see comments at the start of the class).
capacityThe initial table capacity of the new table. (Will be rounded up to a power of two.)
ctxExecution context.

(Not really a copy constructor since we need to pass updater.)

◆ ConcurrentStrToValMap() [3/5]

template<class VALUE , template< class > class UPDATER>
template<class InputIterator >
CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::ConcurrentStrToValMap ( InputIterator  f,
InputIterator  l,
Updater_t &&  updater,
size_type  capacity = 64,
const Context_t ctx = Updater_t::defaultContext() 
)

Constructor from a range.

Parameters
fStart iterator for the range.
lEnd iterator for the range.
updaterObject used to manage memory (see comments at the start of the class).
capacityThe initial table capacity of the new table. (Will be rounded up to a power of two.)
ctxExecution context.

Constructor from a range of pairs.

◆ ConcurrentStrToValMap() [4/5]

template<class VALUE , template< class > class UPDATER>
CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::ConcurrentStrToValMap ( const ConcurrentStrToValMap< VALUE, UPDATER > &  other)
delete

Copy / move / assign not supported.

◆ ConcurrentStrToValMap() [5/5]

template<class VALUE , template< class > class UPDATER>
CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::ConcurrentStrToValMap ( ConcurrentStrToValMap< VALUE, UPDATER > &&  other)
delete

◆ ~ConcurrentStrToValMap()

template<class VALUE , template< class > class UPDATER>
CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::~ConcurrentStrToValMap ( )

Destructor.

Member Function Documentation

◆ at() [1/2]

template<class VALUE , template< class > class UPDATER>
mapped_type& CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::at ( const key_type key)

Look up an element in the map.

Parameters
keyThe element to find.

Returns the value associated with the key. Throws std::out_of_range if the key does not exist in the map.

This returns a non-const reference to the mapped object. The mapped object must be thread-safe itself in order to safely make any changes to it.

◆ at() [2/2]

template<class VALUE , template< class > class UPDATER>
const mapped_type& CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::at ( const key_type key) const

Look up an element in the map.

Parameters
keyThe element to find.

Returns the value associated with the key. Throws std::out_of_range if the key does not exist in the map.

◆ begin() [1/2]

template<class VALUE , template< class > class UPDATER>
iterator CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::begin ( )

Iterator at the start of the map.

The mapped objects must themselves be thread-safe in order to make any changes to them through the returned iterators.

◆ begin() [2/2]

template<class VALUE , template< class > class UPDATER>
const_iterator CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::begin ( ) const

Iterator at the start of the map.

◆ capacity()

template<class VALUE , template< class > class UPDATER>
size_t CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::capacity ( ) const

Return the current size (capacity) of the hash table.

◆ cbegin()

template<class VALUE , template< class > class UPDATER>
const_iterator CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::cbegin ( ) const

Iterator at the start of the map.

◆ cend()

template<class VALUE , template< class > class UPDATER>
const_iterator CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::cend ( ) const

Iterator at the end of the map.

◆ contains()

template<class VALUE , template< class > class UPDATER>
bool CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::contains ( const key_type key) const

Test if a key is in the container.

Parameters
keyThe key to test.

◆ count()

template<class VALUE , template< class > class UPDATER>
size_type CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::count ( const key_type key) const

Return the number of times a given key is in the container.

Parameters
keyThe key to test.

Returns either 0 or 1, depending on whether or not the key is in the map.

◆ emplace() [1/6]

template<class VALUE , template< class > class UPDATER>
std::pair<const_iterator, bool> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::emplace ( const key_type key,
const mapped_type val,
const Context_t ctx = Updater_t::defaultContext() 
)

Add an element to the map.

Parameters
keyThe key of the new item to add.
valThe value of the new item to add.
ctxExecution context.

This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.

◆ emplace() [2/6]

template<class VALUE , template< class > class UPDATER>
std::pair<const_iterator, bool> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::emplace ( const key_type key,
mapped_type &&  val,
const Context_t ctx = Updater_t::defaultContext() 
)

Add an element to the map.

Parameters
keyThe key of the new item to add.
valThe value of the new item to add.
ctxExecution context.

This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.

◆ emplace() [3/6]

template<class VALUE , template< class > class UPDATER>
std::pair<const_iterator, bool> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::emplace ( const key_type key,
std::unique_ptr< mapped_type val,
const Context_t ctx = Updater_t::defaultContext() 
)

Add an element to the map.

Parameters
keyThe key of the new item to add.
valThe value of the new item to add.
ctxExecution context.

This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.

◆ emplace() [4/6]

template<class VALUE , template< class > class UPDATER>
std::pair<const_iterator, bool> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::emplace ( key_type &&  key,
const mapped_type val,
const Context_t ctx = Updater_t::defaultContext() 
)

Add an element to the map.

Parameters
keyThe key of the new item to add.
valThe value of the new item to add.
ctxExecution context.

This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.

◆ emplace() [5/6]

template<class VALUE , template< class > class UPDATER>
std::pair<const_iterator, bool> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::emplace ( key_type &&  key,
mapped_type &&  val,
const Context_t ctx = Updater_t::defaultContext() 
)

Add an element to the map.

Parameters
keyThe key of the new item to add.
valThe value of the new item to add.
ctxExecution context.

This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.

◆ emplace() [6/6]

template<class VALUE , template< class > class UPDATER>
std::pair<const_iterator, bool> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::emplace ( key_type &&  key,
std::unique_ptr< mapped_type val,
const Context_t ctx = Updater_t::defaultContext() 
)

Add an element to the map.

Parameters
keyThe key of the new item to add.
valThe value of the new item to add.
ctxExecution context.

This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.

◆ empty()

template<class VALUE , template< class > class UPDATER>
bool CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::empty ( ) const

Test if the map is currently empty.

◆ end() [1/2]

template<class VALUE , template< class > class UPDATER>
iterator CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::end ( )

Iterator at the end of the map.

The mapped objects must themselves be thread-safe in order to make any changes to them through the returned iterators.

◆ end() [2/2]

template<class VALUE , template< class > class UPDATER>
const_iterator CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::end ( ) const

Iterator at the end of the map.

◆ equal_range() [1/2]

template<class VALUE , template< class > class UPDATER>
std::pair<iterator, iterator> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::equal_range ( const key_type key)

Return a range of iterators with entries matching key.

Parameters
keyThe element to find.

As keys are unique in this container, this is either a single-element range, or both iterators are equal to end().

The mapped objects must themselves be thread-safe in order to make any changes to them through the returned iterators.

◆ equal_range() [2/2]

template<class VALUE , template< class > class UPDATER>
std::pair<const_iterator, const_iterator> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::equal_range ( const key_type key) const

Return a range of iterators with entries matching key.

Parameters
keyThe element to find.

As keys are unique in this container, this is either a single-element range, or both iterators are equal to end().

◆ find() [1/2]

template<class VALUE , template< class > class UPDATER>
iterator CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::find ( const key_type key)

Look up an element in the map.

Parameters
keyThe element to find.

Returns either an iterator referencing the found element or end().

The mapped object must itself be thread-safe in order to make any changes to it through the returned iterator.

◆ find() [2/2]

template<class VALUE , template< class > class UPDATER>
const_iterator CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::find ( const key_type key) const

Look up an element in the map.

Parameters
keyThe element to find.

Returns either an iterator referencing the found element or end().

◆ get()

template<class VALUE , template< class > class UPDATER>
Impl_t::const_iterator CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::get ( const key_type key) const
private

Do a lookup in the table.

Parameters
keyThe key to look up.

Returns an iterator of the underlying map pointing at the found entry or end();

◆ insert() [1/3]

template<class VALUE , template< class > class UPDATER>
template<class PAIR >
std::pair<const_iterator, bool> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::insert ( const PAIR &  p,
const Context_t ctx = Updater_t::defaultContext() 
)

Add an element to the map.

Parameters
pThe item to add. Should be a pair where first is the string key and second is the integer value.
ctxExecution context.

This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.

◆ insert() [2/3]

template<class VALUE , template< class > class UPDATER>
template<class InputIterator >
void CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::insert ( InputIterator  first,
InputIterator  last,
const Context_t ctx = Updater_t::defaultContext() 
)

Insert a range of elements to the map.

Parameters
firstStart of the range.
lastEnd of the range.
ctxExecution context.

The range should be a sequence of pairs where first is the string key and second is the integer value.

◆ insert() [3/3]

template<class VALUE , template< class > class UPDATER>
template<class PAIR >
std::pair<const_iterator, bool> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::insert ( PAIR &&  p,
const Context_t ctx = Updater_t::defaultContext() 
)

Add an element to the map.

Parameters
pThe item to add. Should be a pair where first is the string key and second is the integer value.
ctxExecution context.

This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.

◆ keyAsString()

template<class VALUE , template< class > class UPDATER>
static const std::string* CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::keyAsString ( val_t  val)
staticprivate

Convert an underlying key value to a string pointer.

Parameters
valThe underlying key value.

◆ keyAsVal()

template<class VALUE , template< class > class UPDATER>
static val_t CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::keyAsVal ( const std::string *  s)
staticprivate

Convert a string pointer to an underlying key value.

Parameters
sThe string pointer.

◆ mappedAsMapped()

template<class VALUE , template< class > class UPDATER>
static mapped_type* CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::mappedAsMapped ( val_t  val)
staticprivate

Convert an underlying mapped value a pointer to this type's mapped value.

Parameters
valThe underlying mapped value.

◆ mappedAsVal()

template<class VALUE , template< class > class UPDATER>
static val_t CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::mappedAsVal ( mapped_type val)
staticprivate

Convert this type's mapped value to an underlying mapped value.

Parameters
valThe mapped value.

◆ operator=() [1/2]

template<class VALUE , template< class > class UPDATER>
ConcurrentStrToValMap& CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::operator= ( ConcurrentStrToValMap< VALUE, UPDATER > &&  other)
delete

◆ operator=() [2/2]

template<class VALUE , template< class > class UPDATER>
ConcurrentStrToValMap& CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::operator= ( const ConcurrentStrToValMap< VALUE, UPDATER > &  other)
delete

◆ put()

template<class VALUE , template< class > class UPDATER>
std::pair<const_iterator, bool> CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::put ( std::unique_ptr< key_type key,
std::unique_ptr< mapped_type val,
const Context_t ctx = Updater_t::defaultContext() 
)
private

Insert an entry in the table.

Parameters
keyThe key of the new item to add.
valThe new mapped value to add.
ctxExecution context.

The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.

◆ quiescent()

template<class VALUE , template< class > class UPDATER>
void CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::quiescent ( const Context_t ctx)

Called when this thread is no longer referencing anything from this container.

Parameters
ctxExecution context.

◆ range() [1/2]

template<class VALUE , template< class > class UPDATER>
iterator_range CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::range ( )

Return an iterator range covering the entire map.

The mapped objects must themselves be thread-safe in order to make any changes to them through the returned iterators.

◆ range() [2/2]

template<class VALUE , template< class > class UPDATER>
const_iterator_range CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::range ( ) const

Return an iterator range covering the entire map.

◆ rehash()

template<class VALUE , template< class > class UPDATER>
void CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::rehash ( size_type  capacity)

Increase the table capacity.

Parameters
capacityThe new table capacity.

No action will be taken if capacity is smaller than the current capacity.

◆ reserve()

template<class VALUE , template< class > class UPDATER>
void CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::reserve ( size_type  capacity,
const Context_t ctx = Updater_t::defaultContext() 
)

Increase the table capacity.

Parameters
capacityThe new table capacity.
ctxExecution context.

No action will be taken if capacity is smaller than the current capacity.

◆ size()

template<class VALUE , template< class > class UPDATER>
size_type CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::size ( ) const

Return the number of items currently in the map.

◆ swap()

template<class VALUE , template< class > class UPDATER>
void CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::swap ( ConcurrentStrToValMap< VALUE, UPDATER > &  other)

Swap this container with another.

Parameters
otherThe container with which to swap.

This will also call swap on the Updater object; hence, the Updater object must also support swap.

This operation is NOT thread-safe. No other threads may be accessing either container during this operation.

◆ updater()

template<class VALUE , template< class > class UPDATER>
Updater_t& CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::updater ( )

Access the Updater instance.

Member Data Documentation

◆ m_impl

template<class VALUE , template< class > class UPDATER>
Impl_t CxxUtils::ConcurrentStrToValMap< VALUE, UPDATER >::m_impl
private

The underlying hash table.

Definition at line 787 of file ConcurrentStrToValMap.h.


The documentation for this class was generated from the following file:
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210