11 connect(&m_updateTimer, &misc::CThreadedTimer::timeout,
this, &CThreadedReaderPeriodic::doWork);
16 Q_ASSERT_X(
hasStarted(), Q_FUNC_INFO,
"Thread was not started yet!");
21 std::chrono::milliseconds periodicTime)
23 m_initialTime = initialTime;
24 m_periodicTime = periodicTime;
27 void CThreadedReaderPeriodic::doWork()
31 using namespace std::chrono_literals;
32 Q_ASSERT(m_periodicTime.load() > 0ms);
34 m_updateTimer.startTimer(m_periodicTime);
Support for threaded based reading and parsing tasks such as data files via http, or file system and ...
bool doWorkCheck() const
Still enabled etc.?
CThreadedReaderPeriodic(QObject *owner, const QString &name)
Constructor.
virtual void doWorkImpl()=0
This method does the actual work in the derived class.
void setInitialAndPeriodicTime(std::chrono::milliseconds initialTime, std::chrono::milliseconds periodicTime)
Set initial and periodic times Changes only apply after the next time the timer restarts.
void startReader()
Starts the reader.
bool hasStarted() const
True if the worker has started.
Backend services of the swift project, like dealing with the network or the simulators.
auto singleShot(int msec, QObject *target, F &&task)
Starts a single-shot timer which will call a task in the thread of the given object when it times out...