#pragma once #include #include #include "remote_loopback_base.hpp" #include "transfer_loopback.hpp" namespace saw { template class remote_data { private: id id_; public: remote_data(const id& id): id_{id} {} /** * Wait until data arrives */ error_or> wait(wait_scope& wait); /** * Asynchronously wait for a result */ conveyor> on_receive(); }; /** * Client RPC reference structure */ template class rpc_client { /** * request the data from the remote */ template remote_data request_data(id data); /** @todo * Determine type based on Name */ /* template error_or< id< typename schema_member_type::type > > call(data_or_id inp); */ }; template class rpc_server { public: using InterfaceT = interface; using TypeGroup = typename schema_iface_type_group::Type; using DataServers = typename impl::tmpl_group_to_data_server_ptr_std_tuple::type; private: ptr> remote_; ptr> addr_; InterfaceT iface_; DataServers dat_srvs_; public: rpc_server(ptr> remote__, remote_address& addr__, InterfaceT iface__, DataServers dat_srvs__): remote_{remote__}, addr_{addr__}, iface_{std::move(iface__)}, dat_srvs_{dat_srvs__} {} template error_or< id< typename schema_member_type::type::Response > > call(id::type::Request> id_param){ return make_error(); } }; }