@@ -141,51 +141,6 @@ struct ReadDestUpdate
141
141
Value& m_value;
142
142
};
143
143
144
- template <typename Interface, typename Impl>
145
- std::unique_ptr<Impl> MakeProxyClient (InvokeContext& context, typename Interface::Client&& client)
146
- {
147
- return std::make_unique<ProxyClient<Interface>>(
148
- std::move (client), &context.connection , /* destroy_connection= */ false );
149
- }
150
-
151
- template <typename Interface, typename Impl>
152
- std::unique_ptr<Impl> CustomMakeProxyClient (InvokeContext& context, typename Interface::Client&& client)
153
- {
154
- return MakeProxyClient<Interface, Impl>(context, kj::mv (client));
155
- }
156
-
157
- template <typename LocalType, typename Input, typename ReadDest>
158
- decltype (auto ) CustomReadField(TypeList<std::unique_ptr<LocalType>>,
159
- Priority<1 >,
160
- InvokeContext& invoke_context,
161
- Input&& input,
162
- ReadDest&& read_dest,
163
- typename Decay<decltype(input.get())>::Calls* enable = nullptr )
164
- {
165
- using Interface = typename Decay<decltype (input.get ())>::Calls;
166
- if (input.has ()) {
167
- return read_dest.construct (
168
- CustomMakeProxyClient<Interface, LocalType>(invoke_context, std::move (input.get ())));
169
- }
170
- return read_dest.construct ();
171
- }
172
-
173
- template <typename LocalType, typename Input, typename ReadDest>
174
- decltype (auto ) CustomReadField(TypeList<std::shared_ptr<LocalType>>,
175
- Priority<1 >,
176
- InvokeContext& invoke_context,
177
- Input&& input,
178
- ReadDest&& read_dest,
179
- typename Decay<decltype(input.get())>::Calls* enable = nullptr )
180
- {
181
- using Interface = typename Decay<decltype (input.get ())>::Calls;
182
- if (input.has ()) {
183
- return read_dest.construct (
184
- CustomMakeProxyClient<Interface, LocalType>(invoke_context, std::move (input.get ())));
185
- }
186
- return read_dest.construct ();
187
- }
188
-
189
144
// ProxyCallFn class is needed because c++11 doesn't support auto lambda parameters.
190
145
// It's equivalent c++14: [invoke_context](auto&& params) {
191
146
// invoke_context->call(std::forward<decltype(params)>(params)...)
@@ -345,62 +300,6 @@ void CustomBuildField(TypeList<std::function<FnR(FnParams...)>>,
345
300
std::make_shared<Callback>(std::forward<Value>(value)), invoke_context.connection ));
346
301
}
347
302
}
348
-
349
- template <typename Interface, typename Impl>
350
- kj::Own<typename Interface::Server> MakeProxyServer (InvokeContext& context, std::shared_ptr<Impl> impl)
351
- {
352
- return kj::heap<ProxyServer<Interface>>(std::move (impl), context.connection );
353
- }
354
-
355
- template <typename Interface, typename Impl>
356
- kj::Own<typename Interface::Server> CustomMakeProxyServer (InvokeContext& context, std::shared_ptr<Impl>&& impl)
357
- {
358
- return MakeProxyServer<Interface, Impl>(context, std::move (impl));
359
- }
360
-
361
- template <typename Impl, typename Value, typename Output>
362
- void CustomBuildField (TypeList<std::unique_ptr<Impl>>,
363
- Priority<1 >,
364
- InvokeContext& invoke_context,
365
- Value&& value,
366
- Output&& output,
367
- typename Decay<decltype(output.get())>::Calls* enable = nullptr)
368
- {
369
- if (value) {
370
- using Interface = typename decltype (output.get ())::Calls;
371
- output.set (CustomMakeProxyServer<Interface, Impl>(invoke_context, std::shared_ptr<Impl>(value.release ())));
372
- }
373
- }
374
-
375
- template <typename Impl, typename Value, typename Output>
376
- void CustomBuildField (TypeList<std::shared_ptr<Impl>>,
377
- Priority<2 >,
378
- InvokeContext& invoke_context,
379
- Value&& value,
380
- Output&& output,
381
- typename Decay<decltype(output.get())>::Calls* enable = nullptr)
382
- {
383
- if (value) {
384
- using Interface = typename decltype (output.get ())::Calls;
385
- output.set (CustomMakeProxyServer<Interface, Impl>(invoke_context, std::move (value)));
386
- }
387
- }
388
-
389
- template <typename Impl, typename Output>
390
- void CustomBuildField (TypeList<Impl&>,
391
- Priority<1 >,
392
- InvokeContext& invoke_context,
393
- Impl& value,
394
- Output&& output,
395
- typename decltype (output.get())::Calls* enable = nullptr)
396
- {
397
- // Disable deleter so proxy server object doesn't attempt to delete the
398
- // wrapped implementation when the proxy client is destroyed or
399
- // disconnected.
400
- using Interface = typename decltype (output.get ())::Calls;
401
- output.set (CustomMakeProxyServer<Interface, Impl>(invoke_context, std::shared_ptr<Impl>(&value, [](Impl*){})));
402
- }
403
-
404
303
// Adapter to let BuildField overloads methods work set & init list elements as
405
304
// if they were fields of a struct. If BuildField is changed to use some kind of
406
305
// accessor class instead of calling method pointers, then then maybe this could
0 commit comments