swift
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
swift::core::db::CIcaoDataReader Class Reference

Read ICAO data from Database. More...

Inheritance diagram for swift::core::db::CIcaoDataReader:
[legend]

Public Member Functions

 CIcaoDataReader (QObject *owner, const CDatabaseReaderConfigList &config)
 Constructor.
 
swift::misc::aviation::CAircraftIcaoCodeList getAircraftIcaoCodes () const
 Get aircraft ICAO information. More...
 
int getAircraftIcaoCodesCount () const
 Get aircraft ICAO information count. More...
 
swift::misc::aviation::CAircraftIcaoCode getAircraftIcaoCodeForDesignator (const QString &designator) const
 Get aircraft ICAO information for designator. More...
 
swift::misc::aviation::CAircraftIcaoCodeList getAircraftIcaoCodesForDesignator (const QString &designator) const
 Get aircraft ICAO information for designator. More...
 
swift::misc::aviation::CAircraftIcaoCodeList getAircraftIcaoCodesForIataCode (const QString &iataCode) const
 Get aircraft ICAO information for IATA code. More...
 
swift::misc::aviation::CAircraftIcaoCode getAircraftIcaoCodeForDbKey (int key) const
 Get aircraft ICAO information for key. More...
 
bool containsAircraftIcaoDesignator (const QString &designator) const
 Contains designator? More...
 
swift::misc::aviation::CAircraftIcaoCode smartAircraftIcaoSelector (const swift::misc::aviation::CAircraftIcaoCode &icaoPattern) const
 Get best match for incomplete aircraft ICAO code. More...
 
swift::misc::CCountryList getCountries () const
 Get countries. More...
 
int getCountriesCount () const
 Get countries count. More...
 
swift::misc::CCountry getCountryForIsoCode (const QString &isoCode) const
 Get country for ISO code. More...
 
swift::misc::CCountry getCountryForName (const QString &name) const
 Get country for ISO name. More...
 
swift::misc::aviation::CAirlineIcaoCodeList getAirlineIcaoCodes () const
 Get airline ICAO information. More...
 
int getAirlineIcaoCodesCount () const
 Get airline ICAO information count. More...
 
swift::misc::aviation::CAirlineIcaoCodeList getAirlineIcaoCodesForDesignator (const QString &designator) const
 Find by v-designator, this should be unique. More...
 
bool containsAirlineIcaoDesignator (const QString &designator) const
 Contains given designator? More...
 
swift::misc::aviation::CAirlineIcaoCode getAirlineIcaoCodeForUniqueDesignatorOrDefault (const QString &designator, bool preferOperatingAirlines) const
 Find by ICAO code if this is unique, otherwise return default object. More...
 
swift::misc::aviation::CAirlineIcaoCodeList getAirlineIcaoCodesForIataCode (const QString &iataCode) const
 Find by IATA code Not unique because of virtual airlines and ceased airlines. More...
 
swift::misc::aviation::CAirlineIcaoCode getAirlineIcaoCodeForUniqueIataCodeOrDefault (const QString &iataCode) const
 Find by IATA code if this is unique, otherwise return default object. More...
 
swift::misc::aviation::CAirlineIcaoCode getAirlineIcaoCodeForDbKey (int key) const
 Get airline ICAO information for key. More...
 
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. More...
 
swift::misc::aviation::CAircraftCategoryList getAircraftCategories () const
 Get aircraft categories. More...
 
int getAircraftCategoryCount () const
 Get aircraft category count. More...
 
bool areAllDataRead () const
 All data read? More...
 
bool writeToJsonFiles (const QString &dir)
 Write to static DB data file.
 
virtual swift::misc::CStatusMessageList readFromJsonFiles (const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, bool overrideNewerOnly)
 Data read from local data.
 
virtual bool readFromJsonFilesInBackground (const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, bool overrideNewerOnly)
 Data read from local data.
 
virtual swift::misc::network::CEntityFlags::Entity getSupportedEntities () const
 Supported entities by this reader.
 
virtual QDateTime getCacheTimestamp (swift::misc::network::CEntityFlags::Entity entity) const
 Get cache timestamp.
 
