3#ifndef TEST_IPC_TEST_CAPNP_PROXY_H
4#define TEST_IPC_TEST_CAPNP_PROXY_H
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"
20struct ProxyMethod<
gen::FooInterface::AddParams>
26struct ProxyMethod<
gen::FooInterface::PassOutPointParams>
32struct ProxyMethod<
gen::FooInterface::PassUniValueParams>
37namespace ipc_test_fields {
40 template<
typename S>
static auto get(
S&& s) ->
decltype(s.getA()) {
return s.getA(); }
41 template<
typename S>
static bool has(
S&& s) {
return s.hasA(); }
42 template<
typename S,
typename A>
static void set(
S&& s,
A&& a) { s.setA(std::forward<A>(a)); }
43 template<
typename S,
typename...
A>
static decltype(
auto)
init(
S&& s,
A&&... a) {
return s.initA(std::forward<A>(a)...); }
44 template<
typename S>
static bool getWant(
S&& s) {
return s.getWantA(); }
45 template<
typename S>
static void setWant(
S&& s) { s.setWantA(
true); }
46 template<
typename S>
static bool getHas(
S&& s) {
return s.getHasA(); }
47 template<
typename S>
static void setHas(
S&& s) { s.setHasA(
true); }
51 template<
typename S>
static auto get(
S&& s) ->
decltype(s.getB()) {
return s.getB(); }
52 template<
typename S>
static bool has(
S&& s) {
return s.hasB(); }
53 template<
typename S,
typename A>
static void set(
S&& s,
A&& a) { s.setB(std::forward<A>(a)); }
54 template<
typename S,
typename...
A>
static decltype(
auto)
init(
S&& s,
A&&... a) {
return s.initB(std::forward<A>(a)...); }
55 template<
typename S>
static bool getWant(
S&& s) {
return s.getWantB(); }
56 template<
typename S>
static void setWant(
S&& s) { s.setWantB(
true); }
57 template<
typename S>
static bool getHas(
S&& s) {
return s.getHasB(); }
58 template<
typename S>
static void setHas(
S&& s) { s.setHasB(
true); }
62 template<
typename S>
static auto get(
S&& s) ->
decltype(s.getResult()) {
return s.getResult(); }
63 template<
typename S>
static bool has(
S&& s) {
return s.hasResult(); }
64 template<
typename S,
typename A>
static void set(
S&& s,
A&& a) { s.setResult(std::forward<A>(a)); }
65 template<
typename S,
typename...
A>
static decltype(
auto)
init(
S&& s,
A&&... a) {
return s.initResult(std::forward<A>(a)...); }
66 template<
typename S>
static bool getWant(
S&& s) {
return s.getWantResult(); }
67 template<
typename S>
static void setWant(
S&& s) { s.setWantResult(
true); }
68 template<
typename S>
static bool getHas(
S&& s) {
return s.getHasResult(); }
69 template<
typename S>
static void setHas(
S&& s) { s.setHasResult(
true); }
73 template<
typename S>
static auto get(
S&& s) ->
decltype(s.getArg()) {
return s.getArg(); }
74 template<
typename S>
static bool has(
S&& s) {
return s.hasArg(); }
75 template<
typename S,
typename A>
static void set(
S&& s,
A&& a) { s.setArg(std::forward<A>(a)); }
76 template<
typename S,
typename...
A>
static decltype(
auto)
init(
S&& s,
A&&... a) {
return s.initArg(std::forward<A>(a)...); }
77 template<
typename S>
static bool getWant(
S&& s) {
return s.getWantArg(); }
78 template<
typename S>
static void setWant(
S&& s) { s.setWantArg(
true); }
79 template<
typename S>
static bool getHas(
S&& s) {
return s.getHasArg(); }
80 template<
typename S>
static void setHas(
S&& s) { s.setHasArg(
true); }
85struct ProxyClient<
gen::FooInterface> final :
public ProxyClientCustom<gen::FooInterface, FooImplementation>
88 using ProxyClientCustom::ProxyClientCustom;
90 using M0 = ProxyClientMethodTraits<gen::FooInterface::AddParams>;
91 typename M0::Result add(M0::Param<0> a,M0::Param<1> b);
92 using M1 = ProxyClientMethodTraits<gen::FooInterface::PassOutPointParams>;
93 typename M1::Result passOutPoint(M1::Param<0> arg);
94 using M2 = ProxyClientMethodTraits<gen::FooInterface::PassUniValueParams>;
95 typename M2::Result passUniValue(M2::Param<0> arg);
99struct ProxyServer<
gen::FooInterface> :
public ProxyServerCustom<gen::FooInterface, FooImplementation>
102 using ProxyServerCustom::ProxyServerCustom;
104 kj::Promise<void> add(AddContext call_context)
override;
105 kj::Promise<void> passOutPoint(PassOutPointContext call_context)
override;
106 kj::Promise<void> passUniValue(PassUniValueContext call_context)
override;
119#pragma GCC diagnostic pop
COutPoint passOutPoint(COutPoint o)
UniValue passUniValue(UniValue v)
Functions to serialize / deserialize common bitcoin types.
#define S(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
ProxyClientMethodTraits< gen::FooInterface::PassUniValueParams > M2
ProxyClientMethodTraits< gen::FooInterface::PassOutPointParams > M1
ProxyClientMethodTraits< gen::FooInterface::AddParams > M0
ProxyClient< Message > Client
ProxyServer< Message > Server
static decltype(auto) init(S &&s, A &&... a)
static bool getWant(S &&s)
static bool getHas(S &&s)
static auto get(S &&s) -> decltype(s.getA())
static void setWant(S &&s)
static void set(S &&s, A &&a)
static void setHas(S &&s)
static bool getHas(S &&s)
static void set(S &&s, A &&a)
static void setWant(S &&s)
static void setHas(S &&s)
static decltype(auto) init(S &&s, A &&... a)
static auto get(S &&s) -> decltype(s.getArg())
static bool getWant(S &&s)
static decltype(auto) init(S &&s, A &&... a)
static bool getHas(S &&s)
static void setHas(S &&s)
static bool getWant(S &&s)
static auto get(S &&s) -> decltype(s.getB())
static void setWant(S &&s)
static void set(S &&s, A &&a)
static void setWant(S &&s)
static void setHas(S &&s)
static bool getWant(S &&s)
static auto get(S &&s) -> decltype(s.getResult())
static void set(S &&s, A &&a)
static decltype(auto) init(S &&s, A &&... a)
static bool getHas(S &&s)