3 #ifndef IPC_CAPNP_ECHO_CAPNP_PROXY_H 4 #define IPC_CAPNP_ECHO_CAPNP_PROXY_H 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" 21 struct ProxyMethod<
ipc::capnp::messages::Echo::EchoParams>
26 namespace echo_fields {
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); }
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); }
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); }
63 struct ProxyClient<
ipc::capnp::messages::Echo> final :
public ProxyClientCustom<ipc::capnp::messages::Echo, interfaces::Echo>
66 using ProxyClientCustom::ProxyClientCustom;
68 using M0 = ProxyClientMethodTraits<ipc::capnp::messages::Echo::DestroyParams>;
70 using M1 = ProxyClientMethodTraits<ipc::capnp::messages::Echo::EchoParams>;
75 struct ProxyServer<
ipc::capnp::messages::Echo> :
public ProxyServerCustom<ipc::capnp::messages::Echo, interfaces::Echo>
78 using ProxyServerCustom::ProxyServerCustom;
80 kj::Promise<void> destroy(DestroyContext call_context)
override;
81 kj::Promise<void>
echo(EchoContext call_context)
override;
94 #pragma GCC diagnostic pop
ProxyClientMethodTraits< ipc::capnp::messages::Echo::EchoParams > M1
static void setHas(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)
virtual std::string echo(const std::string &echo)=0
Echo provided string.
ProxyClientMethodTraits< ipc::capnp::messages::Echo::DestroyParams > M0
ProxyClient< Message > Client
static void setWant(S &&s)
static bool getHas(S &&s)
static bool getWant(S &&s)
static bool getWant(S &&s)
static RPCHelpMan echo(const std::string &name)
ProxyServer< Message > Server
static bool getHas(S &&s)
Simple string echoing interface for testing.
static void setHas(S &&s)
static void setWant(S &&s)
static bool getWant(S &&s)
static void setWant(S &&s)
static bool getHas(S &&s)