UnrealVoxta 0.1.1
 
Loading...
Searching...
No Matches
IHubConnection Class Referenceabstract

Interface for a SignalR hub connection that enables real-time communication with a SignalR server. More...

#include <IHubConnection.h>

Inheritance diagram for IHubConnection:
FHubConnection

Public Member Functions

virtual void Start ()=0
 Starts the connection to the SignalR hub.
 
virtual void Stop ()=0
 Stops the connection to the SignalR hub.
 
 DECLARE_EVENT (IHubConnection, FOnHubConnectedEvent)
 Delegate called when a connection has been established successfully.
 
virtual FOnHubConnectedEvent & OnConnected ()=0
 Gets the event that is triggered when the connection is successfully established.
 
 DECLARE_EVENT_OneParam (IHubConnection, FOnHubConnectionErrorEvent, const FString &)
 Delegate called when a connection could not be established.
 
virtual FOnHubConnectionErrorEvent & OnConnectionError ()=0
 Gets the event that is triggered when a connection error occurs.
 
 DECLARE_EVENT (IHubConnection, FHubConnectionClosedEvent)
 Delegate called when a web socket connection has been closed.
 
virtual FHubConnectionClosedEvent & OnClosed ()=0
 Gets the event that is triggered when the connection is closed.
 
 DECLARE_DELEGATE_OneParam (FOnMethodInvocation, const TArray< FSignalRValue > &)
 
virtual FOnMethodInvocation & On (const FString &EventName)=0
 Registers a callback for a specific hub method invocation from the server.
 
 DECLARE_DELEGATE_OneParam (FOnMethodCompletion, const FSignalRInvokeResult &)
 
virtual FOnMethodCompletion & Invoke (const FString &EventName, const TArray< FSignalRValue > &InArguments=TArray< FSignalRValue >())=0
 Invokes a hub method on the server with the specified arguments and waits for a response.
 
template<typename... ArgTypes>
FORCEINLINE FOnMethodCompletion & Invoke (const FString &EventName, ArgTypes... Arguments)
 Templated version of Invoke that converts arguments to FSignalRValue automatically.
 
virtual void Send (const FString &EventName, const TArray< FSignalRValue > &InArguments=TArray< FSignalRValue >())=0
 Sends a message to a hub method on the server without waiting for a response.
 
template<typename... ArgTypes>
FORCEINLINE void Send (const FString &EventName, ArgTypes... Arguments)
 Templated version of Send that converts arguments to FSignalRValue automatically.
 

Protected Member Functions

virtual ~IHubConnection ()
 

Detailed Description

Interface for a SignalR hub connection that enables real-time communication with a SignalR server.

Provides methods for starting/stopping connections, registering event handlers, and invoking server methods.

Constructor & Destructor Documentation

◆ ~IHubConnection()

IHubConnection::~IHubConnection ( )
protectedvirtual

Member Function Documentation

◆ DECLARE_DELEGATE_OneParam() [1/2]

IHubConnection::DECLARE_DELEGATE_OneParam ( FOnMethodCompletion ,
const FSignalRInvokeResult &  )

◆ DECLARE_DELEGATE_OneParam() [2/2]

IHubConnection::DECLARE_DELEGATE_OneParam ( FOnMethodInvocation ,
const TArray< FSignalRValue > &  )

◆ DECLARE_EVENT() [1/2]

IHubConnection::DECLARE_EVENT ( IHubConnection ,
FHubConnectionClosedEvent  )

Delegate called when a web socket connection has been closed.

◆ DECLARE_EVENT() [2/2]

IHubConnection::DECLARE_EVENT ( IHubConnection ,
FOnHubConnectedEvent  )

Delegate called when a connection has been established successfully.

◆ DECLARE_EVENT_OneParam()

IHubConnection::DECLARE_EVENT_OneParam ( IHubConnection ,
FOnHubConnectionErrorEvent ,
const FString &  )

Delegate called when a connection could not be established.

◆ Invoke() [1/2]

template<typename... ArgTypes>
FORCEINLINE FOnMethodCompletion & IHubConnection::Invoke ( const FString & EventName,
ArgTypes... Arguments )
inline

Templated version of Invoke that converts arguments to FSignalRValue automatically.

Template Parameters
ArgTypesVariadic template parameters representing the argument types. Must be types that can be converted to FSignalRValue.
Parameters
EventNameThe name of the hub method to invoke.
ArgumentsVariable number of arguments to pass to the hub method.
Returns
A delegate that will be invoked when the server responds to the method invocation.

◆ Invoke() [2/2]

virtual FOnMethodCompletion & IHubConnection::Invoke ( const FString & EventName,
const TArray< FSignalRValue > & InArguments = TArray< FSignalRValue >() )
pure virtual

Invokes a hub method on the server with the specified arguments and waits for a response.

Parameters
EventNameThe name of the hub method to invoke.
InArgumentsArray of arguments to pass to the hub method.
Returns
A delegate that will be invoked when the server responds to the method invocation.

Implemented in FHubConnection.

◆ On()

virtual FOnMethodInvocation & IHubConnection::On ( const FString & EventName)
pure virtual

Registers a callback for a specific hub method invocation from the server.

Parameters
EventNameThe name of the hub method to listen for.
Returns
A delegate that will be invoked when the specified method is called by the server.

Implemented in FHubConnection.

◆ OnClosed()

virtual FHubConnectionClosedEvent & IHubConnection::OnClosed ( )
pure virtual

Gets the event that is triggered when the connection is closed.

Returns
Reference to the connection closed event.

Implemented in FHubConnection.

◆ OnConnected()

virtual FOnHubConnectedEvent & IHubConnection::OnConnected ( )
pure virtual

Gets the event that is triggered when the connection is successfully established.

Returns
Reference to the connection established event.

Implemented in FHubConnection.

◆ OnConnectionError()

virtual FOnHubConnectionErrorEvent & IHubConnection::OnConnectionError ( )
pure virtual

Gets the event that is triggered when a connection error occurs.

Returns
Reference to the connection error event.

Implemented in FHubConnection.

◆ Send() [1/2]

template<typename... ArgTypes>
FORCEINLINE void IHubConnection::Send ( const FString & EventName,
ArgTypes... Arguments )
inline

Templated version of Send that converts arguments to FSignalRValue automatically.

Parameters
EventNameThe name of the hub method to send a message to.
ArgumentsVariable number of arguments to pass to the hub method.

◆ Send() [2/2]

virtual void IHubConnection::Send ( const FString & EventName,
const TArray< FSignalRValue > & InArguments = TArray< FSignalRValue >() )
pure virtual

Sends a message to a hub method on the server without waiting for a response.

Parameters
EventNameThe name of the hub method to send a message to.
InArgumentsArray of arguments to pass to the hub method.

Implemented in FHubConnection.

◆ Start()

virtual void IHubConnection::Start ( )
pure virtual

Starts the connection to the SignalR hub.

Implemented in FHubConnection.

◆ Stop()

virtual void IHubConnection::Stop ( )
pure virtual

Stops the connection to the SignalR hub.

Implemented in FHubConnection.


The documentation for this class was generated from the following files: