-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathsocketExample.uml
More file actions
69 lines (49 loc) · 1.26 KB
/
socketExample.uml
File metadata and controls
69 lines (49 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# PlantUML Editor
@startuml
class QTcpServer {
#void {abstract} incomingConnection()
}
class MyServer {
-QThreadPool* pool
#startServer():void
#void incomingConnection()
}
note left of MyServer::incomingConnection
Inherited method from QTcpServer, for each connection
this will be called and creates the MyClient instance
end note
class QObject {
}
class QRunnable {
# void {abstract} run()
}
class MyClient {
MyClient(QObject *parent = 0, QThreadPool *pool = 0)
-QTcpSocket *socket
-QThreadPool *pool
-void connected()
-void disconnected()
-void readyRead()
-void TaskResult(int Number)
+void setSocket(qintptr Descriptor)
}
note left of MyClient::readyRead
This will create MyTask instance and send to pool
end note
note left of MyClient::setSocket
three methods will be connected to sockets object equivalent
connect(socket, SIGNAL(connected()), this, SLOT(connected()));
connect(socket, SIGNAL(disconnected()), this, SLOT(disconnected()));
connect(socket, SIGNAL(readyRead()), this, SLOT(readyRead()));
end note
class MyTask {
MyTask()
# void run()
}
MyServer -up-|> QTcpServer
MyClient -down-|> QObject
MyServer -down-> MyClient
MyTask -right-|> QObject
MyTask -left-|> QRunnable
MyClient -down-> MyTask
@enduml