27 bool isOpen()
const {
return _isOpen.load(std::memory_order_relaxed); }
28 bool hasError()
const {
return _hasError.load(std::memory_order_relaxed); }
31 qint64
fileSize()
const {
return _fileSize.load(std::memory_order_relaxed); }
32 qint64
pendingBytes()
const {
return _pendingBytes.load(std::memory_order_relaxed); }
36 void write(
const QByteArray &data);
38 bool flush(
int timeoutMs = 5000);
59 mutable QMutex _mutex;
60 QWaitCondition _condition;
61 QList<WorkItem> _queue;
66 QThread *_thread =
nullptr;
67 std::atomic<bool> _isOpen{
false};
68 std::atomic<bool> _hasError{
false};
69 std::atomic<bool> _quit{
false};
70 std::atomic<qint64> _fileSize{0};
71 std::atomic<qint64> _pendingBytes{0};
72 std::atomic<quint64> _flushSeq{0};
73 std::atomic<quint64> _writeSeq{0};
74 qint64 _maxPendingBytes = 50LL * 1024 * 1024;