#ifndef DATAMANAGER_H #define DATAMANAGER_H #include #include #include #include #include #include #include "database.h" #include "tcpserver.h" #include "protocol.h" #include "code.h" #include "line.h" class DataManager : public QObject { Q_OBJECT public: explicit DataManager(QObject *parent = nullptr); static void disconnect_from_cln(QTcpSocket* sock); static void recv_from_cln(QByteArray &data, QTcpSocket* sock); QString getRandomString(int nLen); signals: private: DataBase *database; Code *codedb; Line *linedb; Protocol *protocol; TCPServer *server; int count; QList online_socket_list; QList online_name_list; static DataManager *p_this; void update_namelist(QTcpSocket *sock); void update_count(QTcpSocket *sock, int count); }; #endif // DATAMANAGER_H