You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
78 lines
2.1 KiB
C++
78 lines
2.1 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "ModuleInterface.h"
|
|
|
|
|
|
struct FMessageAddress;
|
|
class IAuthorizeMessageRecipients;
|
|
class IMessageBus;
|
|
class IMessageBridge;
|
|
class IMessageTransport;
|
|
|
|
|
|
/**
|
|
* Interface for messaging modules.
|
|
*
|
|
* @see IMessageBridge, IMessageBus
|
|
*/
|
|
class IMessagingModule
|
|
: public IModuleInterface
|
|
{
|
|
public:
|
|
|
|
/**
|
|
* Creates a new message bridge.
|
|
*
|
|
* Message bridges translate messages between a message bus and another means of
|
|
* message transportation, such as network sockets.
|
|
*
|
|
* @param Address The bridge's address on the message bus.
|
|
* @param Bus The message bus to attach the bridge to.
|
|
* @param Transport The message transport technology to use.
|
|
* @return The new message bridge, or nullptr if the bridge couldn't be created.
|
|
* @see CreateBus
|
|
*/
|
|
virtual TSharedPtr<IMessageBridge, ESPMode::ThreadSafe> CreateBridge( const FMessageAddress& Address, const TSharedRef<IMessageBus, ESPMode::ThreadSafe>& Bus, const TSharedRef<IMessageTransport, ESPMode::ThreadSafe>& Transport ) = 0;
|
|
|
|
/**
|
|
* Creates a new message bus.
|
|
*
|
|
* @param RecipientAuthorizer An optional recipient authorizer.
|
|
* @return The new message bus, or nullptr if the bus couldn't be created.
|
|
* @see CreateBridge
|
|
*/
|
|
virtual TSharedPtr<IMessageBus, ESPMode::ThreadSafe> CreateBus( const TSharedPtr<IAuthorizeMessageRecipients>& RecipientAuthorizer ) = 0;
|
|
|
|
/**
|
|
* Gets the default message bus if it has been initialized.
|
|
*
|
|
* @return The default bus.
|
|
*/
|
|
virtual TSharedPtr<IMessageBus, ESPMode::ThreadSafe> GetDefaultBus() const = 0;
|
|
|
|
public:
|
|
|
|
/**
|
|
* Gets a reference to the messaging module instance.
|
|
*
|
|
* @return A reference to the Messaging module.
|
|
* @todo gmp: better implementation using dependency injection.
|
|
*/
|
|
static IMessagingModule& Get()
|
|
{
|
|
#if PLATFORM_IOS
|
|
static IMessagingModule& MessageModule = FModuleManager::LoadModuleChecked<IMessagingModule>("Messaging");
|
|
return MessageModule;
|
|
#else
|
|
return FModuleManager::LoadModuleChecked<IMessagingModule>("Messaging");
|
|
#endif
|
|
}
|
|
|
|
public:
|
|
|
|
/** Virtual destructor. */
|
|
virtual ~IMessagingModule() { }
|
|
};
|