Skip to content

FOperatingSystemDeviceMessengerSystem

#include <OperatingSystemSimulator/Public/Devices/OperatingSystemDeviceMessenger.h>
class FOperatingSystemDeviceMessengerSystem

Defined in OperatingSystemDeviceMessenger.h:20

Inherits: NotThreadSafe >

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class FOperatingSystemDeviceMessengerSystem["FOperatingSystemDeviceMessengerSystem"]
  class TSharedFromThis__FOperatingSystemDeviceMessengerSystem__ESPMode__NotThreadSafe["TSharedFromThis< FOperatingSystemDeviceMessengerSystem, ESPMode::NotThreadSafe >"]
  TSharedFromThis__FOperatingSystemDeviceMessengerSystem__ESPMode__NotThreadSafe <|-- FOperatingSystemDeviceMessengerSystem
---
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.

ReturnNameDescription
voidBroadcastBroadcasts an event to all registered delegates or a specific event to its registered delegates.
voidBeginListeningStarts listening for a specific event with the given callback delegate.
voidStopListeningStops listening to a specific event.
voidClearAll inlineClears all mapped delegates in the messaging system.

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.

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


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.

  • ListenToEventName The name of the event to start listening to.

  • Callback The callback delegate to be invoked when the specified event is broadcasted.


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.

  • EventName The name of the event to stop listening to. If empty, all events will be stopped.

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.

ReturnNameDescription
TMap< FName, TArray< FOperatingSystemDeviceMessageDelegate > >MappedDelegatesA mapping of event names to arrays of delegates for operating system device messaging.

TMap< FName, TArray< FOperatingSystemDeviceMessageDelegate > > MappedDelegates

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