Wireshark  4.3.0
The Wireshark network protocol analyzer
glib_mainloop_on_qeventloop.h
Go to the documentation of this file.
1 
8 #ifndef GLIB_MAINLOOP_ON_QEVENTLOOP_H
9 #define GLIB_MAINLOOP_ON_QEVENTLOOP_H
10 
11 #include <QThread>
12 #include <QMutex>
13 #include <QWaitCondition>
14 
15 class GLibPoller : public QThread
16 {
17  Q_OBJECT
18 
19 protected:
20  explicit GLibPoller(GMainContext *context);
21  ~GLibPoller();
22 
23  void run() override;
24 
25  QMutex mutex_;
26  QWaitCondition dispatched_;
27  GMainContext *ctx_;
28  int priority_;
29  GPollFD *fds_;
30  int allocated_fds_, nfds_;
31 
32 signals:
33  void polled(void);
34 
35  friend class GLibMainloopOnQEventLoop;
36 };
37 
38 class GLibMainloopOnQEventLoop : public QObject
39 {
40  Q_OBJECT
41 
42 protected:
43  explicit GLibMainloopOnQEventLoop(QObject *parent);
45 
46 protected slots:
47  void checkAndDispatch();
48 
49 public:
50  static void setup(QObject *parent);
51 
52 protected:
53  GLibPoller poller_;
54 };
55 
56 #endif /* GLIB_MAINLOOP_ON_QEVENTLOOP_H */
Definition: glib_mainloop_on_qeventloop.h:39
Definition: glib_mainloop_on_qeventloop.h:16