#ifndef NETWORKPROVIDER #define NETWORKPROVIDER #include #include #include "provider/IProvider.h" #include "parser/IParser.h" #include class NetworkProvider : public QObject, public IDataProvider { Q_OBJECT Q_INTERFACES(IDataProvider) public: NetworkProvider(QHostAddress hostAddress, quint16 port); void setParser(Parser_ptr parser); void pauseServer(); void resumeServer(); void stopServer(); signals: void provided(const Log_ptr log) override; //uncrustify off private slots: //uncrustify on void onErrorOccured(QAbstractSocket::SocketError error); void createNewConnection(); private: bool _isRunning; quint16 _port; QHostAddress _address; QTcpServer _server; Parser_ptr _parser; void initServer(); void resumeConnectedSessions(); void stopConnectedSessions(); QTimer _timer; }; #endif //NEWTORKPROVIDER