Branch data Line data Source code
1 : : // Generated by mpgen from /tmp/cirrus-ci-build/bitcoin-core/src/ipc/capnp/common.capnp
2 : :
3 : : #ifndef CAPNP_COMMON_CAPNP_PROXY_H
4 : : #define CAPNP_COMMON_CAPNP_PROXY_H
5 : :
6 : : #include <src/ipc/capnp/common.capnp.h> // IWYU pragma: keep
7 : : #include <mp/proxy.h>
8 : :
9 : : #if defined(__GNUC__)
10 : : #pragma GCC diagnostic push
11 : : #if !defined(__has_warning)
12 : : #pragma GCC diagnostic ignored "-Wsuggest-override"
13 : : #elif __has_warning("-Wsuggest-override")
14 : : #pragma GCC diagnostic ignored "-Wsuggest-override"
15 : : #endif
16 : : #endif
17 : : namespace mp {
18 : : namespace common_fields {
19 : : struct Hash
20 : : {
21 : 0 : template<typename S> static auto get(S&& s) -> decltype(s.getHash()) { return s.getHash(); }
22 : 0 : template<typename S> static bool has(S&& s) { return s.hasHash(); }
23 : : template<typename S, typename A> static void set(S&& s, A&& a) { s.setHash(std::forward<A>(a)); }
24 [ # # ]: 0 : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initHash(std::forward<A>(a)...); }
25 : : template<typename S> static bool getWant(S&& s) { return s.getWantHash(); }
26 : : template<typename S> static void setWant(S&& s) { s.setWantHash(true); }
27 : : template<typename S> static bool getHas(S&& s) { return s.getHasHash(); }
28 : : template<typename S> static void setHas(S&& s) { s.setHasHash(true); }
29 : : };
30 : : struct Height
31 : : {
32 [ # # ]: 0 : template<typename S> static auto get(S&& s) -> decltype(s.getHeight()) { return s.getHeight(); }
33 : : template<typename S> static bool has(S&& s) { return s.hasHeight(); }
34 : 0 : template<typename S, typename A> static void set(S&& s, A&& a) { s.setHeight(std::forward<A>(a)); }
35 : : template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initHeight(std::forward<A>(a)...); }
36 : : template<typename S> static bool getWant(S&& s) { return s.getWantHeight(); }
37 : : template<typename S> static void setWant(S&& s) { s.setWantHeight(true); }
38 : : template<typename S> static bool getHas(S&& s) { return s.getHasHeight(); }
39 : : template<typename S> static void setHas(S&& s) { s.setHasHeight(true); }
40 : : };
41 : : } // namespace common_fields
42 : : template<>
43 : : struct ProxyStruct<ipc::capnp::messages::BlockRef>
44 : : {
45 : : using Struct = ipc::capnp::messages::BlockRef;
46 : : using HashAccessor = Accessor<common_fields::Hash, FIELD_IN | FIELD_OUT | FIELD_BOXED>;
47 : : using HeightAccessor = Accessor<common_fields::Height, FIELD_IN | FIELD_OUT>;
48 : : using Accessors = std::tuple<HashAccessor, HeightAccessor>;
49 : : static constexpr size_t fields = 2;
50 : : };
51 : : } // namespace mp
52 : : #if defined(__GNUC__)
53 : : #pragma GCC diagnostic pop
54 : : #endif
55 : : #endif
|