VPTissue Reference Manual
ServerClientProtocol.h
Go to the documentation of this file.
1 #ifndef SIMPT_PAREX_SERVER_CLIENT_PROTOCOL_H_
2 #define SIMPT_PAREX_SERVER_CLIENT_PROTOCOL_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 "Protocol.h"
23 #include <vector>
24 
25 class QTcpSocket;
26 
27 namespace SimPT_Parex {
28 
29 class Exploration;
30 class ExplorationProgress;
31 class SimTask;
32 
37 {
38  Q_OBJECT
39 public:
44  ServerClientProtocol(QTcpSocket* socket, QObject* parent = 0);
45 
49  virtual ~ServerClientProtocol();
50 
51 
56  void SendAck(const std::string& name);
57 
62  void SendExplorationNames(const std::vector<std::string>& names);
63 
68  void SendStatus(const ExplorationProgress& status);
69 
74  void SendStatusDeleted(const std::string& name);
75 
76 signals:
81  void ExplorationReceived(const Exploration* exploration);
82 
87  void DeleteExploration(const std::string& name);
88 
93 
98  void Subscribe(const std::string& name);
99 
104  void Unsubscribe(const std::string& name);
105 
109  void StopTask(const std::string& name, int id);
110 
114  void RestartTask(const std::string& name, int id);
115 
116 protected:
122  virtual void ReceivePtree(const boost::property_tree::ptree& reader);
123 };
124 
125 } // namespace
126 
127 #endif // end-of-include-guard
void SendStatusDeleted(const std::string &name)
Send a deleted status for the exploration with the specified name.
Base class for the XML/ptree protocols between client, server and node.
Definition: Protocol.h:35
void Subscribe(const std::string &name)
Emitted when a request for subscription arrives.
Interface for Protocol.
virtual void ReceivePtree(const boost::property_tree::ptree &reader)
Receive a ptree message Implementation of Protocol::ReceivePtree.
void SendAck(const std::string &name)
Acknowledgement for sent exploration.
void ExplorationNamesRequested()
Emitted when the names of the explorations are requested.
ServerClientProtocol(QTcpSocket *socket, QObject *parent=0)
Constructor.
Class describing the progress state of an exploration.
void SendExplorationNames(const std::vector< std::string > &names)
Send list of Exploration names.
void DeleteExploration(const std::string &name)
Emitted when a request to stop/delete the given exploration is received.
void StopTask(const std::string &name, int id)
Emitted when a request for stopping a task arrives.
void ExplorationReceived(const Exploration *exploration)
Emitted when an exploration is received.
ServerClient Protocol to deal with Client-Server communication (Server-side)
Namespace for SimPT parameter explorer package.
Definition: Client.cpp:52
void Unsubscribe(const std::string &name)
Emitted when a request for unsubscription arrives.
see the online Qt documentation
Class describing a generic exploration.
Definition: Exploration.h:33
void RestartTask(const std::string &name, int id)
Emitted when a request for stopping a task arrives.
void SendStatus(const ExplorationProgress &status)
Send status for given exploration.