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.