Skip to content

UOperatingSystemHDD

#include <OperatingSystemSimulator/Public/Hardware/OperatingSystemHDD.h>
class UOperatingSystemHDD

Defined in OperatingSystemHDD.h:20

Inherits: UOperatingSystemBaseHardware

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

ReturnNameDescription
UOperatingSystemHDD
voidConsumeSpaceInMBConsumeSpaceInMB is a method in the UOperatingSystemHDD class that consumes space in the specified partition in megabytes.
voidConsumeSpaceInGBConsumeSpaceInGB is a method in the UOperatingSystemHDD class that consumes space in the specified partition in gigabytes.
FTextGetSizeAsText constGetSizeAsText is a method in the UOperatingSystemHDD class that returns the size of the specified partition as text.
floatGetStoragePercentage constGetStoragePercentage is a method in the UOperatingSystemHDD class that retrieves the storage percentage of a partition.
UOperatingSystemPartition *AllocatePartitionFromLoadGameUOperatingSystemHDD::AllocatePartitionFromLoadGame is a method that allocates a partition from a loaded game state.
voidAllocatePartitionAllocates a partition on the hard disk drive.
voidRemovePartitionRemoves a partition from the hard disk drive.
voidRefreshPartitionsRefreshPartitions() is a method of the UOperatingSystemHDD class that refreshes the partitions of a hard disk drive.
doubleGetHardDiskSize constGetHardDiskSize is a method in the UOperatingSystemHDD class that returns the size of the hard disk drive.
UOperatingSystemPartition *FindPartitionByID constFinds a partition in the hard disk drive with the given unique ID.
boolHasPartitionWithID constChecks if a hard disk drive has a partition with the given ID.
const TArray< TObjectPtr< UOperatingSystemPartition > > &GetPartitions const inlineGetPartitions is a method that returns the array of partitions associated with the hard disk drive.

UOperatingSystemHDD()
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.

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


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.

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


const

FText GetSizeAsText(const EOperatingSystemSizeMethod SizeMethod, const UOperatingSystemPartition * Partition, FGenericError & OutError) const

Defined in OperatingSystemHDD.h:77 GetSizeAsText is a method in the UOperatingSystemHDD class that returns the size of the specified partition as text.

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

The size of the partition as text.


const

float GetStoragePercentage(const UOperatingSystemPartition * Partition, FGenericError & OutError) const

Defined in OperatingSystemHDD.h:86 GetStoragePercentage is a method in the UOperatingSystemHDD class that retrieves the storage percentage of a partition.

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

The storage percentage of the partition.


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.

  • PartitionSaveLoad The data structure containing the information required to load the partition.

The newly created UOperatingSystemPartition object that represents the loaded partition.

See also: UOperatingSystemPartition, FOperatingSystemPartitionSaveLoad


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.

  • NewPartition The partition to be allocated.

  • OutError The error that occurred during the allocation process, if any.


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

  • Partition The partition to be removed.

  • OutError The error object used to store error information if necessary.


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.


const

double GetHardDiskSize(const EOperatingSystemSizeMethod & SizeMethod) const

Defined in OperatingSystemHDD.h:157 GetHardDiskSize is a method in the UOperatingSystemHDD class that returns the size of the hard disk drive.

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

The size of the hard disk drive based on the specified SizeMethod. The returned size is a double value.


const

UOperatingSystemPartition * FindPartitionByID(const FOperatingSystemUniqueId & TestID) const

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

  • TestID The unique ID to search for.

A pointer to the partition with the unique ID, or nullptr if not found.


const

bool HasPartitionWithID(const FOperatingSystemUniqueId & TestID) const

Defined in OperatingSystemHDD.h:178 Checks if a hard disk drive has a partition with the given ID.

  • TestID The ID of the partition to check for.

True if a partition with the given ID exists, false otherwise.


const inline

inline const TArray< TObjectPtr< UOperatingSystemPartition > > & GetPartitions() const

Defined in OperatingSystemHDD.h:186 GetPartitions is a method that returns the array of partitions associated with the hard disk drive.

A constant reference to an array of TObjectPtr<UOperatingSystemPartition> representing the disk partitions. The caller should not modify this array.

ReturnNameDescription
UOperatingSystemHDD *CreateHDD staticCreateHDD is a method in the UOperatingSystemHDD class that creates a new hard disk drive object.

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.

A pointer to the newly created UOperatingSystemHDD object, or nullptr if an error occurred.

ReturnNameDescription
floatSizeInGBSize of this hard disk.
TArray< TObjectPtr< UOperatingSystemPartition > >DiskPartitionsKey is the drive letter. Like C, D, E etc. In Unix this can be /dev/sda, /dev/sda1 etc.
doublePostDiskAllocatedSpaceInBytesSpace remaining to allocate new partitions.

float SizeInGB

Defined in OperatingSystemHDD.h:28 Size of this hard disk.


TArray< TObjectPtr< UOperatingSystemPartition > > DiskPartitions

Defined in OperatingSystemHDD.h:32 Key is the drive letter. Like C, D, E etc. In Unix this can be /dev/sda, /dev/sda1 etc.


double PostDiskAllocatedSpaceInBytes

Defined in OperatingSystemHDD.h:36 Space remaining to allocate new partitions.

ReturnNameDescription
boolOnValidate virtual const overrideOnValidate is a method in the UOperatingSystemHDD class that performs validation on the hard disk drive.

virtual const override

virtual bool OnValidate(FGenericError & OutError) const override

Defined in OperatingSystemHDD.h:144 OnValidate is a method in the UOperatingSystemHDD class that performs validation on the hard disk drive.

  • OutError A reference to an FGenericError object used to store an error message if the validation fails.

Returns a boolean value indicating whether the validation was successful (true) or not (false).