engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FMessageEndpointBuilder结构体 参考

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.

构造及析构函数说明

◆ FMessageEndpointBuilder() [1/2]

FMessageEndpointBuilder::FMessageEndpointBuilder ( const FName &  InName)
inline

Creates and initializes a new builder using the default message bus.

WARNING: This constructor must be called from the Game thread.

参数
InNameThe endpoint's name (for debugging purposes).
InBusThe message bus to attach the endpoint to.

◆ FMessageEndpointBuilder() [2/2]

FMessageEndpointBuilder::FMessageEndpointBuilder ( const FName &  InName,
const TSharedRef< IMessageBus, ESPMode::ThreadSafe > &  InBus 
)
inline

Creates and initializes a new builder using the specified message bus.

参数
InNameThe endpoint's name (for debugging purposes).
InBusThe message bus to attach the endpoint to.

成员函数说明

◆ Build()

TSharedPtr< FMessageEndpoint, ESPMode::ThreadSafe > FMessageEndpointBuilder::Build ( )
inline

Builds the message endpoint as configured.

返回
A new message endpoint, or nullptr if it couldn't be built.

◆ Handling() [1/2]

template<typename MessageType , typename HandlerType >
FMessageEndpointBuilder & FMessageEndpointBuilder::Handling ( HandlerType *  Handler,
typename TRawMessageHandler< MessageType, HandlerType >::FuncType  HandlerFunc 
)
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.

参数
HandlerTypeThe type of the object handling the messages.
MessageTypeThe type of messages to handle.
HandlerThe class handling the messages.
HandlerFuncThe class function handling the messages.
返回
This instance (for method chaining).
参见
WithCatchall, WithHandler

◆ Handling() [2/2]

template<typename MessageType >
FMessageEndpointBuilder & FMessageEndpointBuilder::Handling ( typename TFunctionMessageHandler< MessageType >::FuncType  HandlerFunc)
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.

参数
MessageTypeThe type of messages to handle.
FunctionThe function object handling the messages.
返回
This instance (for method chaining).
参见
WithCatchall, WithHandler

◆ operator TSharedPtr< FMessageEndpoint, ESPMode::ThreadSafe >()

FMessageEndpointBuilder::operator TSharedPtr< FMessageEndpoint, ESPMode::ThreadSafe > ( )
inline

Implicit conversion operator to build the message endpoint as configured.

返回
The message endpoint.

◆ ReceivingOnAnyThread()

FMessageEndpointBuilder & FMessageEndpointBuilder::ReceivingOnAnyThread ( )
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.

返回
This instance (for method chaining).
参见
ReceivingOnThread

◆ ReceivingOnThread()

FMessageEndpointBuilder & FMessageEndpointBuilder::ReceivingOnThread ( ENamedThreads::Type  NamedThread)
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().

参数
NamedThreadThe name of the thread to receive messages on.
返回
This instance (for method chaining).
参见
ReceivingOnAnyThread

◆ ThatIsDisabled()

FMessageEndpointBuilder & FMessageEndpointBuilder::ThatIsDisabled ( )
inline

Disables the endpoint.

返回
This instance (for method chaining).

◆ WithCatchall() [1/2]

FMessageEndpointBuilder & FMessageEndpointBuilder::WithCatchall ( FFunctionMessageCatchall::FuncType  HandlerFunc)
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.

参数
MessageTypeThe type of messages to handle.
FunctionThe function object handling the messages.
返回
This instance (for method chaining).
参见
WithHandler

◆ WithCatchall() [2/2]

template<typename HandlerType >
FMessageEndpointBuilder & FMessageEndpointBuilder::WithCatchall ( HandlerType *  Handler,
typename TRawMessageCatchall< HandlerType >::FuncType  HandlerFunc 
)
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.

参数
HandlerTypeThe type of the object handling the messages.
MessageTypeThe type of messages to handle.
HandlerThe class handling the messages.
HandlerFuncThe class function handling the messages.
返回
This instance (for method chaining).
参见
WithHandler

◆ WithHandler()

FMessageEndpointBuilder & FMessageEndpointBuilder::WithHandler ( const TSharedRef< IMessageHandler, ESPMode::ThreadSafe > &  Handler)
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.

参数
HandlerThe handler to add.
返回
This instance (for method chaining).
参见
Handling, WithCatchall

◆ WithInbox()

FMessageEndpointBuilder & FMessageEndpointBuilder::WithInbox ( )
inline

Enables the endpoint's message inbox.

The inbox is disabled by default.

返回
This instance (for method chaining).

该结构体的文档由以下文件生成: