UOperatingSystemCPU
#include <OperatingSystemSimulator/Public/Hardware/OperatingSystemCPU.h>class UOperatingSystemCPUDefined in OperatingSystemCPU.h:18
Inherits:
UOperatingSystemBaseHardware
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemCPU["UOperatingSystemCPU"]
class UOperatingSystemBaseHardware["UOperatingSystemBaseHardware"]
UOperatingSystemBaseHardware <|-- UOperatingSystemCPU
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemCPU["UOperatingSystemCPU"]
class UOperatingSystemMBB["UOperatingSystemMBB"]
UOperatingSystemCPU *-- UOperatingSystemMBB
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemCPU {
+UOperatingSystemCPU()
+CreateCPU(UOperatingSystemMBB *OwningMotherboard, FGe UOperatingSystemCPU() *
+Speed : float
+SocketTag : FGameplayTag
+ParentMotherboard : TWeakObjectPtr< UOperatingSystemMBB() >
+OnValidate(FGenericError &OutError) const override bool
}
Represents an operating system CPU.
The UOperatingSystemCPU class is a blueprintable class that represents the CPU of an operating system. It inherits from the UOperatingSystemBaseHardware class.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemCPU |
UOperatingSystemCPU
Section titled “UOperatingSystemCPU”UOperatingSystemCPU()Defined in OperatingSystemCPU.h:49
References
Section titled “References”Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemCPU * | CreateCPU static | Creates a CPU for an operating system. |
CreateCPU
Section titled “CreateCPU”static
static UOperatingSystemCPU * CreateCPU(UOperatingSystemMBB * OwningMotherboard, FGenericError & OutError)Defined in OperatingSystemCPU.h:60 Creates a CPU for an operating system.
This method creates and returns a CPU object for an operating system. The CPU is created with the specified owning motherboard and error output parameter.
Parameters
Section titled “Parameters”-
OwningMotherboardThe owning motherboard for the CPU. -
OutErrorThe error output parameter to capture any error that occurs during CPU creation.
Returns
Section titled “Returns”The created CPU object, or nullptr if an error occurred during creation.
Referenced by
Section titled “Referenced by”References
Section titled “References”GetParentDeviceMAKE_ERRORNEW_SOFT_OBJ
Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
float | Speed | Represents the speed of the operating system’s CPU. |
FGameplayTag | SocketTag | Represents the socket tag for the operating system CPU. |
TWeakObjectPtr< UOperatingSystemMBB > | ParentMotherboard | The ParentMotherboard variable represents a weak pointer to an instance of the UOperatingSystemMBB class. |
float SpeedDefined in OperatingSystemCPU.h:31 Represents the speed of the operating system’s CPU.
The speed of the CPU is measured in gigahertz (GHz) and can range from 1 to 5 GHz. It is used to determine the processing power of the CPU and you can use it to affect the overall performance of the operating system although this is not implemented natively.
Referenced by
Section titled “Referenced by”SocketTag
Section titled “SocketTag”FGameplayTag SocketTagDefined in OperatingSystemCPU.h:39 Represents the socket tag for the operating system CPU.
The socket tag is categorized under the OperatingSystem.Hardware.CPU.Socket category.
Referenced by
Section titled “Referenced by”ParentMotherboard
Section titled “ParentMotherboard”TWeakObjectPtr< UOperatingSystemMBB > ParentMotherboardDefined in OperatingSystemCPU.h:45 The ParentMotherboard variable represents a weak pointer to an instance of the UOperatingSystemMBB class.
Referenced by
Section titled “Referenced by”Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
bool | OnValidate virtual const override | Validates the operating system CPU. |
OnValidate
Section titled “OnValidate”virtual const override
virtual bool OnValidate(FGenericError & OutError) const overrideDefined in OperatingSystemCPU.h:74 Validates the operating system CPU.
This method validates the operating system CPU by performing several checks. It checks if the CPU is using the correct hardware tag, if it is compatible with the motherboard’s CPU socket, if the speed is within the valid range, and if the CPU speed is compatible with the maximum CPU speed supported by the motherboard.
Parameters
Section titled “Parameters”OutErrorThe output parameter to capture any validation errors that occur.
Returns
Section titled “Returns”true if the CPU is valid, false otherwise.
References
Section titled “References”HardwareTagMAKE_ERRORNameParentMotherboardSocketTagSpeed