UOperatingSystemHDD
#include <OperatingSystemSimulator/Public/Hardware/OperatingSystemHDD.h>class UOperatingSystemHDDDefined in OperatingSystemHDD.h:20
Inherits:
UOperatingSystemBaseHardware
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemHDD["UOperatingSystemHDD"]
class UOperatingSystemBaseHardware["UOperatingSystemBaseHardware"]
UOperatingSystemBaseHardware <|-- UOperatingSystemHDD
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemHDD["UOperatingSystemHDD"]
class UOperatingSystemPartition["UOperatingSystemPartition"]
UOperatingSystemHDD *-- UOperatingSystemPartition
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemHDD {
+UOperatingSystemHDD()
+ConsumeSpaceInMB(const float &NewSizeInMB, UOperatingSystemP
+ConsumeSpaceInGB(const float &NewSizeInGB, UOperatingSystemP
+GetSizeAsText(const EOperatingSystemSizeMethod SizeMethod FText
+GetStoragePercentage(const UOperatingSystemPartition *Partition, float
+AllocatePartitionFromLoadGame(const FOperatingSystemPartitionSaveLoad &Pa UOperatingSystemPartition() *
+AllocatePartition(UOperatingSystemPartition &NewPartition, FG
+RemovePartition(UOperatingSystemPartition &Partition, FGene
+RefreshPartitions()
+GetHardDiskSize(const EOperatingSystemSizeMethod &SizeMetho double
+FindPartitionByID(const FOperatingSystemUniqueId &TestID) con UOperatingSystemPartition() *
+HasPartitionWithID(const FOperatingSystemUniqueId &TestID) con bool
+GetPartitions() const const TArray< TObjectPtr< UOperatingSyst
+CreateHDD(UOperatingSystemMBB *OwningMotherboard, FGe UOperatingSystemHDD() *
+SizeInGB : float
+DiskPartitions : TArray< TObjectPtr< UOperatingSystemPart
+PostDiskAllocatedSpaceInBytes : double
+OnValidate(FGenericError &OutError) const override bool
}
UOperatingSystemHDD is a class representing a hard disk drive in an operating system.
This class inherits from UOperatingSystemBaseHardware and provides functionality to manage the hard disk drive.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemHDD | ||
void | ConsumeSpaceInMB | ConsumeSpaceInMB is a method in the UOperatingSystemHDD class that consumes space in the specified partition in megabytes. |
void | ConsumeSpaceInGB | ConsumeSpaceInGB is a method in the UOperatingSystemHDD class that consumes space in the specified partition in gigabytes. |
FText | GetSizeAsText const | GetSizeAsText is a method in the UOperatingSystemHDD class that returns the size of the specified partition as text. |
float | GetStoragePercentage const | GetStoragePercentage is a method in the UOperatingSystemHDD class that retrieves the storage percentage of a partition. |
UOperatingSystemPartition * | AllocatePartitionFromLoadGame | UOperatingSystemHDD::AllocatePartitionFromLoadGame is a method that allocates a partition from a loaded game state. |
void | AllocatePartition | Allocates a partition on the hard disk drive. |
void | RemovePartition | Removes a partition from the hard disk drive. |
void | RefreshPartitions | RefreshPartitions() is a method of the UOperatingSystemHDD class that refreshes the partitions of a hard disk drive. |
double | GetHardDiskSize const | GetHardDiskSize is a method in the UOperatingSystemHDD class that returns the size of the hard disk drive. |
UOperatingSystemPartition * | FindPartitionByID const | Finds a partition in the hard disk drive with the given unique ID. |
bool | HasPartitionWithID const | Checks if a hard disk drive has a partition with the given ID. |
const TArray< TObjectPtr< UOperatingSystemPartition > > & | GetPartitions const inline | GetPartitions is a method that returns the array of partitions associated with the hard disk drive. |
UOperatingSystemHDD
Section titled “UOperatingSystemHDD”UOperatingSystemHDD()Defined in OperatingSystemHDD.h:40
Section titled “Defined in OperatingSystemHDD.h:40”ConsumeSpaceInMB
Section titled “ConsumeSpaceInMB”void ConsumeSpaceInMB(const float & NewSizeInMB, UOperatingSystemPartition * Partition, FGenericError & OutError)Defined in OperatingSystemHDD.h:58 ConsumeSpaceInMB is a method in the UOperatingSystemHDD class that consumes space in the specified partition in megabytes.
Parameters
Section titled “Parameters”-
NewSizeInMB[in] The size of the space to consume in megabytes. -
Partition[in] The UOperatingSystemPartition object representing the partition in which to consume space. -
OutError[out] The FGenericError object used to store any error messages.
References
Section titled “References”ConsumeSpaceMAKE_ERROR
ConsumeSpaceInGB
Section titled “ConsumeSpaceInGB”void ConsumeSpaceInGB(const float & NewSizeInGB, UOperatingSystemPartition * Partition, FGenericError & OutError)Defined in OperatingSystemHDD.h:67 ConsumeSpaceInGB is a method in the UOperatingSystemHDD class that consumes space in the specified partition in gigabytes.
Parameters
Section titled “Parameters”-
NewSizeInGB[in] The size of the space to consume in gigabytes. -
Partition[in] The UOperatingSystemPartition object representing the partition in which to consume space. -
OutError[out] The FGenericError object used to store any error messages.
References
Section titled “References”ConsumeSpaceMAKE_ERROR
GetSizeAsText
Section titled “GetSizeAsText”const
FText GetSizeAsText(const EOperatingSystemSizeMethod SizeMethod, const UOperatingSystemPartition * Partition, FGenericError & OutError) constDefined in OperatingSystemHDD.h:77 GetSizeAsText is a method in the UOperatingSystemHDD class that returns the size of the specified partition as text.
Parameters
Section titled “Parameters”-
SizeMethod[in] The method used to represent the size (bytes, megabytes or gigabytes). -
Partition[in] The UOperatingSystemPartition object representing the partition for which to get the size. -
OutError[out] The FGenericError object used to store any error messages.
Returns
Section titled “Returns”The size of the partition as text.
References
Section titled “References”GetSizeAsTextMAKE_ERROR
GetStoragePercentage
Section titled “GetStoragePercentage”const
float GetStoragePercentage(const UOperatingSystemPartition * Partition, FGenericError & OutError) constDefined in OperatingSystemHDD.h:86 GetStoragePercentage is a method in the UOperatingSystemHDD class that retrieves the storage percentage of a partition.
Parameters
Section titled “Parameters”-
Partition[in] The UOperatingSystemPartition object representing the partition for which to retrieve the storage percentage. -
OutError[out] The FGenericError object used to store any error messages.
Returns
Section titled “Returns”The storage percentage of the partition.
References
Section titled “References”GetStoragePercentageMAKE_ERROR
AllocatePartitionFromLoadGame
Section titled “AllocatePartitionFromLoadGame”UOperatingSystemPartition * AllocatePartitionFromLoadGame(const FOperatingSystemPartitionSaveLoad & PartitionSaveLoad)Defined in OperatingSystemHDD.h:101 UOperatingSystemHDD::AllocatePartitionFromLoadGame is a method that allocates a partition from a loaded game state.
This method takes in a parameter PartitionSaveLoad of type FOperatingSystemPartitionSaveLoad, which contains the necessary data to load the partition. It creates a new UOperatingSystemPartition object and initializes it with the provided data. The newly created partition is then added to the DiskPartitions array of UOperatingSystemHDD.
Parameters
Section titled “Parameters”PartitionSaveLoadThe data structure containing the information required to load the partition.
Returns
Section titled “Returns”The newly created UOperatingSystemPartition object that represents the loaded partition.
See also: UOperatingSystemPartition, FOperatingSystemPartitionSaveLoad
References
Section titled “References”AllocatePartition
Section titled “AllocatePartition”void AllocatePartition(UOperatingSystemPartition & NewPartition, FGenericError & OutError)Defined in OperatingSystemHDD.h:112 Allocates a partition on the hard disk drive.
This method is used to allocate a new partition on the hard disk drive. The partition to be allocated is specified by the NewPartition parameter. The allocation process updates the OutError parameter with any error that occurred during the allocation.
Parameters
Section titled “Parameters”-
NewPartitionThe partition to be allocated. -
OutErrorThe error that occurred during the allocation process, if any.
References
Section titled “References”DiskPartitionsErrorExceptionDescriptionGetTotalSizeBytesIsValidIsValidPartitionMAKE_ERROROS_LOG_ERRORPostDiskAllocatedSpaceInBytesResetSetDiskNameSetSystemPartition
RemovePartition
Section titled “RemovePartition”void RemovePartition(UOperatingSystemPartition & Partition, FGenericError & OutError)Defined in OperatingSystemHDD.h:126 Removes a partition from the hard disk drive.
This method removes the specified partition from the hard disk drive. If the partition is not valid (null or not valid), an error message will be set in the provided OutError object
Parameters
Section titled “Parameters”-
PartitionThe partition to be removed. -
OutErrorThe error object used to store error information if necessary.
References
Section titled “References”RefreshPartitions
Section titled “RefreshPartitions”void RefreshPartitions()Defined in OperatingSystemHDD.h:133 RefreshPartitions() is a method of the UOperatingSystemHDD class that refreshes the partitions of a hard disk drive.
This method iterates over the DiskPartitions array of the UOperatingSystemHDD instance and sets the disk name for each partition based on the partition index.
References
Section titled “References”GetHardDiskSize
Section titled “GetHardDiskSize”const
double GetHardDiskSize(const EOperatingSystemSizeMethod & SizeMethod) constDefined in OperatingSystemHDD.h:157 GetHardDiskSize is a method in the UOperatingSystemHDD class that returns the size of the hard disk drive.
Parameters
Section titled “Parameters”-
SizeMethod- The method to use for determining the size of the hard disk drive. It can be one of the following values: -
EOperatingSystemSizeMethod::Bytes for size in bytes.
-
EOperatingSystemSizeMethod::MB for size in megabytes.
Returns
Section titled “Returns”The size of the hard disk drive based on the specified SizeMethod. The returned size is a double value.
References
Section titled “References”BytesConvertGB_ToMBMBSizeInBytesSizeInGB
FindPartitionByID
Section titled “FindPartitionByID”const
UOperatingSystemPartition * FindPartitionByID(const FOperatingSystemUniqueId & TestID) constDefined in OperatingSystemHDD.h:170 Finds a partition in the hard disk drive with the given unique ID.
This method searches for a partition in the hard disk drive with the specified unique ID. If a partition with the ID is found, it is returned. If no partition with the ID is found, nullptr is returned.
Note that the partition must be a part of the operating system’s hard disk drive for it to be found by this method.
Parameters
Section titled “Parameters”TestIDThe unique ID to search for.
Returns
Section titled “Returns”A pointer to the partition with the unique ID, or nullptr if not found.
Referenced by
Section titled “Referenced by”References
Section titled “References”HasPartitionWithID
Section titled “HasPartitionWithID”const
bool HasPartitionWithID(const FOperatingSystemUniqueId & TestID) constDefined in OperatingSystemHDD.h:178 Checks if a hard disk drive has a partition with the given ID.
Parameters
Section titled “Parameters”TestIDThe ID of the partition to check for.
Returns
Section titled “Returns”True if a partition with the given ID exists, false otherwise.
References
Section titled “References”GetPartitions
Section titled “GetPartitions”const inline
inline const TArray< TObjectPtr< UOperatingSystemPartition > > & GetPartitions() constDefined in OperatingSystemHDD.h:186 GetPartitions is a method that returns the array of partitions associated with the hard disk drive.
Returns
Section titled “Returns”A constant reference to an array of TObjectPtr<UOperatingSystemPartition> representing the disk partitions. The caller should not modify this array.
Referenced by
Section titled “Referenced by”Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemHDD * | CreateHDD static | CreateHDD is a method in the UOperatingSystemHDD class that creates a new hard disk drive object. |
CreateHDD
Section titled “CreateHDD”static
static UOperatingSystemHDD * CreateHDD(UOperatingSystemMBB * OwningMotherboard, FGenericError & OutError)Defined in OperatingSystemHDD.h:49 CreateHDD is a method in the UOperatingSystemHDD class that creates a new hard disk drive object.
Parameters
Section titled “Parameters”-
OwningMotherboardThe UOperatingSystemMBB object that owns the hard disk drive. -
OutErrorThe FGenericError object used to store any error messages.
Returns
Section titled “Returns”A pointer to the newly created UOperatingSystemHDD object, or nullptr if an error occurred.
Referenced by
Section titled “Referenced by”References
Section titled “References”GetParentDeviceMAKE_ERRORNEW_SOFT_OBJSizeInBytes
Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
float | SizeInGB | Size of this hard disk. |
TArray< TObjectPtr< UOperatingSystemPartition > > | DiskPartitions | Key is the drive letter. Like C, D, E etc. In Unix this can be /dev/sda, /dev/sda1 etc. |
double | PostDiskAllocatedSpaceInBytes | Space remaining to allocate new partitions. |
SizeInGB
Section titled “SizeInGB”float SizeInGBDefined in OperatingSystemHDD.h:28 Size of this hard disk.
Referenced by
Section titled “Referenced by”DiskPartitions
Section titled “DiskPartitions”TArray< TObjectPtr< UOperatingSystemPartition > > DiskPartitionsDefined in OperatingSystemHDD.h:32 Key is the drive letter. Like C, D, E etc. In Unix this can be /dev/sda, /dev/sda1 etc.
Referenced by
Section titled “Referenced by”PostDiskAllocatedSpaceInBytes
Section titled “PostDiskAllocatedSpaceInBytes”double PostDiskAllocatedSpaceInBytesDefined in OperatingSystemHDD.h:36 Space remaining to allocate new partitions.
Referenced by
Section titled “Referenced by”Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
bool | OnValidate virtual const override | OnValidate is a method in the UOperatingSystemHDD class that performs validation on the hard disk drive. |
OnValidate
Section titled “OnValidate”virtual const override
virtual bool OnValidate(FGenericError & OutError) const overrideDefined in OperatingSystemHDD.h:144 OnValidate is a method in the UOperatingSystemHDD class that performs validation on the hard disk drive.
Parameters
Section titled “Parameters”OutErrorA reference to an FGenericError object used to store an error message if the validation fails.
Returns
Section titled “Returns”Returns a boolean value indicating whether the validation was successful (true) or not (false).
References
Section titled “References”HardwareTagMAKE_ERRORName