Abstract superclass of cache for VirtualArray, defining the interface. More...
#include <ArrayCache.h>
Public Member Functions | |
virtual ContentPtr | get (const std::string &key) const =0 |
Attempts to get an array; may be nullptr if not available. More... | |
virtual void | set (const std::string &key, const ContentPtr &value)=0 |
Writes or overwrites an array at key . More... | |
virtual bool | is_broken () const =0 |
Returns true if the cache cannot be used for any reason. More... | |
virtual const std::string | tostring_part (const std::string &indent, const std::string &pre, const std::string &post) const =0 |
Static Public Member Functions | |
static const std::string | newkey () |
Returns a new key that is globally unique in the current process. More... | |
Abstract superclass of cache for VirtualArray, defining the interface.
The main implementation, PyArrayCache, is passed through pybind11 to Python to work with cachetools and MutableMapping, but in principle, pure C++ caches could be written.
|
pure virtual |
Attempts to get an array; may be nullptr
if not available.
Implemented in PyArrayCache.
|
pure virtual |
Returns true if the cache cannot be used for any reason.
Implemented in PyArrayCache.
|
static |
Returns a new key that is globally unique in the current process.
If process-independent keys are needed, they can be bound to VirtualArrays by explicitly setting the VirtualArray::cache_key
.
|
pure virtual |
Writes or overwrites an array at key
.
Implemented in PyArrayCache.
|
pure virtual |
Implemented in PyArrayCache.