1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef CLIENT_H |
6 | #define CLIENT_H |
7 | |
8 | #include <QObject> |
9 | #include <QtConcurrent> |
10 | |
11 | #include <jsonrpccpp/client.h> |
12 | #include <jsonrpccpp/client/connectors/tcpsocketclient.h> |
13 | |
14 | #include <iostream> |
15 | |
16 | class Client : public QObject |
17 | { |
18 | Q_OBJECT |
19 | jsonrpc::TcpSocketClient tcpSocketClient; |
20 | public: |
21 | Client(const std::string &ipToConnect, const unsigned int &port); |
22 | |
23 | public slots: |
24 | void initialzation(int pid); |
25 | void pullData(); |
26 | void shutdown(); |
27 | void exit(); |
28 | |
29 | signals: |
30 | void initialzationResult(const Json::Value &result); |
31 | void pullDataResult(const Json::Value &result); |
32 | void shutdownResult(const Json::Value &result); |
33 | }; |
34 | |
35 | #endif // CLIENT_H |
36 |