summaryrefslogtreecommitdiff
path: root/modules/io_codec/rpc.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/io_codec/rpc.hpp')
-rw-r--r--modules/io_codec/rpc.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/io_codec/rpc.hpp b/modules/io_codec/rpc.hpp
new file mode 100644
index 0000000..020bf96
--- /dev/null
+++ b/modules/io_codec/rpc.hpp
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <forstio/codec/rpc.h>
+
+namespace saw {
+namespace rmt {
+struct Network {};
+}
+
+template<>
+class remote<rmt::Network> {
+private:
+ std::string addr_str_;
+public:
+ remote(std::string addr_str);
+
+ template<typename Interface>
+ conveyor<rpc_client<rmt::Network, Interface>> create_client();
+};
+
+template<template Interface>
+class rpc_client<rmt::Network, Interface> {
+private:
+ own<io_stream> stream_;
+public:
+ rpc_client(own<io_stream> stream);
+
+ template<typename T>
+ remote_result<typename response<T>::type> call(typename request<T>::type req);
+};
+}