Operating System Simulator Plugin  3.5.1
Unreal Engine plugin that simulates an Operating System Environment
Loading...
Searching...
No Matches
UOperatingSystemDataObject Class Reference

UOperatingSystemDataObject is a base class for operating system data objects. It inherits from UObject and provides functionality for tick-based updates and object creation. More...

#include "OperatingSystemDataObject.h"

Inheritance diagram for UOperatingSystemDataObject:
[legend]
Collaboration diagram for UOperatingSystemDataObject:
[legend]

Public Member Functions

template<class T >
TGetParentObject () const
 
OPERATINGSYSTEMSIMULATOR_API void SetTickEnabled (const bool bEnable)
 
OPERATINGSYSTEMSIMULATOR_API bool IsTickEnabled () const
 

Static Public Member Functions

static OPERATINGSYSTEMSIMULATOR_API UOperatingSystemDataObjectCreateDataObj (UObject *OwningObject, const TSoftClassPtr< UOperatingSystemDataObject > &DataClassPtr)
 
template<class T >
static OPERATINGSYSTEMSIMULATOR_API T * CreateDataObj (UObject *OwningObject, TSoftClassPtr< UOperatingSystemDataObject > DataClassPtr)
 This method creates a new instance of a data object of type T.
 

Protected Member Functions

virtual OPERATINGSYSTEMSIMULATOR_API bool ShouldCreate () const
 
virtual OPERATINGSYSTEMSIMULATOR_API void Tick (const float &DeltaSeconds)
 The Tick method receives the time elapsed since the last frame update and performs any necessary updates or computations.
 
virtual OPERATINGSYSTEMSIMULATOR_API void OnCreate ()
 This method is called when a new instance of UOperatingSystemDataObject is created.
 
virtual OPERATINGSYSTEMSIMULATOR_API void OnValidate (FGenericError &OutError)
 This method is called to validate the data object.
 
void K2_OnCreate ()
 K2_OnCreate.
 
void K2_Tick (const float &DeltaSeconds)
 K2_Tick method is an event meant to be overridden in Blueprint subclasses of OperatingSystemDataObject. It allows subclasses to define custom behavior that should be executed every tick.
 
bool K2_ShouldCreate () const
 Indicates whether the operating system data object should be created.
 

Protected Attributes

TWeakObjectPtr< UObject > ParentObject
 
uint8 bStartWithTickEnabled: 1
 

Detailed Description

UOperatingSystemDataObject is a base class for operating system data objects. It inherits from UObject and provides functionality for tick-based updates and object creation.

Member Function Documentation

◆ CreateDataObj() [1/2]

UOperatingSystemDataObject * UOperatingSystemDataObject::CreateDataObj ( UObject * OwningObject,
const TSoftClassPtr< UOperatingSystemDataObject > & DataClassPtr )
static

Creates a new instance of UOperatingSystemDataObject.

Parameters
OwningObjectThe owning object that will own the created data object.
DataClassPtrThe class pointer to the data object's class.
Returns
The newly created data object if successful, nullptr otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateDataObj() [2/2]

template<class T >
static OPERATINGSYSTEMSIMULATOR_API T * UOperatingSystemDataObject::CreateDataObj ( UObject * OwningObject,
TSoftClassPtr< UOperatingSystemDataObject > DataClassPtr )
inlinestatic

This method creates a new instance of a data object of type T.

Parameters
OwningObjectThe owning object that will own the created data object.
DataClassPtrThe class pointer to the data object's class.
Template Parameters
TThe type of data object to create.
Returns
The newly created data object if successful, otherwise nullptr.

◆ GetParentObject()

template<class T >
T * UOperatingSystemDataObject::GetParentObject ( ) const
inline

Cast the Parent Object to the given type.

Example:

static OPERATINGSYSTEMSIMULATOR_API UOperatingSystemDataObject * CreateDataObj(UObject *OwningObject, const TSoftClassPtr< UOperatingSystemDataObject > &DataClassPtr)
Definition OperatingSystemDataObject.cpp:20

◆ IsTickEnabled()

bool UOperatingSystemDataObject::IsTickEnabled ( ) const

Check if the tick is enabled for this object.

Returns
True if the tick is enabled, false otherwise.

◆ K2_OnCreate()

