Nui
Classes | Static Public Member Functions | List of all members
Nui::RpcClient Class Reference

#include <rpc_client.hpp>

Classes

struct  AutoUnregister
 
class  RemoteCallable
 

Static Public Member Functions

static auto getRemoteCallable (std::string name)
 Get a callable remote function. More...
 
template<typename... ArgsT>
static auto call (std::string name, ArgsT &&... args)
 Get a callable remote function and call it immediately. More...
 
template<typename FunctionT , typename... ArgsT>
static auto callWithBackChannel (std::string name, FunctionT &&cb, ArgsT &&... args)
 Get a callable remote function and call it immediately with a callback. More...
 
template<typename FunctionT >
static auto getRemoteCallableWithBackChannel (std::string name, FunctionT &&func)
 Get a callable remote function and register a temporary callable for a response. More...
 
template<typename FunctionT >
static std::string registerFunctionOnce (FunctionT &&func)
 Registers a single shot function that is removed after it was called. More...
 
template<typename FunctionT >
static void registerFunction (std::string const &name, FunctionT &&func)
 Register a permanent function that is callable from the backend. More...
 
static void unregisterFunction (std::string const &name)
 Unregister a function. More...
 
template<typename FunctionT >
static AutoUnregister autoRegisterFunction (std::string const &name, FunctionT &&func)
 

Member Function Documentation

◆ autoRegisterFunction()

template<typename FunctionT >
static AutoUnregister Nui::RpcClient::autoRegisterFunction ( std::string const &  name,
FunctionT &&  func 
)
inlinestatic

◆ call()

template<typename... ArgsT>
static auto Nui::RpcClient::call ( std::string  name,
ArgsT &&...  args 
)
inlinestatic

Get a callable remote function and call it immediately.

Parameters
nameName of the function.
argsArguments to pass to the function.
Returns
auto The result of the function.

◆ callWithBackChannel()

template<typename FunctionT , typename... ArgsT>
static auto Nui::RpcClient::callWithBackChannel ( std::string  name,
FunctionT &&  cb,
ArgsT &&...  args 
)
inlinestatic

Get a callable remote function and call it immediately with a callback.

Parameters
nameName of the function.
cbThe callback function.
argsArguments to pass to the function.
Returns
auto The result of the function.

◆ getRemoteCallable()

static auto Nui::RpcClient::getRemoteCallable ( std::string  name)
inlinestatic

Get a callable remote function.

Parameters
nameName of the function.
Returns
auto A wrapper that can be called.

◆ getRemoteCallableWithBackChannel()

template<typename FunctionT >
static auto Nui::RpcClient::getRemoteCallableWithBackChannel ( std::string  name,
FunctionT &&  func 
)
inlinestatic

Get a callable remote function and register a temporary callable for a response.

◆ registerFunction()

template<typename FunctionT >
static void Nui::RpcClient::registerFunction ( std::string const &  name,
FunctionT &&  func 
)
inlinestatic

Register a permanent function that is callable from the backend.

Parameters
nameThe name of the function.
funcThe function itself.

◆ registerFunctionOnce()

template<typename FunctionT >
static std::string Nui::RpcClient::registerFunctionOnce ( FunctionT &&  func)
inlinestatic

Registers a single shot function that is removed after it was called.

Parameters
funcThe function to call.
Returns
std::string The generated name of the function.

◆ unregisterFunction()

static void Nui::RpcClient::unregisterFunction ( std::string const &  name)
inlinestatic

Unregister a function.

Parameters
nameThe name of the function.

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