Bitcoin Core 28.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
echo.capnp.proxy.h
Go to the documentation of this file.
1// Generated by mpgen from ipc/capnp/echo.capnp
2
3#ifndef IPC_CAPNP_ECHO_CAPNP_PROXY_H
4#define IPC_CAPNP_ECHO_CAPNP_PROXY_H
5
7#include <interfaces/echo.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
19namespace mp {
20template<>
21struct ProxyMethod<ipc::capnp::messages::Echo::EchoParams>
22{
23 static constexpr auto impl = &interfaces::Echo::echo;
24};
25
26namespace echo_fields {
27struct Context
28{
29 template<typename S> static auto get(S&& s) -> decltype(s.getContext()) { return s.getContext(); }
30 template<typename S> static bool has(S&& s) { return s.hasContext(); }
31 template<typename S, typename A> static void set(S&& s, A&& a) { s.setContext(std::forward<A>(a)); }
32 template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initContext(std::forward<A>(a)...); }
33 template<typename S> static bool getWant(S&& s) { return s.getWantContext(); }
34 template<typename S> static void setWant(S&& s) { s.setWantContext(true); }
35 template<typename S> static bool getHas(S&& s) { return s.getHasContext(); }
36 template<typename S> static void setHas(S&& s) { s.setHasContext(true); }
37};
38struct Echo
39{
40 template<typename S> static auto get(S&& s) -> decltype(s.getEcho()) { return s.getEcho(); }
41 template<typename S> static bool has(S&& s) { return s.hasEcho(); }
42 template<typename S, typename A> static void set(S&& s, A&& a) { s.setEcho(std::forward<A>(a)); }
43 template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initEcho(std::forward<A>(a)...); }
44 template<typename S> static bool getWant(S&& s) { return s.getWantEcho(); }
45 template<typename S> static void setWant(S&& s) { s.setWantEcho(true); }
46 template<typename S> static bool getHas(S&& s) { return s.getHasEcho(); }
47 template<typename S> static void setHas(S&& s) { s.setHasEcho(true); }
48};
49struct 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 echo_fields
61
62template<>
63struct ProxyClient<ipc::capnp::messages::Echo> final : public ProxyClientCustom<ipc::capnp::messages::Echo, interfaces::Echo>
64{
65public:
66 using ProxyClientCustom::ProxyClientCustom;
67 ~ProxyClient();
68 using M0 = ProxyClientMethodTraits<ipc::capnp::messages::Echo::DestroyParams>;
69 typename M0::Result destroy();
70 using M1 = ProxyClientMethodTraits<ipc::capnp::messages::Echo::EchoParams>;
71 typename M1::Result echo(M1::Param<0> echo);
72};
73
74template<>
75struct ProxyServer<ipc::capnp::messages::Echo> : public ProxyServerCustom<ipc::capnp::messages::Echo, interfaces::Echo>
76{
77public:
78 using ProxyServerCustom::ProxyServerCustom;
79 ~ProxyServer();
80 kj::Promise<void> destroy(DestroyContext call_context) override;
81 kj::Promise<void> echo(EchoContext call_context) override;
82};
83
84template<>
85struct ProxyType<interfaces::Echo>
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
Simple string echoing interface for testing.
Definition echo.h:14
virtual std::string echo(const std::string &echo)=0
Echo provided string.
Definition ipc.h:12
Functions to serialize / deserialize common bitcoin types.
static RPCHelpMan echo()
Definition node.cpp:304
#define S(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
ProxyClientMethodTraits< ipc::capnp::messages::Echo::EchoParams > M1
ProxyClientMethodTraits< ipc::capnp::messages::Echo::DestroyParams > M0
static void setHas(S &&s)
static void set(S &&s, A &&a)
static bool getHas(S &&s)
static decltype(auto) init(S &&s, A &&... a)
static bool getWant(S &&s)
static auto get(S &&s) -> decltype(s.getContext())
static void setWant(S &&s)
static bool getHas(S &&s)
static decltype(auto) init(S &&s, A &&... a)
static void setWant(S &&s)
static void setHas(S &&s)
static bool getWant(S &&s)
static bool has(S &&s)
static void set(S &&s, A &&a)
static auto get(S &&s) -> decltype(s.getEcho())
static bool has(S &&s)
static decltype(auto) init(S &&s, A &&... a)
static bool getHas(S &&s)
static void setWant(S &&s)
static bool getWant(S &&s)
static void set(S &&s, A &&a)
static void setHas(S &&s)
static auto get(S &&s) -> decltype(s.getResult())