Choose your operating system:
Windows
macOS
Linux
| TSharedFromThis | ||
| IMessageReceiver | ||
| IMessageSender | ||
| IBusListener
|
Module |
|
Header |
/Engine/Source/Runtime/MessagingCommon/Public/MessageEndpoint.h |
Include |
#include "MessageEndpoint.h" |
class FMessageEndpoint :
public TSharedFromThis< FMessageEndpoint, ESPMode::ThreadSafe >,
public IMessageReceiver,
public IMessageSender,
public IBusListener
Implements a message endpoint for sending and receiving messages on a message bus.
This class provides a convenient implementation of the IMessageReceiver and IMessageSender interfaces, which allow consumers to send and receive messages on a message bus. The endpoint allows for receiving messages asynchronously as they arrive, as well as synchronously through an inbox that can be polled.
By default, messages are received synchronously on the thread that the endpoint was created on. If the message consumer is thread-safe, a more efficient message dispatch can be enabled by calling the SetRecipientThread() method with ENamedThreads::AnyThread.
Endpoints that are destroyed or receive messages on non-Game threads should use the static function FMessageEndpoint::SafeRelease() to dispose of the endpoint. This will ensure that there are no race conditions between endpoint destruction and the receiving of messages.
The underlying message bus will take ownership of all sent and published message objects. The memory held by the messages must therefore NOT be freed by the caller.
Name | Description | |
---|---|---|
|
FMessageEndpoint ( |
Creates and initializes a new instance. |
Name | Description | |
---|---|---|
|
~FMessageEndpoint() |
Destructor. |
Name | Description | ||
---|---|---|---|
|
ClearHandlers() |
Clears all handlers in a way that guarantees it won't overlap with message processing. |
|
|
Defer ( |
Defers processing of the given message by the specified time delay. |
|
|
Disable() |
Disables this endpoint. |
|
|
DisableInbox() |
Disables the inbox for unhandled messages. The inbox is disabled by default. |
|
|
Enable() |
Enables this endpoint. |
|
|
EnableInbox() |
Enables the inbox for unhandled messages. |
|
|
Forward ( |
Forwards a previously received message. |
|
|
Forward ( |
Immediately forwards a previously received message to the specified list of recipients. |
|
|
Forward ( |
Immediately forwards a previously received message to the specified recipient. |
|
|
Forward ( |
Forwards a previously received message to the specified recipient after a given delay. |
|
|
const FMessa... |
GetAddress() |
Gets the endpoint's message address. |
|
TSharedPtr< ... |
GetBusIfEnabled() |
Gets a shared pointer to the message bus if this endpoint is enabled. |
|
IsConnected() |
Checks whether this endpoint is connected to the bus. |
|
|
IsEnabled() |
Checks whether this endpoint is enabled. |
|
|
IsInboxEmpty() |
Checks whether the inbox is empty. |
|
|
IsInboxEnabled() |
Checks whether the inbox is enabled. |
|
|
T * |
MakeMessage ( |
Creates a message of the specified template type. |
|
ProcessInbox() |
Calls the matching message handlers for all messages queued up in the inbox. |
|
|
ProcessMessage ( |
Forwards the given message context to matching message handlers. |
|
|
Publish ( |
Publishes a message to all subscribed recipients within the specified scope. |
|
|
Publish |
Publishes a message to all subscribed recipients within the specified scope. |
|
|
Publish ( |
Publishes a message to all subscribed recipients within the specified scope. |
|
|
Publish ( |
Immediately pa message to all subscribed recipients within the specified scope. |
|
|
Publish ( |
Publishes a message to all subscribed recipients within the specified scope. |
|
|
Publish ( |
Publishes a message to all subscribed recipients after a given delay. |
|
|
Publish ( |
Publishes a message to all subscribed recipients within the specified scope after a given delay. |
|
|
Publish ( |
Immediately pa message to all subscribed recipients within the specified scope. |
|
|
Publish ( |
Immediately publishes a message to all subscribed recipients. |
|
|
Publish |
Immediately publishes a message to all subscribed recipients. |
|
|
ReceiveFromInbox ( |
Receives a single message from the endpoint's inbox. |
|
|
SafeRelease ( |
Safely releases a message endpoint that is receiving messages on AnyThread. |
|
|
Send ( |
Sends a message to the specified list of recipients. |
|
|
Send ( |
Sends a message to the specified list of recipients. Allows to specify message flags |
|
|
Send ( |
Sends a message to the specified list of recipients. Allows to specify message flags |
|
|
Send ( |
Sends a message to the specified list of recipients. Allows to specify message flags |
|
|
Send ( |
Sends a message with fields, attachment and expiration to the specified recipient after a given delay. |
|
|
Send ( |
Sends a message to the specified list of recipients. |
|
|
Send ( |
Sends a message with fields, attachment and expiration to the specified recipient after a given delay. |
|
|
Send ( |
Sends a message with fields and attachment to the specified list of recipients after a given delay. |
|
|
Send ( |
Sends a message to the specified list of recipients after a given delay after a given delay. |
|
|
Send ( |
Sends a message with fields and attachment to the specified recipient. |
|
|
Send ( |
Sends a message to the specified recipient after a given delay. |
|
|
Send ( |
Immediately sends a message to the specified recipient. |
|
|
Send ( |
Immediately sends a message to the specified list of recipients. |
|
|
Send ( |
Immediately sends a message to the specified recipient. |
|
|
Send ( |
Sends a message with fields and expiration to the specified recipient after a given delay. |
|
|
SetRecipientThread ( |
Sets the name of the thread to receive messages on. |
|
|
Subscribe() |
Template method to subscribe the message endpoint to the specified type of messages with the default message scope. |
|
|
Subscribe ( |
Template method to subscribe the message endpoint to the specified type and scope of messages. |
|
|
Subscribe ( |
Subscribes a message handler. |
|
|
Unsubscribe() |
Template method to unsubscribe the endpoint from the specified message type. |
|
|
Unsubscribe() |
Unsubscribes this endpoint from all message types. |
|
|
Unsubscribe ( |
Unsubscribes this endpoint from the specified message type. |
Name | Description | ||
---|---|---|---|
|
GetDebugName() |
Gets the recipient's name (for debugging purposes). |
|
|
const FGuid ... |
GetRecipientId() |
Gets the recipient's unique identifier (for debugging purposes). |
|
ENamedThread... |
GetRecipientThread() |
Gets the name of the thread on which to receive messages. |
|
IsLocal() |
Checks whether this recipient represents a local endpoint. |
|
|
ReceiveMessage ( |
Handles the given message. |
Name | Description | ||
---|---|---|---|
|
FMessageAddr... |
GetSenderAddress() |
Gets the sender's address. |
|
NotifyMessageError ( |
Notifies the sender of errors. |
Name | Description | ||
---|---|---|---|
|
ENamedThread... |
GetListenerThread() |
Gets the name of the thread on which to receive notifications. |
|
NotifyRegistration ( |
Notify a registration event from the bus This is called when a receiver is registered or unregistered from the bus. |
Name |
Description |
---|---|
Builder |
Type definition for the endpoint builder. |
Name | Description | ||
---|---|---|---|
|
Send ( |
FMessageEndpoint::Send with 6 params is deprecated. Please use FMessageEndpoint::Send that takes additionnal EMessageFlags instead! |