/* * Copyright 2018 gtalent2@gmail.com * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once #include #include #include #include #include #include #include "processdata.hpp" class DataFeed: public QObject { Q_OBJECT private: QSharedPointer m_procData = QSharedPointer(new ProcessData); std::unique_ptr m_dev; public: explicit DataFeed(QIODevice *dev, bool skipInit = false); const QSharedPointer &procData(); public slots: void handleInit(); void read(); signals: void feedEnd(QIODevice*); }; class LogServer: public QObject { Q_OBJECT private: QPointer m_server = new QTcpServer(this); public: LogServer(); public slots: void handleConnection(); void setupDataFeed(QIODevice *conn); signals: void newDataFeed(DataFeed*); };