File cache.
More...
#include <cache.hpp>
|
| | Cache ()=default |
| | create instance.
|
| |
| | Cache (const Cache &other)=delete |
| | create instance by copy.
|
| |
| Cache & | operator= (const Cache &other)=delete |
| | assign instance by copy.
|
| |
| | Cache (Cache &&other)=delete |
| | create instance by move.
|
| |
| Cache & | operator= (Cache &&other)=delete |
| | assign instance by move.
|
| |
| | ~Cache () |
| | destroy instance.
|
| |
| void * | get (const std::string &fileName, struct stat &sbuf) |
| | get or create the cache entry for the given file.
|
| |
| void | remove (const std::string &fileName) |
| | remove a cached entry identified by the given file name.
|
| |
| void | clear () |
| | clear all cached entries.
|
| |
| size_t | size () |
| | get number of cache entries.
|
| |
◆ Cache() [1/3]
◆ Cache() [2/3]
| join::Cache::Cache |
( |
const Cache & | other | ) |
|
|
delete |
create instance by copy.
- Parameters
-
◆ Cache() [3/3]
| join::Cache::Cache |
( |
Cache && | other | ) |
|
|
delete |
create instance by move.
- Parameters
-
◆ ~Cache()
◆ clear()
clear all cached entries.
◆ get()
| void * Cache::get |
( |
const std::string & | fileName, |
|
|
struct stat & | sbuf ) |
get or create the cache entry for the given file.
- Parameters
-
| fileName | path of the file that we want to get cache. |
| sbuf | file stat. |
- Returns
- a pointer to the buffer where the cached file is saved.
◆ operator=() [1/2]
assign instance by move.
- Parameters
-
- Returns
- a reference of the current object.
◆ operator=() [2/2]
| Cache & join::Cache::operator= |
( |
const Cache & | other | ) |
|
|
delete |
assign instance by copy.
- Parameters
-
- Returns
- a reference of the current object.
◆ remove()
| void Cache::remove |
( |
const std::string & | fileName | ) |
|
remove a cached entry identified by the given file name.
- Parameters
-
| fileName | path of the file that we want to remove cache entry. |
◆ size()
get number of cache entries.
◆ _entries
| std::map<std::string, std::unique_ptr <CacheEntry> > join::Cache::_entries |
|
protected |
◆ _mutex
| Mutex join::Cache::_mutex |
|
protected |
protection mutex for the cache map.
The documentation for this class was generated from the following files: