6#ifndef SWIFT_CORE_MODELDATAREADER_H
7#define SWIFT_CORE_MODELDATAREADER_H
140 swift::misc::network::CEntityFlags::Entity whatToRead,
141 bool overrideNewerOnly)
override;
143 bool overrideNewerOnly)
override;
148 int getCacheCount(swift::misc::network::CEntityFlags::Entity entity)
const override;
150 swift::misc::network::CEntityFlags::Entity
152 void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
153 void admitCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
157 void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
164 &CModelDataReader::liveryCacheChanged };
166 &CModelDataReader::modelCacheChanged };
168 this, &CModelDataReader::distributorCacheChanged
170 std::atomic_bool m_syncedLiveryCache {
false };
171 std::atomic_bool m_syncedModelCache {
false };
172 std::atomic_bool m_syncedDistributorCache {
false };
175 void read(swift::misc::network::CEntityFlags::Entity entities =
182 this, &CModelDataReader::baseUrlCacheChanged
195 void liveryCacheChanged();
198 void modelCacheChanged();
201 void distributorCacheChanged();
204 void baseUrlCacheChanged();
Value object encapsulating a list of reader configs.
CDatabaseReader(QObject *owner, const CDatabaseReaderConfigList &config, const QString &name)
Constructor.
bool containsModelString(const QString &modelString) const
Contains modelstring?
swift::misc::simulation::CAircraftModel getModelForModelString(const QString &modelString) const
Get model for string.
swift::misc::simulation::CAircraftModel getModelForDbKey(int dbKey) const
Get model for DB key.
bool writeToJsonFiles(const QString &dir)
Write to JSON file.
swift::misc::aviation::CLivery getLiveryForCombinedCode(const QString &combinedCode) const
Get aircraft livery for code.
int getLiveriesCount() const
Get aircraft liveries count.
swift::misc::simulation::CDistributor getDistributorForDbKey(const QString &dbKey) const
Get distributor for id.
QSet< int > getModelDbKeys() const
Get model keys.
bool areAllDataRead() const
All data read?
QStringList getModelStringList(bool sort=false) const
Get model keys.
swift::misc::aviation::CLivery smartLiverySelector(const swift::misc::aviation::CLivery &livery) const
Best match specified by livery.
int getDistributorsCount() const
Get model distributors count.
swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const
Entities already having data in cache.
void admitCaches(swift::misc::network::CEntityFlags::Entity entities)
Admit caches for given entities.
swift::misc::simulation::CDistributorList getDistributors() const
Get distributors (of models).
int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const
Cache`s number of entities.
swift::misc::simulation::CAircraftModelList getModelsForAircraftDesignatorAndLiveryCombinedCode(const QString &aircraftDesignator, const QString &combinedCode)
Get model for designator/combined code.
swift::misc::network::CUrl getDbServiceBaseUrl() const
Get the service URL, individual for each reader.
bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity, swift::misc::network::CUrl &oldUrlInfo, swift::misc::network::CUrl &newUrlInfo) const
Changed URL, means the cache values have been read from elsewhere.
swift::misc::aviation::CAircraftIcaoCodeList getAicraftIcaoCodesForAirline(const swift::misc::aviation::CAirlineIcaoCode &code) const
Get aircraft ICAO designators (e.g. B737, ..) for given airline.
swift::misc::simulation::CDistributor smartDistributorSelector(const swift::misc::simulation::CDistributor &distributorPattern) const
Best match specified by distributor.
QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const
Get cache timestamp.
swift::misc::network::CEntityFlags::Entity getSupportedEntities() const
Supported entities by this reader.
int getModelsCount() const
Get models count.
swift::misc::aviation::CLivery getStdLiveryForAirlineVDesignator(const swift::misc::aviation::CAirlineIcaoCode &icao) const
Get aircraft livery for ICAO code.
QSet< QString > getAircraftDesignatorsForAirline(const swift::misc::aviation::CAirlineIcaoCode &code) const
Get aircraft ICAO designators (e.g. B737, ..) for given airline.
void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities)
Admit caches for given entities.
swift::misc::aviation::CLivery getLiveryForDbKey(int id) const
Get aircraft livery for id.
swift::misc::simulation::CAircraftModelList getModels() const
Get models.
bool readFromJsonFilesInBackground(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, bool overrideNewerOnly)
Data read from local data.
swift::misc::aviation::CLiveryList getLiveries() const
Get aircraft liveries.
CModelDataReader(QObject *owner, const CDatabaseReaderConfigList &config)
Constructor.
swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const
Entities already having data in cache (based on timestamp assumption).
void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities)
Invalidate the caches for given entities.
swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, bool overrideNewerOnly)
Data read from local data.
const QObject * owner() const
Owner of the worker.
Class template for accessing a specific value in the CDataCache.
Status messages, e.g. from Core -> GUI.
Value object encapsulating a list of ICAO codes.
Value object encapsulating a list of ICAO codes.
Value object for ICAO classification.
Value object encapsulating information about an airpot.
Value object for a list of airports.
DataRetrievalModeFlag
Which data to read, requires corresponding readers.
@ DbReading
directly from DB
@ DistributorLiveryModel
Combined.
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
Aircraft model (used by another pilot, my models on disk).
Value object encapsulating a list of aircraft models.
Value object encapsulating information of software distributor.
Value object encapsulating a list of distributors.
Classes interacting with the swift database (aka "datastore").
#define SWIFT_CORE_EXPORT
Export a class or function from the library.