Branch data Line data Source code
1 : : // Generated by mpgen from /tmp/cirrus-ci-build/bitcoin-core/src/ipc/capnp/init.capnp
2 : :
3 : : #ifndef CAPNP_INIT_CAPNP_PROXY_H
4 : : #define CAPNP_INIT_CAPNP_PROXY_H
5 : :
6 : : #include <capnp/init.capnp.h> // IWYU pragma: keep
7 : : #include "interfaces/echo.h" // IWYU pragma: export
8 : : #include "interfaces/init.h" // IWYU pragma: export
9 : : #include "interfaces/mining.h" // IWYU pragma: export
10 : : #include <mp/proxy.h>
11 : :
12 : : #if defined(__GNUC__)
13 : : #pragma GCC diagnostic push
14 : : #if !defined(__has_warning)
15 : : #pragma GCC diagnostic ignored "-Wsuggest-override"
16 : : #elif __has_warning("-Wsuggest-override")
17 : : #pragma GCC diagnostic ignored "-Wsuggest-override"
18 : : #endif
19 : : #endif
20 : : namespace mp {
21 : : template<>
22 : : struct ProxyMethod<ipc::capnp::messages::Init::MakeEchoParams>
23 : : {
24 : : static constexpr auto impl = &interfaces::Init::makeEcho;
25 : : };
26 : :
27 : : template<>
28 : : struct ProxyMethod<ipc::capnp::messages::Init::MakeMiningOld2Params>
29 : : {
30 : : static constexpr auto impl = &interfaces::Init::makeMiningOld2;
31 : : };
32 : :
33 : : template<>
34 : : struct ProxyMethod<ipc::capnp::messages::Init::MakeMiningParams>
35 : : {
36 : : static constexpr auto impl = &interfaces::Init::makeMining;
37 : : };
38 : :
39 : : template<>
40 : : struct ProxyMethod<ipc::capnp::messages::Init::MakeRpcParams>
41 : : {
42 : : static constexpr auto impl = &interfaces::Init::makeRpc;
43 : : };
44 : :
45 : : namespace init_fields {
46 : : struct ThreadMap
47 : : {
48 : 20 : template<typename S> static auto get(S&& s) -> decltype(s.getThreadMap()) { return s.getThreadMap(); }
49 : : template<typename S> static bool has(S&& s) { return s.hasThreadMap(); }
50 [ + - ]: 40 : template<typename S, typename A> static void set(S&& s, A&& a) { s.setThreadMap(std::forward<A>(a)); }
51 : : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initThreadMap(std::forward<A>(a)...); }
52 : : template<typename S> static bool getWant(S&& s) { return s.getWantThreadMap(); }
53 : : template<typename S> static void setWant(S&& s) { s.setWantThreadMap(true); }
54 : : template<typename S> static bool getHas(S&& s) { return s.getHasThreadMap(); }
55 : : template<typename S> static void setHas(S&& s) { s.setHasThreadMap(true); }
56 : : };
57 : : struct Context
58 : : {
59 [ + - - - : 20 : template<typename S> static auto get(S&& s) -> decltype(s.getContext()) { return s.getContext(); }
+ - ]
60 : : template<typename S> static bool has(S&& s) { return s.hasContext(); }
61 : : template<typename S, typename A> static void set(S&& s, A&& a) { s.setContext(std::forward<A>(a)); }
62 : 10 : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initContext(std::forward<A>(a)...); }
63 : : template<typename S> static bool getWant(S&& s) { return s.getWantContext(); }
64 : : template<typename S> static void setWant(S&& s) { s.setWantContext(true); }
65 : : template<typename S> static bool getHas(S&& s) { return s.getHasContext(); }
66 : : template<typename S> static void setHas(S&& s) { s.setHasContext(true); }
67 : : };
68 : : struct Result
69 : : {
70 : 10 : template<typename S> static auto get(S&& s) -> decltype(s.getResult()) { return s.getResult(); }
71 : 10 : template<typename S> static bool has(S&& s) { return s.hasResult(); }
72 [ + - ]: 20 : template<typename S, typename A> static void set(S&& s, A&& a) { s.setResult(std::forward<A>(a)); }
73 : : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initResult(std::forward<A>(a)...); }
74 : : template<typename S> static bool getWant(S&& s) { return s.getWantResult(); }
75 : : template<typename S> static void setWant(S&& s) { s.setWantResult(true); }
76 : : template<typename S> static bool getHas(S&& s) { return s.getHasResult(); }
77 : : template<typename S> static void setHas(S&& s) { s.setHasResult(true); }
78 : : };
79 : : } // namespace init_fields
80 : :
81 : : template<>
82 : : struct ProxyClient<ipc::capnp::messages::Init> final : public ProxyClientCustom<ipc::capnp::messages::Init, interfaces::Init>
83 : : {
84 : : public:
85 [ + - + - ]: 10 : using ProxyClientCustom::ProxyClientCustom;
86 : : ~ProxyClient();
87 : : using M0 = ProxyClientMethodTraits<ipc::capnp::messages::Init::ConstructParams>;
88 : : static typename M0::Result construct(Super& super);
89 : : using M1 = ProxyClientMethodTraits<ipc::capnp::messages::Init::MakeEchoParams>;
90 : : typename M1::Result makeEcho();
91 : : using M2 = ProxyClientMethodTraits<ipc::capnp::messages::Init::MakeMiningOld2Params>;
92 : : typename M2::Result makeMiningOld2();
93 : : using M3 = ProxyClientMethodTraits<ipc::capnp::messages::Init::MakeMiningParams>;
94 : : typename M3::Result makeMining();
95 : : using M4 = ProxyClientMethodTraits<ipc::capnp::messages::Init::MakeRpcParams>;
96 : : typename M4::Result makeRpc();
97 : : };
98 : :
99 : : template<>
100 : : struct ProxyServer<ipc::capnp::messages::Init> : public ProxyServerCustom<ipc::capnp::messages::Init, interfaces::Init>
101 : : {
102 : : public:
103 : : using ProxyServerCustom::ProxyServerCustom;
104 : : ~ProxyServer();
105 : : kj::Promise<void> construct(ConstructContext call_context) override;
106 : : kj::Promise<void> makeEcho(MakeEchoContext call_context) override;
107 : : kj::Promise<void> makeMiningOld2(MakeMiningOld2Context call_context) override;
108 : : kj::Promise<void> makeMining(MakeMiningContext call_context) override;
109 : : kj::Promise<void> makeRpc(MakeRpcContext call_context) override;
110 : : };
111 : :
112 : : template<>
113 : : struct ProxyType<interfaces::Init>
114 : : {
115 : : using Type = interfaces::Init;
116 : : using Message = ipc::capnp::messages::Init;
117 : : using Client = ProxyClient<Message>;
118 : : using Server = ProxyServer<Message>;
119 : : };
120 : : } // namespace mp
121 : : #if defined(__GNUC__)
122 : : #pragma GCC diagnostic pop
123 : : #endif
124 : : #endif
|