UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IMessageReceiver Class Referenceabstract

#include <IMessageReceiver.h>

+ Inheritance diagram for IMessageReceiver:

Public Member Functions

virtual FName GetDebugName () const =0
 
virtual const FGuidGetRecipientId () const =0
 
virtual ENamedThreads::Type GetRecipientThread () const =0
 
virtual bool IsLocal () const =0
 
virtual void ReceiveMessage (const TSharedRef< IMessageContext, ESPMode::ThreadSafe > &Context)=0
 
bool IsRemote () const
 
virtual ~IMessageReceiver ()
 

Detailed Description

Interface for message recipients.

Classes that implement this interface are able to receive messages from a message bus. A message recipient will receive a call to its IMessageReceiver.ReceiveMessage method for each message that was sent directly to it (via IMessageBus.Send) and for each published message (via IMessageBus.Publish) that it subscribed to (via IMessageBus.Subscribe).

This interface provides a rather low-level mechanism for receiving messages. Instead of implementing it, Most users will want to use an instance of see FMessageEndpoint, which provides a much more convenient way of sending and receiving messages.

See also
FMessageEndpoint, IMessageBus, IMessageSender

Constructor & Destructor Documentation

◆ ~IMessageReceiver()

virtual IMessageReceiver::~IMessageReceiver ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ GetDebugName()

virtual FName IMessageReceiver::GetDebugName ( ) const
pure virtual

Gets the recipient's name (for debugging purposes).

Returns
The debug name.
See also
GetRecipientId, GetRecipientThread

Implemented in FMessageBridge, and FMessageEndpoint.

◆ GetRecipientId()

virtual const FGuid & IMessageReceiver::GetRecipientId ( ) const
pure virtual

Gets the recipient's unique identifier (for debugging purposes).

Returns
The recipient's identifier.
See also
GetDebugName, GetRecipientThread

Implemented in FMessageBridge, and FMessageEndpoint.

◆ GetRecipientThread()

virtual ENamedThreads::Type IMessageReceiver::GetRecipientThread ( ) const
pure virtual

Gets the name of the thread on which to receive messages.

If the recipient's ReceiveMessage() is thread-safe, return ThreadAny for best performance.

Returns
Name of the receiving thread.
See also
GetDebugName, GetRecipientId

Implemented in FMessageBridge, and FMessageEndpoint.

◆ IsLocal()

virtual bool IMessageReceiver::IsLocal ( ) const
pure virtual

Checks whether this recipient represents a local endpoint.

Local recipients are located in the current thread or process. Recipients located in other processes on the same machine or on remote machines are considered remote.

Returns
true if this recipient is local, false otherwise.
See also
IsRemote

Implemented in FMessageBridge, and FMessageEndpoint.

◆ IsRemote()

bool IMessageReceiver::IsRemote ( ) const
inline

Checks whether this recipient represents a remote endpoint.

Local recipients are located in the current thread or process. Recipients located in other processes on the same machine or on remote machines are considered remote.

Returns
true if this recipient is remote, false otherwise.
See also
IsLocal

◆ ReceiveMessage()

virtual void IMessageReceiver::ReceiveMessage ( const TSharedRef< IMessageContext, ESPMode::ThreadSafe > &  Context)
pure virtual

Handles the given message.

Parameters
ContextWill hold the context of the received message.

Implemented in FMessageBridge, and FMessageEndpoint.


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