rpc.hpp 0.8.1
Simple RPC Header-Only Library
|
Class defining an interface for calling into an RPC server or module. More...
#include <rpc.hpp>
Public Member Functions | |
client_interface (const client_interface &)=delete | |
client_interface & | operator= (const client_interface &)=delete |
client_interface & | operator= (client_interface &&)=delete |
template<typename R = void, typename... Args> | |
R | call_func (std::string func_name, Args &&... args) |
Sends an RPC call request to a server, waits for a response, then returns the result. More... | |
template<typename R , typename... Args> | |
R | call_header_func_impl (R(*func)(Args...), std::string func_name, Args &&... args) |
Sends an RPC call request to a server, waits for a response, then returns the result. More... | |
Protected Member Functions | |
client_interface (client_interface &&) noexcept=default | |
virtual void | send (const typename Serial::bytes_t &bytes)=0 |
Sends serialized data to a server or module. More... | |
virtual Serial::bytes_t | receive ()=0 |
Receives serialized data from a server or module. More... | |
Class defining an interface for calling into an RPC server or module.
Serial | serial_adapter type that controls how objects are serialized/deserialized |
|
inline |
Sends an RPC call request to a server, waits for a response, then returns the result.
R | Return type of the remote function to call |
Args | Variadic argument type(s) of the remote function to call |
func_name | Name of the remote function to call |
args | Argument(s) for the remote function |
client_send_error | Thrown if error occurs during the send function |
client_receive_error | Thrown if error occurs during the receive function |
|
inline |
Sends an RPC call request to a server, waits for a response, then returns the result.
R | Return type of the remote function to call |
Args | Variadic argument type(s) of the remote function to call |
func | Pointer to the function definition to deduce signature |
func_name | Name of the remote function to call |
args | Argument(s) for the remote function |
|
protectedpure virtual |
Receives serialized data from a server or module.
|
protectedpure virtual |
Sends serialized data to a server or module.
bytes | Serialized data to be sent |