void CacheManager::invalidateAll() { HandleSet workset; workset.swap(_validHandles); for (HandleSet::iterator itr = workset.begin(), end = workset.end(); itr != end; ++itr) { CacheHandle* handle = *itr; handle->invalidate(); } workset.clear(); _wiredCount = 0; _wiredFootprint = 0; _activeCount = 0; _activeFootprint = 0; _inactiveCount = 0; _inactiveFootprint = 0; }
// avoid loops by passing history of objects traversed via handles argument void StorageBase::SetColorRecursive(ObjectColor::Color color, HandleSet& handles) { Handle handle = GetHandle(); if (handles.find(handle) != handles.end()) return; handles.insert(handle); if (!SetColor(color)) return; GetClass()->SetReferencedObjectsColor(*this, color, handles); if (dictionary.empty()) return; for (Dictionary::value_type const &child : dictionary) { StorageBase *sub = GetRegistry()->GetStorageBase(child.second.GetHandle()); if (!sub) continue; sub->SetColorRecursive(color, handles); } }