Banking_System_Client  1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
ClientHandler Class Reference

A class for managing client requests and responses. More...

#include <ClientHandler.h>

Inheritance diagram for ClientHandler:
Inheritance graph
Collaboration diagram for ClientHandler:
Collaboration graph

Public Slots

void sendRequest (QJsonObject request)
 Sends a request to the server. More...
 
void onResponseReady (QByteArray response)
 Slot to handle the response received from the server. More...
 
void requestClientConnection (const QString &host, quint16 port)
 Requests a connection to the server. More...
 
void requestClientDisconnection ()
 Requests disconnection from the server.
 
void onConnectedSignal ()
 Slot to handle the connected signal.
 
void onDisconnectedSignal ()
 Slot to handle the disconnected signal.
 

Signals

void sendResponseBack (QJsonObject response)
 Signal to send the response back to the window manager. More...
 

Public Member Functions

 ClientHandler (QObject *parent=nullptr)
 Constructor for ClientHandler. More...
 
 ~ClientHandler ()
 Destructor for ClientHandler.
 
void run ()
 Runs the event loop for the ClientHandler.
 

Detailed Description

A class for managing client requests and responses.

The ClientHandler class handles the client-side operations such as sending requests, receiving responses, and managing connections. It uses the TcpClient class to handle the actual TCP communication.

Constructor & Destructor Documentation

◆ ClientHandler()

ClientHandler::ClientHandler ( QObject *  parent = nullptr)
explicit

Constructor for ClientHandler.

Parameters
parentThe parent QObject, default is nullptr.

Member Function Documentation

◆ onResponseReady

void ClientHandler::onResponseReady ( QByteArray  response)
slot

Slot to handle the response received from the server.

Parameters
responseThe response data in QByteArray format.

Referenced by run().

Here is the caller graph for this function:

◆ requestClientConnection

void ClientHandler::requestClientConnection ( const QString &  host,
quint16  port 
)
slot

Requests a connection to the server.

Parameters
hostThe server host.
portThe server port.
Here is the call graph for this function:

◆ sendRequest

void ClientHandler::sendRequest ( QJsonObject  request)
slot

Sends a request to the server.

Parameters
requestThe JSON object containing the request data.
Here is the call graph for this function:

◆ sendResponseBack

void ClientHandler::sendResponseBack ( QJsonObject  response)
signal

Signal to send the response back to the window manager.

Parameters
responseThe JSON object containing the response data.

Referenced by onConnectedSignal(), onDisconnectedSignal(), and onResponseReady().

Here is the caller graph for this function:

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