6#ifndef SWIFT_CORE_DB_INFODATAREADER_H
7#define SWIFT_CORE_DB_INFODATAREADER_H
9#include <QNetworkReply>
11#include <QReadWriteLock>
51 swift::misc::network::CEntityFlags::Entity whatToRead,
52 bool overrideNewer)
override;
54 bool overrideNewer)
override;
59 int getCacheCount(swift::misc::network::CEntityFlags::Entity entity)
const override;
61 swift::misc::network::CEntityFlags::Entity
63 void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
64 void admitCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
68 void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities)
override;
88 void read(swift::misc::network::CEntityFlags::Entity entities,
Value object encapsulating a list of reader configs.
CDatabaseReader(QObject *owner, const CDatabaseReaderConfigList &config, const QString &name)
Constructor.
int getInfoObjectCount() const
Get info list size (either shared or from DB).
swift::misc::db::CDbInfoList getInfoObjects() const
Get info list (either shared or from DB).
void synchronizeCaches(swift::misc::network::CEntityFlags::Entity entities)
Admit caches for given entities.
void readInfoData()
Allow to call directly, special for info objects reader.
int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const
Cache`s number of entities.
swift::misc::CStatusMessageList readFromJsonFiles(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, bool overrideNewer)
Data read from local data.
swift::misc::network::CUrl getInfoObjectsUrl() const
URL depending on mode, i.e. shared/DB.
void invalidateCaches(swift::misc::network::CEntityFlags::Entity entities)
Invalidate the caches for given entities.
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.
CInfoDataReader(QObject *owner, const CDatabaseReaderConfigList &config, swift::misc::db::CDbFlags::DataRetrievalModeFlag mode)
Constructor.
swift::misc::network::CEntityFlags::Entity getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const
Entities already having data in cache (based on timestamp assumption).
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::network::CUrl getDbServiceBaseUrl() const
Get the service URL, individual for each reader.
bool areAllInfoObjectsRead() const
All data read?
bool readFromJsonFilesInBackground(const QString &dir, swift::misc::network::CEntityFlags::Entity whatToRead, bool overrideNewer)
Data read from local data.
swift::misc::network::CEntityFlags::Entity getSupportedEntities() const
Supported entities by this reader.
const QObject * owner() const
Owner of the worker.
Status messages, e.g. from Core -> GUI.
DataRetrievalModeFlag
Which data to read, requires corresponding readers.
Value object encapsulating a list of info objects.
EntityFlag
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.