// Generated by mpgen from /build/bitcoin/src/bitcoin-30.2/src/ipc/capnp/common.capnp

#ifndef CAPNP_COMMON_CAPNP_PROXY_H
#define CAPNP_COMMON_CAPNP_PROXY_H

#include <src/ipc/capnp/common.capnp.h> // IWYU pragma: keep
#include <mp/proxy.h>

#if defined(__GNUC__)
#pragma GCC diagnostic push
#if !defined(__has_warning)
#pragma GCC diagnostic ignored "-Wsuggest-override"
#elif __has_warning("-Wsuggest-override")
#pragma GCC diagnostic ignored "-Wsuggest-override"
#endif
#endif
namespace mp {
namespace common_fields {
struct Hash
{
    template<typename S> static auto get(S&& s) -> decltype(s.getHash()) { return s.getHash(); }
    template<typename S> static bool has(S&& s) { return s.hasHash(); }
    template<typename S, typename A> static void set(S&& s, A&& a) { s.setHash(std::forward<A>(a)); }
    template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initHash(std::forward<A>(a)...); }
    template<typename S> static bool getWant(S&& s) { return s.getWantHash(); }
    template<typename S> static void setWant(S&& s) { s.setWantHash(true); }
    template<typename S> static bool getHas(S&& s) { return s.getHasHash(); }
    template<typename S> static void setHas(S&& s) { s.setHasHash(true); }
};
struct Height
{
    template<typename S> static auto get(S&& s) -> decltype(s.getHeight()) { return s.getHeight(); }
    template<typename S> static bool has(S&& s) { return s.hasHeight(); }
    template<typename S, typename A> static void set(S&& s, A&& a) { s.setHeight(std::forward<A>(a)); }
    template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initHeight(std::forward<A>(a)...); }
    template<typename S> static bool getWant(S&& s) { return s.getWantHeight(); }
    template<typename S> static void setWant(S&& s) { s.setWantHeight(true); }
    template<typename S> static bool getHas(S&& s) { return s.getHasHeight(); }
    template<typename S> static void setHas(S&& s) { s.setHasHeight(true); }
};
} // namespace common_fields
template<>
struct ProxyStruct<ipc::capnp::messages::BlockRef>
{
    using Struct = ipc::capnp::messages::BlockRef;
    using HashAccessor = Accessor<common_fields::Hash, FIELD_IN | FIELD_OUT | FIELD_BOXED>;
    using HeightAccessor = Accessor<common_fields::Height, FIELD_IN | FIELD_OUT>;
    using Accessors = std::tuple<HashAccessor, HeightAccessor>;
    static constexpr size_t fields = 2;
};
} // namespace mp
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#endif
