refs #709, access to timestamp/count per entity

* utility functions
* made protected functions public
This commit is contained in:
Klaus Basan
2016-07-15 19:57:42 +02:00
parent 85d76d364c
commit 6f840f4fd6
7 changed files with 144 additions and 33 deletions

View File

@@ -70,6 +70,7 @@ namespace BlackCore
namespace Db
{
class CDatabaseWriter;
class CDatabaseReader;
class CIcaoDataReader;
class CModelDataReader;
class CInfoDataReader;
@@ -284,6 +285,22 @@ namespace BlackCore
//! Trigger read of new data
BlackMisc::Network::CEntityFlags::Entity triggerRead(BlackMisc::Network::CEntityFlags::Entity whatToRead, const QDateTime &dateTime = QDateTime());
//! Corresponding cache timestamp if applicable
//! \threadsafe
QDateTime getCacheTimestamp(BlackMisc::Network::CEntityFlags::Entity entity) const;
//! Corresponding DB timestamp if applicable
//! \threadsafe
QDateTime getDbLatestEntityTimestamp(BlackMisc::Network::CEntityFlags::Entity entity) const;
//! Cache count for entity
//! \threadsafe
int getCacheCount(BlackMisc::Network::CEntityFlags::Entity entity) const;
//! Count for entity from entity objects
//! \threadsafe
int getDbInfoCount(BlackMisc::Network::CEntityFlags::Entity entity) const;
//! Can connect to swift DB?
bool canConnectSwiftDb() const;
@@ -321,6 +338,9 @@ namespace BlackCore
//! Init the readers
void initReaders(CWebReaderFlags::WebReader flags);
//! DB reader for given entity
Db::CDatabaseReader *getDbReader(BlackMisc::Network::CEntityFlags::Entity entity) const;
//! Init the writers
void initWriters();