UOperatingSystemMBB
#include <OperatingSystemSimulator/Public/Hardware/OperatingSystemMBB.h>class UOperatingSystemMBBDefined in OperatingSystemMBB.h:22
Inherits:
UOperatingSystemBaseHardware
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemMBB["UOperatingSystemMBB"]
class UOperatingSystemBaseHardware["UOperatingSystemBaseHardware"]
UOperatingSystemBaseHardware <|-- UOperatingSystemMBB
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemMBB["UOperatingSystemMBB"]
class UOperatingSystemBIOS["UOperatingSystemBIOS"]
UOperatingSystemMBB *-- UOperatingSystemBIOS
class EOperatingSystemCommonSizes["EOperatingSystemCommonSizes"]
UOperatingSystemMBB ..> EOperatingSystemCommonSizes
class UOperatingSystemBaseDevice["UOperatingSystemBaseDevice"]
UOperatingSystemMBB *-- UOperatingSystemBaseDevice
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemMBB {
+UOperatingSystemMBB()
+ClockTick() const
+TryOpenBIOS() bool
+GetParentDevice() const UOperatingSystemBaseDevice() &
+GetBIOS() const UOperatingSystemBIOS() &
+IsCpuSocketSupported(const FGameplayTag &CpuSocketTag) const bool
+CanOpenBIOS() const bool
+GetMaxCpuSpeed() const float
+IsRamSizeSupported(const EOperatingSystemCommonSizes TestSize) bool
+CreateMotherboard(UOperatingSystemBaseDevice *OwningDevice, F UOperatingSystemMBB() *
+BiosClass : TSoftClassPtr< UOperatingSystemBIOS() >
+MaxCpuSpeed : float
+SupportedCpuSockets : FGameplayTagContainer
+MaxSupportedRamSize : EOperatingSystemCommonSizes()
+SupportedDevices : FGameplayTagContainer
+BIOS : TObjectPtr< UOperatingSystemBIOS() >
+ParentDevice : TWeakObjectPtr< UOperatingSystemBaseDevi
+OnValidate(FGenericError &OutError) const override bool
+Internal_Initialize(FGenericError &OutError) bool
+Internal_OnDeviceStateChanged(const EOperatingSystemDeviceState &Previous
}
Caller impact — GetParentDevice
Section titled “Caller impact — GetParentDevice”Documented call sites inside the plugin (4):
flowchart LR UOperatingSystemMBB__GetParentDevice["UOperatingSystemMBB::GetParentDevice"] UOperatingSystemCPU__CreateCPU["UOperatingSystemCPU::CreateCPU"] UOperatingSystemCPU__CreateCPU --> UOperatingSystemMBB__GetParentDevice UOperatingSystemGPU__CreateGPU["UOperatingSystemGPU::CreateGPU"] UOperatingSystemGPU__CreateGPU --> UOperatingSystemMBB__GetParentDevice UOperatingSystemHDD__CreateHDD["UOperatingSystemHDD::CreateHDD"] UOperatingSystemHDD__CreateHDD --> UOperatingSystemMBB__GetParentDevice UOperatingSystemRAM__CreateRAM["UOperatingSystemRAM::CreateRAM"] UOperatingSystemRAM__CreateRAM --> UOperatingSystemMBB__GetParentDevice
Represents the operating system motherboard.
The UOperatingSystemMBB class is a child class of UOperatingSystemBaseHardware and represents the operating system motherboard. It provides functionality to manage the BIOS, supported CPU sockets, supported devices, clock tick, validation, and more.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemMBB | ||
void | ClockTick const | Performs a clock tick on the operating system motherboard. |
bool | TryOpenBIOS | This method is used to try opening the BIOS. If it is possible to open the BIOS, it will call the OpenBIOS method and return true. Otherwise, it will return false. |
UOperatingSystemBaseDevice & | GetParentDevice const | Retrieves the parent device actor associated with this operating system motherboard. |
UOperatingSystemBIOS & | GetBIOS const | Returns the BIOS of the operating system motherboard. This method retrieves and returns the BIOS of the operating system motherboard. |
bool | IsCpuSocketSupported const | Checks if the provided CPU socket tag is supported by the operating system motherboard. The IsCpuSocketSupported method checks if the provided CPU socket tag is supported by the operating system motherboard. It returns true if the tag is supported, false otherwise. |
bool | CanOpenBIOS const | Determines whether the BIOS can be opened. This function returns a boolean value indicating whether the BIOS can be opened. It checks if the BIOS is valid and if the current state of the parent device is either “Starting” or “BIOS”. |
float | GetMaxCpuSpeed const inline | Get the maximum CPU speed of the operating system motherboard. |
bool | IsRamSizeSupported const inline | Check if a given RAM size is supported by the operating system motherboard. |
UOperatingSystemMBB
Section titled “UOperatingSystemMBB”UOperatingSystemMBB()Defined in OperatingSystemMBB.h:57
References
Section titled “References”ClockTick
Section titled “ClockTick”const
void ClockTick() constDefined in OperatingSystemMBB.h:85 Performs a clock tick on the operating system motherboard.
The ClockTick method performs a clock tick on the operating system motherboard. It calls the ClockTick method of the parent device, which propagates the clock tick to the appropriate components. This method is const and does not modify the state of the object.
See also: UOperatingSystemBaseDevice::ClockTick
References
Section titled “References”TryOpenBIOS
Section titled “TryOpenBIOS”bool TryOpenBIOS()Defined in OperatingSystemMBB.h:139 This method is used to try opening the BIOS. If it is possible to open the BIOS, it will call the OpenBIOS method and return true. Otherwise, it will return false.
Returns
Section titled “Returns”True if the BIOS was successfully opened, false otherwise. @See CanOpenBIOS, OpenBIOS
References
Section titled “References”GetParentDevice
Section titled “GetParentDevice”const
UOperatingSystemBaseDevice & GetParentDevice() constDefined in OperatingSystemMBB.h:147 Retrieves the parent device actor associated with this operating system motherboard.
Returns
Section titled “Returns”The parent device actor, or nullptr if no parent device actor is set.
See also: UOperatingSystemBaseDevice, ParentDevice
Referenced by
Section titled “Referenced by”References
Section titled “References”GetBIOS
Section titled “GetBIOS”const
UOperatingSystemBIOS & GetBIOS() constDefined in OperatingSystemMBB.h:155 Returns the BIOS of the operating system motherboard. This method retrieves and returns the BIOS of the operating system motherboard.
Returns
Section titled “Returns”A reference to an instance of UOperatingSystemBIOS representing the BIOS of the operating system motherboard.
Referenced by
Section titled “Referenced by”References
Section titled “References”IsCpuSocketSupported
Section titled “IsCpuSocketSupported”const
bool IsCpuSocketSupported(const FGameplayTag & CpuSocketTag) constDefined in OperatingSystemMBB.h:168 Checks if the provided CPU socket tag is supported by the operating system motherboard. The IsCpuSocketSupported method checks if the provided CPU socket tag is supported by the operating system motherboard. It returns true if the tag is supported, false otherwise.
Parameters
Section titled “Parameters”CpuSocketTagThe CPU socket tag to check.
Returns
Section titled “Returns”True if the CPU socket tag is supported, false otherwise.
See also: SupportedCpuSockets
See also: InvalidTag
References
Section titled “References”CanOpenBIOS
Section titled “CanOpenBIOS”const
bool CanOpenBIOS() constDefined in OperatingSystemMBB.h:177 Determines whether the BIOS can be opened. This function returns a boolean value indicating whether the BIOS can be opened. It checks if the BIOS is valid and if the current state of the parent device is either “Starting” or “BIOS”.
Returns
Section titled “Returns”True if the BIOS can be opened, false otherwise.
Referenced by
Section titled “Referenced by”References
Section titled “References”BIOSBIOSParentDeviceStarting
GetMaxCpuSpeed
Section titled “GetMaxCpuSpeed”const inline
inline float GetMaxCpuSpeed() constDefined in OperatingSystemMBB.h:186 Get the maximum CPU speed of the operating system motherboard.
This method returns the maximum CPU speed supported by the operating system motherboard.
Returns
Section titled “Returns”The maximum CPU speed.
IsRamSizeSupported
Section titled “IsRamSizeSupported”const inline
inline bool IsRamSizeSupported(const EOperatingSystemCommonSizes TestSize) constDefined in OperatingSystemMBB.h:198 Check if a given RAM size is supported by the operating system motherboard.
This method checks if a given RAM size is supported by the operating system motherboard. The supported RAM size is determined by the MaxSupportedRamSize property.
Parameters
Section titled “Parameters”TestSizeThe RAM size to be tested. It should be one of the values defined in the EOperatingSystemCommonSizes enumeration.
Returns
Section titled “Returns”true if the given RAM size is supported, false otherwise.
References
Section titled “References”None
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemMBB * | CreateMotherboard static | Creates a motherboard for the given owning device. |
CreateMotherboard
Section titled “CreateMotherboard”static
static UOperatingSystemMBB * CreateMotherboard(UOperatingSystemBaseDevice * OwningDevice, FGenericError & OutError)Defined in OperatingSystemMBB.h:74 Creates a motherboard for the given owning device.
This method creates a motherboard object for the given owning device. It checks if the owning device has a valid motherboard class, and if not, sets the error message in OutError and returns nullptr. If the owning device has a valid motherboard class, the method creates the motherboard object, performs validation, and initializes it. If any validation or initialization steps fail, the error message is set in OutError and the motherboard object is marked as garbage and returned as nullptr. On success, the created motherboard object is returned.
Parameters
Section titled “Parameters”-
OwningDeviceThe owning device for which to create the motherboard. -
OutErrorA reference to a FGenericError object that will hold the error message if an error occurs.
Returns
Section titled “Returns”A pointer to the created motherboard object, or nullptr if an error occurs.
See also: UOperatingSystemMBB, UOperatingSystemBaseDevice
Referenced by
Section titled “Referenced by”References
Section titled “References”MAKE_ERRORNEW_SOFT_OBJ
Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
TSoftClassPtr< UOperatingSystemBIOS > | BiosClass | Bios that belongs to this Motherboard. |
float | MaxCpuSpeed | Maximum speed the CPU can have on this motherboard. If the CPU speed is higher than this one, device won’t start. |
FGameplayTagContainer | SupportedCpuSockets | Supported cpu sockets. If empty, it is assumed all CPU sockets are supported. |
EOperatingSystemCommonSizes | MaxSupportedRamSize | Indicates the maximum supported RAM size for the operating system motherboard. |
FGameplayTagContainer | SupportedDevices | List of devices this Motherboard supports. If empty, it is assumed all devices are supported. |
TObjectPtr< UOperatingSystemBIOS > | BIOS | |
TWeakObjectPtr< UOperatingSystemBaseDevice > | ParentDevice | The device that owns this motherboard |
BiosClass
Section titled “BiosClass”TSoftClassPtr< UOperatingSystemBIOS > BiosClassDefined in OperatingSystemMBB.h:30 Bios that belongs to this Motherboard.
Referenced by
Section titled “Referenced by”MaxCpuSpeed
Section titled “MaxCpuSpeed”float MaxCpuSpeedDefined in OperatingSystemMBB.h:34 Maximum speed the CPU can have on this motherboard. If the CPU speed is higher than this one, device won’t start.
SupportedCpuSockets
Section titled “SupportedCpuSockets”FGameplayTagContainer SupportedCpuSocketsDefined in OperatingSystemMBB.h:38 Supported cpu sockets. If empty, it is assumed all CPU sockets are supported.
Referenced by
Section titled “Referenced by”MaxSupportedRamSize
Section titled “MaxSupportedRamSize”EOperatingSystemCommonSizes MaxSupportedRamSizeDefined in OperatingSystemMBB.h:42 Indicates the maximum supported RAM size for the operating system motherboard.
Referenced by
Section titled “Referenced by”SupportedDevices
Section titled “SupportedDevices”FGameplayTagContainer SupportedDevicesDefined in OperatingSystemMBB.h:46 List of devices this Motherboard supports. If empty, it is assumed all devices are supported.
Referenced by
Section titled “Referenced by”TObjectPtr< UOperatingSystemBIOS > BIOSDefined in OperatingSystemMBB.h:49
Referenced by
Section titled “Referenced by”ParentDevice
Section titled “ParentDevice”TWeakObjectPtr< UOperatingSystemBaseDevice > ParentDeviceDefined in OperatingSystemMBB.h:53 The device that owns this motherboard
Referenced by
Section titled “Referenced by”Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
bool | OnValidate virtual const override | Validates the operating system motherboard. |
OnValidate
Section titled “OnValidate”virtual const override
virtual bool OnValidate(FGenericError & OutError) const overrideDefined in OperatingSystemMBB.h:99 Validates the operating system motherboard.
The OnValidate method validates the operating system motherboard by checking various conditions. If any validation step fails, an error message is set in the OutError parameter and the method returns false. If all validation steps pass, the method returns true, indicating that the operating system motherboard is valid.
Parameters
Section titled “Parameters”OutErrorA reference to a FGenericError object that will hold the error message if validation fails.
Returns
Section titled “Returns”True if the operating system motherboard is valid, false otherwise.
References
Section titled “References”BiosClassHardwareTagMAKE_ERRORMaxSupportedRamSizeNameNoneParentDeviceSupportedDevices
Reimplements
Section titled “Reimplements”Private Methods
Section titled “Private Methods”| Return | Name | Description |
|---|---|---|
bool | Internal_Initialize | Performs the internal initialization of the operating system motherboard. |
void | Internal_OnDeviceStateChanged | Internal function that is called when the state of a device changes. |
Internal_Initialize
Section titled “Internal_Initialize”bool Internal_Initialize(FGenericError & OutError)Defined in OperatingSystemMBB.h:114 Performs the internal initialization of the operating system motherboard.
The Internal_Initialize method performs the internal initialization of the operating system motherboard. It creates the BIOS object, initializes it, and checks if the initialization is successful. If the initialization fails, the BIOS object is marked as garbage and set to nullptr. It also adds a dynamic delegate to the OnDeviceStateChanged event of the parent device.
Parameters
Section titled “Parameters”OutErrorA reference to a FGenericError object that will hold the error message if the initialization fails.
Returns
Section titled “Returns”True if the initialization is successful, false otherwise.
See also: UOperatingSystemMBB::InitBIOS, UOperatingSystemBIOS::InitBIOS, UOperatingSystemMBB::Internal_OnDeviceStateChanged
References
Section titled “References”BIOSBiosClassInternal_OnDeviceStateChangedNEW_SOFT_OBJParentDevice
Internal_OnDeviceStateChanged
Section titled “Internal_OnDeviceStateChanged”void Internal_OnDeviceStateChanged(const EOperatingSystemDeviceState & PreviousState, const EOperatingSystemDeviceState & CurrentState)Defined in OperatingSystemMBB.h:128 Internal function that is called when the state of a device changes.
This function is called internally by the operating system motherboard (UOperatingSystemMBB) class whenever the state of a device changes. It is responsible for handling the device state change and performing any necessary actions.
Parameters
Section titled “Parameters”-
PreviousStateThe previous state of the device. -
CurrentStateThe current state of the device.
Referenced by
Section titled “Referenced by”References
Section titled “References”BIOSRunning