MPQC
3.0.0-alpha
|
A cache of objects that can be safely accessed concurrently by threads that share memory. More...
#include <util/container/conc_cache.h>
Public Types | |
typedef ConcurrentCacheBase< val_type, key_types... > | super_t |
Public Types inherited from sc::ConcurrentCacheBase< val_type, key_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 val_type | 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 | |
super_t::value_type | get_or_permute (key_types... keys, const std::function< typename super_t::value_type(const typename super_t::key_tuple &)> &compute_fxn, const std::function< typename super_t::value_type(const typename super_t::value_type &, const typename super_t::key_tuple &)> &permute_fxn) |
Public Member Functions inherited from sc::ConcurrentCacheBase< val_type, key_types... > | |
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 () |
Additional Inherited Members | |
Protected Attributes inherited from sc::ConcurrentCacheBase< val_type, key_types... > | |
future_map | cached_values_ |
A cache of objects that can be safely accessed concurrently by threads that share memory.
Some cached objects may be transformable into objects corresponding to other keys via a transformation.