VPTissue Reference Manual
SimPT_Parex::Protocol Class Referenceabstract

Base class for the XML/ptree protocols between client, server and node. More...

#include <Protocol.h>

Inheritance diagram for SimPT_Parex::Protocol:
Inheritance graph
Collaboration diagram for SimPT_Parex::Protocol:
Collaboration graph

Signals

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

 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

std::string GetClientIP () const
 
int GetClientPort () const
 
virtual void ReceivePtree (const boost::property_tree::ptree &pt)=0
 Method called when a ptree was received over the connection.
 
void SendPtree (const boost::property_tree::ptree &pt)
 Sends a ptree over the connection.
 

Detailed Description

Base class for the XML/ptree protocols between client, server and node.

Definition at line 35 of file Protocol.h.

Constructor & Destructor Documentation

SimPT_Parex::Protocol::Protocol ( QTcpSocket *  socket,
QObject parent = nullptr 
)

Constructor.

Parameters
socketUse socket for the connection
parentThe QObject parent

Definition at line 33 of file Protocol.cpp.

References Ended(), and Error().

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

Constructor.

Parameters
serverUse ServerInfo to connect to server
parentThe QObject parent

Definition at line 43 of file Protocol.cpp.

References Ended(), Error(), SimPT_Parex::ServerInfo::GetAddress(), and SimPT_Parex::ServerInfo::GetPort().

Here is the call graph for this function:


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