MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_cached_region()

std::optional< RegionCache > MayaFlux::Kakshya::RegionCacheManager::get_cached_region ( const Region region)

Definition at line 49 of file RegionCacheManager.cpp.

50{
51 if (!m_initialized) {
52 return std::nullopt;
53 }
54
55 try {
56 std::lock_guard<std::recursive_mutex> lock(m_mutex, std::adopt_lock);
57
58 auto it = m_cache.find(region);
59 if (it != m_cache.end()) {
60 update_lru(region);
61 it->second.mark_accessed();
62 return it->second;
63 }
64 return std::nullopt;
65 } catch (const std::exception& e) {
66 std::cerr << "Exception in get_cached_region: " << e.what() << '\n';
67 return std::nullopt;
68 } catch (...) {
69 std::cerr << "Unknown exception in get_cached_region" << '\n';
70 return std::nullopt;
71 }
72}
std::unordered_map< Region, RegionCache, RegionHash > m_cache

References m_cache, m_initialized, m_mutex, and update_lru().

Referenced by get_segment_with_cache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: