VPTissue Reference Manual
SimPT_Parex::ServerClientProtocol Class Reference

ServerClient Protocol to deal with Client-Server communication (Server-side) More...

#include <ServerClientProtocol.h>

Inheritance diagram for SimPT_Parex::ServerClientProtocol:
Inheritance graph
Collaboration diagram for SimPT_Parex::ServerClientProtocol:
Collaboration graph

Signals

void DeleteExploration (const std::string &name)
 Emitted when a request to stop/delete the given exploration is received. More...
 
void ExplorationNamesRequested ()
 Emitted when the names of the explorations are requested.
 
void ExplorationReceived (const Exploration *exploration)
 Emitted when an exploration is received. More...
 
void RestartTask (const std::string &name, int id)
 Emitted when a request for stopping a task arrives.
 
void StopTask (const std::string &name, int id)
 Emitted when a request for stopping a task arrives.
 
void Subscribe (const std::string &name)
 Emitted when a request for subscription arrives. More...
 
void Unsubscribe (const std::string &name)
 Emitted when a request for unsubscription arrives. More...
 
- Signals inherited from SimPT_Parex::Protocol
void Ended ()
 Signal emitted when the protocol has ended and the connection is closed.
 
void Error (const std::string &error)
 Signal emitted when an error occured.
 

Public Member Functions

 ServerClientProtocol (QTcpSocket *socket, QObject *parent=0)
 Constructor. More...
 
virtual ~ServerClientProtocol ()
 Destructor.
 
void SendAck (const std::string &name)
 Acknowledgement for sent exploration. More...
 
void SendExplorationNames (const std::vector< std::string > &names)
 Send list of Exploration names. More...
 
void SendStatus (const ExplorationProgress &status)
 Send status for given exploration. More...
 
void SendStatusDeleted (const std::string &name)
 Send a deleted status for the exploration with the specified name. More...
 
- Public Member Functions inherited from SimPT_Parex::Protocol
 Protocol (QTcpSocket *socket, QObject *parent=nullptr)
 Constructor. More...
 
 Protocol (ServerInfo *server, QObject *parent=nullptr)
 Constructor. More...
 
virtual ~Protocol ()
 Destructor.
 
bool IsConnected ()
 Check if still connected.
 

Protected Member Functions

virtual void ReceivePtree (const boost::property_tree::ptree &reader)
 Receive a ptree message Implementation of Protocol::ReceivePtree. More...
 
- Protected Member Functions inherited from SimPT_Parex::Protocol
std::string GetClientIP () const
 
int GetClientPort () const
 
void SendPtree (const boost::property_tree::ptree &pt)
 Sends a ptree over the connection.
 

Detailed Description

ServerClient Protocol to deal with Client-Server communication (Server-side)

Definition at line 36 of file ServerClientProtocol.h.

Constructor & Destructor Documentation

SimPT_Parex::ServerClientProtocol::ServerClientProtocol ( QTcpSocket *  socket,
QObject parent = 0 
)

Constructor.

Parameters
socketConnected socket to set-up the connection

Definition at line 36 of file ServerClientProtocol.cpp.

Member Function Documentation

void SimPT_Parex::ServerClientProtocol::DeleteExploration ( const std::string &  name)
signal

Emitted when a request to stop/delete the given exploration is received.

Parameters
nameThe name for the exploration to stop/delete

Referenced by ReceivePtree().

Here is the caller graph for this function:

void SimPT_Parex::ServerClientProtocol::ExplorationReceived ( const Exploration exploration)
signal

Emitted when an exploration is received.

Parameters
explorationThe exploration that is received

Referenced by ReceivePtree().

Here is the caller graph for this function:

void SimPT_Parex::ServerClientProtocol::ReceivePtree ( const boost::property_tree::ptree &  reader)
protectedvirtual

Receive a ptree message Implementation of Protocol::ReceivePtree.

Parameters
readerThe received pt

Implements SimPT_Parex::Protocol.

Definition at line 79 of file ServerClientProtocol.cpp.

References DeleteExploration(), ExplorationNamesRequested(), ExplorationReceived(), SimPT_Parex::Exploration::GetName(), RestartTask(), SimPT_Parex::Exploration::SetName(), StopTask(), Subscribe(), and Unsubscribe().

Here is the call graph for this function:

void SimPT_Parex::ServerClientProtocol::SendAck ( const std::string &  name)

Acknowledgement for sent exploration.

Parameters
nameThe name of the exploration

Definition at line 45 of file ServerClientProtocol.cpp.

References SimPT_Parex::Protocol::SendPtree().

Here is the call graph for this function:

void SimPT_Parex::ServerClientProtocol::SendExplorationNames ( const std::vector< std::string > &  names)

Send list of Exploration names.

Parameters
namesThe names of the explorations

Definition at line 52 of file ServerClientProtocol.cpp.

References SimPT_Parex::Protocol::SendPtree().

Here is the call graph for this function:

void SimPT_Parex::ServerClientProtocol::SendStatus ( const ExplorationProgress status)

Send status for given exploration.

Parameters
statusThe progress of the exploration to send to the client

Definition at line 64 of file ServerClientProtocol.cpp.

References SimPT_Parex::Protocol::SendPtree(), and SimPT_Parex::ExplorationProgress::ToPtree().

Here is the call graph for this function:

void SimPT_Parex::ServerClientProtocol::SendStatusDeleted ( const std::string &  name)

Send a deleted status for the exploration with the specified name.

Parameters
nameThe name of the deleted/nonexistent exploration

Definition at line 71 of file ServerClientProtocol.cpp.

References SimPT_Parex::Protocol::SendPtree().

Here is the call graph for this function:

void SimPT_Parex::ServerClientProtocol::Subscribe ( const std::string &  name)
signal

Emitted when a request for subscription arrives.

Parameters
nameThe exploration name to receive updates for

Referenced by ReceivePtree().

Here is the caller graph for this function:

void SimPT_Parex::ServerClientProtocol::Unsubscribe ( const std::string &  name)
signal

Emitted when a request for unsubscription arrives.

Parameters
nameThe exploration name to unsubscribe to

Referenced by ReceivePtree().

Here is the caller graph for this function:


The documentation for this class was generated from the following files: