use re_entity_db::EntityDb;
use re_log_types::{ApplicationId, StoreId};
use crate::{Cache, StoreCache};
pub struct ActiveStoreContext<'a> {
pub blueprint: &'a EntityDb,
pub default_blueprint: Option<&'a EntityDb>,
pub recording: &'a EntityDb,
pub caches: &'a StoreCache,
pub should_enable_heuristics: bool,
}
impl ActiveStoreContext<'_> {
pub fn is_active(&self, store_id: &StoreId) -> bool {
self.recording.store_id() == store_id || self.blueprint.store_id() == store_id
}
pub fn application_id(&self) -> &ApplicationId {
self.recording.application_id()
}
pub fn recording_store_id(&self) -> &StoreId {
self.recording.store_id()
}
pub fn memoizer<C: Cache + Default, R>(&self, f: impl FnOnce(&mut C) -> R) -> R {
self.caches.memoizer(f)
}
}