6 #ifndef SWIFT_CORE_MODELDATAREADER_H
7 #define SWIFT_CORE_MODELDATAREADER_H
14 #include <QStringList>
79 bool containsModelString(
const QString &modelString)
const;
97 getModelsForAircraftDesignatorAndLiveryCombinedCode(
const QString &aircraftDesignator,
98 const QString &combinedCode);
102 int getLiveriesCount()
const;
106 int getDistributorsCount()
const;
121 int getModelsCount()
const;
125 QSet<int> getModelDbKeys()
const;
129 QStringList getModelStringList(
bool sort =
false)
const;
133 bool areAllDataRead()
const;
136 bool writeToJsonFiles(
const QString &dir);
140 swift::misc::network::CEntityFlags::Entity whatToRead,
141 bool overrideNewerOnly)
override;
142 virtual bool readFromJsonFilesInBackground(
const QString &dir,
143 swift::misc::network::CEntityFlags::Entity whatToRead,
144 bool overrideNewerOnly)
override;
147 virtual swift::misc::network::CEntityFlags::Entity getSupportedEntities()
const override;
148 virtual QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity)
const override;
149 virtual int getCacheCount(swift::misc::network::CEntityFlags::Entity entity)
const override;
150 virtual swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount()
const override;
151 virtual swift::misc::network::CEntityFlags::Entity
152 getEntitiesWithCacheTimestampNewerThan(
const QDateTime &threshold)
const override;
153 virtual void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
154 virtual void admitCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
158 virtual void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
159 virtual bool hasChangedUrl(swift::misc::network::CEntityFlags::Entity entity,
166 &CModelDataReader::liveryCacheChanged };
168 &CModelDataReader::modelCacheChanged };
170 this, &CModelDataReader::distributorCacheChanged
172 std::atomic_bool m_syncedLiveryCache {
false };
173 std::atomic_bool m_syncedModelCache {
false };
174 std::atomic_bool m_syncedDistributorCache {
false };
177 virtual void read(swift::misc::network::CEntityFlags::Entity entities =
180 const QDateTime &newerThan = QDateTime())
override;
184 this, &CModelDataReader::baseUrlCacheChanged
188 void parseLiveryData(QNetworkReply *nwReply);
191 void parseDistributorData(QNetworkReply *nwReply);
194 void parseModelData(QNetworkReply *nwReply);
197 void liveryCacheChanged();
200 void modelCacheChanged();
203 void distributorCacheChanged();
206 void baseUrlCacheChanged();
Value object encapsulating a list of reader configs.
Specialized version of threaded reader for DB data.
Read model related data from Database.
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.