Atlas Game Manager
A game manager for f95 and dlsite written in c++
Loading...
Searching...
No Matches
atlas::cache::ImageCache Class Reference

#include <ImageCache.hpp>

Classes

struct  PixmapItem
 

Public Member Functions

void prune ()
 Prunes the cache. Removing the lowest scores first. Determined via ImageCache::score()
 
void insert (const std::string &key, const QPixmap &pixmap)
 Inserts a pixmap into the cache.
 
std::optional< QPixmap > find (std::string key)
 

Private Attributes

std::recursive_mutex mtx {}
 
std::multimap< std::string, PixmapItemcache {}
 
std::uint64_t max_size { 1024 * 1024 * 128 }
 
std::uint64_t current_size { 0 }
 

Member Function Documentation

◆ find()

std::optional< QPixmap > atlas::cache::ImageCache::find ( std::string key)

◆ insert()

void atlas::cache::ImageCache::insert ( const std::string & key,
const QPixmap & pixmap )

Inserts a pixmap into the cache.

◆ prune()

void atlas::cache::ImageCache::prune ( )

Prunes the cache. Removing the lowest scores first. Determined via ImageCache::score()

Member Data Documentation

◆ cache

std::multimap< std::string, PixmapItem > atlas::cache::ImageCache::cache {}
private

◆ current_size

std::uint64_t atlas::cache::ImageCache::current_size { 0 }
private

◆ max_size

std::uint64_t atlas::cache::ImageCache::max_size { 1024 * 1024 * 128 }
private

◆ mtx

std::recursive_mutex atlas::cache::ImageCache::mtx {}
private

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