79 std::shared_ptr<const std::vector<uint8_t>> bytes;
80 std::string mime_type;
85 std::size_t byte_size{0};
102 void stage(uint64_t content_hash, QImage image);
104 uint64_t content_hash, std::shared_ptr<
const std::vector<uint8_t>> bytes,
105 std::string mime_type = {});
109 std::shared_ptr<const DecodedAsset> acquire(uint64_t content_hash);
116 std::shared_ptr<const DecodedAsset> peek(uint64_t content_hash)
const;
120 void release(uint64_t content_hash);
126 std::size_t trim(std::size_t max_bytes_budget);
138 float utilization,
float high_watermark = 0.80f,
139 float target = 0.60f);
142 std::size_t size() const noexcept;
144 std::
size_t totalBytes() const noexcept;
146 std::
size_t coldCount() const noexcept;
153 using LruList =
std::list<uint64_t>;
157 std::shared_ptr<DecodedAsset> asset;
158 LruList::iterator lru_it;
162 void evictOne() noexcept;
164 mutable
std::mutex m_mutex;
165 ossia::hash_map<uint64_t, Slot> m_entries;
167 std::
size_t m_total_bytes{0};
168 std::size_t m_cold_bytes{0};