virtual int getCacheCount (swift::misc::network::CEntityFlags::Entity entity) const
 Cache`s number of entities. More...
 
virtual swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheCount () const
 Entities already having data in cache. More...
 
virtual swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheTimestampNewerThan (const QDateTime &threshold) const
 Entities already having data in cache (based on timestamp assumption) More...
 
virtual void synchronizeCaches (swift::misc::network::CEntityFlags::Entity entities)
 Admit caches for given entities.
 
virtual void admitCaches (swift::misc::network::CEntityFlags::Entity entities)
 Admit caches for given entities.
 
- Public Member Functions inherited from swift::core::db::CDatabaseReader
void readInBackgroundThread (swift::misc::network::CEntityFlags::Entity entities, const QDateTime &newerThan)
 Start reading in own thread. More...
 
swift::misc::network::CEntityFlags::Entity triggerLoadingDirectlyFromDb (swift::misc::network::CEntityFlags::Entity entities, const QDateTime &newerThan)
 Start loading from DB in own thread. More...
 
swift::misc::network::CEntityFlags::Entity triggerLoadingDirectlyFromSharedFiles (swift::misc::network::CEntityFlags::Entity entities, bool checkCacheTsUpfront)
 Start loading from shared files in own thread. More...
 
bool hasReceivedOkReply () const
 Has received Ok response from server at least once? More...
 
bool hasReceivedOkReply (QString &message) const
 Has received Ok response from server? A message why connect failed can be obtained. More...
 
bool hasReceivedFirstReply () const
 Has received 1st reply? More...
 
QString getSupportedEntitiesAsString () const
 Supported entities as string.
 
swift::misc::network::CEntityFlags::Entity maskBySupportedEntities (swift::misc::network::CEntityFlags::Entity entities) const
 Mask by supported entities.
 
bool supportsAnyOfEntities (swift::misc::network::CEntityFlags::Entity entities) const
 Is any of the given entities supported here by this reader.
 
bool hasCacheTimestampNewerThan (swift::misc::network::CEntityFlags::Entity entity, const QDateTime &threshold) const
 Has entity a valid and newer timestamp.
 
bool hasDbInfoObjects () const
 DB info objects available?
 
bool hasSharedInfoObjects () const
 Shared info objects available?
 
bool hasSharedFileHeader (const swift::misc::network::CEntityFlags::Entity entity) const
 Header of shared file read (for single entity)?
 
bool hasSharedFileHeaders (const swift::misc::network::CEntityFlags::Entity entities) const
 Headers of shared file read (for single entity)?
 
QDateTime getLatestEntityTimestampFromDbInfoObjects (swift::misc::network::CEntityFlags::Entity entity) const
 Obtain latest object timestamp from DB info objects. More...
 
QDateTime getLatestEntityTimestampFromSharedInfoObjects (swift::misc::network::CEntityFlags::Entity entity) const
 Obtain latest object timestamp from shared info objects. More...
 
QDateTime getLatestSharedFileHeaderTimestamp (swift::misc::network::CEntityFlags::Entity entity) const
 Header timestamp (last-modified) for shared file. More...
 
bool isSharedHeaderNewerThanCacheTimestamp (swift::misc::network::CEntityFlags::Entity entity) const
 Is the file timestamp newer than cache timestamp? More...
 
bool isSharedInfoObjectNewerThanCacheTimestamp (swift::misc::network::CEntityFlags::Entity entity) const
 Is the shared info timestamp newer than cache timestamp?
 
swift::misc::network::CEntityFlags::Entity getEntitesWithNewerHeaderTimestamp (swift::misc::network::CEntityFlags::Entity entities) const
 Those entities where the timestamp of the header is newer than the cache timestamp.
 
swift::misc::network::CEntityFlags::Entity getEntitesWithNewerSharedInfoObject (swift::misc::network::CEntityFlags::Entity entities) const
 Those entities where the timestamp of a shared info object is newer than the cache timestamp.
 
const QString & getStatusMessage () const
 Status message (error message)
 
void setSeverityNoWorkingUrl (swift::misc::CStatusMessage::StatusSeverity s)
 Severity used for log messages in case of no URLs.
 
swift::misc::CStatusMessageList initFromLocalResourceFiles (bool inBackground)
 Init from local resource file. More...
 
swift::misc::CStatusMessageList initFromLocalResourceFiles (swift::misc::network::CEntityFlags::Entity entities, bool inBackground)
 Init from local resource file. More...
 
- Public Member Functions inherited from swift::core::CThreadedReader
virtual ~CThreadedReader ()
 Destructor.
 
QDateTime getUpdateTimestamp () const
 Thread safe, get update timestamp. More...
 
void setUpdateTimestamp (const QDateTime &updateTimestamp=QDateTime::currentDateTimeUtc())
 Thread safe, set update timestamp. More...
 
bool updatedWithinLastMs (qint64 timeLastMs)
 Was setup read within last xx milliseconds. More...
 
bool isMarkedAsFailed () const
 Is marked as read failed. More...
 
void setMarkedAsFailed (bool failed)
 Set marker for read failed. More...
 
swift::misc::network::CUrlLogList getReadLog () const
 Get the read log. More...
 
void startReader ()
 Starts the reader. More...
 
void pauseReader ()
 Pauses the reader. More...
 
void markAsUsedInUnitTest ()
 Used in unit test. More...
 
bool hasPendingUrls () const
 Has pending URLs? More...
 
swift::misc::network::CUrlLogList getUrlLogList () const
 Get the URL log list. More...
 
int getNetworkReplyProgress () const
 Progress 0..100. More...
 
QPair< qint64, qint64 > getNetworkReplyBytes () const
 Max./current bytes.
 
- Public Member Functions inherited from swift::misc::CContinuousWorker
 CContinuousWorker (QObject *owner, const QString &name)
 Constructor. More...
 
void start (QThread::Priority priority=QThread::InheritPriority)
 Starts a thread and moves the worker into it.
 
void quit () noexcept final
 Stops the thread the next time around its event loop. The thread and the worker will then be deleted. More...
 
void quitAndWait () noexcept final
 Calls quit() and blocks until the thread is finished. More...
 
bool isEnabled () const
 Enabled (running)? More...
 
void setEnabled (bool enabled)
 Enabled (running)? More...
 
void startUpdating (int updateTimeSecs)
 Start updating (start/stop timer) More...
 
const QString & getName ()
 Name of the worker.
 
const QObject * owner () const
 Owner of the worker.
 
- Public Member Functions inherited from swift::misc::CWorkerBase
template<typename T , typename F >
void then (T *context, F functor)
 Connects to a functor or method which will be called when the task is finished. More...
 
template<typename F >
void then (F functor)
 Connects to a functor which will be called when the task is finished. More...
 
bool isFinished () const
 Returns true if the task has finished. More...
 
template<typename F >
void doIfFinished (F functor) const
 Executes some code (in the caller's thread) if the task has finished. More...
 
template<typename F >
void doIfNotFinished (F functor) const
 Executes some code (in the caller's thread) if the task has not finished. More...
 
template<typename F1 , typename F2 >
void doIfFinishedElse (F1 ifFunctor, F2 elseFunctor) const
 Executes some code (in the caller's thread) if the task has finished and some different code if it has not finished. More...
 
void waitForFinished () noexcept
 Blocks until the task is finished. More...
 
void abandon () noexcept
 Notify the task that its result is no longer needed, so it can finish early. More...
 
void abandonAndWait () noexcept
 Convenience to call abandon() followed by waitForFinished().
 

Protected Member Functions

virtual void invalidateCaches (swift::misc::network::CEntityFlags::Entity entities)
 Invalidate the caches for given entities.
 
virtual 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. More...
 
virtual swift::misc::network::CUrl getDbServiceBaseUrl () const
 Get the service URL, individual for each reader.
 
- Protected Member Functions inherited from swift::core::db::CDatabaseReader
 CDatabaseReader (QObject *owner, const CDatabaseReaderConfigList &config, const QString &name)
 Constructor.
 
CDatabaseReader::JsonDatastoreResponse setStatusAndTransformReplyIntoDatastoreResponse (QNetworkReply *nwReply)
 Check if terminated or error, otherwise split into array of objects.
 
swift::misc::db::CDbInfoList getDbInfoObjects () const
 DB Info list (latest data timestamps from DB web service) More...
 
swift::misc::db::CDbInfoList getSharedInfoObjects () const
 Shared info list (latest data timestamps from DB web service) More...
 
CDatabaseReaderConfig getConfigForEntity (swift::misc::network::CEntityFlags::Entity entity) const
 Config for given entity.
 
swift::misc::network::CEntityFlags::Entity emitReadSignalPerSingleCachedEntity (swift::misc::network::CEntityFlags::Entity cachedEntities, bool onlyIfHasData)
 Split into single entity and send dataRead signal.
 
void emitAndLogDataRead (swift::misc::network::CEntityFlags::Entity entity, int number, const JsonDatastoreResponse &res)
 Emit signal and log when data have been read.
 
void logNoWorkingUrl (swift::misc::network::CEntityFlags::Entity entity)
 Log if no working URL exists, using m_noWorkingUrlSeverity.
 
swift::misc::network::CUrl getBaseUrl (swift::misc::db::CDbFlags::DataRetrievalModeFlag mode) const
 Base URL for mode (either a shared or DB URL)
 
void startReadFromBackendInBackgroundThread (swift::misc::network::CEntityFlags::Entity entities, swift::misc::db::CDbFlags::DataRetrievalModeFlag mode, const QDateTime &newerThan=QDateTime())
 Start reading in own thread (without config/caching) More...
 
void receivedSharedFileHeader (QNetworkReply *nwReplyPtr)
 Received a reply of a header for a shared file.
 
void receivedSharedFileHeaderNonClosing (QNetworkReply *nwReplyPtr)
 Received a reply of a header for a shared file.
 
JsonDatastoreResponse transformReplyIntoDatastoreResponse (QNetworkReply *nwReply) const
 Check if terminated or error, otherwise split into array of objects.
 
HeaderResponse transformReplyIntoHeaderResponse (QNetworkReply *nwReply) const
 Check if terminated or error, otherwise set header information.
 
bool setHeaderInfoPart (HeaderResponse &headerResponse, QNetworkReply *nwReply) const
 Set the header part.
 
void setReplyStatus (QNetworkReply::NetworkError status, const QString &message="")
 Feedback about connection status. More...
 
void setReplyStatus (QNetworkReply *nwReply)
 Feedback about connection status. More...
 
bool overrideCacheFromFile (bool overrideNewerOnly, const QFileInfo &fileInfo, swift::misc::network::CEntityFlags::Entity entity, swift::misc::CStatusMessageList &msgs) const
 Override cache from file. More...
 
void logParseMessage (const QString &entity, int size, int msElapsed, const JsonDatastoreResponse &response) const
 Parsing info message.
 
virtual void networkReplyProgress (int logId, qint64 current, qint64 max, const QUrl &url)
 Network request progress.
 
virtual void cacheHasChanged (swift::misc::network::CEntityFlags::Entity entities)
 Cache for given entity has changed.
 
- Protected Member Functions inherited from swift::core::CThreadedReader
 CThreadedReader (QObject *owner, const QString &name)
 Constructor.
 
qint64 lastModifiedMsSinceEpoch (QNetworkReply *nwReply) const
 When was reply last modified, -1 if N/A.
 
void threadAssertCheck () const
 Make sure everthing runs correctly in own thread.
 
bool didContentChange (const QString &content, int startPosition=-1)
 Stores new content hash and returns if content changed (based on hash value. More...
 
void setInitialAndPeriodicTime (int initialTime, int periodicTime)
 Set initial and periodic times.
 
virtual void doWorkImpl ()
 This method does the actual work in the derived class.
 
bool doWorkCheck () const
 Still enabled etc.? More...
 
QNetworkReply * getFromNetworkAndLog (const swift::misc::network::CUrl &url, const swift::misc::CSlot< void(QNetworkReply *)> &callback)
 Get request from network, and log with m_urlReadLog. More...
 
void logNetworkReplyReceived (QNetworkReply *reply)
 Network reply received, mark in m_urlReadLog. More...
 
- Protected Member Functions inherited from swift::misc::CContinuousWorker
virtual void initialize ()
 Called when the thread is started.
 
virtual void cleanup ()
 Called when the thread is finished.
 
virtual void beforeQuit () noexcept
 Called before quit is called. More...
 
virtual unsigned long waitTimeoutMs () const
 Wait time for quitAndWait, 0 means not waiting.
 
void stopUpdateTimer ()
 Safely stop update time.
 
- Protected Member Functions inherited from swift::misc::CWorkerBase
 CWorkerBase ()
 Constructor.
 
 ~CWorkerBase ()
 Destructor.
 
bool isAbandoned () const
 For the task to check whether it can finish early. More...
 
bool hasStarted () const
 True if the worker has started.
 
void setStarted ()
 Mark the task as started.
 
void setFinished ()
 Mark the task as finished.
 

Private Member Functions

virtual void read (swift::misc::network::CEntityFlags::Entity entities, swift::misc::db::CDbFlags::DataRetrievalModeFlag mode, const QDateTime &newerThan)
 Read / re-read data file. More...
 

Additional Inherited Members

- Signals inherited from swift::core::db::CDatabaseReader
void swiftDbDataRead (bool success)
 DB have been read.
 
void dataRead (swift::misc::network::CEntityFlags::Entity entities, swift::misc::network::CEntityFlags::ReadState state, int number, const QUrl &url)
 Combined read signal. More...
 
void sharedFileHeaderRead (swift::misc::network::CEntityFlags::Entity entity, const QString &fileName, bool success)
 Header of shared file read.
 
void databaseReaderMessages (const swift::misc::CStatusMessageList &messages)
 Database reader messages. More...
 
void entityDownloadProgress (swift::misc::network::CEntityFlags::Entity entity, int logId, int progress, qint64 current, qint64 max, const QUrl &url)
 Download progress for an entity.
 
- Signals inherited from swift::misc::CWorkerBase
void aboutToStart ()
 Emitted when the task is about to start.
 
void finished ()
 Emitted when the task is finished. More...
 
- Static Public Member Functions inherited from swift::core::db::CDatabaseReader
static const QStringList & getLogCategories ()
 Log categories.
 
- Static Public Member Functions inherited from swift::core::CThreadedReader
static const QStringList & getLogCategories ()
 Log categories.
 
- Static Public Member Functions inherited from swift::misc::CWorkerBase
static const QStringList & getLogCategories ()
 Log categories.
 
static const QSet< CWorkerBase * > & allWorkers ()
 All workers currently existing.
 
- Static Protected Member Functions inherited from swift::core::db::CDatabaseReader
static const swift::misc::network::CUrlgetDbUrl ()
 DB base URL.
 
static QString fileNameForMode (swift::misc::network::CEntityFlags::Entity entity, swift::misc::db::CDbFlags::DataRetrievalModeFlag mode)
 File name for given mode, either php service or shared file name.
 
static const QString & parameterLatestTimestamp ()
 Name of latest timestamp.
 
static QString dateTimeToDbLatestTs (const QDateTime &ts)
 A newer than value understood by swift DB. More...
 
static QString queryLatestTimestamp (const QDateTime &ts)
 Latest timestamp query for DB.
 
static bool isChangedUrl (const swift::misc::network::CUrl &oldUrl, const swift::misc::network::CUrl &currentUrl)
 Has URL been changed? Means we load from a different server.
 
- Static Protected Member Functions inherited from swift::core::CThreadedReader
static void logInconsistentData (const swift::misc::CStatusMessage &msg, const char *funcInfo=nullptr)
 Use this to log inconsistent data. More...
 
- Protected Attributes inherited from swift::core::db::CDatabaseReader
CDatabaseReaderConfigList m_config
 DB reder configuration.
 
QString m_statusMessage
 Returned status message from watchdog.
 
bool m_1stReplyReceived = false
 Successful connection? Does not mean data / authorizations are correct.
 
QReadWriteLock m_statusLock
 Lock.
 
QNetworkReply::NetworkError m_1stReplyStatus = QNetworkReply::UnknownServerError
 Successful connection?
 
QMap< swift::misc::network::CEntityFlags::Entity, HeaderResponsem_sharedFileResponses
 file responses of the shared files
 
swift::misc::CStatusMessage::StatusSeverity m_severityNoWorkingUrl
 severity of message if there is no working URL More...
 
- Protected Attributes inherited from swift::core::CThreadedReader
QReadWriteLock m_lock
 lock which can be used from the derived classes More...
 
std::atomic_int m_networkReplyProgress
 Progress percentage 0...100.
 
std::atomic_llong m_networkReplyCurrent
 current bytes
 
std::atomic_llong m_networkReplyNax
 max bytes
 
- Protected Attributes inherited from swift::misc::CContinuousWorker
QTimer m_updateTimer { this }
 timer which can be used by implementing classes
 

Detailed Description

Read ICAO data from Database.

Definition at line 31 of file icaodatareader.h.

Member Function Documentation

◆ areAllDataRead()

bool swift::core::db::CIcaoDataReader::areAllDataRead ( ) const

All data read?

Remarks
This function is thread safe.

Definition at line 141 of file icaodatareader.cpp.

◆ containsAircraftIcaoDesignator()

bool swift::core::db::CIcaoDataReader::containsAircraftIcaoDesignator ( const QString &  designator) const

Contains designator?

Remarks
This function is thread safe.

Definition at line 70 of file icaodatareader.cpp.

◆ containsAirlineIcaoDesignator()

bool swift::core::db::CIcaoDataReader::containsAirlineIcaoDesignator ( const QString &  designator) const

Contains given designator?

Remarks
This function is thread safe.

Definition at line 100 of file icaodatareader.cpp.

◆ getAircraftCategories()

CAircraftCategoryList swift::core::db::CIcaoDataReader::getAircraftCategories ( ) const

Get aircraft categories.

Remarks
This function is thread safe.

Definition at line 133 of file icaodatareader.cpp.

◆ getAircraftCategoryCount()

int swift::core::db::CIcaoDataReader::getAircraftCategoryCount ( ) const

Get aircraft category count.

Remarks
This function is thread safe.

Definition at line 135 of file icaodatareader.cpp.

◆ getAircraftIcaoCodeForDbKey()

CAircraftIcaoCode swift::core::db::CIcaoDataReader::getAircraftIcaoCodeForDbKey ( int  key) const

Get aircraft ICAO information for key.

Remarks
This function is thread safe.

Definition at line 65 of file icaodatareader.cpp.

◆ getAircraftIcaoCodeForDesignator()

CAircraftIcaoCode swift::core::db::CIcaoDataReader::getAircraftIcaoCodeForDesignator ( const QString &  designator) const

Get aircraft ICAO information for designator.

Remarks
This function is thread safe.

Definition at line 50 of file icaodatareader.cpp.

◆ getAircraftIcaoCodes()

CAircraftIcaoCodeList swift::core::db::CIcaoDataReader::getAircraftIcaoCodes ( ) const

Get aircraft ICAO information.

Remarks
This function is thread safe.

Definition at line 48 of file icaodatareader.cpp.

◆ getAircraftIcaoCodesCount()

int swift::core::db::CIcaoDataReader::getAircraftIcaoCodesCount ( ) const

Get aircraft ICAO information count.

Remarks
This function is thread safe.

Definition at line 137 of file icaodatareader.cpp.

◆ getAircraftIcaoCodesForDesignator()

CAircraftIcaoCodeList swift::core::db::CIcaoDataReader::getAircraftIcaoCodesForDesignator ( const QString &  designator) const

Get aircraft ICAO information for designator.

Remarks
This function is thread safe.

Definition at line 55 of file icaodatareader.cpp.

◆ getAircraftIcaoCodesForIataCode()

CAircraftIcaoCodeList swift::core::db::CIcaoDataReader::getAircraftIcaoCodesForIataCode ( const QString &  iataCode) const

Get aircraft ICAO information for IATA code.

Remarks
This function is thread safe.

Definition at line 60 of file icaodatareader.cpp.

◆ getAirlineIcaoCodeForDbKey()

CAirlineIcaoCode swift::core::db::CIcaoDataReader::getAirlineIcaoCodeForDbKey ( int  key) const

Get airline ICAO information for key.

Remarks
This function is thread safe.

Definition at line 121 of file icaodatareader.cpp.

◆ getAirlineIcaoCodeForUniqueDesignatorOrDefault()

CAirlineIcaoCode swift::core::db::CIcaoDataReader::getAirlineIcaoCodeForUniqueDesignatorOrDefault ( const QString &  designator,
bool  preferOperatingAirlines 
) const

Find by ICAO code if this is unique, otherwise return default object.

Remarks
This function is thread safe.

Definition at line 105 of file icaodatareader.cpp.

◆ getAirlineIcaoCodeForUniqueIataCodeOrDefault()

CAirlineIcaoCode swift::core::db::CIcaoDataReader::getAirlineIcaoCodeForUniqueIataCodeOrDefault ( const QString &  iataCode) const

Find by IATA code if this is unique, otherwise return default object.

Remarks
This function is thread safe.

Definition at line 116 of file icaodatareader.cpp.

◆ getAirlineIcaoCodes()

CAirlineIcaoCodeList swift::core::db::CIcaoDataReader::getAirlineIcaoCodes ( ) const

Get airline ICAO information.

Remarks
This function is thread safe.

Definition at line 75 of file icaodatareader.cpp.

◆ getAirlineIcaoCodesCount()

int swift::core::db::CIcaoDataReader::getAirlineIcaoCodesCount ( ) const

Get airline ICAO information count.

Remarks
This function is thread safe.

Definition at line 139 of file icaodatareader.cpp.

◆ getAirlineIcaoCodesForDesignator()

CAirlineIcaoCodeList swift::core::db::CIcaoDataReader::getAirlineIcaoCodesForDesignator ( const QString &  designator) const

Find by v-designator, this should be unique.

Remarks
This function is thread safe.

Definition at line 95 of file icaodatareader.cpp.

◆ getAirlineIcaoCodesForIataCode()

CAirlineIcaoCodeList swift::core::db::CIcaoDataReader::getAirlineIcaoCodesForIataCode ( const QString &  iataCode) const

Find by IATA code Not unique because of virtual airlines and ceased airlines.

Remarks
This function is thread safe.

Definition at line 111 of file icaodatareader.cpp.

◆ getCacheCount()

int swift::core::db::CIcaoDataReader::getCacheCount ( swift::misc::network::CEntityFlags::Entity  entity) const
virtual

Cache`s number of entities.

