refs #649, skip reading of info objects if only caches are used and emit signals when syncronized from cache

(applied after 1st performance fix for cache was ready)
* utility functions to detect if only caches are used
* renamed some functions
* renamed some db flags and added new ones
This commit is contained in:
Klaus Basan
2016-06-05 15:52:44 +02:00
parent c31145b3a0
commit f02bf0ac0a
16 changed files with 159 additions and 89 deletions

View File

@@ -16,42 +16,43 @@ namespace BlackCore
CWebReaderFlags::WebReader CWebReaderFlags::entityToReader(CEntityFlags::Entity entity)
{
WebReader f = None;
if (entity.testFlag(CEntityFlags::AircraftIcaoEntity) ||
entity.testFlag(CEntityFlags::AirlineIcaoEntity) ||
entity.testFlag(CEntityFlags::CountryEntity))
if (entity.testFlag(CEntityFlags::AircraftIcaoEntity) || entity.testFlag(CEntityFlags::AirlineIcaoEntity) || entity.testFlag(CEntityFlags::CountryEntity))
{
f |= IcaoDataReader;
}
if (entity.testFlag(CEntityFlags::ModelEntity) ||
entity.testFlag(CEntityFlags::DistributorEntity) ||
entity.testFlag(CEntityFlags::LiveryEntity))
if (entity.testFlag(CEntityFlags::ModelEntity) || entity.testFlag(CEntityFlags::DistributorEntity) || entity.testFlag(CEntityFlags::LiveryEntity))
{
f |= ModelReader;
}
if (entity.testFlag(CEntityFlags::InfoObjectEntity))
{
f |= InfoDataReader;
}
if (entity.testFlag(CEntityFlags::InfoObjectEntity)) { f |= InfoDataReader; }
if (entity.testFlag(CEntityFlags::BookingEntity)) { f |= VatsimBookingReader; }
if (entity.testFlag(CEntityFlags::VatsimDataFile)) { f |= VatsimDataReader; }
if (entity.testFlag(CEntityFlags::VatsimStatusFile)) { f |= VatsimStatusReader; }
if (entity.testFlag(CEntityFlags::MetarEntity)) { f |= VatsimMetarReader; }
if (entity.testFlag(CEntityFlags::BookingEntity))
{
f |= VatsimBookingReader;
}
if (entity.testFlag(CEntityFlags::VatsimDataFile))
{
f |= VatsimDataReader;
}
if (entity.testFlag(CEntityFlags::MetarEntity))
{
f |= VatsimMetarReader;
}
return f;
}
CWebReaderFlags::WebReader CWebReaderFlags::webReaderFlagToWebReader(CWebReaderFlags::WebReaderFlag flag)
{
return static_cast<WebReader>(flag);
}
CEntityFlags::Entity CWebReaderFlags::allEntitiesForReaders(WebReader readers)
{
CEntityFlags::Entity entities = CEntityFlags::NoEntity;
if (readers.testFlag(IcaoDataReader)) { entities |= CEntityFlags::AllIcaoAndCountries; }
if (readers.testFlag(ModelReader)) { entities |= CEntityFlags::DistributorLiveryModel; }
if (readers.testFlag(InfoDataReader)) { entities |= CEntityFlags::InfoObjectEntity; }
if (readers.testFlag(VatsimBookingReader)) { entities |= CEntityFlags::BookingEntity; }
if (readers.testFlag(VatsimMetarReader)) { entities |= CEntityFlags::MetarEntity; }
if (readers.testFlag(VatsimDataReader)) { entities |= CEntityFlags::VatsimDataFile; }
if (readers.testFlag(VatsimStatusReader)) { entities |= CEntityFlags::VatsimStatusFile; }
return entities;
}
bool CWebReaderFlags::isFromSwiftDb(BlackMisc::Network::CEntityFlags::Entity entity)
{
return isFromSwiftDb(entityToReader(entity));