MPQC  3.0.0-alpha
sc::ConcurrentCacheBase< ValueType, key_types > Class Template Reference

Public Types

template<typename... Types>
using tuple_type = boost::tuple< Types... >
 types for keys More...
 
typedef tuple_type< key_types... > key_tuple
 The type used as a key into the map.
 
typedef ValueType value_type
 types for map of values More...
 
typedef boost::shared_future< value_typefuture_value
 A future of a value, used to prevent recomputation.
 
typedef madness::ConcurrentHashMap< key_tuple, future_value, _hash< key_tuple > > future_map
 A map from keys to futures.
 
typedef future_map::accessor future_map_accessor
 The accessor type used by the madness ConcurrentHashMap.
 
typedef future_map::const_accessor future_map_const_accessor
 The const accessor used by the madness ConcurrentHashMap.
 

Public Member Functions

 ConcurrentCacheBase (int nbins)
 
value_type get (key_types... keys, const std::function< value_type()> &compute_fxn)
 
value_type get (key_types... keys, const std::function< value_type(const key_tuple &)> &compute_fxn)
 
void clear ()
 

Protected Attributes

future_map cached_values_
 

Member Typedef Documentation

◆ tuple_type

template<typename ValueType, typename... key_types>
template<typename... Types>
using sc::ConcurrentCacheBase< ValueType, key_types >::tuple_type = boost::tuple<Types...>

types for keys

tuple type alias (may use std::tuple in the future)

◆ value_type

template<typename ValueType, typename... key_types>
typedef ValueType sc::ConcurrentCacheBase< ValueType, key_types >::value_type

types for map of values

The type of the cached value; returned by the get() functions


The documentation for this class was generated from the following file:

Generated at Sun Jan 26 2020 23:24:04 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.