summaryrefslogtreecommitdiff
path: root/docs/data/remote/rpc_server.loopback.json
blob: 3f43ab2041350c08a6a7ff6b462458b8df331589 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
{
	"format": 1,
	"id": "saw-rpc_server-loopback",
	"kind": "class",
	"name": "rpc_server",
	"namespace": "saw",
	"module": "remote",
	"header": "modules/remote/c++/remote_loopback.hpp",
	"is_special": true,
	"specializes": "saw-rpc_server",
	"arguments": ["Iface", "Encode", "rmt::Loopback"],
	"brief_description": "Answers calls inline against the data servers of its address.",
	"detailed_description": [
		[
			"Translates a call on an id into a call on the local interface: it looks the parameter up in the data server of the request schema, calls the function, and stores the answer in the data server of the response schema."
		],
		[
			"The data itself never passes through the rpc layer. Registering with its",
			{"name": "remote", "id": "saw-remote-loopback"},
			"on construction is what makes rpc_connect able to find it."
		]
	],
	"templates": [
		{"name": "Iface", "kind": "type"},
		{"name": "Encode", "kind": "type"}
	],
	"aliases": {
		"saw-rpc_server-loopback-InterfaceT": {
			"id": "saw-rpc_server-loopback-InterfaceT",
			"name": "InterfaceT",
			"type": ["interface< Iface, Encode >"],
			"brief_description": "The implementations backing the interface."
		},
		"saw-rpc_server-loopback-TypeGroup": {
			"id": "saw-rpc_server-loopback-TypeGroup",
			"name": "TypeGroup",
			"type": ["typename schema_iface_type_group< Iface >::Type"],
			"brief_description": "Every schema the interface mentions, reduced to unique types."
		},
		"saw-rpc_server-loopback-DataServers": {
			"id": "saw-rpc_server-loopback-DataServers",
			"name": "DataServers",
			"type": ["std::tuple< ptr<", {"name": "data_server", "id": "saw-data_server-loopback"}, "< T, Encode, rmt::Loopback > >... >"],
			"brief_description": "One data server pointer per schema in the type group."
		}
	},
	"attributes": {
		"saw-rpc_server-loopback-class_id": {
			"id": "saw-rpc_server-loopback-class_id",
			"name": "class_id",
			"type": ["std::pair< uint32_t, uint32_t >"],
			"visibility": "public",
			"static": true,
			"constexpr": true,
			"initializer": "{schema_hash<Iface>::apply(), schema_hash<Encode>::apply()}",
			"brief_description": "Identifies which interface this server provides."
		},
		"saw-rpc_server-loopback-iface_": {
			"id": "saw-rpc_server-loopback-iface_",
			"name": "iface_",
			"type": ["InterfaceT"],
			"visibility": "private"
		},
		"saw-rpc_server-loopback-dat_srvs_": {
			"id": "saw-rpc_server-loopback-dat_srvs_",
			"name": "dat_srvs_",
			"type": ["DataServers"],
			"visibility": "private"
		}
	},
	"functions": {
		"saw-rpc_server-loopback-get_class_id": {
			"id": "saw-rpc_server-loopback-get_class_id",
			"name": "get_class_id",
			"type": ["std::pair< uint32_t, uint32_t >"],
			"const": true,
			"override": true,
			"brief_description": "Returns the interface id."
		},
		"saw-rpc_server-loopback-get_data_servers": {
			"id": "saw-rpc_server-loopback-get_data_servers",
			"name": "get_data_servers",
			"type": ["const DataServers &"],
			"const": true,
			"brief_description": "The data servers this rpc server moves its parameters and responses through."
		},
		"saw-rpc_server-loopback-call-1": {
			"id": "saw-rpc_server-loopback-call-1",
			"name": "call",
			"type": ["error_or< id< ResponseT > >"],
			"brief_description": "Calls a function and lets the server decide where the response is stored.",
			"detailed_description": [
				[
					"A client cannot know which ids are free without asking, so this is the variant which costs no roundtrip beforehand."
				],
				[
					"The slot is picked after the function returned, which is the latest and therefore most accurate moment."
				]
			],
			"templates": [
				{
					"name": "Lit",
					"kind": "non_type",
					"type": "string_literal",
					"brief_description": "Name of the interface member to call."
				}
			],
			"parameters": [
				{
					"name": "id_param",
					"type": ["id< typename schema_member_type< Lit, Iface >::type::RequestT >"],
					"brief_description": "Id of a value already sitting in the request data server."
				}
			]
		},
		"saw-rpc_server-loopback-call-2": {
			"id": "saw-rpc_server-loopback-call-2",
			"name": "call",
			"type": ["error_or< void >"],
			"brief_description": "Calls a function and stores the response in a slot allocated beforehand.",
			"detailed_description": [
				[
					"Meant for backends where the output exists before the call, such as a device buffer allocated on the remote."
				]
			],
			"templates": [
				{
					"name": "Lit",
					"kind": "non_type",
					"type": "string_literal",
					"brief_description": "Name of the interface member to call."
				}
			],
			"parameters": [
				{"name": "id_param", "type": ["id< typename schema_member_type< Lit, Iface >::type::RequestT >"]},
				{
					"name": "id_resp",
					"type": ["id< typename schema_member_type< Lit, Iface >::type::ResponseT >"],
					"brief_description": "Slot the answer has to end up in."
				}
			]
		},
		"saw-rpc_server-loopback-call_by_id-1": {
			"id": "saw-rpc_server-loopback-call_by_id-1",
			"name": "call_by_id",
			"type": ["error_or< uint64_t >"],
			"brief_description": "Calls a function which is only known at runtime.",
			"detailed_description": [
				[
					"The entry point for every backend which transports the call itself. The ids are untyped here, since such a backend only knows the function id and a number."
				],
				[
					"The id the response ended up in is meant to travel back in the reply. Fails with not_found if no interface member carries that function id."
				]
			],
			"parameters": [
				{
					"name": "func_id",
					"type": ["uint32_t"],
					"brief_description": "rpc_function_id of the member name."
				},
				{"name": "id_param", "type": ["uint64_t"]}
			]
		},
		"saw-rpc_server-loopback-call_by_id-2": {
			"id": "saw-rpc_server-loopback-call_by_id-2",
			"name": "call_by_id",
			"type": ["error_or< void >"],
			"brief_description": "Runtime call into a slot the caller allocated beforehand.",
			"parameters": [
				{"name": "func_id", "type": ["uint32_t"]},
				{"name": "id_param", "type": ["uint64_t"]},
				{"name": "id_resp", "type": ["uint64_t"]}
			]
		}
	},
	"notes": [
		"Copy and move are forbidden, because the remote holds a pointer to this object while it is registered."
	]
}