Operating System Simulator Plugin  3.5.1
Unreal Engine plugin that simulates an Operating System Environment
No Matches
UOperatingSystemPSU Class Reference

#include "OperatingSystemPSU.h"

Inheritance diagram for UOperatingSystemPSU:
Collaboration diagram for UOperatingSystemPSU:

Public Member Functions

 UOperatingSystemPSU ()
- Public Member Functions inherited from UOperatingSystemBaseHardware
 UOperatingSystemBaseHardware ()
FText GetHardwareName () const
FText GetHardwareMadeBy () const
FText GetModelNumber () const
FString GetHardwareNameAsString () const
 Returns the name of the hardware as a string.
FGameplayTag GetHardwareTag () const
 Returns the hardware tag associated with the hardware object.

Static Public Member Functions

static UE_NODISCARD UOperatingSystemPSUCreatePSU (UOperatingSystemBaseDevice *OwningDevice, FGenericError &OutError)
 Creates an instance of UOperatingSystemPSU.

Protected Member Functions

virtual bool OnValidate (FGenericError &OutError) const override
 Validates the Power Supply Unit (PSU).
- Protected Member Functions inherited from UOperatingSystemBaseHardware
bool Validate (FGenericError &OutError) const
 Validates the current state of the operating system hardware object.
bool K2_OnValidate (FGenericError &OutError) const

Additional Inherited Members

- Protected Attributes inherited from UOperatingSystemBaseHardware
FText Name
FText MadeBy
FText ModelNumber
FGameplayTag HardwareTag
bool bHasBlueprintValidateFunction

Detailed Description

Represents a Power Supply Unit (PSU) in the operating system simulator.

This class is a blueprintable and blueprint type that inherits from UOperatingSystemBaseHardware. It represents a power supply unit in the operating system simulator. It contains a weak pointer to the parent device and provides a static method to create an instance of the PSU.

Constructor & Destructor Documentation

◆ UOperatingSystemPSU()

UOperatingSystemPSU::UOperatingSystemPSU ( )

Member Function Documentation

◆ CreatePSU()

UOperatingSystemPSU * UOperatingSystemPSU::CreatePSU ( UOperatingSystemBaseDevice * OwningDevice,
FGenericError & OutError )

Creates an instance of UOperatingSystemPSU.

This method creates and returns an instance of UOperatingSystemPSU. It takes an OwningDevice pointer and an OutError reference as input parameters. The OwningDevice pointer is used to get the PSU class of the parent device. If the parent device does not have a PSU class, the method sets the OutError parameter to an error message and returns nullptr. If the parent device has a PSU class, the method creates a new instance of UOperatingSystemPSU and sets the ParentDevice pointer to the OwningDevice. It then calls the Validate method of the instance to ensure its validity. If the instance is not valid, the method marks it as garbage, sets ProxyPsu to nullptr, and returns nullptr. Otherwise, it returns the instance.

OwningDeviceA pointer to the parent device.
OutErrorA reference to a FGenericError object that will be set with an error message if an error occurs.
An instance of UOperatingSystemPSU if successful, nullptr otherwise.
Here is the caller graph for this function:

◆ OnValidate()

bool UOperatingSystemPSU::OnValidate ( FGenericError & OutError) const

Validates the Power Supply Unit (PSU).

This method validates the Power Supply Unit (PSU). It checks if the HardwareTag is equal to the PsuTag. If they are not equal, an error message is created and assigned to the OutError parameter. The method returns false to indicate that the validation failed. If the HardwareTag is equal to the PsuTag, the method returns true to indicate that the validation passed.

OutErrorA reference to a FGenericError object that will be set with an error message if the validation fails.
true if the validation passed, false otherwise.

Reimplemented from UOperatingSystemBaseHardware.

The documentation for this class was generated from the following files: