VPTissue Reference Manual
ClientHandler.h
Go to the documentation of this file.
1 #ifndef SIMPT_PAREX_CLIENT_HANDLER_H_
2 #define SIMPT_PAREX_CLIENT_HANDLER_H_
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include <QObject>
23 #include <memory>
24 #include <string>
25 
26 class QTcpSocket;
27 
28 namespace SimPT_Parex {
29 
30 class Exploration;
31 class ExplorationManager;
32 class ServerClientProtocol;
33 
37 class ClientHandler: public QObject
38 {
39  Q_OBJECT
40 public:
47  ClientHandler(QTcpSocket *socket, const std::shared_ptr<ExplorationManager> &explorationManager, QObject *parent = 0);
48 
49 private slots:
50  void DeleteExploration(const std::string &name);
51 
52  void DisplayError(const std::string &error) const;
53 
54  void Refresh();
55 
56  void RegisterExploration(const Exploration *exploration);
57 
58  void SendExplorationNames();
59 
60  void Subscribe(const std::string &name);
61 
62  void Unsubscribe(const std::string &name);
63 
64 private:
65  ServerClientProtocol* m_protocol;
66  std::shared_ptr<ExplorationManager> m_exploration_manager;
67  std::string m_subscribed_exploration;
68 };
69 
70 } // namespace
71 
72 #endif // end-of-include-guard
ClientHandler(QTcpSocket *socket, const std::shared_ptr< ExplorationManager > &explorationManager, QObject *parent=0)
Constructor.
Connection from the server to one client, handles client messages and requests.
Definition: ClientHandler.h:37
ServerClient Protocol to deal with Client-Server communication (Server-side)
Namespace for SimPT parameter explorer package.
Definition: Client.cpp:52
see the online Qt documentation
Class describing a generic exploration.
Definition: Exploration.h:33