Class UCommunicationManager
Class UCommunicationManager
- Defined in File CommunicationManager.h
Inheritance Relationships
Base Type
public UObject
class UCommunicationManager : public UObjectSource: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
Dependencies: FRPCServerSettings, IConsumerBackend, IExchangeBackend, IProducerBackend
A class that manages a gRPC server running on a specified URL.
Public Functions
| Symbol | Details |
|---|---|
RegisterService | Register a service with the server. |
GetCompletionQueue | Get the completion queue for the server. |
CreatePollingBackend | Create a new Polling Backend, where Unreal Polls for messages of type In. |
CreateProducerBackend | Create a new Producer Backend, where Unreal Sends messages of type Out. |
CreateExchangeBackend | Create a new Exchange Backend, where Unreal Sends messages of type Out and receives back messages of type In. |
ShutdownServer | Shutdown the Communication manager. |
StartBackends | Starts all backends created by the communication manager. |
~UCommunicationManager | — |
Initialize | Initialize the Communication Manager. |
RegisterService
bool RegisterService(std::shared_ptr<grpc::Service> Service)Register a service with the server.
Parameters
Service – [in] The service to register
Returns:
True if the service was registered successfully, false otherwise
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | Service | std::shared_ptr< grpc::Service > | The service to register |
Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp
GetCompletionQueue
std::unique_ptr<ServerCompletionQueue> GetCompletionQueue()Get the completion queue for the server.
Returns:
The completion queue
Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp
CreatePollingBackend
template <typename ServiceType, typename In, typename Out>inline IConsumerBackend<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.
Template Parameters:
-
ServiceType – The type of the service
-
In – The type of the input message
-
Out – The type of the output message
Parameters
-
TargetRPC – The RPC method to wrap
-
Service – The service to attach the backend to
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | TargetRPC | AsyncRPCHandle< ServiceType, In, Out > | The RPC method to wrap |
| 2 | — | Service | std::shared_ptr< ServiceType > | The service to attach the backend to |
Attributes: inline
Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
CreateProducerBackend
template <typename ServiceType, typename In, typename Out>inline IProducerBackend<Out> *CreateProducerBackend(AsyncRPCHandle<ServiceType, In, Out> TargetRPC, std::shared_ptr<ServiceType> Service)Create a new Producer Backend, where Unreal Sends messages of type Out.
Template Parameters:
-
ServiceType – The type of the service
-
In – The type of the input message
-
Out – The type of the output message
Parameters
-
TargetRPC – The RPC method to wrap
-
Service – The service to attach the backend to
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | TargetRPC | AsyncRPCHandle< ServiceType, In, Out > | The RPC method to wrap |
| 2 | — | Service | std::shared_ptr< ServiceType > | The service to attach the backend to |
Attributes: inline
Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
CreateExchangeBackend
template <typename ServiceType, typename In, typename Out>inline IExchangeBackend<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.
Template Parameters:
-
ServiceType – The type of the service
-
In – The type of the input message
-
Out – The type of the output message
Parameters
-
TargetRPC – The RPC method to wrap
-
Service – The service to attach the backend to
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | TargetRPC | AsyncRPCHandle< ServiceType, In, Out > | The RPC method to wrap |
| 2 | — | Service | std::shared_ptr< ServiceType > | The service to attach the backend to |
Attributes: inline
Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
ShutdownServer
void ShutdownServer()Shutdown the Communication manager.
Triggers OnServerShutdownDelegate
Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp
StartBackends
bool StartBackends()Starts all backends created by the communication manager.
Triggers OnServerStartDelegate and OnServerReadyDelegate
Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp
~UCommunicationManager
~UCommunicationManager()Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp
Initialize
void Initialize(int Port, const FString &Address)Initialize the Communication Manager.
Sets the Port and URL for the server from the Settings Panel
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | Port | int | — |
| 2 | — | Address | const FString & | — |
Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h
Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp
Public Members
| Symbol | Details |
|---|---|
OnServerStartDelegate | A delegate that is called when the server starts. |
OnServerReadyDelegate | A delegate that is called when the server is ready. |
OnConnectionEstablishedDelegate | A delegate that is called when the server establishes a connection. |
OnServerShutdownDelegate | A delegate that is called when the server shuts down. |
ConnectionSettings | — |
OnServerStartDelegate
FOnServerStartSignature OnServerStartDelegateA delegate that is called when the server starts.
OnServerReadyDelegate
FOnServerReadySignature OnServerReadyDelegateA delegate that is called when the server is ready.
OnConnectionEstablishedDelegate
FOnServerReadySignature OnConnectionEstablishedDelegateA delegate that is called when the server establishes a connection.
OnServerShutdownDelegate
FOnServerShutdownSignature OnServerShutdownDelegateA delegate that is called when the server shuts down.
ConnectionSettings
FRPCServerSettings ConnectionSettings = FRPCServerSettings()