Diana Software
QDbWatchdogThread.hh
Go to the documentation of this file.
1 
2 #ifndef _Q_DB_WATCHDOG_THREAD_HH_
3 #define _Q_DB_WATCHDOG_THREAD_HH_
4 
5 #include "QBaseThread.hh"
6 
7 class QWatchdogTimer;
8 class QDb;
9 
20 {
21 public:
23  virtual ~QDbWatchdogThread() {}
24 
26  void SetWatchdogTimer(QWatchdogTimer* timer) { fTimer = timer; }
28  void SetDatabase(QDb* db) { fDb = db; }
29 
30  /*
31  * After some preliminary error checks, a loop is started that repeatedly
32  * checks the timeout and ends the db connection if it has expired.
33  */
34  virtual void operator()();
35 
36 private:
37  QWatchdogTimer* fTimer; // not owned by this object
38  QDb* fDb; // not owned by this object
39 };
40 #endif
base abstract class for running a separate thread
Definition: QBaseThread.hh:21
thread responsible for closing the database connection after it remains idle for a certain amount of ...
QWatchdogTimer * fTimer
virtual void operator()()
virtual ~QDbWatchdogThread()
void SetDatabase(QDb *db)
void SetWatchdogTimer(QWatchdogTimer *timer)
base class for db interface
Definition: QDb.hh:28
thread-safe timer class