| #pragma once |
| |
| #ifndef TIPC_SERVER_H |
| #define TIPC_SERVER_H |
| |
| |
| #include "tcommon.h" |
| |
| |
| #include <map> |
| |
| |
| #include <QString> |
| #include <QHash> |
| #include <QSharedMemory> |
| #include <QLocalServer> |
| #include <QLocalSocket> |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZCORE_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| namespace tipc { |
| |
| class MessageParser; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI Server final : public QLocalServer { |
| Q_OBJECT |
| |
| QHash<QString, MessageParser *> m_parsers; |
| bool m_lock; |
| |
| public: |
| Server(); |
| ~Server(); |
| |
| void addParser(MessageParser *parser); |
| void removeParser(QString header); |
| |
| |
| |
| |
| |
| |
| |
| |
| void dispatchSocket(QLocalSocket *socket); |
| |
| public Q_SLOTS: |
| |
| |
| |
| void onNewConnection(); |
| void onError(QLocalSocket::LocalSocketError); |
| }; |
| |
| } |
| |
| #endif |