28 #include <boost/property_tree/ptree.hpp>
31 using boost::property_tree::ptree;
47 if (dynamic_cast<const ParameterExploration*>(exploration) !=
nullptr) {
48 writer.put_child(
"parameter_exploration", exploration->
ToPtree());
49 }
else if (dynamic_cast<const FileExploration*>(exploration) !=
nullptr) {
50 writer.put_child(
"file_exploration", exploration->
ToPtree());
52 assert(
"Exploration type unknown.");
65 writer.put(
"Control.Delete", name);
77 writer.put(
"Control.RequestExplorations",
"Explorations");
89 writer.put(
"Control.Subscribe", explorationName);
101 writer.put(
"Control.Unsubscribe", explorationName);
113 writer.put(
"Control.Stop.name", name);
114 writer.put(
"Control.Stop.id", to_string(task));
126 writer.put(
"Control.Start.name", name);
127 writer.put(
"Control.Start.id", to_string(task));
135 if (reader.find(
"Control") != reader.not_found()) {
136 ptree control_pt = reader.get_child(
"Control");
138 if (control_pt.find(
"ExplorationNames") != control_pt.not_found()) {
139 std::vector<std::string> names;
140 int size = control_pt.get<
int>(
"ExplorationNames.size");
141 for (
int i = 0; i < size; ++i) {
142 names.push_back(control_pt.get<std::string>(
143 "ExplorationNames.exploration" + to_string(i) +
".name"));
147 }
else if (control_pt.find(
"Status") != control_pt.not_found()) {
148 ptree status_pt = control_pt.get_child(
"Status");
149 if (status_pt.find(
"deleted") != status_pt.not_found()) {
Base class for the XML/ptree protocols between client, server and node.
Interface for Exploration.
bool RequestExplorationNames()
Request a list of current Explorations.
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.
void SendPtree(const boost::property_tree::ptree &pt)
Sends a ptree over the connection.
bool RestartTask(const std::string &name, int task)
Request to restart a task.
bool SubscribeUpdates(const std::string &explorationName)
Subscribe for regular updates.
virtual boost::property_tree::ptree ToPtree() const
Convert the exploration to a ptree.
bool SendExploration(const Exploration *exploration)
Send exploration.
Interface for ClientProtocol.
bool DeleteExploration(const std::string &name)
Request a stop and delete of the given exploration.
String manipulation utilities.
Class for storing server info used on client-side.
Namespace for SimPT parameter explorer package.
void ExplorationNames(const std::vector< std::string > &names) const
Signal emitted when exploration names are received.
bool UnsubscribeUpdates(const std::string &explorationName)
Unsubscribe for regular updates.
void ExplorationDeleted() const
Signal emitted when subscribed exploration has been deleted.
bool IsConnected()
Check if still connected.
see the online Qt documentation
Class describing a generic exploration.
bool StopTask(const std::string &name, int task)
Request to stop a task.
Interface for ParameterExploration.
Interface for ExplorationProgress.
Interface for FileExploration.