18 std::unordered_map<Region, RegionCache, RegionHash>
m_cache;
21 size_t m_current_size = 0;
22 bool m_initialized =
false;
25 void evict_lru_if_needed();
26 std::optional<RegionCache> get_cached_region_internal(
const Region& region);
27 void update_lru(
const Region& region);
50 std::optional<RegionCache> get_cached_region(
const Region& region);
51 std::optional<RegionCache> get_cached_segment(
const RegionSegment& segment);
52 std::optional<RegionSegment> get_segment_with_cache(
const RegionSegment& segment);
55 size_t max_size()
const;
~RegionCacheManager()=default
RegionCacheManager(RegionCacheManager &&) noexcept=delete
RegionCacheManager(const RegionCacheManager &)=delete
RegionCacheManager & operator=(const RegionCacheManager &)=delete
std::recursive_mutex m_mutex
std::list< Region > m_lru_list
std::unordered_map< Region, RegionCache, RegionHash > m_cache
bool is_initialized() const
Check if the cache manager is initialized.
Manages caching of region data for efficient access and eviction.
Stores cached data for a region, with metadata for cache management.
std::size_t operator()(const Region ®ion) const
Represents a discrete segment of audio data with caching capabilities.
Represents a point or span in N-dimensional space.