Implements a message endpoint builder. 更多...
#include <MessageEndpointBuilder.h>
Public 成员函数 | |
| TSharedPtr< FMessageEndpoint, ESPMode::ThreadSafe > | Build () |
| Builds the message endpoint as configured. 更多... | |
| FMessageEndpointBuilder (const FName &InName) | |
| Creates and initializes a new builder using the default message bus. 更多... | |
| FMessageEndpointBuilder (const FName &InName, const TSharedRef< IMessageBus, ESPMode::ThreadSafe > &InBus) | |
| Creates and initializes a new builder using the specified message bus. 更多... | |
| template<typename MessageType , typename HandlerType > | |
| FMessageEndpointBuilder & | Handling (HandlerType *Handler, typename TRawMessageHandler< MessageType, HandlerType >::FuncType HandlerFunc) |
| Adds a message handler for the given type of messages (via raw function pointers). 更多... | |
| template<typename MessageType > | |
| FMessageEndpointBuilder & | Handling (typename TFunctionMessageHandler< MessageType >::FuncType HandlerFunc) |
| Adds a message handler for the given type of messages (via TFunction object). 更多... | |
| operator TSharedPtr< FMessageEndpoint, ESPMode::ThreadSafe > () | |
| Implicit conversion operator to build the message endpoint as configured. 更多... | |
| FMessageEndpointBuilder & | ReceivingOnAnyThread () |
| Configures the endpoint to receive messages on any thread. 更多... | |
| FMessageEndpointBuilder & | ReceivingOnThread (ENamedThreads::Type NamedThread) |
| Configured the endpoint to receive messages on a specific thread. 更多... | |
| FMessageEndpointBuilder & | ThatIsDisabled () |
| Disables the endpoint. 更多... | |
| FMessageEndpointBuilder & | WithCatchall (FFunctionMessageCatchall::FuncType HandlerFunc) |
| Adds a message handler for the given type of messages (via TFunction object). 更多... | |
| template<typename HandlerType > | |
| FMessageEndpointBuilder & | WithCatchall (HandlerType *Handler, typename TRawMessageCatchall< HandlerType >::FuncType HandlerFunc) |
| Adds a message handler for the given type of messages (via raw function pointers). 更多... | |
| FMessageEndpointBuilder & | WithHandler (const TSharedRef< IMessageHandler, ESPMode::ThreadSafe > &Handler) |
| Registers a message handler with the endpoint. 更多... | |
| FMessageEndpointBuilder & | WithInbox () |
| Enables the endpoint's message inbox. 更多... | |
Implements a message endpoint builder.
|
inline |
Creates and initializes a new builder using the default message bus.
WARNING: This constructor must be called from the Game thread.
| InName | The endpoint's name (for debugging purposes). |
| InBus | The message bus to attach the endpoint to. |
|
inline |
Creates and initializes a new builder using the specified message bus.
| InName | The endpoint's name (for debugging purposes). |
| InBus | The message bus to attach the endpoint to. |
|
inline |
Builds the message endpoint as configured.
|
inline |
Adds a message handler for the given type of messages (via raw function pointers).
It is legal to configure multiple handlers for the same message type. Each handler will be executed when a message of the specified type is received.
This overload is used to register raw class member functions.
| HandlerType | The type of the object handling the messages. |
| MessageType | The type of messages to handle. |
| Handler | The class handling the messages. |
| HandlerFunc | The class function handling the messages. |
|
inline |
Adds a message handler for the given type of messages (via TFunction object).
It is legal to configure multiple handlers for the same message type. Each handler will be executed when a message of the specified type is received.
This overload is used to register functions that are compatible with TFunction function objects, such as global and static functions, as well as lambdas.
| MessageType | The type of messages to handle. |
| Function | The function object handling the messages. |
|
inline |
Implicit conversion operator to build the message endpoint as configured.
|
inline |
Configures the endpoint to receive messages on any thread.
By default, the builder initializes the message endpoint to receive on the current thread. Use this method to receive on any available thread instead.
ThreadAny is the fastest way to receive messages. It should be used if the receiving code is completely thread-safe and if it is sufficiently fast. ThreadAny MUST NOT be used if the receiving code is not thread-safe. It also SHOULD NOT be used if the code includes time consuming operations, because it will block the message router, causing no other messages to be delivered in the meantime.
|
inline |
Configured the endpoint to receive messages on a specific thread.
By default, the builder initializes the message endpoint to receive on the current thread. Use this method to receive on a different thread instead.
Also see the additional notes for ReceivingOnAnyThread().
| NamedThread | The name of the thread to receive messages on. |
|
inline |
Disables the endpoint.
|
inline |
Adds a message handler for the given type of messages (via TFunction object).
It is legal to configure multiple handlers for the same message type. Each handler will be executed when a message of the specified type is received.
This overload is used to register functions that are compatible with TFunction function objects, such as global and static functions, as well as lambdas.
| MessageType | The type of messages to handle. |
| Function | The function object handling the messages. |
|
inline |
Adds a message handler for the given type of messages (via raw function pointers).
It is legal to configure multiple handlers for the same message type. Each handler will be executed when a message of the specified type is received.
This overload is used to register raw class member functions.
| HandlerType | The type of the object handling the messages. |
| MessageType | The type of messages to handle. |
| Handler | The class handling the messages. |
| HandlerFunc | The class function handling the messages. |
|
inline |
Registers a message handler with the endpoint.
It is legal to configure multiple handlers for the same message type. Each handler will be executed when a message of the specified type is received.
| Handler | The handler to add. |
|
inline |
Enables the endpoint's message inbox.
The inbox is disabled by default.