VPTissue Reference Manual
SimPT_Parex::ClientProtocol Class Reference

Client side of the protocol. More...

#include <ClientProtocol.h>

Inheritance diagram for SimPT_Parex::ClientProtocol:
Inheritance graph
Collaboration diagram for SimPT_Parex::ClientProtocol:
Collaboration graph

Signals

void ExplorationDeleted () const
 Signal emitted when subscribed exploration has been deleted.
 
void ExplorationNames (const std::vector< std::string > &names) const
 Signal emitted when exploration names are received.
 
void ExplorationStatus (const ExplorationProgress *exploration) const
 Signal emitted when new status update is received.
 
- 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

 ClientProtocol (ServerInfo *server, QObject *parent=nullptr)
 Constructor. More...
 
virtual ~ClientProtocol ()
 Destructor.
 
bool DeleteExploration (const std::string &name)
 Request a stop and delete of the given exploration. More...
 
bool RequestExplorationNames ()
 Request a list of current Explorations.
 
bool RestartTask (const std::string &name, int task)
 Request to restart a task.
 
bool SendExploration (const Exploration *exploration)
 Send exploration. More...
 
bool StopTask (const std::string &name, int task)
 Request to stop a task.
 
bool SubscribeUpdates (const std::string &explorationName)
 Subscribe for regular updates. More...
 
bool UnsubscribeUpdates (const std::string &explorationName)
 Unsubscribe for regular updates. 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

Client side of the protocol.

Definition at line 36 of file ClientProtocol.h.

Constructor & Destructor Documentation

SimPT_Parex::ClientProtocol::ClientProtocol ( ServerInfo server,
QObject parent = nullptr 
)

Constructor.

Parameters
socketThe socket to connect through

Definition at line 35 of file ClientProtocol.cpp.

Member Function Documentation

bool SimPT_Parex::ClientProtocol::DeleteExploration ( const std::string &  name)

Request a stop and delete of the given exploration.

Parameters
nameThe name of the exploration to stop and delete

Definition at line 59 of file ClientProtocol.cpp.

References SimPT_Parex::Protocol::IsConnected(), and SimPT_Parex::Protocol::SendPtree().

Here is the call graph for this function:

void SimPT_Parex::ClientProtocol::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 133 of file ClientProtocol.cpp.

References ExplorationDeleted(), ExplorationNames(), and ExplorationStatus().

bool SimPT_Parex::ClientProtocol::SendExploration ( const Exploration exploration)

Send exploration.

Parameters
explorationThe Exploration to send

Definition at line 40 of file ClientProtocol.cpp.

References SimPT_Parex::Protocol::IsConnected(), SimPT_Parex::Protocol::SendPtree(), and SimPT_Parex::Exploration::ToPtree().

Here is the call graph for this function:

bool SimPT_Parex::ClientProtocol::SubscribeUpdates ( const std::string &  explorationName)

Subscribe for regular updates.

Parameters
exploration_nameThe name of the exploration to subscribe to

Definition at line 83 of file ClientProtocol.cpp.

References SimPT_Parex::Protocol::IsConnected(), and SimPT_Parex::Protocol::SendPtree().

Here is the call graph for this function:

bool SimPT_Parex::ClientProtocol::UnsubscribeUpdates ( const std::string &  explorationName)

Unsubscribe for regular updates.

Parameters
exploration_nameThe name of the exploration to unsubscribe

Definition at line 95 of file ClientProtocol.cpp.

References SimPT_Parex::Protocol::IsConnected(), and SimPT_Parex::Protocol::SendPtree().

Here is the call graph for this function:


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