跳至内容

UCommunicationManager

class UCommunicationManager : public UObject

一个在指定 URL 上运行 gRPC 服务器的管理器类。

依赖项: IExchangeBackendInterface, IPollingBackendInterface, IProducerBackendInterface

继承自: public UObject

公共接口

析构函数

~UCommunicationManager

~UCommunicationManager()

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 172, column 1)

实现: Schola/Source/Schola/Private/Communicator/CommunicationManager.cpp (lines 54-63)

公共函数

RegisterService

bool RegisterService(std::shared_ptr<grpc::Service> Service)

向服务器注册一个服务。

返回值: 如果服务注册成功,则为 True,否则为 False

参数

  • Service (std::shared_ptr<grpc::Service>) – [in] 要注册的服务

返回: bool

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 95, column 6)

实现: Schola/Source/Schola/Private/Communicator/CommunicationManager.cpp (lines 5-27)

GetCompletionQueue

std::unique_ptr<ServerCompletionQueue> GetCompletionQueue()

获取服务器的完成队列。

返回值: 完成队列

返回值: std::unique&#95;ptr&lt;ServerCompletionQueue&gt;

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 102, column 17)

实现: Schola/Source/Schola/Private/Communicator/CommunicationManager.cpp (lines 29-32)

CreatePollingBackend

inline IPollingBackendInterface<In> * CreatePollingBackend(AsyncRPCHandle<ServiceType, In, Out> TargetRPC, std::shared_ptr<ServiceType> Service)

创建一个新的轮询后端,Unreal 会在此轮询 In 类型消息。

参数

  • TargetRPC (AsyncRPCHandle<ServiceType, In, Out>) – 要包装的 RPC 方法
  • Service (std::shared_ptr<ServiceType>) – 要附加后端的服务

返回值: IPollingBackendInterface&lt;In&gt; &#42;

属性: inline

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 113, column 26)

CreateProducerBackend

inline IProducerBackendInterface<Out> * CreateProducerBackend(AsyncRPCHandle<ServiceType, In, Out> TargetRPC, std::shared_ptr<ServiceType> Service)

创建一个新的生产者后端,Unreal 会在此发送 Out 类型消息。

参数

  • TargetRPC (AsyncRPCHandle<ServiceType, In, Out>) – 要包装的 RPC 方法
  • Service (std::shared_ptr<ServiceType>) – 要附加后端的服务

返回值: IProducerBackendInterface&lt;Out&gt; &#42;

属性: inline

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 132, column 27)

CreateExchangeBackend

inline IExchangeBackendInterface<In, Out> * CreateExchangeBackend(AsyncRPCHandle<ServiceType, In, Out> TargetRPC, std::shared_ptr<ServiceType> Service)

创建一个新的交换后端,Unreal 会在此发送 Out 类型消息并接收 In 类型消息。

参数

  • TargetRPC (AsyncRPCHandle<ServiceType, In, Out>) – 要包装的 RPC 方法
  • Service (std::shared_ptr<ServiceType>) – 要附加后端的服务

返回值: IExchangeBackendInterface&lt;In, Out&gt; &#42;

属性: inline

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 152, column 27)

ShutdownServer

void ShutdownServer()

关闭通信管理器。

触发 OnServerShutdownDelegate

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 165, column 6)

实现: Schola/Source/Schola/Private/Communicator/CommunicationManager.cpp (lines 34-52)

StartBackends

bool StartBackends()

启动通信管理器创建的所有后端。

触发 OnServerStartDelegate 和 OnServerReadyDelegate

返回: bool

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 170, column 6)

实现: Schola/Source/Schola/Private/Communicator/CommunicationManager.cpp (lines 65-91)

Initialize

void Initialize()

初始化通信管理器。

从设置面板设置服务器的端口和 URL

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 177, column 6)

实现: Schola/Source/Schola/Private/Communicator/CommunicationManager.cpp (lines 93-106)

公共成员

FOnServerStartSignature OnServerStartDelegate

FOnServerStartSignature OnServerStartDelegate

服务器启动时调用的委托。

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 80, column 27)

FOnServerReadySignature OnServerReadyDelegate

FOnServerReadySignature OnServerReadyDelegate

服务器准备好时调用的委托。

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 82, column 27)

FOnServerReadySignature OnConnectionEstablishedDelegate

FOnServerReadySignature OnConnectionEstablishedDelegate

服务器建立连接时调用的委托。

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 84, column 27)

FOnServerShutdownSignature OnServerShutdownDelegate

FOnServerShutdownSignature OnServerShutdownDelegate

服务器关闭时调用的委托。

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 86, column 28)

私有接口

私有成员

FString ServerURL

FString ServerURL

服务器的 URL。

属性: private

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 48, column 9)

grpc::ServerBuilder * Builder

grpc::ServerBuilder * Builder = = nullptr

服务器构建器对象。

属性: private

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 51, column 20)

std::unique_ptr<Server> Server

std::unique_ptr<Server> Server

服务器对象。

属性: private

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 54, column 17)

std::unordered_set<grpc::Service *> RegisteredServices

std::unordered_set<grpc::Service *> RegisteredServices

现有服务的列表,用于防止重复添加服务

属性: private

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 57, column 20)

EComSystemState State

EComSystemState State = = EComSystemState::NOTSTARTED

通信系统的状态。

属性: private

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 61, column 17)

被使用于: UPythonGymConnector

来源: Schola/Source/Schola/Public/Communicator/CommunicationManager.h (line 41, column 1)

© . This site is unofficial and not affiliated with AMD.