Operating System Simulator Plugin
3.5.1
Unreal Engine plugin that simulates an Operating System Environment
|
#include "OperatingSystemDeviceMessenger.h"
Public Member Functions | |
UOperatingSystemDeviceMessenger () | |
void | BeginDestroyMessenger () |
OPERATINGSYSTEMSIMULATOR_API void | Broadcast (const FName EventName, UObject *Payload) |
OPERATINGSYSTEMSIMULATOR_API void | BeginListening (const FName ListenToEventName, const FOperatingSystemDeviceMessageDelegate &Callback) |
OPERATINGSYSTEMSIMULATOR_API void | StopListening (const FName EventName) |
Static Public Member Functions | |
static UOperatingSystemDeviceMessenger * | CreateMessenger (AOperatingSystemDeviceActor *NewDevice) |
Protected Member Functions | |
virtual OPERATINGSYSTEMSIMULATOR_API void | OnConstructed () |
This method is called when the operating system device messenger is constructed. | |
OPERATINGSYSTEMSIMULATOR_API TWeakObjectPtr< UOperatingSystemBaseDevice > | GetParentDevice () const |
Retrieves the parent device associated with this operating system device. | |
void | K2_OnConstructed () |
void | K2_OnMessengerBeginDestroy () |
K2_OnMessengerBeginDestroy function. | |
A class that provides messaging functionality for an operating system device.
This class is responsible for broadcasting and listening to events in the operating system device. It allows communication between different components of the device.
A class that creates a messenger for an operating system device.
This method creates a messenger for the specified operating system device. The messenger is responsible for broadcasting and listening to events in the device, allowing communication between different components of the device.
NewDevice | The operating system device for which to create the messenger. |
UOperatingSystemDeviceMessenger::UOperatingSystemDeviceMessenger | ( | ) |
void UOperatingSystemDeviceMessenger::BeginDestroyMessenger | ( | ) |
Begins the process of destroying the operating system device messenger.
This method is called when the operating system device is being destroyed. It performs the necessary clean-up tasks to ensure a proper destruction of the messenger.
Example usage:
void UOperatingSystemDeviceMessenger::BeginListening | ( | const FName | ListenToEventName, |
const FOperatingSystemDeviceMessageDelegate & | Callback ) |
Starts listening for a specific event and registers the specified callback to be executed when the event occurs. The event can be triggered by an operating system device, and the registered callback will be notified with the event details.
ListenToEventName | The name of the event to listen to. |
Callback | The delegate that will be called when the event occurs. |
Example usage:
void UOperatingSystemDeviceMessenger::Broadcast | ( | const FName | EventName, |
UObject * | Payload ) |
Broadcasts an event with a payload. The event name is specified by the EventName
parameter, and the payload object is specified by the Payload
parameter.
EventName | The name of the event to be broadcasted. |
Payload | The payload object associated with the event. |
|
static |
|
protected |
Retrieves the parent device associated with this operating system device.
This method returns the parent device actor that is associated with the current operating system device. If no parent device actor is set, it returns nullptr.
|
protected |
A method that is called when an object of the OperatingSystemDeviceMessenger class is constructed.
This method is blueprint implementable, allowing it to be overridden in blueprint subclasses. It is intended to be used for any necessary initialization logic when an object is created.
|
protected |
K2_OnMessengerBeginDestroy function.
This function is a BlueprintImplementableEvent that is part of the OperatingSystemDeviceMessenger class. It is used to handle the logic when the messenger begins destruction.
|
inlineprotectedvirtual |
This method is called when the operating system device messenger is constructed.
This method is virtual and can be overridden by subclasses to perform custom initialization tasks when the messenger is constructed. Subclasses should override this method to provide any necessary initialization logic specific to the subclass.
void UOperatingSystemDeviceMessenger::StopListening | ( | const FName | EventName | ) |
Stops listening to a specific event identified by its name. Once this method is called, the device messenger will no longer receive events with the specified name.
EventName | The name of the event to stop listening to. |