6 #ifndef SWIFT_CORE_THREADED_READER_H
7 #define SWIFT_CORE_THREADED_READER_H
14 #include <QReadWriteLock>
38 static const QStringList &getLogCategories();
57 QDateTime getUpdateTimestamp()
const;
61 void setUpdateTimestamp(
const QDateTime &updateTimestamp = QDateTime::currentDateTimeUtc());
66 bool isMarkedAsFailed()
const;
71 void setMarkedAsFailed(
bool failed);
86 QPair<qint64, qint64> getNetworkReplyBytes()
const;
89 mutable QReadWriteLock m_lock {
90 QReadWriteLock::Recursive
100 qint64 lastModifiedMsSinceEpoch(QNetworkReply *nwReply)
const;
103 void threadAssertCheck()
const;
107 bool didContentChange(
const QString &content,
int startPosition = -1);
111 bool doWorkCheck()
const;
119 virtual void networkReplyProgress(
int logId, qint64 current, qint64 max,
const QUrl &url);
123 void logNetworkReplyReceived(QNetworkReply *reply);
130 static constexpr
int OutdatedPendingCallMs = 30 * 1000;
132 QDateTime m_updateTimestamp;
133 size_t m_contentHash = 0;
134 std::atomic_bool m_markedAsFailed {
false };
135 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.
CThreadedReader(CThreadedReader &&)=delete
Move constructor.
void markAsUsedInUnitTest()
Used in unit test.
CThreadedReader & operator=(const CThreadedReader &)=delete
Copy assignment.
CThreadedReader & operator=(CThreadedReader &&)=delete
Move assignment.
CThreadedReader(const CThreadedReader &)=delete
Copy constructor.
~CThreadedReader()=default
Destructor.
std::atomic_llong m_networkReplyMax
max bytes
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.