Navigation
API > API/Runtime > API/Runtime/Messaging
Interface for message contexts.
Messages are delivered inside message contexts, which store the message itself plus additional data associated with the message. Recipients of a message are usually interested in data that describes the message, such as its origin or when it expires. They may also be interested in optional out-of-band binary data that is attached to the message.
The sender's address (IMessageContext.GetSender) is often needed to send a reply message to a message sender, i.e. in response to a published message. The message attachment (IMessageContext.GetAttachment) is an optional bundle of binary bulk data that is transferred independently from the message itself and allows for transferring larger amounts of data that would otherwise clog up the messaging system.
In case a message was forwarded by another endpoint, the context of the original sender can be accessed using the IMessageContext.GetOriginalContext method.
| Name | IMessageContext |
| Type | class |
| Header File | /Engine/Source/Runtime/Messaging/Public/IMessageContext.h |
| Include Path | #include "IMessageContext.h" |
Syntax
class IMessageContext
Derived Classes
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IMessageContext() |
Virtual destructor. | IMessageContext.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Gets the optional message annotations. | IMessageContext.h | ||
TSharedPtr< IMessageAttachment, ESPMode::ThreadSafe > GetAttachment() |
Gets the message attachment, if present. | IMessageContext.h | |
const FDateTime & GetExpiration() |
Gets the date and time at which the message expires. | IMessageContext.h | |
EMessageFlags GetFlags() |
Gets the scope to which the message was sent. | IMessageContext.h | |
const FMessageAddress & GetForwarder () |
Gets the forwarder's address. Identical to GetSender if the message wasn't forwarded. | IMessageContext.h | |
const void * GetMessage () |
Gets the message data. | IMessageContext.h | |
| Gets the name of the message type. | IMessageContext.h | ||
const TWeakObjectPtr< UScriptStruct > & GetMessageTypeInfo () |
Gets the message's type information. | IMessageContext.h | |
| Gets the path name of the message type. | IMessageContext.h | ||
TSharedPtr< IMessageContext, ESPMode::ThreadSafe > GetOriginalContext() |
Returns the original message context in case the message was forwarded. | IMessageContext.h | |
const TArray< FMessageAddress > & GetRecipients () |
Gets the list of message recipients. | IMessageContext.h | |
EMessageScope GetScope() |
Gets the scope to which the message was sent. | IMessageContext.h | |
const FMessageAddress & GetSender () |
Gets the sender's address. | IMessageContext.h | |
| Gets the name of the thread from which the message was sent. | IMessageContext.h | ||
const FDateTime & GetTimeForwarded () |
Gets the time at which the message was forwarded. | IMessageContext.h | |
const FDateTime & GetTimeSent () |
Gets the time at which the message was sent. | IMessageContext.h | |
bool IsForwarded () |
Checks whether this is a forwarded message. | IMessageContext.h | |
bool IsValid () |
Checks whether this context is valid. | IMessageContext.h |