Skip to content

UOperatingSystemCPU

#include <OperatingSystemSimulator/Public/Hardware/OperatingSystemCPU.h>
class UOperatingSystemCPU

Defined in OperatingSystemCPU.h:18

Inherits: UOperatingSystemBaseHardware

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemCPU["UOperatingSystemCPU"]
  class UOperatingSystemBaseHardware["UOperatingSystemBaseHardware"]
  UOperatingSystemBaseHardware <|-- UOperatingSystemCPU
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemCPU["UOperatingSystemCPU"]
  class UOperatingSystemMBB["UOperatingSystemMBB"]
  UOperatingSystemCPU *-- UOperatingSystemMBB
---
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.

ReturnNameDescription
UOperatingSystemCPU

UOperatingSystemCPU()

Defined in OperatingSystemCPU.h:49

ReturnNameDescription
UOperatingSystemCPU *CreateCPU staticCreates a CPU for an operating system.

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.

  • OwningMotherboard The owning motherboard for the CPU.

  • OutError The error output parameter to capture any error that occurs during CPU creation.

The created CPU object, or nullptr if an error occurred during creation.

ReturnNameDescription
floatSpeedRepresents the speed of the operating system’s CPU.
FGameplayTagSocketTagRepresents the socket tag for the operating system CPU.
TWeakObjectPtr< UOperatingSystemMBB >ParentMotherboardThe ParentMotherboard variable represents a weak pointer to an instance of the UOperatingSystemMBB class.

float Speed

Defined 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.


FGameplayTag SocketTag

Defined 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.


TWeakObjectPtr< UOperatingSystemMBB > ParentMotherboard

Defined in OperatingSystemCPU.h:45 The ParentMotherboard variable represents a weak pointer to an instance of the UOperatingSystemMBB class.

ReturnNameDescription
boolOnValidate virtual const overrideValidates the operating system CPU.

virtual const override

virtual bool OnValidate(FGenericError & OutError) const override

Defined 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.

  • OutError The output parameter to capture any validation errors that occur.

true if the CPU is valid, false otherwise.