42 lines
632 B
C++
42 lines
632 B
C++
#ifndef REPOINDEX_SERVER_H
|
|
#define REPOINDEX_SERVER_H
|
|
|
|
#include <QObject>
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
|
|
|
|
namespace RepoIndex {
|
|
|
|
class Config;
|
|
class Manager;
|
|
|
|
}
|
|
|
|
namespace RepoIndex {
|
|
|
|
class Connection;
|
|
|
|
class Server : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Server(RepoIndex::Manager &alpmManager, const RepoIndex::Config &config, QObject *parent = nullptr);
|
|
~Server();
|
|
|
|
signals:
|
|
void closed();
|
|
void connectionEstablished(Connection *connection);
|
|
|
|
private Q_SLOTS:
|
|
void incomingConnection();
|
|
|
|
private:
|
|
QWebSocketServer *m_server;
|
|
RepoIndex::Manager &m_alpmManager;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // SERVER_H
|