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" 20 struct ProxyMethod<
gen::FooInterface::AddParams>
26 struct ProxyMethod<
gen::FooInterface::PassOutPointParams>
32 struct ProxyMethod<
gen::FooInterface::PassUniValueParams>
37 namespace 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); }
85 struct 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);
99 struct 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;
118 #if defined(__GNUC__) 119 #pragma GCC diagnostic pop ProxyClientMethodTraits< gen::FooInterface::PassOutPointParams > M1
static void setHas(S &&s)
static void setHas(S &&s)
static bool getWant(S &&s)
static void setHas(S &&s)
#define S(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
static void setWant(S &&s)
COutPoint passOutPoint(COutPoint o)
Functions to serialize / deserialize common bitcoin types.
static bool getWant(S &&s)
static bool getHas(S &&s)
ProxyClientMethodTraits< gen::FooInterface::AddParams > M0
UniValue passUniValue(UniValue v)
static void setWant(S &&s)
static bool getHas(S &&s)
static bool getHas(S &&s)
ProxyClient< Message > Client
static bool getHas(S &&s)
static bool getWant(S &&s)
static void setWant(S &&s)
ProxyServer< Message > Server
ProxyClientMethodTraits< gen::FooInterface::PassUniValueParams > M2
static bool getWant(S &&s)
static void setHas(S &&s)
static void setWant(S &&s)