refs #687, further performance improvements

* avoid redundant reads by excluding entities which will be periodically updated
* restart timers when data are received, avoid overlapping requests
This commit is contained in:
Klaus Basan
2016-06-26 00:13:02 +02:00
parent fcba4f2e75
commit 0939b1f08f
7 changed files with 45 additions and 13 deletions

View File

@@ -59,6 +59,10 @@ namespace BlackCore
//! \threadsafe
int interval() const;
//! Is timer running
//! \threadsafe
bool isTimerActive() const;
//! Set inverval from settings and start
void setIntervalFromSettingsAndStart();
@@ -68,7 +72,7 @@ namespace BlackCore
void gracefulShutdown();
protected:
QTimer *m_updateTimer = nullptr; //!< update timer
QTimer *m_updateTimer = nullptr; //!< update timer
mutable QReadWriteLock m_lock {QReadWriteLock::Recursive}; //!< lock which can be used from the derived classes
//! Constructor
@@ -94,6 +98,10 @@ namespace BlackCore
//! \threadsafe
void setInterval(int updatePeriodMs);
//! Restart timer
//! \threadsafe
void restartTimer(bool onlyWhenActive = false);
//! Stores new content hash and returns if content changed (based on hash value
//! \threadsafe
bool didContentChange(const QString &content, int startPosition = -1);