24 using boost::property_tree::ptree;
26 ServerNodeProtocol::ServerNodeProtocol(QTcpSocket *socket,
QObject *parent)
27 : Protocol(socket, parent)
31 ServerNodeProtocol::~ServerNodeProtocol()
38 writer.put(
"SimResult.Ack",
"");
45 writer.put(
"SimTask.Id", task.
GetId());
46 writer.put(
"SimTask.Tree", task.
ToString());
55 writer.put(
"Control.Stop",
"");
62 writer.put(
"Control.Delete", name);
68 if (reader.find(
"SimResult") != reader.not_found()) {
69 std::string exploration = reader.get<std::string>(
"SimResult.Exploration");
70 int task_id = reader.get<
int>(
"SimResult.Id");
71 SimResult::ResultType success =
static_cast<SimResult::ResultType
>(reader.get<
int>(
"SimResult.Success"));
72 SimResult result(exploration, task_id, success, this->GetClientIP(), this->GetClientPort());
void StopTask()
Orders the node to stop its current task.
virtual void ReceivePtree(const boost::property_tree::ptree &reader)
Receive a ptree message (implements of Protocol::ReceivePtree).
A container class for the final result of a simulation.
void SendTask(const SimTask &task)
Sends a task to the server.
void SendPtree(const boost::property_tree::ptree &pt)
Sends a ptree over the connection.
std::string ToString() const
Get the simulation in string representation (ptree xml).
void SendAck()
Sends an acknowledgment of a received result to the server.
void ResultReceived(const SimResult &result)
Signals emitted when a sim result was received.
Interface for ServerNodeProtocol.
std::string WorkspaceToString() const
Get the workspace settings in string representation (ptree xml).
void Delete(const std::string &name)
Orders the node to delete all files it has for a certain exploration.
Namespace for SimPT parameter explorer package.
std::string GetExploration() const
Get the name of the exploration.
Contains all information needed for a transmitable simulation task.
int GetId() const
Get the id of the task in the exploration.
see the online Qt documentation