diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-04-15 15:24:40 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-04-15 15:24:40 +0200 |
commit | 24d83f549a6fba7b23a0c048e1512d00ed704e0d (patch) | |
tree | 1c38294285e1fb60b5023f25f02f7c3bbd990a40 /modules/codec/c++/rpc.hpp | |
parent | c0d6895eac25040f1fa2ee766fc0f2c55c492634 (diff) |
codec, io_codec: Fixed some type issues with functions and moved rpc to
io_codec due to dependency issues
Diffstat (limited to 'modules/codec/c++/rpc.hpp')
-rw-r--r-- | modules/codec/c++/rpc.hpp | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/modules/codec/c++/rpc.hpp b/modules/codec/c++/rpc.hpp deleted file mode 100644 index 5a24034..0000000 --- a/modules/codec/c++/rpc.hpp +++ /dev/null @@ -1,102 +0,0 @@ -#pragma once - -#include <forstio/id.hpp> -#include <forstio/codec/data.hpp> -#include <forstio/io/io.hpp> - -namespace saw { - -/** - * Representing data on the remote - */ -template<typename T, typename Remote> -class remote_data { -private: - id<T> id_; -public: - remote_data(const id<T>& id): - id_{id} - {} - - /** - * Wait until data arrives - */ - error_or<data<T>> wait(wait_scope& wait); - - /** - * Asynchronously wait for a result - */ - conveyor<data<T>> on_receive(); -}; - -/** - * Client RPC reference structure - */ -template<typename T, typename Iface> -class rpc_client { - /** - * request the data from the remote - */ - template<typename IdT> - remote_data<IdT> request_data(id<IdT> data); - - /** - * Determine type based on Name - */ - template<string_literal Name> - error_or< - id< - typename schema_member_type<Name, Iface>::type - > - > call(data_or_id<Input> inp); -}; - -/** - * Implementation of a remote server on the backend - */ -template<typename T, typename Iface> -class rpc_server { -private: - interface<Iface> iface_; -public: - rpc_server(interface<Iface> iface): - iface_{std::move(iface)} - {} -}; - -/** - * Representation of a remote. - * Partially similar to a network address - */ -template<typename T> -class remote_address { - static_assert(always_false<T>, "Type of remote not supported"); - - -}; - -/** - * Reference Backend structure - */ -template<typename T> -class remote { - static_assert(always_false<T>, "Type of backend not supported"); - - /** - * Resolves an address for the remote - */ - conveyor<remote_address<T>> resolve_address(); - - /** - * Connect to a remote - */ - template<typename Iface> - conveyor<rpc_client<T,Iface>> connect(const remote_address<T>& addr); - - /** - * Start listening - */ - template<typename Iface> - rpc_server<T,Iface> listen(); -}; -} |