UOperatingSystemBaseDevice
#include <OperatingSystemSimulator/Public/Devices/OperatingSystemBaseDevice.h>class UOperatingSystemBaseDeviceDefined in OperatingSystemBaseDevice.h:46
Inherits:
UObject
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemBaseDevice["UOperatingSystemBaseDevice"]
class UObject["UObject"]
UObject <|-- UOperatingSystemBaseDevice
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemBaseDevice["UOperatingSystemBaseDevice"]
class UOperatingSystemDeviceWidget["UOperatingSystemDeviceWidget"]
UOperatingSystemBaseDevice *-- UOperatingSystemDeviceWidget
class UOperatingSystem["UOperatingSystem"]
UOperatingSystemBaseDevice *-- UOperatingSystem
class EOperatingSystemDeviceStartupType["EOperatingSystemDeviceStartupType"]
UOperatingSystemBaseDevice ..> EOperatingSystemDeviceStartupType
class FOperatingSystemRangeTime["FOperatingSystemRangeTime"]
UOperatingSystemBaseDevice *-- FOperatingSystemRangeTime
class UOperatingSystemMBB["UOperatingSystemMBB"]
UOperatingSystemBaseDevice *-- UOperatingSystemMBB
class EOperatingSystemDeviceState["EOperatingSystemDeviceState"]
UOperatingSystemBaseDevice ..> EOperatingSystemDeviceState
class UOperatingSystemBaseHardware["UOperatingSystemBaseHardware"]
UOperatingSystemBaseDevice *-- UOperatingSystemBaseHardware
class AOperatingSystemDeviceActor["AOperatingSystemDeviceActor"]
UOperatingSystemBaseDevice *-- AOperatingSystemDeviceActor
class UOperatingSystemBiosWidget["UOperatingSystemBiosWidget"]
UOperatingSystemBaseDevice *-- UOperatingSystemBiosWidget
class UOperatingSystemSaveGame["UOperatingSystemSaveGame"]
UOperatingSystemBaseDevice *-- UOperatingSystemSaveGame
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemBaseDevice {
+OnOperatingSystemStartedDelegate : FOnOperatingSystemStartedDelegate()
+OnDeviceStateChanged : FOnDeviceStateChanged
+DeviceCreated(AOperatingSystemDeviceActor *OwningDeviceAc
+DestroyDevice()
+ClearOnScreenWidget() const
+ApplyWidgetToScreen() const
+ReApplyWidget() const
+ClockTick()
+OpenBIOS(TWeakObjectPtr< UOperatingSystemBiosWidget
+OnFinishOperatingSystemInstallation() bool
+OnFinishSettingUpOperatingSystemPostInstallation() const
+ShowBSOD() bool
+StartOperatingSystem(FGenericError &OutError)
+DeviceSessionEnd(const bool bShouldRestart)
+GetMessenger() const UOperatingSystemDeviceMessenger() *
+GetCurrentOperatingSystem() const UOperatingSystem() *
+GetOperatingSystemClass() const TSoftClassPtr< UOperatingSystem() >
+GetHardwareByTag(const FGameplayTag TestTag) const UOperatingSystemBaseHardware() *
+GetHardwareByTag(const FGameplayTag &TestTag) const T *
+GetCurrentState() const EOperatingSystemDeviceState()
+GetParentDeviceActor() const AOperatingSystemDeviceActor() *
+GetSaveGameClass() const TSoftClassPtr< UOperatingSystemSaveGame(
+TimerHandle_SessionEnd : FTimerHandle
+DeviceName : FText
+DeviceWidgetClass : TSoftClassPtr< UOperatingSystemDeviceWid
+OperatingSystemClass : TSoftClassPtr< UOperatingSystem() >
+DeviceStartupType : EOperatingSystemDeviceStartupType()
+bOperatingSystemIsPreInstalled_DEPRECATED : bool
+PowerOnTime : FOperatingSystemRangeTime()
+SessionEndTime : FOperatingSystemRangeTime()
+MotherboardClass : TSoftClassPtr< UOperatingSystemMBB() >
+bRequiresGPU : uint8
+bOperatingSystemInstalled : uint8
+DeviceTag : FGameplayTag
+PreviousState : EOperatingSystemDeviceState()
+CurrentState : EOperatingSystemDeviceState()
+ActiveOperatingSystem : TObjectPtr< UOperatingSystem() >
+DeviceWidget : TObjectPtr< UOperatingSystemDeviceWidget
+OnScreenWidget : TObjectPtr< UUserWidget >
+Hardwares : TArray< TObjectPtr< UOperatingSystemBase
+DeviceActor : TWeakObjectPtr< AOperatingSystemDeviceAc
+BiosWidget : TWeakObjectPtr< UOperatingSystemBiosWidg
+LoadGameInstance : TWeakObjectPtr< UOperatingSystemSaveGame
+ChangeOnScreenWidget(UUserWidget *NewOnScreenWidget=nullptr)
+CheckHardware(FGenericError &OutError)
+UpdateDeviceState(const EOperatingSystemDeviceState &NewState bool
+OnDeviceCreated(FGenericError &OutError)
+OnDeviceStartRunning()
+OnDeviceShutdown()
+OnDeviceRestart()
+DestroyDeviceAndRestart()
+Internal_SessionEnd()
+Internal_OnDeviceSessionEnd(const bool bRestart)
+Internal_DestroyDevice()
}
Caller impact — UpdateDeviceState
Section titled “Caller impact — UpdateDeviceState”Documented call sites inside the plugin (6):
flowchart LR UOperatingSystemBaseDevice__UpdateDeviceState["UOperatingSystemBaseDevice::UpdateDeviceState"] UOperatingSystemBaseDevice__DeviceCreated["UOperatingSystemBaseDevice::DeviceCreated"] UOperatingSystemBaseDevice__DeviceCreated --> UOperatingSystemBaseDevice__UpdateDeviceState UOperatingSystemBaseDevice__DeviceSessionEnd["UOperatingSystemBaseDevice::DeviceSessionEnd"] UOperatingSystemBaseDevice__DeviceSessionEnd --> UOperatingSystemBaseDevice__UpdateDeviceState UOperatingSystemBaseDevice__OnFinishOperatingSystemInstallation["UOperatingSystemBaseDevice::OnFinishOperatingSystemInstallation"] UOperatingSystemBaseDevice__OnFinishOperatingSystemInstallation --> UOperatingSystemBaseDevice__UpdateDeviceState UOperatingSystemBaseDevice__OpenBIOS["UOperatingSystemBaseDevice::OpenBIOS"] UOperatingSystemBaseDevice__OpenBIOS --> UOperatingSystemBaseDevice__UpdateDeviceState UOperatingSystemBaseDevice__ShowBSOD["UOperatingSystemBaseDevice::ShowBSOD"] UOperatingSystemBaseDevice__ShowBSOD --> UOperatingSystemBaseDevice__UpdateDeviceState UOperatingSystemBaseDevice__StartOperatingSystem["UOperatingSystemBaseDevice::StartOperatingSystem"] UOperatingSystemBaseDevice__StartOperatingSystem --> UOperatingSystemBaseDevice__UpdateDeviceState
Caller impact — GetParentDeviceActor
Section titled “Caller impact — GetParentDeviceActor”Documented call sites inside the plugin (4):
flowchart LR UOperatingSystemBaseDevice__GetParentDeviceActor["UOperatingSystemBaseDevice::GetParentDeviceActor"] UOperatingSystemBaseDevice__DestroyDeviceAndRestart["UOperatingSystemBaseDevice::DestroyDeviceAndRestart"] UOperatingSystemBaseDevice__DestroyDeviceAndRestart --> UOperatingSystemBaseDevice__GetParentDeviceActor UOperatingSystemBaseDevice__GetMessenger["UOperatingSystemBaseDevice::GetMessenger"] UOperatingSystemBaseDevice__GetMessenger --> UOperatingSystemBaseDevice__GetParentDeviceActor UOperatingSystemBaseDevice__Internal_DestroyDevice["UOperatingSystemBaseDevice::Internal_DestroyDevice"] UOperatingSystemBaseDevice__Internal_DestroyDevice --> UOperatingSystemBaseDevice__GetParentDeviceActor UOperatingSystemBaseDevice__Internal_SessionEnd["UOperatingSystemBaseDevice::Internal_SessionEnd"] UOperatingSystemBaseDevice__Internal_SessionEnd --> UOperatingSystemBaseDevice__GetParentDeviceActor
Caller impact — ChangeOnScreenWidget
Section titled “Caller impact — ChangeOnScreenWidget”Documented call sites inside the plugin (4):
flowchart LR UOperatingSystemBaseDevice__ChangeOnScreenWidget["UOperatingSystemBaseDevice::ChangeOnScreenWidget"] UOperatingSystemBaseDevice__DeviceCreated["UOperatingSystemBaseDevice::DeviceCreated"] UOperatingSystemBaseDevice__DeviceCreated --> UOperatingSystemBaseDevice__ChangeOnScreenWidget UOperatingSystemBaseDevice__Internal_DestroyDevice["UOperatingSystemBaseDevice::Internal_DestroyDevice"] UOperatingSystemBaseDevice__Internal_DestroyDevice --> UOperatingSystemBaseDevice__ChangeOnScreenWidget UOperatingSystemBaseDevice__OnFinishOperatingSystemInstallation["UOperatingSystemBaseDevice::OnFinishOperatingSystemInstallation"] UOperatingSystemBaseDevice__OnFinishOperatingSystemInstallation --> UOperatingSystemBaseDevice__ChangeOnScreenWidget UOperatingSystemBaseDevice__StartOperatingSystem["UOperatingSystemBaseDevice::StartOperatingSystem"] UOperatingSystemBaseDevice__StartOperatingSystem --> UOperatingSystemBaseDevice__ChangeOnScreenWidget
This class represents a device that can run an operating system. It contains properties related to the device hardware, the operating system that the device is running, and the device state. It also provides functions to start and stop the operating system, manage the device’s on-screen widget, and update the device state.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
FOnOperatingSystemStartedDelegate | OnOperatingSystemStartedDelegate | Delegate for handling the event when the operating system has started. |
FOnDeviceStateChanged | OnDeviceStateChanged | A BlueprintAssignable event that is raised when the device state changes. This event can be bound to a delegate or a blueprint function to receive notifications when the device state changes. |
OnOperatingSystemStartedDelegate
Section titled “OnOperatingSystemStartedDelegate”FOnOperatingSystemStartedDelegate OnOperatingSystemStartedDelegateDefined in OperatingSystemBaseDevice.h:230 Delegate for handling the event when the operating system has started.
This delegate is used to define a callback function that will be called when the operating system has started. It is used in conjunction with the OnOperatingSystemStarted event to provide a way to handle the event and perform any desired actions.
Use the BindDynamic function to bind a specific function to this delegate. The bound function will be called when the OnOperatingSystemStarted event is broadcast.
See also: OnOperatingSystemStarted event
Referenced by
Section titled “Referenced by”OnDeviceStateChanged
Section titled “OnDeviceStateChanged”FOnDeviceStateChanged OnDeviceStateChangedDefined in OperatingSystemBaseDevice.h:237 A BlueprintAssignable event that is raised when the device state changes. This event can be bound to a delegate or a blueprint function to receive notifications when the device state changes.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
void | DeviceCreated | Creates a new operating system device. |
void | DestroyDevice | Destroys the operating system device. |
void | ClearOnScreenWidget const | Remove the on-screen widget from the device’s viewport if it is currently valid and visible. |
void | ApplyWidgetToScreen const | Applies the device’s on-screen widget to the viewport, allowing it to be displayed on the screen. The widget will only be added if it is valid and if the device actor can add widgets to the screen. |
void | ReApplyWidget const | Reapplies the widget to the device actor. |
void | ClockTick | Not implemented yet. |
void | OpenBIOS | Opens the BIOS widget for the operating system device and sets it as the active widget. The BIOS widget is responsible for displaying BIOS-related information and providing options to interact with the device’s BIOS settings. |
bool | OnFinishOperatingSystemInstallation | Executed when the operating system installation process completes successfully. It updates the device state to indicate that the operating system is installed, logs the installation, and determines whether a restart is required. If a restart is not required (e.g., device startup type is not set to “FullBoot”), it only updates the device state and returns false. If a restart is required, it updates the device state, clears the restart timer handle, destroys the device, restarts the system, changes the on-screen widget to the device widget, and returns true. |
void | OnFinishSettingUpOperatingSystemPostInstallation const | Function to be called after the operating system has finished setting up post installation. |
bool | ShowBSOD | Displays the Blue Screen of Death (BSOD) on the operating system device. It updates the device state to indicate that the device is currently in a BSOD state. |
void | StartOperatingSystem | Starts the operating system on the base device. It checks if the loaded game instance is valid, then compares the operating system ID of the loaded device with the ID of the active operating system. If they do not match, an error is generated and the device’s on-screen widget is updated to indicate the operating system mismatch. The active operating system is marked as garbage and set to nullptr. |
void | DeviceSessionEnd | End the session of the operating system device. |
UOperatingSystemDeviceMessenger * | GetMessenger const | Get the device messenger of the operating system base device. |
UOperatingSystem * | GetCurrentOperatingSystem const | Returns the active operating system on the device. |
TSoftClassPtr< UOperatingSystem > | GetOperatingSystemClass const | Returns the class of the operating system associated with this device. The operating system class is represented by the type TSoftClassPtr<UOperatingSystem>. |
UOperatingSystemBaseHardware * | GetHardwareByTag const | Retrieves the hardware object associated with the specified tag. |
T * | GetHardwareByTag const inline | Retrieves the hardware instance associated with the specified tag. |
EOperatingSystemDeviceState | GetCurrentState const inline | Gets the current state of the operating system device. |
AOperatingSystemDeviceActor * | GetParentDeviceActor const | Retrieves the parent device actor associated with this operating system device. |
TSoftClassPtr< UOperatingSystemSaveGame > | GetSaveGameClass const | Returns the class pointer to the save game class associated with the device. |
DeviceCreated
Section titled “DeviceCreated”void DeviceCreated(AOperatingSystemDeviceActor * OwningDeviceActor, UOperatingSystemSaveGame * NewLoadGameInstance, FGenericError & OutError)Defined in OperatingSystemBaseDevice.h:266 Creates a new operating system device.
This method initializes the operating system device with the given parameters. It performs the following steps:
-
Checks if the device name is set. If the name is empty or consists of only whitespace characters, an error is set and the method returns.
-
Checks if the device widget class is null. If it is null, an error is set and the method returns.
-
Sets the load game instance and owning device actor properties of the operating system device.
-
Sets the device tag by getting it from the owning device actor.
-
Creates an instance of the device widget using the UOperatingSystemDeviceWidget::CreateDeviceWidget() method.
-
Updates the device state to “Starting” and sets the error parameter if there was an error during the state update.
-
Changes the on-screen widget of the device to the newly created device widget.
-
Logs a success message with the name of the device.
-
Calls the OnDeviceCreated() method to notify listeners that the device was successfully created.
-
If there was an error during the creation process, ends the device session.
-
If there were no errors, schedules a timer to update the device state to “Running” after a delay specified by the PowerOnTime property.
Parameters
Section titled “Parameters”-
OwningDeviceActorThe owning device actor that represents the physical device in the game world. -
NewLoadGameInstanceThe load game instance to use for the operating system device. -
OutErrorThe error object that receives any errors that occur during the device creation process.
References
Section titled “References”ChangeOnScreenWidgetCreateDeviceWidgetDeviceActorDeviceNameDeviceSessionEndDeviceTagDeviceWidgetDeviceWidgetClassGetTimeIsValidLoadGameInstanceMAKE_ERROROnDeviceCreatedOS_LOGPowerOnTimeRunningStartingUpdateDeviceState
DestroyDevice
Section titled “DestroyDevice”void DestroyDevice()Defined in OperatingSystemBaseDevice.h:277 Destroys the operating system device.
This function is responsible for destroying the operating system device. It performs the necessary cleanup tasks and notifies the device actor that the device has been destroyed.
Once this function is called, the device will no longer be accessible or functional. Make sure to handle any necessary tasks before calling this function.
Referenced by
Section titled “Referenced by”References
Section titled “References”ClearOnScreenWidget
Section titled “ClearOnScreenWidget”const
void ClearOnScreenWidget() constDefined in OperatingSystemBaseDevice.h:282 Remove the on-screen widget from the device’s viewport if it is currently valid and visible.
Referenced by
Section titled “Referenced by”References
Section titled “References”ApplyWidgetToScreen
Section titled “ApplyWidgetToScreen”const
void ApplyWidgetToScreen() constDefined in OperatingSystemBaseDevice.h:291 Applies the device’s on-screen widget to the viewport, allowing it to be displayed on the screen. The widget will only be added if it is valid and if the device actor can add widgets to the screen.
Referenced by
Section titled “Referenced by”References
Section titled “References”ReApplyWidget
Section titled “ReApplyWidget”const
void ReApplyWidget() constDefined in OperatingSystemBaseDevice.h:302 Reapplies the widget to the device actor.
This function is called to update the widget of the device actor. It will reapply the widget to the device actor, ensuring that any changes made to the widget are reflected in the device actor’s display.
References
Section titled “References”ClockTick
Section titled “ClockTick”void ClockTick()Defined in OperatingSystemBaseDevice.h:305 Not implemented yet.
Referenced by
Section titled “Referenced by”OpenBIOS
Section titled “OpenBIOS”void OpenBIOS(TWeakObjectPtr< UOperatingSystemBiosWidget > InBiosWidget)Defined in OperatingSystemBaseDevice.h:320 Opens the BIOS widget for the operating system device and sets it as the active widget. The BIOS widget is responsible for displaying BIOS-related information and providing options to interact with the device’s BIOS settings.
Parameters
Section titled “Parameters”InBiosWidgetThe BIOS widget to be opened for the operating system device. It should be a reference to an instance of UOperatingSystemBiosWidget class. The BIOS widget is responsible for displaying BIOS-related information and providing options to interact with the device’s BIOS settings.
References
Section titled “References”OnFinishOperatingSystemInstallation
Section titled “OnFinishOperatingSystemInstallation”bool OnFinishOperatingSystemInstallation()Defined in OperatingSystemBaseDevice.h:332 Executed when the operating system installation process completes successfully. It updates the device state to indicate that the operating system is installed, logs the installation, and determines whether a restart is required. If a restart is not required (e.g., device startup type is not set to “FullBoot”), it only updates the device state and returns false. If a restart is required, it updates the device state, clears the restart timer handle, destroys the device, restarts the system, changes the on-screen widget to the device widget, and returns true.
Returns
Section titled “Returns”True if a restart is required and the on-screen widget is changed to the device widget, false otherwise.
References
Section titled “References”ActiveOperatingSystembOperatingSystemInstalledChangeOnScreenWidgetDestroyDeviceAndRestartDeviceNameDeviceStartupTypeDeviceWidgetFullBootOS_LOGRestartingTimerHandle_SessionEndUpdateDeviceState
OnFinishSettingUpOperatingSystemPostInstallation
Section titled “OnFinishSettingUpOperatingSystemPostInstallation”const
void OnFinishSettingUpOperatingSystemPostInstallation() constDefined in OperatingSystemBaseDevice.h:346 Function to be called after the operating system has finished setting up post installation.
This function is called after the operating system of the device has finished setting up post installation. It is called internally within the UOperatingSystemBaseDevice class. The function saves the game by calling the SaveGame() function from the UOperatingSystemSaveGame class, passing in the DeviceActor member variable as the argument.
References
Section titled “References”ShowBSOD
Section titled “ShowBSOD”bool ShowBSOD()Defined in OperatingSystemBaseDevice.h:354 Displays the Blue Screen of Death (BSOD) on the operating system device. It updates the device state to indicate that the device is currently in a BSOD state.
Returns
Section titled “Returns”True if the device state was successfully updated to BSOD, false otherwise.
References
Section titled “References”BSODUpdateDeviceState
StartOperatingSystem
Section titled “StartOperatingSystem”void StartOperatingSystem(FGenericError & OutError)Defined in OperatingSystemBaseDevice.h:374 Starts the operating system on the base device. It checks if the loaded game instance is valid, then compares the operating system ID of the loaded device with the ID of the active operating system. If they do not match, an error is generated and the device’s on-screen widget is updated to indicate the operating system mismatch. The active operating system is marked as garbage and set to nullptr.
If the operating system IDs match, the “bOperatingSystemInstalled” property of the device is updated based on the “bSaveLoad_OperatingSystemInstalled” property of the loaded device. The device’s on-screen widget is updated with the active operating system’s widget, and the “StartOperatingSystem” function is called on the active operating system with the loaded game instance and the “OutError” parameter.
If an error occurs during the start operation, the device’s state is updated to “BSOD” (Blue Screen of Death). Otherwise, the “OnOperatingSystemStartedDelegate” is executed and a log message is written indicating that the operating system has started.
Parameters
Section titled “Parameters”OutErrorThe error message to be populated in case an error occurs during the start operation.
Referenced by
Section titled “Referenced by”References
Section titled “References”ActiveOperatingSystembOperatingSystemInstalledBSODChangeOnScreenWidgetDeviceNameDeviceWidgetGetOperatingSystemUniqueIDIsValidLoadGameInstanceMAKE_ERROROnOperatingSystemStartedDelegateOS_CLOGResetUpdateDeviceState
DeviceSessionEnd
Section titled “DeviceSessionEnd”void DeviceSessionEnd(const bool bShouldRestart)Defined in OperatingSystemBaseDevice.h:386 End the session of the operating system device.
This method is used to end the session of the operating system device. It updates the device state and performs any necessary actions based on the given value of bShouldRestart. If bShouldRestart is true, the device state is updated to “Restarting”. If bShouldRestart is false, the device state is updated to “ShuttingDown”.
Parameters
Section titled “Parameters”bShouldRestartIndicates whether the device should be restarted after ending the session.
Referenced by
Section titled “Referenced by”References
Section titled “References”RestartingShuttingDownUpdateDeviceState
GetMessenger
Section titled “GetMessenger”const
UOperatingSystemDeviceMessenger * GetMessenger() constDefined in OperatingSystemBaseDevice.h:504 Get the device messenger of the operating system base device.
This method returns the device messenger associated with the operating system base device. The device messenger is responsible for handling device communications, such as sending and receiving messages.
Returns
Section titled “Returns”The device messenger of the operating system base device.
References
Section titled “References”GetCurrentOperatingSystem
Section titled “GetCurrentOperatingSystem”const
UOperatingSystem * GetCurrentOperatingSystem() constDefined in OperatingSystemBaseDevice.h:511 Returns the active operating system on the device.
Returns
Section titled “Returns”The current operating system running on the device.
Referenced by
Section titled “Referenced by”References
Section titled “References”GetOperatingSystemClass
Section titled “GetOperatingSystemClass”const
TSoftClassPtr< UOperatingSystem > GetOperatingSystemClass() constDefined in OperatingSystemBaseDevice.h:520 Returns the class of the operating system associated with this device. The operating system class is represented by the type TSoftClassPtr<UOperatingSystem>.
Returns
Section titled “Returns”The class of the operating system associated with this device.
Referenced by
Section titled “Referenced by”References
Section titled “References”GetHardwareByTag
Section titled “GetHardwareByTag”const
UOperatingSystemBaseHardware * GetHardwareByTag(const FGameplayTag TestTag) constDefined in OperatingSystemBaseDevice.h:529 Retrieves the hardware object associated with the specified tag.
Parameters
Section titled “Parameters”TestTagThe gameplay tag used to search for the hardware object.
Returns
Section titled “Returns”Pointer to the hardware object if found, nullptr otherwise.
Referenced by
Section titled “Referenced by”References
Section titled “References”GetHardwareByTag
Section titled “GetHardwareByTag”const inline
template<class T> inline T * GetHardwareByTag(const FGameplayTag & TestTag) constDefined in OperatingSystemBaseDevice.h:543 Retrieves the hardware instance associated with the specified tag.
This method searches for a hardware instance that is derived from UOperatingSystemBaseHardware and is associated with the given tag. It returns a pointer to the hardware instance if found, otherwise it returns nullptr.
This method will assert if T is not derived from UOperatingSystemBaseHardware.
Parameters
Section titled “Parameters”TestTagThe tag used to search for the hardware instance.
Returns
Section titled “Returns”A pointer to the hardware instance associated with the tag, or nullptr if no hardware instance is found.
GetCurrentState
Section titled “GetCurrentState”const inline
inline EOperatingSystemDeviceState GetCurrentState() constDefined in OperatingSystemBaseDevice.h:555 Gets the current state of the operating system device.
Returns
Section titled “Returns”The current state of the operating system device.
GetParentDeviceActor
Section titled “GetParentDeviceActor”const
AOperatingSystemDeviceActor * GetParentDeviceActor() constDefined in OperatingSystemBaseDevice.h:564 Retrieves the parent device actor associated with this operating system device.
Returns
Section titled “Returns”The parent device actor, or nullptr if no parent device actor is set.
See also: DeviceActor
Referenced by
Section titled “Referenced by”References
Section titled “References”GetSaveGameClass
Section titled “GetSaveGameClass”const
TSoftClassPtr< UOperatingSystemSaveGame > GetSaveGameClass() constDefined in OperatingSystemBaseDevice.h:571 Returns the class pointer to the save game class associated with the device.
Returns
Section titled “Returns”A class pointer to the save game class associated with the device. Returns nullptr if the device actor is invalid.
References
Section titled “References”Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
FTimerHandle | TimerHandle_SessionEnd | Timer handle for the end of a session. |
FText | DeviceName | Device name of the operating system device. |
TSoftClassPtr< UOperatingSystemDeviceWidget > | DeviceWidgetClass | Class is used to store the reference to the widget class that will be used to display a specific device in the operating system. |
TSoftClassPtr< UOperatingSystem > | OperatingSystemClass | Specify the class pointer of an operating system device in the editor. |
EOperatingSystemDeviceStartupType | DeviceStartupType | Determine whether the operating system should follow the normal installation flow or should it be preinstalled or directly boot to desktop. |
bool | bOperatingSystemIsPreInstalled_DEPRECATED | DEPRECATED. Use Device Startup Type instead. Determine whether the operating system comes pre-installed on the device. If set to true, it indicates that the operating system is already present on the device. If set to false, it indicates that the operating system needs to be installed on the device. |
FOperatingSystemRangeTime | PowerOnTime | The PowerOnTime variable represents the range of time for which the operating system device needs to power on. This is a FOperatingSystemRangeTime object that provides a convenient way to store and manipulate the range of time values. |
FOperatingSystemRangeTime | SessionEndTime | Shutdown and restart time. |
TSoftClassPtr< UOperatingSystemMBB > | MotherboardClass | Motherboard class for which this device will be created. |
uint8 | bRequiresGPU | Does this device requires a GPU? If true, you must provide a valid class for Gpu Class. |
uint8 | bOperatingSystemInstalled | Indicates whether the operating system is installed on the device. |
FGameplayTag | DeviceTag | Gameplay tag assigned from parent device actor. |
EOperatingSystemDeviceState | PreviousState | Represents the previous state of an operating system device. |
EOperatingSystemDeviceState | CurrentState | Represents the current state of the operating system device. |
TObjectPtr< UOperatingSystem > | ActiveOperatingSystem | Current operating system that is active. |
TObjectPtr< UOperatingSystemDeviceWidget > | DeviceWidget | Represents the on-screen widget for an operating system device. It is used to display information and interact with the device’s hardware and operating system. |
TObjectPtr< UUserWidget > | OnScreenWidget | The on-screen widget associated with the operating system device that is currently displayed on the player screen. |
TArray< TObjectPtr< UOperatingSystemBaseHardware > > | Hardwares | Array of operating system base hardware objects used to store hardware information related to the operating system device. |
TWeakObjectPtr< AOperatingSystemDeviceActor > | DeviceActor | Device Actor pointer that represents an operating system device. |
TWeakObjectPtr< UOperatingSystemBiosWidget > | BiosWidget | Pointer to a weak reference of the BiosWidget which is used to interact with the BiosWidget instance in the operating system device. |
TWeakObjectPtr< UOperatingSystemSaveGame > | LoadGameInstance | Holds a weak reference to an instance of a saved game for an operating system. The type of the saved game is UOperatingSystemSaveGame. If the object is destroyed, the weak reference will automatically become null. |
TimerHandle_SessionEnd
Section titled “TimerHandle_SessionEnd”FTimerHandle TimerHandle_SessionEndDefined in OperatingSystemBaseDevice.h:60 Timer handle for the end of a session.
This variable represents the timer handle used to track the end of a session. It is used in the OnFinishOperatingSystemInstallation() method of the UOperatingSystemBaseDevice class. When the installation of the operating system finishes, the timer handle is cleared using GetWorld()->GetTimerManager().ClearTimer(TimerHandle_SessionEnd). This handle is associated with a timer set by the operating system device to manage the device state and perform actions such as restarting the device.
Referenced by
Section titled “Referenced by”DeviceName
Section titled “DeviceName”FText DeviceNameDefined in OperatingSystemBaseDevice.h:64 Device name of the operating system device.
Referenced by
Section titled “Referenced by”DeviceWidgetClass
Section titled “DeviceWidgetClass”TSoftClassPtr< UOperatingSystemDeviceWidget > DeviceWidgetClassDefined in OperatingSystemBaseDevice.h:73 Class is used to store the reference to the widget class that will be used to display a specific device in the operating system.
Referenced by
Section titled “Referenced by”OperatingSystemClass
Section titled “OperatingSystemClass”TSoftClassPtr< UOperatingSystem > OperatingSystemClassDefined in OperatingSystemBaseDevice.h:79 Specify the class pointer of an operating system device in the editor.
Referenced by
Section titled “Referenced by”DeviceStartupType
Section titled “DeviceStartupType”EOperatingSystemDeviceStartupType DeviceStartupTypeDefined in OperatingSystemBaseDevice.h:83 Determine whether the operating system should follow the normal installation flow or should it be preinstalled or directly boot to desktop.
Referenced by
Section titled “Referenced by”bOperatingSystemIsPreInstalled_DEPRECATED
Section titled “bOperatingSystemIsPreInstalled_DEPRECATED”bool bOperatingSystemIsPreInstalled_DEPRECATEDDefined in OperatingSystemBaseDevice.h:92 DEPRECATED. Use Device Startup Type instead. Determine whether the operating system comes pre-installed on the device. If set to true, it indicates that the operating system is already present on the device. If set to false, it indicates that the operating system needs to be installed on the device.
PowerOnTime
Section titled “PowerOnTime”FOperatingSystemRangeTime PowerOnTimeDefined in OperatingSystemBaseDevice.h:99 The PowerOnTime variable represents the range of time for which the operating system device needs to power on. This is a FOperatingSystemRangeTime object that provides a convenient way to store and manipulate the range of time values.
Referenced by
Section titled “Referenced by”SessionEndTime
Section titled “SessionEndTime”FOperatingSystemRangeTime SessionEndTimeDefined in OperatingSystemBaseDevice.h:103 Shutdown and restart time.
Referenced by
Section titled “Referenced by”MotherboardClass
Section titled “MotherboardClass”TSoftClassPtr< UOperatingSystemMBB > MotherboardClassDefined in OperatingSystemBaseDevice.h:107 Motherboard class for which this device will be created.
bRequiresGPU
Section titled “bRequiresGPU”uint8 bRequiresGPUDefined in OperatingSystemBaseDevice.h:128 Does this device requires a GPU? If true, you must provide a valid class for Gpu Class.
bOperatingSystemInstalled
Section titled “bOperatingSystemInstalled”uint8 bOperatingSystemInstalledDefined in OperatingSystemBaseDevice.h:132 Indicates whether the operating system is installed on the device.
Referenced by
Section titled “Referenced by”DeviceTag
Section titled “DeviceTag”FGameplayTag DeviceTagDefined in OperatingSystemBaseDevice.h:136 Gameplay tag assigned from parent device actor.
Referenced by
Section titled “Referenced by”PreviousState
Section titled “PreviousState”EOperatingSystemDeviceState PreviousStateDefined in OperatingSystemBaseDevice.h:148 Represents the previous state of an operating system device.
This variable is used to store the previous state of an operating system device. It is of type EOperatingSystemDeviceState, which is an enumeration that defines different states that the device can be in.
See also: EOperatingSystemDeviceState
CurrentState
Section titled “CurrentState”EOperatingSystemDeviceState CurrentStateDefined in OperatingSystemBaseDevice.h:159 Represents the current state of the operating system device.
The CurrentState variable is an instance of the EOperatingSystemDeviceState enumeration, which defines the possible states that the operating system device can be in.
See also: EOperatingSystemDeviceState
ActiveOperatingSystem
Section titled “ActiveOperatingSystem”TObjectPtr< UOperatingSystem > ActiveOperatingSystemDefined in OperatingSystemBaseDevice.h:163 Current operating system that is active.
Referenced by
Section titled “Referenced by”GetCurrentOperatingSystemInternal_DestroyDeviceInternal_OnDeviceSessionEndOnDeviceStartRunningOnFinishOperatingSystemInstallationStartOperatingSystem
DeviceWidget
Section titled “DeviceWidget”TObjectPtr< UOperatingSystemDeviceWidget > DeviceWidgetDefined in OperatingSystemBaseDevice.h:170 Represents the on-screen widget for an operating system device. It is used to display information and interact with the device’s hardware and operating system.
Referenced by
Section titled “Referenced by”CheckHardwareDeviceCreatedInternal_DestroyDeviceOnDeviceStartRunningOnFinishOperatingSystemInstallationStartOperatingSystem
OnScreenWidget
Section titled “OnScreenWidget”TObjectPtr< UUserWidget > OnScreenWidgetDefined in OperatingSystemBaseDevice.h:180 The on-screen widget associated with the operating system device that is currently displayed on the player screen.
It is a reference to an instance of the UUserWidget class, which is the base class for all user interface widgets in the game engine. The widget may contain interactive controls, display information, or provide functionality specific to the operating system device.
Referenced by
Section titled “Referenced by”Hardwares
Section titled “Hardwares”TArray< TObjectPtr< UOperatingSystemBaseHardware > > HardwaresDefined in OperatingSystemBaseDevice.h:189 Array of operating system base hardware objects used to store hardware information related to the operating system device.
See also: UOperatingSystemBaseHardware
Referenced by
Section titled “Referenced by”DeviceActor
Section titled “DeviceActor”TWeakObjectPtr< AOperatingSystemDeviceActor > DeviceActorDefined in OperatingSystemBaseDevice.h:199 Device Actor pointer that represents an operating system device.
This variable is a weak pointer to an object of class AOperatingSystemDeviceActor, which is an actor representing an operating system device. A weak pointer is used to prevent memory leaks and potential dangling references.
Referenced by
Section titled “Referenced by”ApplyWidgetToScreenChangeOnScreenWidgetDestroyDeviceDestroyDeviceAndRestartDeviceCreatedGetParentDeviceActorGetSaveGameClassInternal_OnDeviceSessionEndOnFinishSettingUpOperatingSystemPostInstallationReApplyWidget
BiosWidget
Section titled “BiosWidget”TWeakObjectPtr< UOperatingSystemBiosWidget > BiosWidgetDefined in OperatingSystemBaseDevice.h:205 Pointer to a weak reference of the BiosWidget which is used to interact with the BiosWidget instance in the operating system device.
Referenced by
Section titled “Referenced by”LoadGameInstance
Section titled “LoadGameInstance”TWeakObjectPtr< UOperatingSystemSaveGame > LoadGameInstanceDefined in OperatingSystemBaseDevice.h:214 Holds a weak reference to an instance of a saved game for an operating system. The type of the saved game is UOperatingSystemSaveGame. If the object is destroyed, the weak reference will automatically become null.
See also: UOperatingSystemSaveGame
Referenced by
Section titled “Referenced by”Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
void | ChangeOnScreenWidget | Allows the user to change the on-screen widget of the operating system device. By providing a new widget, the current on-screen widget is replaced with the new one. |
void | CheckHardware | Checks the hardware of the operating system base device. It ensures that all hardware components are valid and initializes them if necessary. If any errors occur during the hardware check, the method will return an error message via the OutError parameter. |
bool | UpdateDeviceState | Update the state of the operating system device. It takes the new state as a parameter and updates the device’s current state accordingly. If the new state is different from the current state, the method performs the necessary actions associated with the state change. These actions may include logging, hardware checks, on-screen widget changes, and event broadcasts. If the state is successfully updated, the method returns true; otherwise, it returns false. |
void | OnDeviceCreated virtual inline | This method is called when a device is created. |
void | OnDeviceStartRunning | Callback function called when the device starts running. |
void | OnDeviceShutdown | Triggers the device shutdown process. |
void | OnDeviceRestart | Restarts the operating system on the device. |
void | DestroyDeviceAndRestart | DestroyDeviceAndRestart |
ChangeOnScreenWidget
Section titled “ChangeOnScreenWidget”void ChangeOnScreenWidget(UUserWidget * NewOnScreenWidget = nullptr)Defined in OperatingSystemBaseDevice.h:400 Allows the user to change the on-screen widget of the operating system device. By providing a new widget, the current on-screen widget is replaced with the new one.
Parameters
Section titled “Parameters”NewOnScreenWidgetThe new on-screen widget to be set. If nullptr is provided, the current on-screen widget will be cleared.
Referenced by
Section titled “Referenced by”References
Section titled “References”CheckHardware
Section titled “CheckHardware”void CheckHardware(FGenericError & OutError)Defined in OperatingSystemBaseDevice.h:414 Checks the hardware of the operating system base device. It ensures that all hardware components are valid and initializes them if necessary. If any errors occur during the hardware check, the method will return an error message via the OutError parameter.
Parameters
Section titled “Parameters”OutErrorA reference to a FGenericError object that will store any error messages if the hardware check fails.
References
Section titled “References”UpdateDeviceState
Section titled “UpdateDeviceState”bool UpdateDeviceState(const EOperatingSystemDeviceState & NewState, FGenericError & OutError)Defined in OperatingSystemBaseDevice.h:435 Update the state of the operating system device. It takes the new state as a parameter and updates the device’s current state accordingly. If the new state is different from the current state, the method performs the necessary actions associated with the state change. These actions may include logging, hardware checks, on-screen widget changes, and event broadcasts. If the state is successfully updated, the method returns true; otherwise, it returns false.
Parameters
Section titled “Parameters”-
NewStateThe new state of the device (EOperatingSystemDeviceState enum). -
OutError(output) Any error message that occurred during the state change.
Returns
Section titled “Returns”True if the state was successfully updated, false otherwise.
See also: EOperatingSystemDeviceState, FGenericError, CheckHardware, ChangeOnScreenWidget, OnDeviceStartRunning, OnDeviceRestart, OnDeviceShutdown, OnDeviceStateChanged
Referenced by
Section titled “Referenced by”DeviceCreatedDeviceSessionEndOnFinishOperatingSystemInstallationOpenBIOSShowBSODStartOperatingSystemUpdateDeviceState
References
Section titled “References”OnDeviceCreated
Section titled “OnDeviceCreated”virtual inline
virtual inline void OnDeviceCreated(FGenericError & OutError)Defined in OperatingSystemBaseDevice.h:445 This method is called when a device is created.
Parameters
Section titled “Parameters”OutErrorThe error object to populate if an error occurs during device creation.
Referenced by
Section titled “Referenced by”OnDeviceStartRunning
Section titled “OnDeviceStartRunning”void OnDeviceStartRunning()Defined in OperatingSystemBaseDevice.h:459 Callback function called when the device starts running.
This function is called when the device starts running. It first checks if the active operating system instance is valid. If not, it creates a new operating system instance and assigns it to the ActiveOperatingSystem member variable. If there is any error during the creation of the operating system instance, the error is passed to the DeviceWidget’s OperatingSystemError function and the function returns.
After creating or validating the active operating system instance, it calls the StartOperatingSystem function, passing an OutError parameter. The StartOperatingSystem function is responsible for starting the operating system execution.
References
Section titled “References”OnDeviceShutdown
Section titled “OnDeviceShutdown”void OnDeviceShutdown()Defined in OperatingSystemBaseDevice.h:468 Triggers the device shutdown process.
This method is called when the device is being shut down. It triggers the necessary actions to gracefully shut down the device, such as saving data and closing connections. It does not perform the actual power-off or hardware shutdown.
References
Section titled “References”OnDeviceRestart
Section titled “OnDeviceRestart”void OnDeviceRestart()Defined in OperatingSystemBaseDevice.h:476 Restarts the operating system on the device.
This method is called to initiate a device restart. It performs the necessary operations to gracefully stop the current session, then restarts the operating system on the device.
References
Section titled “References”DestroyDeviceAndRestart
Section titled “DestroyDeviceAndRestart”void DestroyDeviceAndRestart()Defined in OperatingSystemBaseDevice.h:487 DestroyDeviceAndRestart
This method destroys the device and restarts it. It internally calls the Internal_DestroyDevice() method to destroy the device and then calls the RestartDevice() method of the DeviceActor to restart the device.
Referenced by
Section titled “Referenced by”References
Section titled “References”Private Methods
Section titled “Private Methods”| Return | Name | Description |
|---|---|---|
void | Internal_SessionEnd | |
void | Internal_OnDeviceSessionEnd | |
void | Internal_DestroyDevice |
Internal_SessionEnd
Section titled “Internal_SessionEnd”void Internal_SessionEnd()Defined in OperatingSystemBaseDevice.h:491
References
Section titled “References”Internal_OnDeviceSessionEnd
Section titled “Internal_OnDeviceSessionEnd”void Internal_OnDeviceSessionEnd(const bool bRestart)Defined in OperatingSystemBaseDevice.h:492
Referenced by
Section titled “Referenced by”References
Section titled “References”Internal_DestroyDevice
Section titled “Internal_DestroyDevice”void Internal_DestroyDevice()Defined in OperatingSystemBaseDevice.h:493