![]() |
Banking_System_Client
1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
|
Manages the creation and dispatching of requests in the system. More...
#include <RequestManager.h>
Public Types | |
enum | AvailableRequests { Login = 1 , GetAccountnumber , GetBalance , GetTransactionsHistory , MakeTransaction , TransferAmount , GetDatabase , CreateNewUser , DeleteUser , UpdateUser , UserInit , UpdateEmail , UpdatePassword , JsonParseError = -1 } |
Defines the types of requests that can be created. More... | |
Signals | |
void | makeRequest (QJsonObject Data) |
Signal emitted when a request is made. More... | |
Public Member Functions | |
RequestManager (const RequestManager &)=delete | |
void | operator= (const RequestManager &)=delete |
void | createRequest (AvailableRequests requestType, QVariantMap data) |
Creates a request based on the provided type and data. More... | |
Static Public Member Functions | |
static RequestManager * | getInstance (QObject *parent=nullptr) |
Get the singleton instance of RequestManager. More... | |
Manages the creation and dispatching of requests in the system.
The RequestManager class follows the Singleton design pattern to ensure that only one instance of the class exists throughout the application. It is responsible for creating various types of requests and emitting a signal to notify when a request is made.
The requests are defined by the AvailableRequests enum and include operations such as user login, account retrieval, balance checking, transaction history, and more. The requests are created in the form of QJsonObject and emitted via the makeRequest signal.
Defines the types of requests that can be created.
void RequestManager::createRequest | ( | AvailableRequests | requestType, |
QVariantMap | data | ||
) |
Creates a request based on the provided type and data.
requestType | The type of request to create, defined by AvailableRequests enum. |
data | The data to be included in the request, in the form of QVariantMap. |
Referenced by LoginWidget::onSuccessfullRequest().
|
static |
Get the singleton instance of RequestManager.
parent | The parent QObject, default is nullptr. |
|
signal |
Signal emitted when a request is made.
Data | The QJsonObject representing the request data. |
Referenced by createRequest().