engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
IMessageSender类 参考abstract

Interface for message senders. 更多...

#include <IMessageSender.h>

+ 类 IMessageSender 继承关系图:

Public 成员函数

virtual FMessageAddress GetSenderAddress ()=0
 Gets the sender's address. 更多...
 
virtual void NotifyMessageError (const TSharedRef< IMessageContext, ESPMode::ThreadSafe > &Context, const FString &Error)=0
 Notifies the sender of errors. 更多...
 
virtual ~IMessageSender ()
 Virtual destructor.
 

详细描述

Interface for message senders.

Classes that implement this interface are able to send messages on a message bus. Each message sender must be uniquely identifiable with a message address that is returned by the IMessageSender.GetSenderAddress method. It is recommended that implementors of this interface generate a GUID for each instance, which must not change throughout the lifetime of the instance.

The sending of messages is accomplished with the IMessageBus.Forward, IMessageBus.Publish and IMessageBus.Send methods. In case an error occurs during the sending of a message, the IMessageSender.NotifyMessageError method will be called.

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

参见
FMessageEndpoint, IMessageBus, IMessageReceiver

成员函数说明

◆ GetSenderAddress()

virtual FMessageAddress IMessageSender::GetSenderAddress ( )
pure virtual

Gets the sender's address.

返回
The message address.

在 FMessageEndpoint 内被实现.

◆ NotifyMessageError()

virtual void IMessageSender::NotifyMessageError ( const TSharedRef< IMessageContext, ESPMode::ThreadSafe > &  Context,
const FString &  Error 
)
pure virtual

Notifies the sender of errors.

参数
ContextThe context of the message that generated the error.
ErrorThe error string.

在 FMessageEndpoint 内被实现.


该类的文档由以下文件生成: