Loading...
Searching...
No Matches
ArrayCache Class Referenceabstract

Abstract superclass of cache for VirtualArray, defining the interface. More...

#include <ArrayCache.h>

Inheritance diagram for ArrayCache:
PyArrayCache

Public Member Functions

virtual ContentPtr get (const std::string &key) const =0
 Attempts to get an array; may be nullptr if not available.
 
virtual void set (const std::string &key, const ContentPtr &value)=0
 Writes or overwrites an array at key.
 
virtual bool is_broken () const =0
 Returns true if the cache cannot be used for any reason.
 
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.
 

Detailed Description

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.

Member Function Documentation

◆ get()

virtual ContentPtr get ( const std::string &  key) const
pure virtual

Attempts to get an array; may be nullptr if not available.

Implemented in PyArrayCache.

◆ is_broken()

virtual bool is_broken ( ) const
pure virtual

Returns true if the cache cannot be used for any reason.

Implemented in PyArrayCache.

◆ newkey()

static const std::string newkey ( )
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.

◆ set()

virtual void set ( const std::string &  key,
const ContentPtr value 
)
pure virtual

Writes or overwrites an array at key.

Implemented in PyArrayCache.

◆ tostring_part()

virtual const std::string tostring_part ( const std::string &  indent,
const std::string &  pre,
const std::string &  post 
) const
pure virtual

Implemented in PyArrayCache.


The documentation for this class was generated from the following file: