author | Markus Bröker <mbroeker@largo.homelinux.org> |
Sat, 13 Dec 2008 15:47:44 +0100 | |
changeset 1 | 9de88b525a59 |
parent 0 | 826dd5531eb0 |
child 3 | 724e07a9f155 |
permissions | -rw-r--r-- |
0
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
1 |
/* |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
2 |
* $Id: readerthread.h 2 2007-12-22 14:15:30Z mbroeker $ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
3 |
* $URL: http://localhost/svn/cpp/qMonitor/trunk/include/readerthread.h $ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
4 |
*/ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
5 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
6 |
#ifndef READERTHREAD_H |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
7 |
#define READERTHREAD_H |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
8 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
9 |
#include "monitor.h" |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
10 |
#include <qthread.h> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
11 |
#include <qevent.h> |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
12 |
#include "PacketParser.h" |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
13 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
14 |
#define MSG_EVENT 65432 |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
15 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
16 |
class Monitor; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
17 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
18 |
class DataChangeEvent : public QEvent { |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
19 |
public: |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
20 |
DataChangeEvent(QString msg_) |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
21 |
: QEvent((QEvent::Type)MSG_EVENT) |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
22 |
{ |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
23 |
msg = msg_; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
24 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
25 |
} |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
26 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
27 |
QString Text() const { return msg; } |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
28 |
private: |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
29 |
QString msg; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
30 |
}; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
31 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
32 |
class readerThread : public QThread { |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
33 |
public: |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
34 |
readerThread(Monitor*); |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
35 |
virtual void run(); |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
36 |
private: |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
37 |
Monitor *handle; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
38 |
}; |
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
39 |
|
826dd5531eb0
svn copy of qmonitor
Markus Bröker <mbroeker@largo.homelinux.org>
parents:
diff
changeset
|
40 |
#endif |