MPQC
3.0.0-alpha
|
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_type > | future_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_ |
using sc::ConcurrentCacheBase< ValueType, key_types >::tuple_type = boost::tuple<Types...> |
types for keys
tuple type alias (may use std::tuple in the future)
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