summaryrefslogtreecommitdiff
path: root/modules/io_codec/rpc.hpp
blob: eec149f0c2fae620e3914ae5a26e77f4bca8b5fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include <forstio/codec/rpc.hpp>

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);
};
}