FOperatingSystemDeviceMessengerSystem
#include <OperatingSystemSimulator/Public/Devices/OperatingSystemDeviceMessenger.h>class FOperatingSystemDeviceMessengerSystemDefined in OperatingSystemDeviceMessenger.h:20
Inherits:
NotThreadSafe >
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class FOperatingSystemDeviceMessengerSystem["FOperatingSystemDeviceMessengerSystem"]
class TSharedFromThis__FOperatingSystemDeviceMessengerSystem__ESPMode__NotThreadSafe["TSharedFromThis< FOperatingSystemDeviceMessengerSystem, ESPMode::NotThreadSafe >"]
TSharedFromThis__FOperatingSystemDeviceMessengerSystem__ESPMode__NotThreadSafe <|-- FOperatingSystemDeviceMessengerSystem
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class FOperatingSystemDeviceMessengerSystem {
+Broadcast(const FName &EventName, UObject *Payload)
+BeginListening(const FName &ListenToEventName, const FOper
+StopListening(const FName &EventName)
+ClearAll()
+MappedDelegates : TMap< FName, TArray< FOperatingSystemDev
}
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.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
void | Broadcast | Broadcasts an event to all registered delegates or a specific event to its registered delegates. |
void | BeginListening | Starts listening for a specific event with the given callback delegate. |
void | StopListening | Stops listening to a specific event. |
void | ClearAll inline | Clears all mapped delegates in the messaging system. |
Broadcast
Section titled “Broadcast”void Broadcast(const FName & EventName, UObject * Payload)Defined in OperatingSystemDeviceMessenger.h:50 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.
Parameters
Section titled “Parameters”-
EventNameThe name of the event to broadcast. If empty, the method will broadcast the event to all registered delegates. -
PayloadThe payload object to pass to the delegates. This can be any UObject-derived class or nullptr.
References
Section titled “References”MappedDelegatesOS_CLOGOS_LOG_WARN
BeginListening
Section titled “BeginListening”void BeginListening(const FName & ListenToEventName, const FOperatingSystemDeviceMessageDelegate & Callback)Defined in OperatingSystemDeviceMessenger.h:61 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.
Parameters
Section titled “Parameters”-
ListenToEventNameThe name of the event to start listening to. -
CallbackThe callback delegate to be invoked when the specified event is broadcasted.
References
Section titled “References”StopListening
Section titled “StopListening”void StopListening(const FName & EventName)Defined in OperatingSystemDeviceMessenger.h:71 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.
Parameters
Section titled “Parameters”EventNameThe name of the event to stop listening to. If empty, all events will be stopped.
References
Section titled “References”ClearAll
Section titled “ClearAll”inline
inline void ClearAll()Defined in OperatingSystemDeviceMessenger.h:78 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.
Referenced by
Section titled “Referenced by”References
Section titled “References”Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
TMap< FName, TArray< FOperatingSystemDeviceMessageDelegate > > | MappedDelegates | A mapping of event names to arrays of delegates for operating system device messaging. |
MappedDelegates
Section titled “MappedDelegates”TMap< FName, TArray< FOperatingSystemDeviceMessageDelegate > > MappedDelegatesDefined in OperatingSystemDeviceMessenger.h:31 A mapping of event names to arrays of delegates for operating system device messaging.
This map stores event names as keys and arrays of delegates as values. The delegates are used for messaging functionality in an operating system device. This allows components of the device to communicate with each other.
The key type is FName, which represents the name of the event. The value type is TArray<FOperatingSystemDeviceMessageDelegate>, which represents an array of delegates for the event.