Remarks
this only works if the cache is admitted, DB caches are read deferred

Implements swift::core::db::CDatabaseReader.

Definition at line 749 of file icaodatareader.cpp.

◆ getCountries()

CCountryList swift::core::db::CIcaoDataReader::getCountries ( ) const

Get countries.

Remarks
This function is thread safe.

Definition at line 83 of file icaodatareader.cpp.

◆ getCountriesCount()

int swift::core::db::CIcaoDataReader::getCountriesCount ( ) const

Get countries count.

Remarks
This function is thread safe.

Definition at line 146 of file icaodatareader.cpp.

◆ getCountryForIsoCode()

CCountry swift::core::db::CIcaoDataReader::getCountryForIsoCode ( const QString &  isoCode) const

Get country for ISO code.

Remarks
This function is thread safe.

Definition at line 85 of file icaodatareader.cpp.

◆ getCountryForName()

CCountry swift::core::db::CIcaoDataReader::getCountryForName ( const QString &  name) const

Get country for ISO name.

Remarks
This function is thread safe.

Definition at line 90 of file icaodatareader.cpp.

◆ getEntitiesWithCacheCount()

CEntityFlags::Entity swift::core::db::CIcaoDataReader::getEntitiesWithCacheCount ( ) const
virtual

Entities already having data in cache.

