summaryrefslogtreecommitdiff
path: root/modules/remote/c++
diff options
context:
space:
mode:
authorClaudius 'keldu' Holeksa <mail@keldu.de>2024-07-22 17:44:27 +0200
committerClaudius 'keldu' Holeksa <mail@keldu.de>2024-07-22 17:44:27 +0200
commit977ac8bce989285eaabc76c4ed8571ce5fd6793a (patch)
tree08df4e53e4f2ea947662cc6b1d207ed852292474 /modules/remote/c++
parentfdf1b23129d73b27b28756e77da9b02215878721 (diff)
wip
Diffstat (limited to 'modules/remote/c++')
-rw-r--r--modules/remote/c++/remote.hpp2
-rw-r--r--modules/remote/c++/remote_loopback.hpp15
-rw-r--r--modules/remote/c++/transfer.hpp6
-rw-r--r--modules/remote/c++/transfer_loopback.hpp4
4 files changed, 25 insertions, 2 deletions
diff --git a/modules/remote/c++/remote.hpp b/modules/remote/c++/remote.hpp
index fd6f4e6..72c9cce 100644
--- a/modules/remote/c++/remote.hpp
+++ b/modules/remote/c++/remote.hpp
@@ -8,6 +8,8 @@
#include <variant>
+#include "transfer.hpp"
+
namespace saw {
/**
* This class acts as a helper for rpc calls and representing data on the remote.
diff --git a/modules/remote/c++/remote_loopback.hpp b/modules/remote/c++/remote_loopback.hpp
index 76aab69..10ac79c 100644
--- a/modules/remote/c++/remote_loopback.hpp
+++ b/modules/remote/c++/remote_loopback.hpp
@@ -55,6 +55,16 @@ class rpc_client<Iface, Encoding, Storage, rmt::Loopback> {
template<>
class remote_address<rmt::Loopback> {
+private:
+ data<schema::UInt64> addr_id_;
+public:
+ remote_address(data<schema::UInt64> addr_id__):
+ addr_id_{addr_id__}
+ {}
+
+ const data<schema::UInt64>& get_address_id() const {
+ return addr_id_;
+ }
};
template<typename Iface, typename Encode, typename Storage>
@@ -75,12 +85,13 @@ public:
template<>
class remote<rmt::Loopback> {
+private:
public:
/**
* Resolves an address for the remote
*/
- error_or<own<remote_address<rmt::Loopback>>> parse_address(){
- return heap<remote_address<rmt::Loopback>>();
+ error_or<own<remote_address<rmt::Loopback>>> parse_address(data<schema::UInt64> id){
+ return heap<remote_address<rmt::Loopback>>(id);
}
/**
diff --git a/modules/remote/c++/transfer.hpp b/modules/remote/c++/transfer.hpp
index 2fdd0b9..ea61d56 100644
--- a/modules/remote/c++/transfer.hpp
+++ b/modules/remote/c++/transfer.hpp
@@ -1,6 +1,12 @@
#pragma once
namespace saw {
+template<typename Remote>
+class i_data_server {
+protected:
+ virtual ~i_data_server() = default;
+};
+
template<typename Schema, typename Encoding, typename Remote>
class data_server;
diff --git a/modules/remote/c++/transfer_loopback.hpp b/modules/remote/c++/transfer_loopback.hpp
index abea83f..9d026f2 100644
--- a/modules/remote/c++/transfer_loopback.hpp
+++ b/modules/remote/c++/transfer_loopback.hpp
@@ -13,7 +13,11 @@ template<typename... Schema, typename Encoding>
class data_server<tmpl_group<Schema...>, Encoding, rmt::Loopback> {
private:
typename impl::data_server_redux<Encoding, storage::Default, typename tmpl_reduce<tmpl_group<Schema...>>::type>::type values_;
+
+ ptr<remote<rmt::Loopback>> remote_;
public:
+ data_server(remote_address<rmt::Loopback>& addr)
+
/**
* Get data from client
*/