VPTissue Reference Manual
ClientProtocol.h
Go to the documentation of this file.
1 #ifndef SIMPT_PAREX_CLIENT_PROTOCOL_H_
2 #define SIMPT_PAREX_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 
24 #include <vector>
25 #include <QObject>
26 
27 namespace SimPT_Parex {
28 
29 class Exploration;
30 class ExplorationProgress;
31 class ServerInfo;
32 
36 class ClientProtocol: public Protocol
37 {
38  Q_OBJECT
39 public:
45  ClientProtocol(ServerInfo *server, QObject *parent = nullptr);
46 
50  virtual ~ClientProtocol() {}
51 
57  bool SendExploration(const Exploration *exploration);
58 
64  bool DeleteExploration(const std::string &name);
65 
70 
76  bool SubscribeUpdates(const std::string &explorationName);
77 
83  bool UnsubscribeUpdates(const std::string &explorationName);
84 
88  bool StopTask(const std::string &name, int task);
89 
93  bool RestartTask(const std::string &name, int task);
94 
95 signals:
99  void ExplorationNames(const std::vector<std::string> &names) const;
100 
104  void ExplorationStatus(const ExplorationProgress* exploration) const;
105 
109  void ExplorationDeleted() const;
110 
111 protected:
118  virtual void ReceivePtree(const boost::property_tree::ptree &reader);
119 };
120 
121 } // namespace
122 
123 #endif // end-of-include-guard
Base class for the XML/ptree protocols between client, server and node.
Definition: Protocol.h:35
bool RequestExplorationNames()
Request a list of current Explorations.
Interface for Protocol.
void ExplorationStatus(const ExplorationProgress *exploration) const
Signal emitted when new status update is received.
virtual void ReceivePtree(const boost::property_tree::ptree &reader)
Receive a ptree message Implementation of Protocol::ReceivePtree.
Class describing the progress state of an exploration.
bool RestartTask(const std::string &name, int task)
Request to restart a task.
bool SubscribeUpdates(const std::string &explorationName)
Subscribe for regular updates.
virtual ~ClientProtocol()
Destructor.
bool SendExploration(const Exploration *exploration)
Send exploration.
bool DeleteExploration(const std::string &name)
Request a stop and delete of the given exploration.
Class for storing server info used on client-side.
Definition: ServerInfo.h:29
Namespace for SimPT parameter explorer package.
Definition: Client.cpp:52
void ExplorationNames(const std::vector< std::string > &names) const
Signal emitted when exploration names are received.
ClientProtocol(ServerInfo *server, QObject *parent=nullptr)
Constructor.
bool UnsubscribeUpdates(const std::string &explorationName)
Unsubscribe for regular updates.
void ExplorationDeleted() const
Signal emitted when subscribed exploration has been deleted.
see the online Qt documentation
Class describing a generic exploration.
Definition: Exploration.h:33
bool StopTask(const std::string &name, int task)
Request to stop a task.
Client side of the protocol.