summaryrefslogtreecommitdiffstats
path: root/src/net/pvsLocalhostCommunicator.h
blob: 425cc37bd5e3621950601b6fa2d191840140453f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/// test documentation
/// whatever
//! and one more



#ifndef _PVSLocalhostCommunicator_H_
#define _PVSLocalhostCommunicator_H_
#include <src/util/dispatcher.h>
#include <QtNetwork/QUdpSocket>


class PVSMsg;

class PVSLocalhostCommunicator : public QObject
{
    Q_OBJECT
public:
    PVSLocalhostCommunicator(QString path);
    void run();
    bool server()
    {
        return _isServer;
    };
    bool running()
    {
        return _isRunning;
    };
    void stop();
    void sendCommand(QString ident, QString cmd);
    EventIdentDispatcher<PVSMsg>* getDispatcher()
    {
        return &_daemonDispatcher;
    };

private Q_SLOTS:
    void sock_dataArrival();

private:

    bool _isServer, _isRunning;
    QUdpSocket* _sock;



    EventIdentDispatcher<PVSMsg> _daemonDispatcher; //!< Dispatcher for Daemon Commands
};

typedef PVSLocalhostCommunicator PVSUDSC;

#endif