40 while (!fns.empty()) {
41 auto fn = std::move(fns.front());
61 void reset(
bool relock=
false);
79template <
typename Interface_,
typename Impl_>
138template <
typename Interface,
typename Impl>
146template <
typename Interface_,
typename Impl_>
194template <
typename Interface,
typename Impl>
221template <
class _Class,
class _Result,
class... _Params>
227 using Param =
typename std::tuple_element<N, std::tuple<_Params...>>::type;
229 std::conditional_t<std::is_same_v<void, Result>,
Params,
TypeList<_Params..., _Result>>;
256template <
typename MethodParams,
typename Enable =
void>
263 template <
typename ServerContext>
281template <
typename MethodParams>
283 :
public FunctionTraits<decltype(ProxyMethod<MethodParams>::impl)>
294template <
typename MethodParams>
301template <
typename MethodParams>
313template <
typename Field,
int flags>
324template <
typename Fn>
328template <
typename Result,
typename... Args>
const CChainParams & Params()
Return the currently selected parameters.
Object holding network & rpc state associated with either an incoming server connection,...
Event loop implementation.
Event loop smart pointer automatically managing m_num_clients.
EventLoopRef & operator=(const EventLoopRef &)=delete
EventLoopRef(EventLoopRef &&other) noexcept
EventLoopRef & operator=(EventLoopRef &&)=delete
EventLoopRef(EventLoop &loop, Lock *lock=nullptr)
void reset(bool relock=false)
EventLoopRef(const EventLoopRef &)=delete
EventLoop * operator->() const
EventLoop & operator*() const
virtual Result call(Args &&... args)=0
Wrapper around std::function for passing std::function objects between client and servers.
Base class for generated ProxyClient classes that implement a C++ interface and forward calls to a ca...
Interface::Client m_client
~ProxyClientBase() noexcept
ProxyClientBase(typename Interface::Client client, Connection *connection, bool destroy_connection)
Construct libmultiprocess client object wrapping Cap'n Proto client object with a reference to the as...
static void construct(Super &)
static void destroy(Super &)
Customizable (through template specialization) base class used in generated ProxyClient implementatio...
Functions to serialize / deserialize common bitcoin types.
std::list< std::function< void()> > CleanupList
typename _Require< SfinaeExpr, Result >::Result Require
SFINAE helper, basically the same as to C++17's void_t, but allowing types other than void to be retu...
static constexpr int FIELD_OUT
ServerInvokeContext< ProxyServer< Interface >, ::capnp::CallContext< Params, Results > > ServerContext
static constexpr int FIELD_BOXED
static constexpr int FIELD_REQUESTED
static constexpr int FIELD_IN
typename CleanupList::iterator CleanupIt
void CleanupRun(CleanupList &fns)
static constexpr int FIELD_OPTIONAL
Accessor type holding flags that determine how to access a message field.
static const bool optional
static const bool requested
std::conditional_t< std::is_same_v< void, Result >, Params, TypeList< _Params..., _Result > > Fields
static decltype(auto) Fwd(Param< N > &arg)
Enable perfect forwarding for clientInvoke calls.
typename std::tuple_element< N, std::tuple< _Params... > >::type Param
Function traits class used to get method parameter and result types, used in generated ProxyClient an...
Mapping from capnp interface type to proxy client implementation (specializations are generated by pr...
Customizable (through template specialization) traits class used in generated ProxyClient implementat...
Context data associated with proxy client and server classes.
ProxyContext(Connection *connection)
Mapping from capnp method params type to method traits (specializations are generated by proxy-codege...
static decltype(auto) invoke(ServerContext &server_context, Args &&... args)
Traits class for a proxy method, providing the same Params/Result/Param/Fields described in the Funct...
static void invoke(ServerContext &)
Base class for generated ProxyServer classes that implement capnp server methods and forward calls to...
ProxyServerBase(std::shared_ptr< Impl > impl, Connection &connection)
void invokeDestroy()
If the capnp interface defined a special "destroy" method, as described the ProxyClientBase class,...
virtual ~ProxyServerBase()
ProxyServer destructor, called from the EventLoop thread by Cap'n Proto garbage collection code after...
std::shared_ptr< Impl > m_impl
Implementation pointer that may or may not be owned and deleted when this capnp server goes out of sc...
Customizable (through template specialization) base class which ProxyServer classes produced by gener...
Mapping from capnp interface type to proxy server implementation (specializations are generated by pr...
Customizable (through template specialization) traits class used in generated ProxyServer implementat...
Mapping from capnp struct type to struct traits (specializations are generated by proxy-codegen....
Mapping from local c++ type to capnp type and traits (specializations are generated by proxy-codegen....
ProxyServer & proxy_server
Generic utility functions used by capnp code.