Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
Loading...
Searching...
No Matches
event_loop_watchdog.h
Go to the documentation of this file.
1
5
6
#ifndef EVENT_LOOP_WATCHDOG_H
7
#define EVENT_LOOP_WATCHDOG_H
8
9
#include <QElapsedTimer>
10
#include <QObject>
11
#include <QString>
12
#include <qtmetamacros.h>
13
14
class
Servatrice
;
15
class
QTimer;
16
26
class
EventLoopWatchdog
:
public
QObject
27
{
28
Q_OBJECT
29
public
:
31
static
constexpr
int
HeartbeatIntervalMs
= 500;
32
33
EventLoopWatchdog
(
Servatrice
*_servatrice, QString _threadName);
34
39
void
start
();
40
41
private
slots:
42
void
checkHeartbeat
();
43
44
private
:
45
Servatrice
*
servatrice
;
46
QString
threadName
;
47
QElapsedTimer
sinceLastTick
;
48
QTimer *
heartbeatTimer
=
nullptr
;
49
};
50
51
#endif
EventLoopWatchdog::sinceLastTick
QElapsedTimer sinceLastTick
Definition
event_loop_watchdog.h:47
EventLoopWatchdog::checkHeartbeat
void checkHeartbeat()
Definition
event_loop_watchdog.cpp:27
EventLoopWatchdog::HeartbeatIntervalMs
static constexpr int HeartbeatIntervalMs
How often the heartbeat expects to fire. Small enough to catch short stalls.
Definition
event_loop_watchdog.h:31
EventLoopWatchdog::heartbeatTimer
QTimer * heartbeatTimer
Definition
event_loop_watchdog.h:48
EventLoopWatchdog::EventLoopWatchdog
EventLoopWatchdog(Servatrice *_servatrice, QString _threadName)
Definition
event_loop_watchdog.cpp:14
EventLoopWatchdog::start
void start()
Definition
event_loop_watchdog.cpp:19
EventLoopWatchdog::threadName
QString threadName
Definition
event_loop_watchdog.h:46
EventLoopWatchdog::servatrice
Servatrice * servatrice
Definition
event_loop_watchdog.h:45
Servatrice
Definition
servatrice.h:149
servatrice
src
event_loop_watchdog.h
Generated by
1.18.0