|
occ
|
Somewhere to keep expensive intermediate results (monomer energies, wavefunctions, solvation surfaces) as JSON documents, so a repeat calculation can skip them. More...
#include <json_cache.h>
Public Member Functions | |
| virtual | ~JsonCache ()=default |
| virtual std::optional< nlohmann::json > | load (const std::string &key) const =0 |
The document stored under key, or nothing if there is none. | |
| virtual void | store (const std::string &key, const nlohmann::json &doc)=0 |
| virtual std::string | location (const std::string &key) const =0 |
Where key lives, for log messages: "file <key>" or "memory [<key>]". | |
Somewhere to keep expensive intermediate results (monomer energies, wavefunctions, solvation surfaces) as JSON documents, so a repeat calculation can skip them.
A key names one document. The file backend uses it as the path, so the keys are the cache filenames the calculations have always written; the memory backend only needs them to be distinct. Checking that a cached document still matches the calculation (model, level of theory, ...) is the caller's job: the cache just stores what it is given.
|
virtualdefault |
|
pure virtual |
The document stored under key, or nothing if there is none.
A document that exists but cannot be parsed is an error, not a miss.
Implemented in occ::io::FileJsonCache, and occ::io::MemoryJsonCache.
|
pure virtual |
Where key lives, for log messages: "file <key>" or "memory [<key>]".
Implemented in occ::io::FileJsonCache, and occ::io::MemoryJsonCache.
|
pure virtual |
Implemented in occ::io::FileJsonCache, and occ::io::MemoryJsonCache.