LCOV - code coverage report
Current view: top level - bld-cov/src/ipc/capnp - init.capnp.proxy.h (source / functions) Coverage Total Hit
Test: total_coverage.info Lines: 100.0 % 8 8
Test Date: 2025-08-25 05:11:47 Functions: 75.0 % 4 3
Branches: 50.0 % 8 4

             Branch data     Line data    Source code
       1                 :             : // Generated by mpgen from /tmp/cirrus-ci-build/bitcoin-core/src/ipc/capnp/init.capnp
       2                 :             : 
       3                 :             : #ifndef CAPNP_INIT_CAPNP_PROXY_H
       4                 :             : #define CAPNP_INIT_CAPNP_PROXY_H
       5                 :             : 
       6                 :             : #include <src/ipc/capnp/init.capnp.h> // IWYU pragma: keep
       7                 :             : #include "interfaces/echo.h" // IWYU pragma: export
       8                 :             : #include "interfaces/init.h" // IWYU pragma: export
       9                 :             : #include "interfaces/mining.h" // IWYU pragma: export
      10                 :             : #include <mp/proxy.h>
      11                 :             : 
      12                 :             : #if defined(__GNUC__)
      13                 :             : #pragma GCC diagnostic push
      14                 :             : #if !defined(__has_warning)
      15                 :             : #pragma GCC diagnostic ignored "-Wsuggest-override"
      16                 :             : #elif __has_warning("-Wsuggest-override")
      17                 :             : #pragma GCC diagnostic ignored "-Wsuggest-override"
      18                 :             : #endif
      19                 :             : #endif
      20                 :             : namespace mp {
      21                 :             : template<>
      22                 :             : struct ProxyMethod<ipc::capnp::messages::Init::MakeEchoParams>
      23                 :             : {
      24                 :             :     static constexpr auto impl = &interfaces::Init::makeEcho;
      25                 :             : };
      26                 :             : 
      27                 :             : template<>
      28                 :             : struct ProxyMethod<ipc::capnp::messages::Init::MakeMiningParams>
      29                 :             : {
      30                 :             :     static constexpr auto impl = &interfaces::Init::makeMining;
      31                 :             : };
      32                 :             : 
      33                 :             : namespace init_fields {
      34                 :             : struct ThreadMap
      35                 :             : {
      36                 :          12 :     template<typename S> static auto get(S&& s) -> decltype(s.getThreadMap()) { return s.getThreadMap(); }
      37                 :             :     template<typename S> static bool has(S&& s) { return s.hasThreadMap(); }
      38         [ +  - ]:          24 :     template<typename S, typename A> static void set(S&& s, A&& a) { s.setThreadMap(std::forward<A>(a)); }
      39                 :             :     template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initThreadMap(std::forward<A>(a)...); }
      40                 :             :     template<typename S> static bool getWant(S&& s) { return s.getWantThreadMap(); }
      41                 :             :     template<typename S> static void setWant(S&& s) { s.setWantThreadMap(true); }
      42                 :             :     template<typename S> static bool getHas(S&& s) { return s.getHasThreadMap(); }
      43                 :             :     template<typename S> static void setHas(S&& s) { s.setHasThreadMap(true); }
      44                 :             : };
      45                 :             : struct Context
      46                 :             : {
      47                 :          12 :     template<typename S> static auto get(S&& s) -> decltype(s.getContext()) { return s.getContext(); }
      48                 :             :     template<typename S> static bool has(S&& s) { return s.hasContext(); }
      49                 :             :     template<typename S, typename A> static void set(S&& s, A&& a) { s.setContext(std::forward<A>(a)); }
      50                 :           6 :     template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initContext(std::forward<A>(a)...); }
      51                 :             :     template<typename S> static bool getWant(S&& s) { return s.getWantContext(); }
      52                 :             :     template<typename S> static void setWant(S&& s) { s.setWantContext(true); }
      53                 :             :     template<typename S> static bool getHas(S&& s) { return s.getHasContext(); }
      54                 :             :     template<typename S> static void setHas(S&& s) { s.setHasContext(true); }
      55                 :             : };
      56                 :             : struct Result
      57                 :             : {
      58                 :           6 :     template<typename S> static auto get(S&& s) -> decltype(s.getResult()) { return s.getResult(); }
      59                 :           6 :     template<typename S> static bool has(S&& s) { return s.hasResult(); }
      60         [ +  - ]:          12 :     template<typename S, typename A> static void set(S&& s, A&& a) { s.setResult(std::forward<A>(a)); }
      61                 :             :     template<typename S, typename... A> static decltype(auto) init(S&& s, A&&... a) { return s.initResult(std::forward<A>(a)...); }
      62                 :             :     template<typename S> static bool getWant(S&& s) { return s.getWantResult(); }
      63                 :             :     template<typename S> static void setWant(S&& s) { s.setWantResult(true); }
      64                 :             :     template<typename S> static bool getHas(S&& s) { return s.getHasResult(); }
      65                 :             :     template<typename S> static void setHas(S&& s) { s.setHasResult(true); }
      66                 :             : };
      67                 :             : } // namespace init_fields
      68                 :             : 
      69                 :             : template<>
      70                 :             : struct ProxyClient<ipc::capnp::messages::Init> final : public ProxyClientCustom<ipc::capnp::messages::Init, interfaces::Init>
      71                 :             : {
      72                 :             : public:
      73   [ +  -  +  - ]:           6 :     using ProxyClientCustom::ProxyClientCustom;
      74                 :             :     ~ProxyClient();
      75                 :             :     using M0 = ProxyClientMethodTraits<ipc::capnp::messages::Init::ConstructParams>;
      76                 :             :     static typename M0::Result construct(Super& super);
      77                 :             :     using M1 = ProxyClientMethodTraits<ipc::capnp::messages::Init::MakeEchoParams>;
      78                 :             :     typename M1::Result makeEcho();
      79                 :             :     using M2 = ProxyClientMethodTraits<ipc::capnp::messages::Init::MakeMiningParams>;
      80                 :             :     typename M2::Result makeMining();
      81                 :             : };
      82                 :             : 
      83                 :             : template<>
      84                 :             : struct ProxyServer<ipc::capnp::messages::Init> : public ProxyServerCustom<ipc::capnp::messages::Init, interfaces::Init>
      85                 :             : {
      86                 :             : public:
      87                 :             :     using ProxyServerCustom::ProxyServerCustom;
      88                 :             :     ~ProxyServer();
      89                 :             :     kj::Promise<void> construct(ConstructContext call_context) override;
      90                 :             :     kj::Promise<void> makeEcho(MakeEchoContext call_context) override;
      91                 :             :     kj::Promise<void> makeMining(MakeMiningContext call_context) override;
      92                 :             : };
      93                 :             : 
      94                 :             : template<>
      95                 :             : struct ProxyType<interfaces::Init>
      96                 :             : {
      97                 :             :     using Type = interfaces::Init;
      98                 :             :     using Message = ipc::capnp::messages::Init;
      99                 :             :     using Client = ProxyClient<Message>;
     100                 :             :     using Server = ProxyServer<Message>;
     101                 :             : };
     102                 :             : } // namespace mp
     103                 :             : #if defined(__GNUC__)
     104                 :             : #pragma GCC diagnostic pop
     105                 :             : #endif
     106                 :             : #endif
        

Generated by: LCOV version 2.0-1