mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #781, use admit in database reader
* added amit functions in readers * cacheHasChanged functions (needed because data of caches are loaded in background) * pinned small caches * CDatabaseReader::readInBackgroundThread uses admitCaches now
This commit is contained in:
@@ -181,17 +181,17 @@ namespace BlackCore
|
||||
|
||||
void CIcaoDataReader::ps_aircraftIcaoCacheChanged()
|
||||
{
|
||||
// void
|
||||
this->cacheHasChanged(CEntityFlags::AircraftIcaoEntity);
|
||||
}
|
||||
|
||||
void CIcaoDataReader::ps_airlineIcaoCacheChanged()
|
||||
{
|
||||
// void
|
||||
this->cacheHasChanged(CEntityFlags::AirlineIcaoEntity);
|
||||
}
|
||||
|
||||
void CIcaoDataReader::ps_countryCacheChanged()
|
||||
{
|
||||
// void
|
||||
this->cacheHasChanged(CEntityFlags::CountryEntity);
|
||||
}
|
||||
|
||||
void CIcaoDataReader::ps_baseUrlCacheChanged()
|
||||
@@ -400,6 +400,13 @@ namespace BlackCore
|
||||
if (entities.testFlag(CEntityFlags::CountryEntity)) { this->m_countryCache.synchronize(); }
|
||||
}
|
||||
|
||||
void CIcaoDataReader::admitCaches(CEntityFlags::Entity entities)
|
||||
{
|
||||
if (entities.testFlag(CEntityFlags::AircraftIcaoEntity)) { this->m_aircraftIcaoCache.admit(); }
|
||||
if (entities.testFlag(CEntityFlags::AirlineIcaoEntity)) { this->m_airlineIcaoCache.admit(); }
|
||||
if (entities.testFlag(CEntityFlags::CountryEntity)) { this->m_countryCache.admit(); }
|
||||
}
|
||||
|
||||
void CIcaoDataReader::invalidateCaches(CEntityFlags::Entity entities)
|
||||
{
|
||||
if (entities.testFlag(CEntityFlags::AircraftIcaoEntity)) { CDataCache::instance()->clearAllValues(this->m_aircraftIcaoCache.getKey()); }
|
||||
|
||||
Reference in New Issue
Block a user