|
VR-Engage
2.2
|
DtVreSelectConnectionPageDriver serves as the abstract base class for specific connection protocol drivers (such as DIS or HLA) in the VR-Engage connection system. It provides common properties like driver name, type, auto-connect state, and active connection state that are shared across all driver implementations. This class exposes these properties to QML for the connection selection UI, and handles updates to the backend connection system when the properties change.
#include <vreSelectConnectionPageDriver.h>
Public Slots | |
| virtual void | setDriverName (const QString &name) |
| virtual void | setDriverType (const QString &type) |
| virtual void | setAutoConnect (const bool autoConnect) |
| virtual void | setActiveConnection (const bool activeConnection) |
Signals | |
| void | driverNameChanged (QString name) |
| void | driverTypeChanged (QString type) |
| void | autoConnectChanged (bool autoConnect) |
| void | activeConnectionChanged (bool activeConnection) |
Public Member Functions | |
| DtVreSelectConnectionPageDriver (QObject *parent=nullptr) | |
| virtual | ~DtVreSelectConnectionPageDriver () override |
| QString | getDriverName () const |
| QString | getDriverType () const |
| bool | isAutoConnect () const |
| bool | isActiveConnection () const |
| virtual void | setData (makVre::DtVreMessage *msg)=0 |
| virtual Q_INVOKABLE void | save () |
Protected Attributes | |
| QString | myDriverName |
| QString | myDriverType |
| bool | myAutoConnect |
| bool | myActiveConnection |
Properties | |
| QString | driverName |
| QString | driverType |
| bool | autoConnect |
| bool | activeConnection |
|
explicit |
Constructor.
| parent | Optional parent QObject for memory management |
Creates a new connection driver with default property values. Sets initial state with empty names and false flags.
|
overridevirtual |
Destructor.
Cleans up resources used by the connection driver.
| QString makVre::DtVreSelectConnectionPageDriver::getDriverName | ( | ) | const |
Gets the name of the driver.
Returns the display name of this connection driver.
| QString makVre::DtVreSelectConnectionPageDriver::getDriverType | ( | ) | const |
Gets the type of the driver.
Returns the type identifier of this connection driver (e.g., "DIS" or "HLA").
| bool makVre::DtVreSelectConnectionPageDriver::isAutoConnect | ( | ) | const |
Checks if the driver should auto-connect.
Determines whether this driver should automatically connect when the application starts up.
| bool makVre::DtVreSelectConnectionPageDriver::isActiveConnection | ( | ) | const |
Checks if the driver is the active connection.
Determines whether this driver is currently the active connection for the application.
|
pure virtual |
Sets driver data from a message.
| msg | Pointer to the message containing driver data |
Pure virtual method that must be implemented by derived classes to parse and apply data from a message. This allows different driver types to handle their specific configuration data differently.
Implemented in makVre::DtVreSelectConnectionPageDriverDIS, and makVre::DtVreSelectConnectionPageDriverHLA.
|
inlinevirtual |
Saves the current driver configuration.
QML-invokable method that saves the current driver configuration. Each driver type can implement this differently to handle its specific configuration data. The base implementation does nothing and is intended to be overridden by derived classes.
Reimplemented in makVre::DtVreSelectConnectionPageDriverDIS, and makVre::DtVreSelectConnectionPageDriverHLA.
|
virtualslot |
Sets the name of the driver.
| name | New name for the driver |
Updates the driver name and emits the driverNameChanged signal.
|
virtualslot |
Sets the type of the driver.
| type | New type for the driver |
Updates the driver type and emits the driverTypeChanged signal.
|
virtualslot |
Sets the auto-connect state of the driver.
| autoConnect | New auto-connect state |
Updates the auto-connect state, emits the autoConnectChanged signal, calls save(), and sends an update message to the network thread to persist the change. If the value hasn't changed, this is a no-op.
References autoConnect.
|
virtualslot |
Sets the active connection state of the driver.
| activeConnection | New active connection state |
Updates the active connection state, emits the activeConnectionChanged signal, calls save(), and sends an update message to the network thread to make this driver the active connection. If the value hasn't changed, this is a no-op.
References activeConnection.
|
signal |
Signal emitted when the driver name changes.
| name | New driver name |
Notifies the QML interface that the driver name has changed.
|
signal |
Signal emitted when the driver type changes.
| type | New driver type |
Notifies the QML interface that the driver type has changed.
|
signal |
Signal emitted when the auto-connect state changes.
| autoConnect | New auto-connect state |
Notifies the QML interface that the auto-connect state has changed.
References autoConnect.
|
signal |
Signal emitted when the active connection state changes.
| activeConnection | New active connection state |
Notifies the QML interface that the active connection state has changed.
References activeConnection.
|
protected |
Name of the connection driver.
Stores the display name of this connection driver for UI presentation.
|
protected |
Type of the connection driver.
Stores the type of this connection driver (e.g., "DIS" or "HLA").
|
protected |
Auto-connect state flag.
When true, indicates that this driver should automatically connect when the application starts up.
|
protected |
Active connection state flag.
When true, indicates that this driver is currently the active connection for the application.
|
readwrite |
Name of the connection driver.
QML property for the display name of this connection driver. This is typically used in the UI to identify the driver to the user.
|
readwrite |
Type of the connection driver.
QML property for the type of this connection driver (e.g., "DIS" or "HLA"). This identifies the protocol used by this driver.
|
readwrite |
Auto-connect state of the driver.
QML property indicating whether this driver should automatically connect on application startup.
Referenced by autoConnectChanged(), and setAutoConnect().
|
readwrite |
Active connection state.
QML property indicating whether this driver is currently the active connection for the application.
Referenced by activeConnectionChanged(), and setActiveConnection().