source: pacpusframework/trunk/src/PacpusTools/src/PeriodicWorker.cpp@ 76

Last change on this file since 76 was 76, checked in by Marek Kurdej, 12 years ago

Added: automated license updating lines:
%pacpus:license{
%pacpus:license}

  • Property svn:keywords set to Id
File size: 683 bytes
Line 
1// %pacpus:license{
2// This file is part of the PACPUS framework distributed under the
3// CECILL-C License, Version 1.0.
4// %pacpus:license}
5
6#include <Pacpus/PacpusTools/PeriodicWorker.h>
7
8#include <QTimer>
9
10using namespace pacpus;
11
12PeriodicWorker::PeriodicWorker()
13 : AsyncWorkerBase()
14 , mHeartbeat(NULL)
15{
16 mHeartbeat = new QTimer(this);
17}
18
19PeriodicWorker::~PeriodicWorker()
20{
21}
22
23void
24PeriodicWorker::startWork(int msec)
25{
26 mHeartbeat->start(msec);
27 connect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
28
29 this->start();
30}
31
32void
33PeriodicWorker::stopWork()
34{
35 disconnect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
36}
Note: See TracBrowser for help on using the repository browser.