Skip to content

UCommunicationManager

class UCommunicationManager : public UObject

A class that manages a gRPC server running on a specified URL.

Dependencies: IExchangeBackendInterface, IPollingBackendInterface, IProducerBackendInterface

Inherits from: public UObject

Public Interface

Destructor:

~UCommunicationManager

~UCommunicationManager()

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

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

Public Functions:

RegisterService

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

Register a service with the server.

Returns: True if the service was registered successfully, false otherwise

Parameters:

  • Service (std::shared_ptr<grpc::Service>) – [in] The service to register

Returns: bool

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

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

GetCompletionQueue

std::unique_ptr<ServerCompletionQueue> GetCompletionQueue()

Get the completion queue for the server.

Returns: The completion queue

Returns: std::unique&#95;ptr&lt;ServerCompletionQueue&gt;

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

Implementation: 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)

Create a new Polling Backend, where Unreal Polls for messages of type In.

Parameters:

  • TargetRPC (AsyncRPCHandle<ServiceType, In, Out>) – The RPC method to wrap
  • Service (std::shared_ptr<ServiceType>) – The service to attach the backend to

Returns: IPollingBackendInterface&lt;In&gt; &#42;

Attributes: inline

Source: 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)

Create a new Producer Backend, where Unreal Sends messages of type Out.

Parameters:

  • TargetRPC (AsyncRPCHandle<ServiceType, In, Out>) – The RPC method to wrap
  • Service (std::shared_ptr<ServiceType>) – The service to attach the backend to

Returns: IProducerBackendInterface&lt;Out&gt; &#42;

Attributes: inline

Source: 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)

Create a new Exchange Backend, where Unreal Sends messages of type Out and receives back messages of type In.

Parameters:

  • TargetRPC (AsyncRPCHandle<ServiceType, In, Out>) – The RPC method to wrap
  • Service (std::shared_ptr<ServiceType>) – The service to attach the backend to

Returns: IExchangeBackendInterface&lt;In, Out&gt; &#42;

Attributes: inline

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

ShutdownServer

void ShutdownServer()

Shutdown the Communication manager.

Triggers OnServerShutdownDelegate

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

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

StartBackends

bool StartBackends()

Starts all backends created by the communication manager.

Triggers OnServerStartDelegate and OnServerReadyDelegate

Returns: bool

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

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

Initialize

void Initialize()

Initialize the Communication Manager.

Sets the Port and URL for the server from the Settings Panel

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

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

Public Members:

FOnServerStartSignature OnServerStartDelegate

FOnServerStartSignature OnServerStartDelegate

A delegate that is called when the server starts.

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

FOnServerReadySignature OnServerReadyDelegate

FOnServerReadySignature OnServerReadyDelegate

A delegate that is called when the server is ready.

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

FOnServerReadySignature OnConnectionEstablishedDelegate

FOnServerReadySignature OnConnectionEstablishedDelegate

A delegate that is called when the server establishes a connection.

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

FOnServerShutdownSignature OnServerShutdownDelegate

FOnServerShutdownSignature OnServerShutdownDelegate

A delegate that is called when the server shuts down.

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

Private Interface

Private Members:

FString ServerURL

FString ServerURL

The URL of the server.

Attributes: private

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

grpc::ServerBuilder * Builder

grpc::ServerBuilder * Builder = = nullptr

The server builder object.

Attributes: private

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

std::unique_ptr<Server> Server

std::unique_ptr<Server> Server

The server object.

Attributes: private

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

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

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

list of existing services to prevent readding services

Attributes: private

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

EComSystemState State

EComSystemState State = = EComSystemState::NOTSTARTED

The state of the communication system.

Attributes: private

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

Used By: UPythonGymConnector

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