ConstCacheObjectPtr Cache::_load( ConstCacheObjectPtr obj ) { if( obj->getId() == INVALID_CACHE_ID ) return ConstCacheObjectPtr(); return _impl->load( obj ); }
ConstCacheObjectPtr load( ConstCacheObjectPtr obj ) { WriteLock writeLock( _mutex ); const CacheId& cacheId = obj->getId(); ConstCacheMap::const_iterator it = _cacheMap.find( cacheId ); if( it != _cacheMap.end( )) return it->second; _cacheMap[ cacheId ] = obj; _statistics.notifyMiss(); _statistics.notifyLoaded( *obj ); _policy.insert( cacheId ); applyPolicy(); return obj; }