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.
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.
- Parameters
-
OwningDevice | A pointer to the parent device. |
OutError | A reference to a FGenericError object that will be set with an error message if an error occurs. |
- Returns
- An instance of UOperatingSystemPSU if successful, nullptr otherwise.
bool UOperatingSystemPSU::OnValidate |
( |
FGenericError & | OutError | ) |
const |
|
overrideprotectedvirtual |
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.
- Parameters
-
OutError | A reference to a FGenericError object that will be set with an error message if the validation fails. |
- Returns
- true if the validation passed, false otherwise.
Reimplemented from UOperatingSystemBaseHardware.