Bitcoin Core  26.1.0
P2P Digital Currency
init.capnp.proxy.h
Go to the documentation of this file.
1 // Generated by mpgen from ipc/capnp/init.capnp
2 
3 #ifndef IPC_CAPNP_INIT_CAPNP_PROXY_H
4 #define IPC_CAPNP_INIT_CAPNP_PROXY_H
5 
6 #include <ipc/capnp/init.capnp.h>
7 #include <interfaces/echo.h>
8 #include <interfaces/init.h>
9 #include <mp/proxy.h>
10 
11 #if defined(__GNUC__)
12 #pragma GCC diagnostic push
13 #if !defined(__has_warning)
14 #pragma GCC diagnostic ignored "-Wsuggest-override"
15 #elif __has_warning("-Wsuggest-override")
16 #pragma GCC diagnostic ignored "-Wsuggest-override"
17 #endif
18 #endif
19 namespace mp {
20 template<>
21 struct ProxyMethod<ipc::capnp::messages::Init::MakeEchoParams>
22 {
23  static constexpr auto impl = &interfaces::Init::makeEcho;
24 };
25 
26 namespace init_fields {
27 struct ThreadMap
28 {
29  template<typename S> static auto get(S&& s) -> decltype(s.getThreadMap()) { return s.getThreadMap(); }
30  template<typename S> static bool has(S&& s) { return s.hasThreadMap(); }
31  template<typename S, typename A> static void set(S&& s, A&& a) { s.setThreadMap(std::forward<A>(a)); }
32  template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initThreadMap(std::forward<A>(a)...); }
33  template<typename S> static bool getWant(S&& s) { return s.getWantThreadMap(); }
34  template<typename S> static void setWant(S&& s) { s.setWantThreadMap(true); }
35  template<typename S> static bool getHas(S&& s) { return s.getHasThreadMap(); }
36  template<typename S> static void setHas(S&& s) { s.setHasThreadMap(true); }
37 };
38 struct Context
39 {
40  template<typename S> static auto get(S&& s) -> decltype(s.getContext()) { return s.getContext(); }
41  template<typename S> static bool has(S&& s) { return s.hasContext(); }
42  template<typename S, typename A> static void set(S&& s, A&& a) { s.setContext(std::forward<A>(a)); }
43  template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initContext(std::forward<A>(a)...); }
44  template<typename S> static bool getWant(S&& s) { return s.getWantContext(); }
45  template<typename S> static void setWant(S&& s) { s.setWantContext(true); }
46  template<typename S> static bool getHas(S&& s) { return s.getHasContext(); }
47  template<typename S> static void setHas(S&& s) { s.setHasContext(true); }
48 };
49 struct Result
50 {
51  template<typename S> static auto get(S&& s) -> decltype(s.getResult()) { return s.getResult(); }
52  template<typename S> static bool has(S&& s) { return s.hasResult(); }
53  template<typename S, typename A> static void set(S&& s, A&& a) { s.setResult(std::forward<A>(a)); }
54  template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initResult(std::forward<A>(a)...); }
55  template<typename S> static bool getWant(S&& s) { return s.getWantResult(); }
56  template<typename S> static void setWant(S&& s) { s.setWantResult(true); }
57  template<typename S> static bool getHas(S&& s) { return s.getHasResult(); }
58  template<typename S> static void setHas(S&& s) { s.setHasResult(true); }
59 };
60 } // namespace init_fields
61 
62 template<>
63 struct ProxyClient<ipc::capnp::messages::Init> final : public ProxyClientCustom<ipc::capnp::messages::Init, interfaces::Init>
64 {
65 public:
66  using ProxyClientCustom::ProxyClientCustom;
67  ~ProxyClient();
68  using M0 = ProxyClientMethodTraits<ipc::capnp::messages::Init::ConstructParams>;
69  typename M0::Result construct();
70  using M1 = ProxyClientMethodTraits<ipc::capnp::messages::Init::MakeEchoParams>;
71  typename M1::Result makeEcho();
72 };
73 
74 template<>
75 struct ProxyServer<ipc::capnp::messages::Init> : public ProxyServerCustom<ipc::capnp::messages::Init, interfaces::Init>
76 {
77 public:
78  using ProxyServerCustom::ProxyServerCustom;
79  ~ProxyServer();
80  kj::Promise<void> construct(ConstructContext call_context) override;
81  kj::Promise<void> makeEcho(MakeEchoContext call_context) override;
82 };
83 
84 template<>
85 struct ProxyType<interfaces::Init>
86 {
89  using Client = ProxyClient<Message>;
90  using Server = ProxyServer<Message>;
91 };
92 } // namespace mp
93 #if defined(__GNUC__)
94 #pragma GCC diagnostic pop
95 #endif
96 #endif
static bool getHas(S &&s)
static bool getWant(S &&s)
static bool has(S &&s)
static bool getWant(S &&s)
virtual std::unique_ptr< Echo > makeEcho()
Definition: init.h:36
#define S(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
static bool getHas(S &&s)
static bool has(S &&s)
ProxyClientMethodTraits< ipc::capnp::messages::Init::ConstructParams > M0
static void setWant(S &&s)
static void setWant(S &&s)
static void setHas(S &&s)
Definition: ipc.h:12
static bool getHas(S &&s)
ProxyClientMethodTraits< ipc::capnp::messages::Init::MakeEchoParams > M1
static bool getWant(S &&s)
static void setHas(S &&s)
static void setHas(S &&s)
Initial interface created when a process is first started, and used to give and get access to other i...
Definition: init.h:29
static void setWant(S &&s)