Singleton class responsible for initiating the creation of a new wavelength.
More...
#include <wavelength_creator.h>
|
| void | connectionError (const QString &error_message) |
| | Emitted if an error occurs during the connection or registration process.
|
| |
| void | wavelengthClosed (QString frequency) |
| | Emitted if the WebSocket connection for the wavelength is closed unexpectedly (e.g., during registration or after creation).
|
| |
| void | wavelengthCreated (QString frequency) |
| | Emitted when the wavelength has been successfully created and registered with the server.
|
| |
|
| bool | CreateWavelength (QString frequency, bool is_password_protected, const QString &password) |
| | Attempts to create and register a new wavelength with the relay server. Checks if the wavelength already exists locally or is pending registration. Creates a new WebSocket connection, connects signals for connection events, errors, and the registration result message. Sends the registration request upon successful connection. Manages a keep-alive timer for the connection.
|
| |
Singleton class responsible for initiating the creation of a new wavelength.
This class handles the process of connecting to the relay server, sending a registration request for a new frequency (wavelength), and managing the initial WebSocket connection until the registration result is received. It interacts with WavelengthRegistry, WavelengthConfig, AuthenticationManager, and MessageHandler. It emits signals indicating success (wavelengthCreated), failure (connectionError), or closure (wavelengthClosed).
◆ WavelengthCreator() [1/2]
| WavelengthCreator::WavelengthCreator |
( |
QObject * | parent = nullptr | ) |
|
|
inlineexplicitprivate |
Private constructor to enforce the singleton pattern.
- Parameters
-
| parent | Optional parent QObject. |
◆ ~WavelengthCreator()
| WavelengthCreator::~WavelengthCreator |
( |
| ) |
|
|
overrideprivatedefault |
◆ WavelengthCreator() [2/2]
Deleted copy constructor to prevent copying.
◆ connectionError
| void WavelengthCreator::connectionError |
( |
const QString & | error_message | ) |
|
|
signal |
Emitted if an error occurs during the connection or registration process.
- Parameters
-
| error_message | A description of the error. |
◆ CreateWavelength()
| bool WavelengthCreator::CreateWavelength |
( |
QString | frequency, |
|
|
bool | is_password_protected, |
|
|
const QString & | password ) |
Attempts to create and register a new wavelength with the relay server. Checks if the wavelength already exists locally or is pending registration. Creates a new WebSocket connection, connects signals for connection events, errors, and the registration result message. Sends the registration request upon successful connection. Manages a keep-alive timer for the connection.
- Parameters
-
| frequency | The desired name for the new wavelength. |
| is_password_protected | True if the wavelength should require a password. |
| password | The password to set (if protected). |
- Returns
- True if the creation process was initiated (a connection attempt started), false if the wavelength already exists or is pending.
◆ GetInstance()
◆ operator=()
Deleted assignment operator to prevent assignment.
◆ wavelengthClosed
| void WavelengthCreator::wavelengthClosed |
( |
QString | frequency | ) |
|
|
signal |
Emitted if the WebSocket connection for the wavelength is closed unexpectedly (e.g., during registration or after creation).
- Parameters
-
| frequency | The frequency identifier of the wavelength whose connection closed. |
◆ wavelengthCreated
| void WavelengthCreator::wavelengthCreated |
( |
QString | frequency | ) |
|
|
signal |
Emitted when the wavelength has been successfully created and registered with the server.
- Parameters
-
| frequency | The frequency identifier of the newly created wavelength. |
The documentation for this class was generated from the following files: