|
MADNESS 0.10.1
|
Distributed caching utility. More...
#include <dist_cache.h>

Classes | |
| class | Cache |
| Cache interface class. More... | |
| class | CacheData |
| Cache value container. More... | |
Static Public Member Functions | |
| template<typename valueT> | |
| static madness::Future< valueT > | get_cache_value (const keyT &key) |
Get the cache value accosted with key. | |
| template<typename valueT> | |
| static void | get_cache_value (const keyT &key, madness::Future< valueT > &value) |
Get the cache value accosted with key. | |
| template<typename valueT> | |
| static void | set_cache_value (const keyT &key, const valueT &value) |
Set the cache value accosted with key. | |
Private Types | |
| typedef madness::ConcurrentHashMap< keyT, Cache * > | cache_container |
| The container that holds cache values. | |
| typedef cache_container::datumT | datum_type |
| Cache container datum type. | |
Static Private Attributes | |
| static cache_container | caches_ |
| Cache container. | |
Distributed caching utility.
This object implements a local, key-value caching mechanism that can be used by remote tasks or active messages to move data between processes without synchronization. Because cache values are retrieved via a Future, you can get or set the cache in any order. The first call get_cache_value or set_cache_value or will insert the cache element, and the second call to these functions will remove it. Therefore, set_cache_value and get_cache_value can only be called once each per cache value.
| keyT | The key type of the cache |
|
private |
The container that holds cache values.
|
private |
Cache container datum type.
|
inlinestatic |
Get the cache value accosted with key.
This will get the value associated with key to value. If the cache element does not exist, it is inserted into the cache. Otherwise, it is removed from the cache.
| valueT | The object type that will be used to set the cache |
| [in] | key | The key associated with value |
Future that holds/will hold the cache value, which will be set by a call to set_cache_value. References madness::cache, caches_, madness::Future< void >::value, and madness::Hash_private::HashAccessor< hashT, lockmode >::release().
|
inlinestatic |
Get the cache value accosted with key.
This will get the value associated with key to value. The value is given in the form of a Future, which is set by a call to set_cache_value. If the cache element does not exist, it is inserted into the cache. Otherwise, it is removed from the cache.
| valueT | The object type that will be used to set the cache |
| [in] | key | The key associated with value |
| [out] | value | The data that will be cached |
References madness::cache, caches_, madness::Future< void >::value, and madness::Hash_private::HashAccessor< hashT, lockmode >::release().
Referenced by madness::WorldGopInterface::bcast_internal(), and madness::WorldGopInterface::bcast_internal().
|
inlinestatic |
Set the cache value accosted with key.
This will set the value associated with key to value. If the cache element does not exist, it is inserted into the cache. Otherwise, it is removed from the cache.
| valueT | The object type that will be used to set the cache (may be a madness::Future type). |
| key | The key associated with value |
| value | The data that will be cached |
References madness::cache, caches_, madness::f, madness::Future< void >::value, MADNESS_ASSERT, and madness::Hash_private::HashAccessor< hashT, lockmode >::release().
Referenced by madness::WorldGopInterface::bcast_task(), and madness::WorldGopInterface::group_bcast_task().
|
staticprivate |
Cache container.
Referenced by get_cache_value(), get_cache_value(), and set_cache_value().