6 #ifndef SWIFT_CORE_THREADED_READER_H
7 #define SWIFT_CORE_THREADED_READER_H
14 #include <QReadWriteLock>
37 static const QStringList &getLogCategories();
44 QDateTime getUpdateTimestamp()
const;
48 void setUpdateTimestamp(
const QDateTime &updateTimestamp = QDateTime::currentDateTimeUtc());
52 bool updatedWithinLastMs(qint64 timeLastMs);
57 bool isMarkedAsFailed()
const;
62 void setMarkedAsFailed(
bool failed);
82 bool hasPendingUrls()
const;
93 QPair<qint64, qint64> getNetworkReplyBytes()
const;
96 mutable QReadWriteLock m_lock {
97 QReadWriteLock::Recursive
107 qint64 lastModifiedMsSinceEpoch(QNetworkReply *nwReply)
const;
110 void threadAssertCheck()
const;
114 bool didContentChange(
const QString &content,
int startPosition = -1);
117 void setInitialAndPeriodicTime(
int initialTime,
int periodicTime);
124 bool doWorkCheck()
const;
132 virtual void networkReplyProgress(
int logId, qint64 current, qint64 max,
const QUrl &url);
136 void logNetworkReplyReceived(QNetworkReply *reply);
146 static constexpr
int OutdatedPendingCallMs = 30 * 1000;
148 int m_initialTime = -1;
149 int m_periodicTime = -1;
150 QDateTime m_updateTimestamp;
151 size_t m_contentHash = 0;
152 std::atomic_bool m_markedAsFailed {
false };
153 bool m_unitTest {
false };
Support for threaded based reading and parsing tasks such as data files via http, or file system and ...
std::atomic_llong m_networkReplyCurrent
current bytes
std::atomic_int m_networkReplyProgress
Progress percentage 0...100.
int getNetworkReplyProgress() const
Progress 0..100.
void markAsUsedInUnitTest()
Used in unit test.
std::atomic_llong m_networkReplyNax
max bytes
virtual void doWorkImpl()
This method does the actual work in the derived class.
Base class for a long-lived worker object which lives in its own thread.
Callable wrapper for a member function with function signature F.
Streamable status message, e.g.
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
Value object encapsulating a list of voice rooms.
Backend services of the swift project, like dealing with the network or the simulators.
#define SWIFT_CORE_EXPORT
Export a class or function from the library.