OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
CommunicationHandler.h
Go to the documentation of this file.
1#pragma once
2
3// Qt header
4#include <QtCore/qobject.h>
5
6// std header
7#include <string>
8
9class QLocalSocket;
10
11class CommunicationHandler : public QObject {
12 Q_OBJECT
13public:
15 virtual ~CommunicationHandler();
16
17 void setServerName(const std::string& _serverName) { m_serverName = _serverName; };
18 const std::string& getServerName(void) const { return m_serverName; };
19
20 bool ensureConnectionToServer(void);
21
22Q_SIGNALS:
23 void disconnected(void);
24
25private Q_SLOTS:
26 void slotDataReceived(void);
27 void slotProcessMessage(std::string _message);
28 void slotDisconnected(void);
29
30private:
31 bool writeToServer(const std::string& _message);
32 void processNextEvent(void);
33
34 std::string m_serverName;
35 QLocalSocket* m_serverSocket;
36
37};
Definition CommunicationHandler.h:11
void setServerName(const std::string &_serverName)
Definition CommunicationHandler.h:17
virtual ~CommunicationHandler()
Definition CommunicationHandler.cpp:22
const std::string & getServerName(void) const
Definition CommunicationHandler.h:18
CommunicationHandler()
Definition CommunicationHandler.cpp:16
void disconnected(void)
bool ensureConnectionToServer(void)
Definition CommunicationHandler.cpp:26