From 98cf3372f2ed4e61ccb0acc522549aaa3d18fd59 Mon Sep 17 00:00:00 2001 From: Claudius 'keldu' Holeksa Date: Tue, 22 Oct 2024 14:24:32 +0200 Subject: Fixing interface deduction type --- modules/remote/c++/remote.hpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'modules/remote/c++/remote.hpp') diff --git a/modules/remote/c++/remote.hpp b/modules/remote/c++/remote.hpp index 0f508f5..7e846d3 100644 --- a/modules/remote/c++/remote.hpp +++ b/modules/remote/c++/remote.hpp @@ -84,13 +84,32 @@ class rpc_client; namespace impl { template -struct tmpl_group_to_std_data_server_tuple; +struct tmpl_group_to_data_server_ptr_std_tuple; template -struct tmpl_group_to_std_data_server_ptr_tuple, Encoding, Remote> { +struct tmpl_group_to_data_server_ptr_std_tuple, Encoding, Remote> { using type = std::tuple>...>; }; } +template +class i_rpc_server { +protected: + virtual ~i_rpc_server() = default; +public: + virtual std::pair get_class_id() const = 0; + + template + error_or> cast_to(){ + { + auto rhs = get_class_id(); + if(To::class_id.first == rhs.first && To::class_id.second == rhs.second){ + return {ptr{*static_cast(this)}}; + } + } + + return make_error("Class IDs are not matching."); + } +}; /** * Implementation of a remote server on the backend -- cgit v1.2.3