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

Subsystem that allows broadcasting and listening to global messages. More...

#include "GlobalMessageSubsystem.h"

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

Public Member Functions

void BroadcastMessage (const FGameplayTag FilterTag, UObject *Payload)
 
void ListenToMessage (const UObject *WorldContextObject, const FGameplayTag FilterTag, const FGlobalMessageReceiveDelegate &Callback)
 
bool RemoveListener (const UObject *ListenerObject)
 

Static Public Member Functions

static UGlobalMessageSubsystemGet (const UWorld &TargetWorld)
 Retrieves the instance of the global message subsystem for the specified world.
 

Protected Member Functions

virtual void Deinitialize () override
 

Detailed Description

Subsystem that allows broadcasting and listening to global messages.

Member Function Documentation

◆ BroadcastMessage()

void UGlobalMessageSubsystem::BroadcastMessage ( const FGameplayTag FilterTag,
UObject * Payload )

Broadcast a message to the global message subsystem. The message is sent to all listeners that are currently registered to receive messages with the specified filter tag. The payload object can be any UObject derived class providing the necessary data for the message.

Parameters
FilterTagThe filter tag used to determine which listeners should receive the message.
PayloadThe payload object containing the data for the message. Can be nullptr if no data is needed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Deinitialize()

void UGlobalMessageSubsystem::Deinitialize ( )
overrideprotectedvirtual

◆ Get()

UGlobalMessageSubsystem * UGlobalMessageSubsystem::Get ( const UWorld & TargetWorld)
static

Retrieves the instance of the global message subsystem for the specified world.

Parameters
TargetWorldThe world for which to retrieve the global message subsystem.
Returns
The instance of the global message subsystem for the specified world.
Here is the caller graph for this function:

◆ ListenToMessage()

void UGlobalMessageSubsystem::ListenToMessage ( const UObject * WorldContextObject,
const FGameplayTag FilterTag,
const FGlobalMessageReceiveDelegate & Callback )

Listens for global messages that match the specified filter tag and invokes the provided callback function.

This function adds a listener to the global message subsystem, which allows you to receive global messages that match the specified filter tag. When a global message with a matching tag is received, the provided callback function is invoked.

Parameters
WorldContextObjectThe object that represents the world context.
FilterTagThe tag used to filter the global messages.
CallbackThe delegate function to be invoked when a global message is received.

◆ RemoveListener()

bool UGlobalMessageSubsystem::RemoveListener ( const UObject * ListenerObject)

Removes a listener from the GlobalMessageSubsystem.

This method removes a listener object from the GlobalMessageSubsystem. Once removed, the listener will no longer be notified of any global message events.

Parameters
ListenerObjectThe listener object to be removed.
Returns
True if the listener was successfully removed, false otherwise.

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