コード例 #1
0
    ConstCacheObjectPtr getFromMap( const CacheId& cacheId ) const
    {
        ReadLock readLock( _mutex );
        ConstCacheMap::const_iterator it = _cacheMap.find( cacheId );
        if( it == _cacheMap.end( ))
            return CacheObjectPtr();

        return it->second;
    }
コード例 #2
0
ファイル: Cache.cpp プロジェクト: hernando/Livre
CacheObjectPtr Cache::getObjectFromCache_( const CacheId cacheObjectID ) const
{
    ReadLock readLock( mutex_ );
    CacheMap::const_iterator it = cacheMap_.find( cacheObjectID );

    if( it == cacheMap_.end() )
        return CacheObjectPtr();

    LBASSERT( it->second->commonInfoPtr_ );

    return it->second;
}