/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
bool PropertyNamesCache::getCachedPropertyNames( const OUString& rURL, PropertyNames& rCacheElement )
{ // search the URL in the static map
std::unique_lock aGuard( m_aMutex );
PropNameCache::const_iterator it;
it = m_aTheCache.find( rURL ); if ( it == m_aTheCache.end() ) returnfalse; else
{ // check if the element is stale, before restoring
TimeValue t1;
osl_getSystemTime( &t1 ); if ( (*it).second.getStaleTime() < t1.Seconds )
{ // if stale, remove from cache, do not restore
m_aTheCache.erase( it ); returnfalse; // return false instead
}
rCacheElement = (*it).second; returntrue;
}
}
void PropertyNamesCache::removeCachedPropertyNames( const OUString& rURL )
{
std::unique_lock aGuard( m_aMutex );
PropNameCache::const_iterator it;
it = m_aTheCache.find( rURL ); if ( it != m_aTheCache.end() )
{
m_aTheCache.erase( it );
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.