Remarks
this only works if the cache is admitted, DB caches are read deferred

Implements swift::core::db::CDatabaseReader.

Definition at line 761 of file icaodatareader.cpp.

◆ getEntitiesWithCacheTimestampNewerThan()

CEntityFlags::Entity swift::core::db::CIcaoDataReader::getEntitiesWithCacheTimestampNewerThan ( const QDateTime &  threshold) const
virtual

Entities already having data in cache (based on timestamp assumption)

Remarks
unlike getEntitiesWithCacheCount() this even works when the cache is not yet admitted

Implements swift::core::db::CDatabaseReader.

Definition at line 772 of file icaodatareader.cpp.

◆ hasChangedUrl()

bool swift::core::db::CIcaoDataReader::hasChangedUrl ( swift::misc::network::CEntityFlags::Entity  entity,
swift::misc::network::CUrl oldUrlInfo,
swift::misc::network::CUrl newUrlInfo 
) const
protectedvirtual

Changed URL, means the cache values have been read from elsewhere.

Remarks
testing based on swift::misc::db::CDbFlags::DbReading

Implements swift::core::db::CDatabaseReader.

Definition at line 786 of file icaodatareader.cpp.

◆ read()

void swift::core::db::CIcaoDataReader::read ( swift::misc::network::CEntityFlags::Entity  entities,
swift::misc::db::CDbFlags::DataRetrievalModeFlag  mode,
const QDateTime &  newerThan 
)
privatevirtual

Read / re-read data file.

Implements swift::core::db::CDatabaseReader.

Definition at line 148 of file icaodatareader.cpp.

◆ smartAircraftIcaoSelector()

CAircraftIcaoCode swift::core::db::CIcaoDataReader::smartAircraftIcaoSelector ( const swift::misc::aviation::CAircraftIcaoCode icaoPattern) const

Get best match for incomplete aircraft ICAO code.

Remarks
This function is thread safe.

Definition at line 77 of file icaodatareader.cpp.

◆ smartAirlineIcaoSelector()

CAirlineIcaoCode swift::core::db::CIcaoDataReader::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.

Remarks
This function is thread safe.

Definition at line 126 of file icaodatareader.cpp.


The documentation for this class was generated from the following files: