MADNESS 0.10.1
|
Simplified interface around hash_map to cache stuff for 1D. More...
#include <simplecache.h>
Public Member Functions | |
SimpleCache () | |
SimpleCache (const SimpleCache &c) | |
const Q * | getptr (const Key< NDIM > &key) const |
If key is present return pointer to cached value, otherwise return NULL. | |
const Q * | getptr (Level n, const Key< NDIM > &disp) const |
If key=(n,l) is present return pointer to cached value, otherwise return NULL. | |
const Q * | getptr (Level n, Translation l) const |
If key=(n,l) is present return pointer to cached value, otherwise return NULL. | |
SimpleCache & | operator= (const SimpleCache &c) |
void | set (const Key< NDIM > &key, const Q &val) |
Set value associated with key ... gives ownership of a new copy to the container. | |
void | set (Level n, const Key< NDIM > &disp, const Q &val) |
void | set (Level n, Translation l, const Q &val) |
Private Types | |
typedef ConcurrentHashMap< Key< NDIM >, Q > | mapT |
typedef std::pair< Key< NDIM >, Q > | pairT |
Private Attributes | |
mapT | cache |
Simplified interface around hash_map to cache stuff for 1D.
This is a write once cache — subsequent writes of elements have no effect (so that pointers/references to cached data cannot be invalidated)
|
private |
|
private |
|
inline |
|
inline |
|
inline |
If key is present return pointer to cached value, otherwise return NULL.
References madness::SimpleCache< Q, NDIM >::cache, madness::ConcurrentHashMap< keyT, valueT, hashfunT >::end(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::find(), and test().
Referenced by madness::SimpleCache< Q, NDIM >::getptr(), and madness::SimpleCache< Q, NDIM >::getptr().
|
inline |
If key=(n,l) is present return pointer to cached value, otherwise return NULL.
This for the convenience (backward compatibility) of 1D routines
References madness::SimpleCache< Q, NDIM >::getptr(), and madness::Key< NDIM >::translation().
|
inline |
If key=(n,l) is present return pointer to cached value, otherwise return NULL.
This for the convenience (backward compatibility) of 1D routines
References madness::SimpleCache< Q, NDIM >::getptr().
|
inline |
|
inline |
Set value associated with key ... gives ownership of a new copy to the container.
References madness::SimpleCache< Q, NDIM >::cache, and madness::ConcurrentHashMap< keyT, valueT, hashfunT >::insert().
Referenced by madness::SimpleCache< Q, NDIM >::set(), and madness::SimpleCache< Q, NDIM >::set().
|
inline |
References madness::SimpleCache< Q, NDIM >::set().
|
private |