25 using boost::property_tree::ptree;
42 writer.put(
"SimResult.Id", result.
GetTaskId());
43 writer.put(
"SimResult.Success", static_cast<int>(result.
GetResult()));
50 if (reader.find(
"SimTask") != reader.not_found()) {
51 int task_id = reader.get<
int>(
"SimTask.Id");
52 std::string tree = reader.get<std::string>(
"SimTask.Tree");
53 std::string workspace = reader.get<std::string>(
"SimTask.Workspace");
54 std::string name = reader.get<std::string>(
"SimTask.Exploration");
57 }
else if (reader.find(
"SimResult") != reader.not_found()) {
58 std::string tree = reader.get<std::string>(
"SimResult.Ack");
60 }
else if (reader.find(
"Control") != reader.not_found()) {
61 ptree control_pt = reader.get_child(
"Control");
62 if (control_pt.find(
"Stop") != control_pt.not_found()) {
64 }
else if (control_pt.find(
"Delete") != control_pt.not_found()){
65 std::string name = control_pt.get<std::string>(
"Delete");
Base class for the XML/ptree protocols between client, server and node.
void Delete(const std::string &name) const
Emitted to indicate an exploration must be deleted from the disk.
void StopTask() const
Emitted to indicate the current task must be stopped.
virtual ~NodeProtocol()
Destructor.
A container class for the final result of a simulation.
void SendPtree(const boost::property_tree::ptree &pt)
Sends a ptree over the connection.
int GetTaskId() const
Return the id of the finished task.
ResultType GetResult() const
Check if the simulation was successfully completed.
void SendSimResult(const SimResult &result)
Sends the result of a simulation back to the server.
void TaskReceived(const SimTask *task) const
Signal emitted when a SimTask is received.
std::string GetExplorationName() const
Returns the name of the exploration of the finished task.
Interface for NodeProtocol.
virtual void ReceivePtree(const boost::property_tree::ptree &reader)
Receive a ptree message (implementats Protocol::ReceivePtree).
Namespace for SimPT parameter explorer package.
NodeProtocol(QTcpSocket *socket, QObject *parent=0)
Constructor.
Contains all information needed for a transmitable simulation task.
void SuccessfullySent() const
Signal emitted when a SimTask is successfully sent.
see the online Qt documentation