void UOperatingSystemDataObject::K2_OnCreate ( )
protected

K2_OnCreate.

K2_OnCreate is a BlueprintImplementableEvent that is called when the object is created to provide custom behavior during object creation. This function is called after the object has been created and initialized, and before it is added to the world.

◆ K2_ShouldCreate()

bool UOperatingSystemDataObject::K2_ShouldCreate ( ) const
protected

Indicates whether the operating system data object should be created.

This method is a BlueprintImplementableEvent and can be overridden in Blueprint subclasses. It allows custom logic to be implemented to determine whether the object should be created.

Returns
True if the data object should be created, false otherwise.

◆ K2_Tick()

void UOperatingSystemDataObject::K2_Tick ( const float & DeltaSeconds)
protected

K2_Tick method is an event meant to be overridden in Blueprint subclasses of OperatingSystemDataObject. It allows subclasses to define custom behavior that should be executed every tick.

Parameters
DeltaSecondsThe amount of time in seconds since the last tick.

◆ OnCreate()

virtual OPERATINGSYSTEMSIMULATOR_API void UOperatingSystemDataObject::OnCreate ( )
inlineprotectedvirtual

This method is called when a new instance of UOperatingSystemDataObject is created.

This method is called after the data object has been created and initialized, but before tick-based updates begin. This provides an opportunity for the derived class to perform any additional setup or initialization that is required. The derived class can override this method to add any custom initialization logic.

Note
This method is virtual and can be overridden by derived classes. By default, this method does nothing.

Reimplemented in UOperatingSystemProgramData, UOperatingSystemTerminalHistory, and UOperatingSystemVideoPlayerProgramData.

◆ OnValidate()

virtual OPERATINGSYSTEMSIMULATOR_API void UOperatingSystemDataObject::OnValidate ( FGenericError & OutError)
inlineprotectedvirtual

This method is called to validate the data object.

This method is virtual and can be overridden by derived classes to provide custom validation logic for the data object. By default, this method does nothing. The derived class should implement this method to add any specific validation logic that is required.

Parameters
OutErrorThe error object to store any validation errors.
Note
The derived class can use the OutError parameter to report any validation errors that occur during the validation process. If there are no validation errors, the OutError object should not be modified. By default, this method does nothing.

Reimplemented in UOperatingSystemSettingsData.

◆ SetTickEnabled()

void UOperatingSystemDataObject::SetTickEnabled ( const bool bEnable)

Enable or disable ticking functionality.

This method enables or disables the ticking functionality of the operating system data object. When ticking is enabled, the object will receive tick events at a regular interval, allowing it to perform any necessary updates or computations. When ticking is disabled, the object will no longer receive tick events.

Parameters
bEnableWhether to enable or disable ticking.
Here is the call graph for this function:

◆ ShouldCreate()

virtual OPERATINGSYSTEMSIMULATOR_API bool UOperatingSystemDataObject::ShouldCreate ( ) const
inlineprotectedvirtual

Check if the object should be created.

Returns
True if the object should be created, False otherwise.

Reimplemented in UOperatingSystemTerminalHistory.

◆ Tick()

virtual OPERATINGSYSTEMSIMULATOR_API void UOperatingSystemDataObject::Tick ( const float & DeltaSeconds)
inlineprotectedvirtual

The Tick method receives the time elapsed since the last frame update and performs any necessary updates or computations.

Parameters
DeltaSecondsThe time elapsed since the last frame update in seconds.
Note
This method is virtual and can be overridden by derived classes to provide custom tick functionality. By default, this method does nothing. The derived class should implement this method to add any specific tick functionality that is required.

Member Data Documentation

◆ bStartWithTickEnabled

uint8 UOperatingSystemDataObject::bStartWithTickEnabled
protected

Flag indicating whether the tick function should start enabled.

This flag is used in conjunction with the "bTickEnabled" property of the owning class to determine whether the tick function is initially enabled or disabled.

By default, this flag is set to false, indicating that the tick function should start disabled. If set to true, the tick function will start enabled.

Note
This property can only be modified in editor and not at runtime.

◆ ParentObject

TWeakObjectPtr<UObject> UOperatingSystemDataObject::ParentObject
protected

The ParentObject variable is used to store a weak pointer to the owner object. It is useful for maintaining a reference to the parent object without causing a strong reference cycle.


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