summaryrefslogtreecommitdiff
path: root/modules/remote-io/c++/remote.hpp
blob: fe2804dd4ae9c9d09fe195c452dc9e256e93c9e9 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once

#include <forstio/io/io.hpp>

namespace saw {
/**
 */
namespace rmt {
struct IoTcp {};
}

template<>
class remote_address<rmt::IoTcp> final {
private:

public:
	remote_address() = default;
};

/**
 * A device representing a remote server. Technically it's
 * a logical distinction and not a physical.
 */
template<>
class remote<rmt::IoTcp> final {
private:
	ref<network> net_;
public:
	remote(network& net__):
		net_{net__}
	{}

	conveyor<own<remote_address<rmt::IoTcp>>> resolve_address(){
		return heap<remote_address<rmt::IoTcp>>();
	}

	error_or<own<remote_address<rmt::IoTcp>>> parse_address(){
		return heap<remote_address<rmt::IoTcp>>();
	}

	template<typename Schema, typename Encoding>
	error_or<own<data_server<Schema, Encoding, rmt::IoTcp>>> data_listen(const remote_address<rmt::IoTcp>& addr){
		return make_error<err::not_implemented>();
	}

	template<typename Schema, typename Encoding>
	conveyor<own<data_client<Schema, Encoding, rmt::IoTcp>>> data_connect(const remote_address<rmt::IoTcp>& addr){
		return make_error<err::not_implemented>();
	}
};
}