Bridges-C++  3.4.4
Bridges(C++ API)
Public Member Functions | List of all members
bridges::SimpleCache Class Reference

#include <Cache.h>

Inheritance diagram for bridges::SimpleCache:
bridges::Cache

Detailed Description

object managing a disk cache for which ever purpose needed.

This object is not meant to be used directly by the end-user (student or instructor) but rather to be used internally for caching purposes.

The cache is created according to XDG ( https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html ) that it is to it is created in $XDG_CACHE_HOME/bridges_data/cxx/ if XDG_CACHE_HOME is defined or $HOME/.cache/bridges_data/cxx/ otherwise. On windows it is created in $LOCALAPPDATA/.cache/bridges_data/cxx/ .

You can force a different cache location by setting $FORCE_BRIDGES_CACHEDIR .

Public Member Functions

 SimpleCache ()
 
virtual ~SimpleCache ()=default
 
virtual bool inCache (const std::string &docName) noexcept(false) override
 
virtual std::string getDoc (const std::string &docName) noexcept(false) override
 
virtual void putDoc (const std::string &docName, const std::string &content) noexcept(false) override
 
bool evict (const std::string &docName)
 evicts a document from the cache More...
 

Constructor & Destructor Documentation

◆ SimpleCache()

bridges::SimpleCache::SimpleCache ( )
inline

◆ ~SimpleCache()

virtual bridges::SimpleCache::~SimpleCache ( )
virtualdefault

Member Function Documentation

◆ evict()

bool bridges::SimpleCache::evict ( const std::string &  docName)
inline

evicts a document from the cache

Parameters
docNamedocument to evict
Returns
true on success

◆ getDoc()

virtual std::string bridges::SimpleCache::getDoc ( const std::string &  docName)
inlineoverridevirtualnoexcept

Implements bridges::Cache.

◆ inCache()

virtual bool bridges::SimpleCache::inCache ( const std::string &  docName)
inlineoverridevirtualnoexcept

Implements bridges::Cache.

◆ putDoc()

virtual void bridges::SimpleCache::putDoc ( const std::string &  docName,
const std::string &  content 
)
inlineoverridevirtualnoexcept

Implements bridges::Cache.


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