MayaFlux 0.4.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 51 of file RegionCacheManager.cpp.

52{
53 if (!m_initialized) {
54 return std::nullopt;
55 }
56
57 try {
58 std::lock_guard<std::recursive_mutex> lock(m_mutex, std::adopt_lock);
59
60 auto it = m_cache.find(region);
61 if (it != m_cache.end()) {
62 update_lru(region);
63 it->second.mark_accessed();
64 return it->second;
65 }
66 return std::nullopt;
67 } catch (const std::exception& e) {
68 MF_ERROR(Journal::Component::Kakshya, Journal::Context::Runtime, "Exception in get_cached_region: {}", e.what());
69 return std::nullopt;
70 } catch (...) {
71 MF_ERROR(Journal::Component::Kakshya, Journal::Context::Runtime, "Unknown exception in get_cached_region");
72 return std::nullopt;
73 }
74}
#define MF_ERROR(comp, ctx,...)
std::unordered_map< Region, RegionCache, RegionHash > m_cache
@ Runtime
General runtime operations (default fallback)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References MayaFlux::Journal::Kakshya, m_cache, m_initialized, m_mutex, MF_ERROR, MayaFlux::Journal::Runtime, 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: