summaryrefslogtreecommitdiff
path: root/c++/io_codec/rpc.h
blob: 34d60995bb8240d29bdd024a625308fa558302f6 (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
#pragma once

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