6#ifndef SWIFT_CORE_ICAODATAREADER_H
7#define SWIFT_CORE_ICAODATAREADER_H
145 swift::misc::network::CEntityFlags::Entity whatToRead,
146 bool overrideNewerOnly)
override;
148 bool overrideNewerOnly)
override;
153 int getCacheCount(swift::misc::network::CEntityFlags::Entity entity)
const override;
155 swift::misc::network::CEntityFlags::Entity
157 void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
158 void admitCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
162 void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
169 this, &CIcaoDataReader::aircraftIcaoCacheChanged
172 this, &CIcaoDataReader::airlineIcaoCacheChanged
175 &CIcaoDataReader::countryCacheChanged };
177 this, &CIcaoDataReader::aircraftCategoryCacheChanged
179 std::atomic_bool m_syncedAircraftIcaoCache {
false };
180 std::atomic_bool m_syncedAirlineIcaoCache {
false };
181 std::atomic_bool m_syncedCountryCache {
false };
182 std::atomic_bool m_syncedCategories {
false };
185 void read(swift::misc::network::CEntityFlags::Entity entities,
190 this, &CIcaoDataReader::baseUrlCacheChanged
206 void aircraftIcaoCacheChanged();
209 void airlineIcaoCacheChanged();
212 void countryCacheChanged();
215 void aircraftCategoryCacheChanged();
218 void baseUrlCacheChanged();
Value object encapsulating a list of reader configs.
CDatabaseReader(QObject *owner, const CDatabaseReaderConfigList &config, const QString &name)
Constructor.
swift::misc::CCountry getCountryForName(const QString &name) const
Get country for ISO name.
swift::misc::CCountry getCountryForIsoCode(const QString &isoCode) const
Get country for ISO code.
bool containsAirlineIcaoDesignator(const QString &designator) const
Contains given designator?
CIcaoDataReader(QObject *owner, const CDatabaseReaderConfigList &config)
Constructor.
int getCountriesCount() const
Get countries count.
swift::misc::aviation::CAirlineIcaoCode getAirlineIcaoCodeForDbKey(int key) const
Get airline ICAO information for key.
swift::misc::aviation::CAirlineIcaoCode getAirlineIcaoCodeForUniqueIataCodeOrDefault(const QString &iataCode) const
Find by IATA code if this is unique, otherwise return default object.
swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, bool overrideNewerOnly)
Data read from local data.
int getAirlineIcaoCodesCount() const
Get airline ICAO information count.
bool writeToJsonFiles(const QString &dir)
Write to static DB data file.
int getAircraftCategoryCount() const
Get aircraft category count.
int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const
Cache`s number of entities.
swift::misc::aviation::CAircraftIcaoCodeList getAircraftIcaoCodes() const
Get aircraft ICAO information.
swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount() const
Entities already having data in cache.
QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const
Get cache timestamp.
swift::misc::aviation::CAircraftIcaoCode getAircraftIcaoCodeForDesignator(const QString &designator) const
Get aircraft ICAO information for designator.
swift::misc::aviation::CAirlineIcaoCodeList getAirlineIcaoCodesForDesignator(const QString &designator) const
Find by v-designator, this should be unique.
swift::misc::aviation::CAirlineIcaoCodeList getAirlineIcaoCodes() const
Get airline ICAO information.
swift::misc::aviation::CAircraftIcaoCodeList getAircraftIcaoCodesForIataCode(const QString &iataCode) const
Get aircraft ICAO information for IATA code.
swift::misc::network::CEntityFlags::Entity getSupportedEntities() const
Supported entities by this reader.
bool readFromJsonFilesInBackground(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, bool overrideNewerOnly)
Data read from local data.
swift::misc::aviation::CAircraftIcaoCodeList getAircraftIcaoCodesForDesignator(const QString &designator) const
Get aircraft ICAO information for designator.
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.
void admitCaches(swift::misc::network::CEntityFlags::Entity entities)
Admit caches for given entities.
swift::misc::aviation::CAircraftCategoryList getAircraftCategories() const
Get aircraft categories.
swift::misc::aviation::CAirlineIcaoCode getAirlineIcaoCodeForUniqueDesignatorOrDefault(const QString &designator, bool preferOperatingAirlines) const
Find by ICAO code if this is unique, otherwise return default object.
swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const
Entities already having data in cache (based on timestamp assumption).
bool areAllDataRead() const
All data read?
swift::misc::CCountryList getCountries() const
Get countries.
void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities)
Invalidate the caches for given entities.
int getAircraftIcaoCodesCount() const
Get aircraft ICAO information count.
bool containsAircraftIcaoDesignator(const QString &designator) const
Contains designator?
void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities)
Admit caches for given entities.
swift::misc::aviation::CAirlineIcaoCode smartAirlineIcaoSelector(const swift::misc::aviation::CAirlineIcaoCode &icaoPattern, const swift::misc::aviation::CCallsign &callsign=swift::misc::aviation::CCallsign()) const
Get best match for airline ICAO code.
swift::misc::aviation::CAirlineIcaoCodeList getAirlineIcaoCodesForIataCode(const QString &iataCode) const
Find by IATA code Not unique because of virtual airlines and ceased airlines.
swift::misc::network::CUrl getDbServiceBaseUrl() const
Get the service URL, individual for each reader.
swift::misc::aviation::CAircraftIcaoCode getAircraftIcaoCodeForDbKey(int key) const
Get aircraft ICAO information for key.
swift::misc::aviation::CAircraftIcaoCode smartAircraftIcaoSelector(const swift::misc::aviation::CAircraftIcaoCode &icaoPattern) const
Get best match for incomplete aircraft ICAO code.
const QObject * owner() const
Owner of the worker.
Value object encapsulating a list of countries.
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 for ICAO classification.
Value object encapsulating a list of ICAO codes.
Value object for ICAO classification.
Value object encapsulating a list of ICAO codes.
Value object encapsulating information of a callsign.
DataRetrievalModeFlag
Which data to read, requires corresponding readers.
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
Classes interacting with the swift database (aka "datastore").
#define SWIFT_CORE_EXPORT
Export a class or function from the library.