Bitcoin Core 31.99.0
P2P Digital Currency
type-threadmap.h
Go to the documentation of this file.
1// Copyright (c) The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef MP_PROXY_TYPE_THREADMAP_H
6#define MP_PROXY_TYPE_THREADMAP_H
7
8#include <mp/util.h>
9
10namespace mp {
11template <>
12struct ProxyServer<ThreadMap> final : public virtual ThreadMap::Server
13{
14public:
15 ProxyServer(Connection& connection);
16 kj::Promise<void> makeThread(MakeThreadContext context) override;
17 kj::Promise<void> makePool(MakePoolContext context) override;
19};
20
21template <typename Output>
24 InvokeContext& invoke_context,
25 Output&& output,
26 typename std::enable_if<std::is_same<decltype(output.get()), ThreadMap::Client>::value>::type* enable = nullptr)
27{
28 output.set(kj::heap<ProxyServer<ThreadMap>>(invoke_context.connection));
29}
30
31template <typename Input>
34 InvokeContext& invoke_context,
35 Input&& input,
36 typename std::enable_if<std::is_same<decltype(input.get()), ThreadMap::Client>::value>::type* enable = nullptr)
37{
38 invoke_context.connection.m_thread_map = input.get();
39}
40} // namespace mp
41
42#endif // MP_PROXY_TYPE_THREADMAP_H
Object holding network & rpc state associated with either an incoming server connection,...
Definition: proxy-io.h:436
ThreadMap::Client m_thread_map
Definition: proxy-io.h:487
Functions to serialize / deserialize common bitcoin types.
Definition: common-types.h:57
decltype(auto) CustomReadField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
Overload multiprocess library's CustomReadField hook to allow any object with an Unserialize method t...
Definition: common-types.h:83
void CustomBuildField(TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
Overload multiprocess library's CustomBuildField hook to allow any serializable object to be stored i...
Definition: common-types.h:63
Connection & connection
Definition: proxy-io.h:34
Function parameter type for prioritizing overloaded function calls that would otherwise be ambiguous.
Definition: util.h:115
Mapping from capnp interface type to proxy server implementation (specializations are generated by pr...
Definition: proxy.h:28
Generic utility functions used by capnp code.
Definition: util.h:39