Operating System Simulator Plugin
3.5.1
Unreal Engine plugin that simulates an Operating System Environment
|
#include "OperatingSystemDeviceMessenger.h"
Public Member Functions | |
~FOperatingSystemDeviceMessengerSystem () | |
void | Broadcast (const FName &EventName, UObject *Payload) |
Broadcasts an event to all registered delegates or a specific event to its registered delegates. | |
void | BeginListening (const FName &ListenToEventName, const FOperatingSystemDeviceMessageDelegate &Callback) |
Starts listening for a specific event with the given callback delegate. | |
void | StopListening (const FName &EventName) |
Stops listening to a specific event. | |
FORCEINLINE void | ClearAll () |
Clears all mapped delegates in the messaging system. | |
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.
|
inline |
void FOperatingSystemDeviceMessengerSystem::BeginListening | ( | const FName & | ListenToEventName, |
const FOperatingSystemDeviceMessageDelegate & | Callback ) |
Starts listening for a specific event with the given callback delegate.
This method adds the provided callback delegate to the list of delegates associated with the specified event name. When the event with the given name is broadcasted, the registered callback will be invoked.
ListenToEventName | The name of the event to start listening to. |
Callback | The callback delegate to be invoked when the specified event is broadcasted. |
void FOperatingSystemDeviceMessengerSystem::Broadcast | ( | const FName & | EventName, |
UObject * | Payload ) |
Broadcasts an event to all registered delegates or a specific event to its registered delegates.
This method is used to broadcast an event to all registered delegates or a specific event to its registered delegates. If the EventName parameter is empty, the method will broadcast the event to all registered delegates. If the EventName parameter is not empty, the method will broadcast the event only to the delegates registered for that specific event.
EventName | The name of the event to broadcast. If empty, the method will broadcast the event to all registered delegates. |
Payload | The payload object to pass to the delegates. This can be any UObject-derived class or nullptr. |
|
inline |
Clears all mapped delegates in the messaging system.
This method clears all the mapped delegates in the messaging system. It empties the map, compacts it, and then shrinks it to free up memory.
void FOperatingSystemDeviceMessengerSystem::StopListening | ( | const FName & | EventName | ) |
Stops listening to a specific event.
This method removes all delegates associated with the specified event name. If the EventName parameter is empty, all delegates for all events will be removed.
EventName | The name of the event to stop listening to. If empty, all events will be stopped. |