Branch data Line data Source code
1 : : // Generated by mpgen from /tmp/cirrus-ci-build/bitcoin-core/src/ipc/capnp/rpc.capnp
2 : :
3 : : #ifndef CAPNP_RPC_CAPNP_PROXY_H
4 : : #define CAPNP_RPC_CAPNP_PROXY_H
5 : :
6 : : #include <capnp/rpc.capnp.h> // IWYU pragma: keep
7 : : #include "interfaces/rpc.h" // IWYU pragma: export
8 : : #include <mp/proxy.h>
9 : :
10 : : #if defined(__GNUC__)
11 : : #pragma GCC diagnostic push
12 : : #if !defined(__has_warning)
13 : : #pragma GCC diagnostic ignored "-Wsuggest-override"
14 : : #elif __has_warning("-Wsuggest-override")
15 : : #pragma GCC diagnostic ignored "-Wsuggest-override"
16 : : #endif
17 : : #endif
18 : : namespace mp {
19 : : template<>
20 : : struct ProxyMethod<ipc::capnp::messages::Rpc::ExecuteRpcParams>
21 : : {
22 : : static constexpr auto impl = &interfaces::Rpc::executeRpc;
23 : : };
24 : :
25 : : namespace rpc_fields {
26 : : struct Context
27 : : {
28 [ + - ]: 8 : template<typename S> static auto get(S&& s) -> decltype(s.getContext()) { return s.getContext(); }
29 : : template<typename S> static bool has(S&& s) { return s.hasContext(); }
30 : : template<typename S, typename A> static void set(S&& s, A&& a) { s.setContext(std::forward<A>(a)); }
31 : 4 : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initContext(std::forward<A>(a)...); }
32 : : template<typename S> static bool getWant(S&& s) { return s.getWantContext(); }
33 : : template<typename S> static void setWant(S&& s) { s.setWantContext(true); }
34 : : template<typename S> static bool getHas(S&& s) { return s.getHasContext(); }
35 : : template<typename S> static void setHas(S&& s) { s.setHasContext(true); }
36 : : };
37 : : struct Request
38 : : {
39 : 4 : template<typename S> static auto get(S&& s) -> decltype(s.getRequest()) { return s.getRequest(); }
40 : : template<typename S> static bool has(S&& s) { return s.hasRequest(); }
41 : : template<typename S, typename A> static void set(S&& s, A&& a) { s.setRequest(std::forward<A>(a)); }
42 [ + - ]: 4 : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initRequest(std::forward<A>(a)...); }
43 : : template<typename S> static bool getWant(S&& s) { return s.getWantRequest(); }
44 : : template<typename S> static void setWant(S&& s) { s.setWantRequest(true); }
45 : : template<typename S> static bool getHas(S&& s) { return s.getHasRequest(); }
46 : : template<typename S> static void setHas(S&& s) { s.setHasRequest(true); }
47 : : };
48 : : struct Uri
49 : : {
50 : 4 : template<typename S> static auto get(S&& s) -> decltype(s.getUri()) { return s.getUri(); }
51 : : template<typename S> static bool has(S&& s) { return s.hasUri(); }
52 : : template<typename S, typename A> static void set(S&& s, A&& a) { s.setUri(std::forward<A>(a)); }
53 : 4 : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initUri(std::forward<A>(a)...); }
54 : : template<typename S> static bool getWant(S&& s) { return s.getWantUri(); }
55 : : template<typename S> static void setWant(S&& s) { s.setWantUri(true); }
56 : : template<typename S> static bool getHas(S&& s) { return s.getHasUri(); }
57 : : template<typename S> static void setHas(S&& s) { s.setHasUri(true); }
58 : : };
59 : : struct User
60 : : {
61 : 4 : template<typename S> static auto get(S&& s) -> decltype(s.getUser()) { return s.getUser(); }
62 : : template<typename S> static bool has(S&& s) { return s.hasUser(); }
63 : : template<typename S, typename A> static void set(S&& s, A&& a) { s.setUser(std::forward<A>(a)); }
64 : 4 : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initUser(std::forward<A>(a)...); }
65 : : template<typename S> static bool getWant(S&& s) { return s.getWantUser(); }
66 : : template<typename S> static void setWant(S&& s) { s.setWantUser(true); }
67 : : template<typename S> static bool getHas(S&& s) { return s.getHasUser(); }
68 : : template<typename S> static void setHas(S&& s) { s.setHasUser(true); }
69 : : };
70 : : struct Result
71 : : {
72 : 4 : template<typename S> static auto get(S&& s) -> decltype(s.getResult()) { return s.getResult(); }
73 : : template<typename S> static bool has(S&& s) { return s.hasResult(); }
74 : : template<typename S, typename A> static void set(S&& s, A&& a) { s.setResult(std::forward<A>(a)); }
75 [ + - ]: 4 : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initResult(std::forward<A>(a)...); }
76 : : template<typename S> static bool getWant(S&& s) { return s.getWantResult(); }
77 : : template<typename S> static void setWant(S&& s) { s.setWantResult(true); }
78 : : template<typename S> static bool getHas(S&& s) { return s.getHasResult(); }
79 : : template<typename S> static void setHas(S&& s) { s.setHasResult(true); }
80 : : };
81 : : } // namespace rpc_fields
82 : :
83 : : template<>
84 : : struct ProxyClient<ipc::capnp::messages::Rpc> final : public ProxyClientCustom<ipc::capnp::messages::Rpc, interfaces::Rpc>
85 : : {
86 : : public:
87 [ + - + - ]: 4 : using ProxyClientCustom::ProxyClientCustom;
88 : : ~ProxyClient();
89 : : using M0 = ProxyClientMethodTraits<ipc::capnp::messages::Rpc::ExecuteRpcParams>;
90 : : typename M0::Result executeRpc(M0::Param<0> request,M0::Param<1> uri,M0::Param<2> user);
91 : : };
92 : :
93 : : template<>
94 : : struct ProxyServer<ipc::capnp::messages::Rpc> : public ProxyServerCustom<ipc::capnp::messages::Rpc, interfaces::Rpc>
95 : : {
96 : : public:
97 : : using ProxyServerCustom::ProxyServerCustom;
98 : : ~ProxyServer();
99 : : kj::Promise<void> executeRpc(ExecuteRpcContext call_context) override;
100 : : };
101 : :
102 : : template<>
103 : : struct ProxyType<interfaces::Rpc>
104 : : {
105 : : using Type = interfaces::Rpc;
106 : : using Message = ipc::capnp::messages::Rpc;
107 : : using Client = ProxyClient<Message>;
108 : : using Server = ProxyServer<Message>;
109 : : };
110 : : } // namespace mp
111 : : #if defined(__GNUC__)
112 : : #pragma GCC diagnostic pop
113 : : #endif
114 : : #endif
|